日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

android基于socket的局域網(wǎng)內(nèi)服務(wù)器與客戶端加密通信


android基于socket的局域網(wǎng)內(nèi)服務(wù)器與客戶端加密通信


實(shí)現(xiàn)了基本的socket通信(即兩臺(tái)設(shè)備 , 一臺(tái)用作服務(wù)器 , 一臺(tái)用作客戶端) , 服務(wù)器進(jìn)行監(jiān)聽(tīng) , 客戶端發(fā)送加密數(shù)據(jù)到服務(wù)器 , 服務(wù)器進(jìn)行解密得到明文 。
注意:本項(xiàng)目中使用了ButterKnife及EventBus作為輔助工具 , 通信建立時(shí)默認(rèn)網(wǎng)絡(luò)正常(未做局域網(wǎng)網(wǎng)絡(luò)環(huán)境檢測(cè)) , 加密方式為AES加密
1.效果圖:
(1)客戶端
android基于socket的局域網(wǎng)內(nèi)服務(wù)器與客戶端加密通信



(2)服務(wù)器端
android基于socket的局域網(wǎng)內(nèi)服務(wù)器與客戶端加密通信



2.界面布局部分
(1)服務(wù)器端布局 function_socket_server.xml
?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout style="@style/ToolBar">
<TextView
style="@style/ToolBar_tv_Title"
android:text="網(wǎng)絡(luò)加密-服務(wù)器端" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/btn_startListener"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="啟動(dòng)監(jiān)聽(tīng)" />
<Button
android:id="@+id/btn_stopListener"

推薦閱讀