forked from kjanku1/ADBTouchScreenControl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.vb
304 lines (275 loc) · 14.7 KB
/
Form1.vb
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
Imports System.IO
Imports System.Threading
Imports System.Windows.Forms.DialogResult
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If Not Directory.Exists("Tools") Then
Directory.CreateDirectory("Tools")
Else
If Not File.Exists("Tools\adb.exe") Then
File.WriteAllBytes("Tools\adb.exe", My.Resources.adb)
End If
If Not File.Exists("Tools\AdbWinApi.dll") Then
File.WriteAllBytes("Tools\AdbWinApi.dll", My.Resources.AdbWinApi)
End If
If Not File.Exists("Tools\AdbWinUsbApi.dll") Then
File.WriteAllBytes("Tools\AdbWinUsbApi.dll", My.Resources.AdbWinUsbApi)
End If
If Not File.Exists("Tools\droidAtScreen-1.1.jar") Then
File.WriteAllBytes("Tools\droidAtScreen-1.1.jar", My.Resources.droidAtScreen_1_1)
End If
Shell("cmd.exe /c" & "start Tools\droidAtScreen-1.1.jar")
End If
End Sub
Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
Select Case ComboBox1.Text
Case "1440x2560"
Shell("""Tools\adb.exe"" shell input swipe 562 1800 1440 1800")
Case "1080x1920"
Shell("""Tools\adb.exe"" shell input swipe 722 1390 1340 1390")
Case "800x1280"
Shell("""Tools\adb.exe"" shell input swipe 400 900 740 900")
Case "768x1280"
Shell("""Tools\adb.exe"" shell input swipe 300 900 720 900")
Case "720x1280"
Shell("""Tools\adb.exe"" shell input swipe 359 907 660 907")
Case "720x1200"
Shell("""Tools\adb.exe"" shell input swipe 360 850 660 850")
Case "540x960"
Shell("""Tools\adb.exe"" shell input swipe 270 680 509 676")
Case "480x800"
Shell("""Tools\adb.exe"" shell input swipe 240 570 560 570")
Case "400x800"
Shell("""Tools\adb.exe"" shell input swipe 200 570 560 570")
Case "240x320"
Shell("""Tools\adb.exe"" shell input swipe 120 230 213 230")
Case Else
MsgBox("Choose you're devices resolution")
End Select
End Sub
Private Sub Button16_Click_1(sender As Object, e As EventArgs) Handles Button16.Click
Select Case ComboBox1.Text
Case "1440x2560"
Shell("""Tools\adb.exe"" shell input swipe 562 1800 1440 1800")
Case "1080x1920"
Shell("""Tools\adb.exe"" shell input swipe 722 1390 1340 1390")
Case "800x1280"
Shell("""Tools\adb.exe"" shell input swipe 400 900 740 900")
Case "768x1280"
Shell("""Tools\adb.exe"" shell input swipe 300 900 720 900")
Case "720x1280"
Shell("""Tools\adb.exe"" shell input swipe 359 907 660 907")
Case "720x1200"
Shell("""Tools\adb.exe"" shell input swipe 360 850 660 850")
Case "540x960"
Shell("""Tools\adb.exe"" shell input swipe 270 680 509 676")
Case "480x800"
Shell("""Tools\adb.exe"" shell input swipe 240 570 560 570")
Case "400x800"
Shell("""Tools\adb.exe"" shell input swipe 200 570 560 570")
Case "240x320"
Shell("""Tools\adb.exe"" shell input swipe 120 230 213 230")
Case Else
MsgBox("Choose you're devices resolution")
End Select
End Sub
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = Keys.Enter Then
Shell("""Tools\adb.exe"" shell input text '" & TextBox1.Text & "'")
TextBox1.Clear()
End If
End Sub
'numerki
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" & Button1.Text)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Button2.Text)
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Button3.Text)
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Button4.Text)
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Button5.Text)
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Button6.Text)
End Sub
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Button7.Text)
End Sub
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Button8.Text)
End Sub
Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Button9.Text)
End Sub
Private Sub Button0_Click(sender As Object, e As EventArgs) Handles Button0.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Button0.Text)
End Sub
'literki
Private Sub Buttonq_Click(sender As Object, e As EventArgs) Handles Buttonq.Click
Shell("""Tools\adb.exe"" input keyevent KEYCODE_" + Buttonq.Text)
End Sub
Private Sub Buttonw_Click(sender As Object, e As EventArgs) Handles Buttonw.Click
Shell("""Tools\adb.exe"" input keyevent KEYCODE_" + Buttonw.Text)
End Sub
Private Sub Buttone_Click(sender As Object, e As EventArgs) Handles Buttone.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttone.Text)
End Sub
Private Sub Buttonr_Click(sender As Object, e As EventArgs) Handles Buttonr.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonr.Text)
End Sub
Private Sub Buttont_Click(sender As Object, e As EventArgs) Handles Buttont.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttont.Text)
End Sub
Private Sub Buttony_Click(sender As Object, e As EventArgs) Handles Buttony.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttony.Text)
End Sub
Private Sub Buttonu_Click(sender As Object, e As EventArgs) Handles Buttonu.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonu.Text)
End Sub
Private Sub Buttoni_Click(sender As Object, e As EventArgs) Handles Buttoni.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttoni.Text)
End Sub
Private Sub Buttono_Click(sender As Object, e As EventArgs) Handles Buttono.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttono.Text)
End Sub
Private Sub Buttonp_Click(sender As Object, e As EventArgs) Handles Buttonp.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonp.Text)
End Sub
Private Sub Buttona_Click(sender As Object, e As EventArgs) Handles Buttona.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttona.Text)
End Sub
Private Sub Buttons_Click(sender As Object, e As EventArgs) Handles Buttons.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttons.Text)
End Sub
Private Sub Buttond_Click(sender As Object, e As EventArgs) Handles Buttond.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttond.Text)
End Sub
Private Sub Buttonf_Click(sender As Object, e As EventArgs) Handles Buttonf.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonf.Text)
End Sub
Private Sub Buttong_Click(sender As Object, e As EventArgs) Handles Buttong.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttong.Text)
End Sub
Private Sub Buttonh_Click(sender As Object, e As EventArgs) Handles Buttonh.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonh.Text)
End Sub
Private Sub Buttonj_Click(sender As Object, e As EventArgs) Handles Buttonj.Click
Shell("""Tools\adb.exe""b shell input keyevent KEYCODE_" + Buttonj.Text)
End Sub
Private Sub Buttonk_Click(sender As Object, e As EventArgs) Handles Buttonk.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonk.Text)
End Sub
Private Sub Buttonl_Click(sender As Object, e As EventArgs) Handles Buttonl.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonl.Text)
End Sub
Private Sub Buttonz_Click(sender As Object, e As EventArgs) Handles Buttonz.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonz.Text)
End Sub
Private Sub Buttonx_Click(sender As Object, e As EventArgs) Handles Buttonx.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonx.Text)
End Sub
Private Sub Buttonc_Click(sender As Object, e As EventArgs) Handles Buttonc.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonc.Text)
End Sub
Private Sub Buttonv_Click(sender As Object, e As EventArgs) Handles Buttonv.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonv.Text)
End Sub
Private Sub Buttonb_Click(sender As Object, e As EventArgs) Handles Buttonb.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonb.Text)
End Sub
Private Sub Buttonn_Click(sender As Object, e As EventArgs) Handles Buttonn.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonn.Text)
End Sub
Private Sub Buttonm_Click(sender As Object, e As EventArgs) Handles Buttonm.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_" + Buttonm.Text)
End Sub
'specials
Private Sub Buttonback_Click(sender As Object, e As EventArgs) Handles Buttonback.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_DEL")
End Sub
Private Sub Buttonspace_Click(sender As Object, e As EventArgs) Handles Buttonspace.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_SPACE")
End Sub
Private Sub Buttonenter_Click(sender As Object, e As EventArgs) Handles Buttonenter.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_ENTER")
End Sub
Private Sub Buttoncomma_Click(sender As Object, e As EventArgs) Handles Buttoncomma.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_COMMA")
End Sub
Private Sub Buttondot_Click(sender As Object, e As EventArgs) Handles Buttondot.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_PERIOD")
End Sub
Private Sub Button16_Click(sender As Object, e As EventArgs) Handles GoBack.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_BACK")
End Sub
Private Sub Home_Click(sender As Object, e As EventArgs) Handles Home.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_HOME")
End Sub
Private Sub Apps_Click(sender As Object, e As EventArgs) Handles Apps.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_APP_SWITCH")
End Sub
Private Sub Up_Click(sender As Object, e As EventArgs) Handles Up.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_DPAD_UP")
End Sub
Private Sub Left_Click(sender As Object, e As EventArgs) Handles bLeft.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_DPAD_LEFT")
End Sub
Private Sub Down_Click(sender As Object, e As EventArgs) Handles Down.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_DPAD_DOWN")
End Sub
Private Sub Right_Click(sender As Object, e As EventArgs) Handles bRight.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_DPAD_RIGHT")
End Sub
Private Sub Center_Click(sender As Object, e As EventArgs) Handles Center.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_DPAD_CENTER")
End Sub
Private Sub bsym_Click(sender As Object, e As EventArgs) Handles bsym.Click
Form2.Show()
Me.Hide()
End Sub
Private Sub Powerbtn_Click(sender As Object, e As EventArgs) Handles Powerbtn.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_POWER")
End Sub
Private Sub adb_Click(sender As Object, e As EventArgs) Handles adb.Click
Shell("cmd.exe /k cd Tools && color 02 && title adb path")
End Sub
Private Sub Buttoncaps_Click(sender As Object, e As EventArgs) Handles Buttoncaps.Click
Shell("""Tools\adb.exe"" shell input keyevent KEYCODE_CAPS_LOCK")
End Sub
Private Sub Buttonslash_Click(sender As Object, e As EventArgs) Handles Buttonslash.Click
Shell("""Tools\adb.exe"" shell input text '/'")
End Sub
Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
Shell("""Tools\adb.exe"" shell su -c " & """rm /data/system/*.key""")
Shell("""Tools\adb.exe"" shell su -c " & """rm /data/system/*.db""")
Shell("""Tools\adb.exe"" shell su -c " & """rm /data/system/*.db-shm""")
Shell("""Tools\adb.exe"" shell su -c " & """rm /data/system/*.db-wal""")
End Sub
Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click
Shell("""Tools\adb.exe"" reboot")
End Sub
Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click
Shell("""Tools\adb.exe"" reboot recovery")
End Sub
Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
Shell("""Tools\adb.exe"" shell su -c " & """poweroff""")
End Sub
Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click
Gestures.Show()
End Sub
Private Sub AndroidControlByToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AndroidControlByToolStripMenuItem.Click
'ShellExecute ByVal 0&, "open", _
'"http://forum.xda-developers.com/showthread.php?t=2786395", _
'vbNullString, vbNullString,
System.Diagnostics.Process.Start("http://forum.xda-developers.com/showthread.php?t=2786395")
End Sub
Private Sub Version010ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles Version010ToolStripMenuItem.Click
System.Diagnostics.Process.Start("https://github.com/kjanku1/WindowsApplication1/commits/master")
End Sub
End Class