-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathForm11.frm
1316 lines (1256 loc) · 34.4 KB
/
Form11.frm
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
VERSION 5.00
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "ieframe.dll"
Begin VB.Form Form11
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "所有应用"
ClientHeight = 8490
ClientLeft = 7650
ClientTop = 1275
ClientWidth = 9960
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "Form11.frx":0000
LinkTopic = "Form11"
MaxButton = 0 'False
ScaleHeight = 8490
ScaleWidth = 9960
Begin VB.Frame Frame3
BackColor = &H00FFFFFF&
Caption = "列表中显示的应用"
BeginProperty Font
Name = "微软雅黑"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 735
Left = 5640
TabIndex = 25
Top = 2880
Visible = 0 'False
Width = 4095
Begin VB.OptionButton Option3
BackColor = &H00FFFFFF&
Caption = "停用的应用"
ForeColor = &H8000000D&
Height = 255
Left = 2760
TabIndex = 28
Top = 360
Width = 1215
End
Begin VB.OptionButton Option2
BackColor = &H00FFFFFF&
Caption = "启用的应用"
ForeColor = &H8000000D&
Height = 255
Left = 1320
TabIndex = 27
Top = 360
Width = 1335
End
Begin VB.OptionButton Option1
BackColor = &H00FFFFFF&
Caption = "全部应用"
Enabled = 0 'False
ForeColor = &H8000000D&
Height = 255
Left = 120
TabIndex = 26
Top = 360
Width = 1095
End
End
Begin VB.CheckBox Check2
BackColor = &H00FFFFFF&
Caption = "全选"
Enabled = 0 'False
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 255
Left = 160
TabIndex = 24
Top = 600
Width = 1095
End
Begin VB.CommandButton Command11
BackColor = &H00C9A8FF&
Caption = "中断操作"
BeginProperty Font
Name = "微软雅黑"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 8760
MaskColor = &H00FFFFFF&
Style = 1 'Graphical
TabIndex = 23
Top = 2160
Visible = 0 'False
Width = 1095
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 10
Left = 9480
Top = 1680
End
Begin VB.TextBox Text5
Height = 495
Left = 13680
TabIndex = 22
Top = 3960
Width = 1455
End
Begin VB.TextBox Text4
Height = 1455
Left = 13560
MultiLine = -1 'True
TabIndex = 21
Top = 4560
Width = 1935
End
Begin VB.CommandButton Command10
BackColor = &H00FFFFFF&
Caption = "提取"
Enabled = 0 'False
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 8280
Style = 1 'Graphical
TabIndex = 20
Top = 4320
Width = 975
End
Begin VB.ListBox List3
Height = 1335
Left = 11520
TabIndex = 18
Top = 6480
Width = 2295
End
Begin VB.TextBox Text3
Height = 1215
Left = 13800
MultiLine = -1 'True
TabIndex = 17
Top = 6480
Width = 1695
End
Begin VB.Frame Frame1
BackColor = &H00FFFFFF&
Caption = "应用分类"
BeginProperty Font
Name = "微软雅黑"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1815
Left = 5640
TabIndex = 13
Top = 5880
Width = 4095
Begin VB.CommandButton Command9
BackColor = &H00FFFFFF&
Caption = "其他系统应用"
Enabled = 0 'False
Height = 375
Left = 240
Style = 1 'Graphical
TabIndex = 16
Top = 1080
Width = 1575
End
Begin VB.CommandButton Command8
BackColor = &H00FFFFFF&
Caption = "华为全家桶"
Enabled = 0 'False
Height = 375
Left = 2040
Style = 1 'Graphical
TabIndex = 15
Top = 480
Width = 1575
End
Begin VB.CommandButton Command5
BackColor = &H00FFFFFF&
Caption = "谷歌全家桶"
Enabled = 0 'False
Height = 375
Left = 240
Style = 1 'Graphical
TabIndex = 14
Top = 480
Width = 1575
End
End
Begin VB.CommandButton Command7
BackColor = &H00C9A8FF&
Caption = "返回"
BeginProperty Font
Name = "微软雅黑"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
MaskColor = &H00C9A8FF&
Style = 1 'Graphical
TabIndex = 11
Top = 7560
Visible = 0 'False
Width = 5295
End
Begin VB.ListBox List4
Appearance = 0 'Flat
BeginProperty Font
Name = "微软雅黑"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 6630
Left = 120
Style = 1 'Checkbox
TabIndex = 10
Top = 960
Visible = 0 'False
Width = 5295
End
Begin VB.ListBox List2
Height = 3120
Left = 10680
TabIndex = 9
Top = 3360
Width = 3735
End
Begin SHDocVwCtl.WebBrowser WebBrowser1
Height = 3015
Left = 10680
TabIndex = 8
Top = 480
Width = 3735
ExtentX = 6588
ExtentY = 5318
ViewMode = 0
Offline = 0
Silent = 0
RegisterAsBrowser= 0
RegisterAsDropTarget= 1
AutoArrange = 0 'False
NoClientEdge = 0 'False
AlignLeft = 0 'False
NoWebView = 0 'False
HideFileNames = 0 'False
SingleClick = 0 'False
SingleSelection = 0 'False
NoFolders = 0 'False
Transparent = 0 'False
ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
Location = "http:///"
End
Begin VB.TextBox Text2
Height = 375
Left = 11160
TabIndex = 7
Text = "Text2"
Top = 7800
Width = 1455
End
Begin VB.CommandButton Command6
BackColor = &H00FFFFFF&
Caption = "清除"
Height = 375
Left = 3840
Style = 1 'Graphical
TabIndex = 6
Top = 120
Visible = 0 'False
Width = 615
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
Caption = "卸载"
Enabled = 0 'False
Height = 375
Left = 5880
Style = 1 'Graphical
TabIndex = 5
Top = 4920
Width = 975
End
Begin VB.CommandButton Command3
BackColor = &H00FFFFFF&
Caption = "启用"
Enabled = 0 'False
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 7080
Style = 1 'Graphical
TabIndex = 4
Top = 4320
Width = 975
End
Begin VB.CommandButton Command2
BackColor = &H00FFFFFF&
Caption = "停用"
Enabled = 0 'False
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5880
Style = 1 'Graphical
TabIndex = 3
Top = 4320
Width = 975
End
Begin VB.CommandButton Command1
Appearance = 0 'Flat
BackColor = &H00F5F1E7&
Caption = "搜索应用"
Enabled = 0 'False
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
MaskColor = &H00FFFFFF&
Style = 1 'Graphical
TabIndex = 2
Top = 120
Width = 975
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H00808080&
Height = 375
Left = 120
TabIndex = 1
Text = "在这里输入应用中文名或英文包名"
Top = 120
Width = 4335
End
Begin VB.ListBox List1
Appearance = 0 'Flat
Enabled = 0 'False
BeginProperty Font
Name = "微软雅黑"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 7290
Left = 120
Style = 1 'Checkbox
TabIndex = 0
Top = 960
Width = 5295
End
Begin VB.Frame Frame2
BackColor = &H00FFFFFF&
Caption = "操作选中的应用"
BeginProperty Font
Name = "微软雅黑"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1815
Left = 5640
TabIndex = 19
Top = 3840
Width = 4095
Begin VB.Label Label1
BackColor = &H00FFFFFF&
Caption = "强烈建议您卸载前先提取备份应用"
ForeColor = &H005809FF&
Height = 255
Left = 1440
TabIndex = 29
Top = 1160
Width = 2415
End
End
Begin VB.Image Image1
Height = 75
Left = -5760
Picture = "Form11.frx":74CA
Stretch = -1 'True
Top = 520
Visible = 0 'False
Width = 5895
End
Begin VB.Label Label2
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "微软雅黑"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H005809FF&
Height = 1545
Left = 5520
TabIndex = 12
Top = 840
Width = 4320
End
End
Attribute VB_Name = "Form11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim r, g As Integer
Private Sub Check1_Click()
End Sub
Private Sub Check2_Click()
Dim i As Integer
If Check2 = 1 Then
If g = 0 Then
For i = 0 To List1.ListCount - 1
List1.Selected(i) = True
Next
ElseIf g = 1 Then
For i = 0 To List4.ListCount - 1
List4.Selected(i) = True
Next
End If
ElseIf Check2 = 0 Then
If g = 0 Then
For i = 0 To List1.ListCount - 1
List1.Selected(i) = False
Next
ElseIf g = 1 Then
For i = 0 To List4.ListCount - 1
List4.Selected(i) = False
Next
End If
End If
End Sub
Private Sub Command11_Click()
m = MsgBox("您确定要中断操作并退出YUYU助手吗?可能造成未知的后果!", 1 + 48, "警告")
If m = 1 Then
Shell "cmd /c adb kill-server"
End
End If
End Sub
Private Sub Option1_Click()
List1.Clear
Open Text2 & "\all.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, S
j = 0
V = Mid(S, 9) '手机应用
For i = 0 To List2.ListCount - 1 '网上列表
y = List2.List(i)
n = InStr(y, ":")
If n > 0 Then
c = Mid(y, n + 1)
Else
c = ""
End If
If c = V Then
List1.AddItem y
j = 1
Exit For
End If
Next i
If j = 0 Then List1.AddItem V
Loop
Close #1
r = 1
g = 0
Label2 = "加载完毕!"
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
Label2 = "正在加载..."
If Dir(Text2 & "\enable.txt") <> "" Then
Kill Text2 & "\enable.txt"
End If
Shell "cmd /c adb shell pm list packages -e" & ">" & Text2 & "\enable.txt"
List1.Clear
Savetime = Timer
While Timer < Savetime + 1
DoEvents
Wend
Dim S, V, n As String
Open Text2 & "\enable.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, S
j = 0
V = Mid(S, 9) '手机应用
For i = 0 To List2.ListCount - 1 '网上列表
y = List2.List(i)
n = InStr(y, ":")
If n > 0 Then
c = Mid(y, n + 1)
Else
c = ""
End If
If c = V Then
List1.AddItem y
j = 1
Exit For
End If
Next i
If j = 0 Then List1.AddItem V
Loop
Close #1
r = 1
g = 0
Label2 = "加载完毕!"
If c = "" Then MsgBox "当前没有已停用的应用!"
If Dir(Text2 & "\enable.txt") <> "" Then
Kill Text2 & "\enable.txt"
End If
ElseIf Option3.Value Then
List1.Clear
Open Text2 & "\all.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, S
j = 0
V = Mid(S, 9) '手机应用
For i = 0 To List2.ListCount - 1 '网上列表
y = List2.List(i)
n = InStr(y, ":")
If n > 0 Then
c = Mid(y, n + 1)
Else
c = ""
End If
If c = V Then
List1.AddItem y
j = 1
Exit For
End If
Next i
If j = 0 Then List1.AddItem V
Loop
Close #1
r = 1
g = 0
Label2 = "加载完毕!"
End If
End Sub
Private Sub Option3_Click()
If Option3.Value = True Then
Label2 = "正在加载..."
If Dir(Text2 & "\disable.txt") <> "" Then
Kill Text2 & "\disable.txt"
End If
Shell "cmd /c adb shell pm list packages -d" & ">" & Text2 & "\disable.txt"
List1.Clear
Savetime = Timer
While Timer < Savetime + 1
DoEvents
Wend
Dim S, V, n As String
Open Text2 & "\disable.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, S
j = 0
V = Mid(S, 9) '手机应用
For i = 0 To List2.ListCount - 1 '网上列表
y = List2.List(i)
n = InStr(y, ":")
If n > 0 Then
c = Mid(y, n + 1)
Else
c = ""
End If
If c = V Then
List1.AddItem y
j = 1
Exit For
End If
Next i
If j = 0 Then List1.AddItem V
Loop
Close #1
r = 1
g = 0
Label2 = "加载完毕!"
If List1.ListCount = 0 Then MsgBox "当前没有已停用的应用!"
If Dir(Text2 & "\disable.txt") <> "" Then
Kill Text2 & "\disable.txt"
End If
ElseIf Option3.Value Then
List1.Clear
Open Text2 & "\all.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, S
j = 0
V = Mid(S, 9) '手机应用
For i = 0 To List2.ListCount - 1 '网上列表
y = List2.List(i)
n = InStr(y, ":")
If n > 0 Then
c = Mid(y, n + 1)
Else
c = ""
End If
If c = V Then
List1.AddItem y
j = 1
Exit For
End If
Next i
If j = 0 Then List1.AddItem V
Loop
Close #1
r = 1
g = 0
Label2 = "加载完毕!"
End If
End Sub
Private Sub Timer1_Timer()
If Image1.Left > 9600 Then Image1.Left = -5780
Image1.Left = Image1.Left + 50
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, Url As Variant)
If (pDisp Is WebBrowser1.Object) Then
Label2 = "正在获取中文名称,请耐心等待..."
End If
End Sub
Private Sub Command1_Click()
List4.Clear
j = 0
For i = 0 To List1.ListCount - 1
y = List1.List(i)
n = InStr(y, Text1)
If n > 0 Then
List4.Visible = True
List1.Visible = 0
List4.AddItem y
j = 1
g = 1
Command7.Visible = True
End If
Next i
Frame3.Enabled = 0
Option1.ForeColor = &H808080: Option2.ForeColor = &H808080: Option3.ForeColor = &H808080
If j = 0 Then
MsgBox "没有找到任何结果"
Frame3.Enabled = 1
Option1.ForeColor = &H8000000D: Option2.ForeColor = &H8000000D: Option3.ForeColor = &H8000000D
End If
Command6.Visible = True
End Sub
Private Sub Command10_Click()
Command2.Enabled = False: Command3.Enabled = False: Command4.Enabled = False: Command10.Enabled = False
If List1.SelCount = 0 And List4.SelCount = 0 Then 'IF1
MsgBox "没有选中的项目!双击应用名称或勾选名称前的方框即可选中项目"
'----------------------------------------------------------------------------------
Else
Shell "cmd /c adb decices"
Image1.Visible = True
Timer1.Enabled = True
Dim Savetime As Single
f = MsgBox("推荐使用有线连接传输。若使用无线连接请保持手机亮屏!!否则失败率极高!" & vbCrLf & "现在,您是否要开始提取应用?", 4 + 48, "提示")
If f = vbYes Then
Command11.Visible = True
Dim i, t, h, e As Integer
Dim y, z As String
h = 0
Label2 = "正在获取应用路径..."
If g = 0 Then 'IF2
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then 'IF3
y = List1.List(i)
n = InStr(y, ":")
If n > 0 Then 'IF4
z = Mid(y, n + 1)
ElseIf n = 0 Then
z = y
End If 'END4
h = h + 1
If Dir(Text2 & "\appname" & h & ".txt") <> "" Then Kill Text2 & "\appname" & h & ".txt"
Open Text2 & "\appname" & h & ".txt" For Append As #1 '没有新建
Print #1, y
Close #1
Shell "cmd /c adb shell pm path " & z & ">" & Text2 & "\path" & h & ".txt"
If h = 1 Then
Savetime = Timer
While Timer < Savetime + 1
DoEvents
Wend
End If
End If 'END3
Next i
ElseIf g = 1 Then
For t = 0 To List4.ListCount - 1
If List4.Selected(t) Then 'IF3.2
y = List4.List(t)
n = InStr(y, ":")
If n > 0 Then 'IF4.2
z = Mid(y, n + 1)
ElseIf n = 0 Then
z = y
End If
'E4.2
h = h + 1
If Dir(Text2 & "\appname" & h & ".txt") <> "" Then Kill Text2 & "\appname" & h & ".txt"
Open Text2 & "\appname" & h & ".txt" For Append As #1 '没有新建
Print #1, y
Close #1
Shell "cmd /c adb shell pm path " & z & ">" & Text2 & "\path" & h & ".txt"
If h = 1 Then
Savetime = Timer
While Timer < Savetime + 1
DoEvents
Wend
End If
End If 'END3
Next t
End If 'END2
'---------------------------------------------------获取完路径
Savetime = Timer
While Timer < Savetime + 0.5
DoEvents
Wend
Dim b, m As Integer
b = 0
m = 0
Text3 = ""
'---------------------------------------
For e = 1 To h
'------------------------------------打开文件
Dim strFile As String
Dim intFile As Integer
Dim strData As String
strFile = Text2 & "\path" & e & ".txt"
intFile = FreeFile
Open strFile For Input As intFile
strData = StrConv(InputB(FileLen(strFile), intFile), vbUnicode)
Debug.Print strData
Close intFile
Text5 = strData
Do
ab = InStr(Text5, "/")
Text5 = Mid(Text5, ab + 1)
Loop Until ab = 0
cb = InStr(Text5, "apk")
Text5 = Left(Text5, cb + 2)
Pa = Mid(strData, 9)
strFile = Text2 & "\appname" & e & ".txt"
intFile = FreeFile
Open strFile For Input As intFile
strData = StrConv(InputB(FileLen(strFile), intFile), vbUnicode)
Debug.Print strData
Close intFile
Label2 = "正在准备提取" & strData
Shell "cmd /c adb pull " & Pa
If Text5 = "" Then 'IF A1
MsgBox strData & "无法被提取!点击确定提取下一个应用"
Text3 = Text3 & strData & "提取失败!"
'________________________________________________________________________可以提取
Else 'else A1
o = 0 '正在准备提取
Dim Filepath$
Dim yz
Do
Savetime = Timer
While Timer < Savetime + 1
DoEvents
Wend
o = o + 1
Label2 = "已用时" & o & "秒 正在准备提取 " & strData
Loop Until Dir(App.Path & "\" & Text5) <> "" Or o > 15
If o > 14 Then
MsgBox strData & "超时仍未开始传输,似乎无法被提取,点击确定提取下一个应用"
Text3 = Text3 & strData & "可能失败!" & vbCrLf
End If
'IF A2
Savetime = Timer
While Timer < Savetime + 1
DoEvents
Wend
Do '提取中
Label2 = "正在提取,请耐心等待 " & strData
yz = FileLen(App.Path & "\" & Text5)
Savetime = Timer
While Timer < Savetime + 0.5
DoEvents
Wend
Loop Until yz > 0
Label2 = strData & "提取成功!安装包保存在" & App.Path
Text3 = Text3 & strData & "提取成功!"
'-----------------------------------准备重命名
n = InStr(strData, ":")
If n > 0 Then 'IF A3
z = Mid(strData, 1, n - 1)
ElseIf n = 0 Then
If Text5 = "base.apk" Then
z = "base" & e
Text4 = Text4 & strData & "命名为" & z & ".apk" & vbCrLf
Else
zs = InStr(Text5, ".apk")
z = Mid(Text5, 1, zs - 1)
End If
End If 'End A3
o = 0
Do Until Dir(App.Path & "\" & Text5) <> "" Or o > 3
Savetime = Timer
While Timer < Savetime + 1
DoEvents
Wend
o = o + 1
Label2 = "等待重命名" & z
Loop
'-----------------------------------重命名
If Dir(App.Path & "\" & Text5) <> "" Then 'if A4
Name App.Path & "\" & Text5 As App.Path & "\" & z & ".apk"
Else
MsgBox z & "重命名失败"
End If 'End A4
'End A2
Text3 = Text3 & vbCrLf
End If 'End A1
Savetime = Timer
While Timer < Savetime + 1
DoEvents
Wend
Next e
'___________________________________________________________________________________________
For d = 1 To h '删除
Kill Text2 & "\appname" & d & ".txt"
Kill Text2 & "\path" & d & ".txt"
Next d
'-------------------------------------结果
Label2 = "提取完成"
MsgBox Text3 & "提取的应用已保存至" & App.Path & ",请及时移走它们!"
Text3 = ""
If Text4 <> "" Then
MsgBox "请注意,由于安装包没有名字:" & vbCrLf & Text4, 0, "重要提示!"
Text4 = ""
End If
'------------------------------------------
End If
Image1.Visible = 0
Timer1.Enabled = 0
Command11.Visible = 0
End If 'End 1
Command2.Enabled = 1: Command3.Enabled = 1: Command4.Enabled = 1: Command10.Enabled = 1
End Sub
Private Sub Command2_Click()
Command2.Enabled = False: Command3.Enabled = False: Command4.Enabled = False
If List1.SelCount = 0 And List4.SelCount = 0 Then 'IF1
MsgBox "没有选中的项目!双击应用名称或勾选名称前的方框即可选中项目"
Else
Dim i, t, h, e As Integer
Dim y, z As String
h = 0
If g = 0 Then 'IF2
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then 'IF3
y = List1.List(i)
n = InStr(y, ":")
If n > 0 Then 'IF4
z = Mid(y, n + 1)
ElseIf n = 0 Then
z = y
End If 'END4
List3.AddItem y
h = h + 1
Shell "cmd /c adb shell pm disable-user " & z & ">" & Text2 & "\临时" & h & ".txt"
End If 'END3
Next i
ElseIf g = 1 Then
For t = 0 To List4.ListCount - 1
If List4.Selected(t) Then 'IF3.2
y = List4.List(t)
n = InStr(y, ":")
If n > 0 Then 'IF4.2
z = Mid(y, n + 1)
ElseIf n = 0 Then
z = y
End If 'E4.2
List3.AddItem y
h = h + 1
Shell "cmd /c adb shell pm disable-user " & z & ">" & Text2 & "\临时" & h & ".txt"
End If 'E3.2
Next t
End If 'END2
Dim Savetime As Single
Savetime = Timer
While Timer < Savetime + 1
DoEvents
Wend