-
Notifications
You must be signed in to change notification settings - Fork 1
/
VPN.smali
405 lines (287 loc) · 9.48 KB
/
VPN.smali
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
.class public Lmt/VPN;
.super Landroid/content/ContentProvider;
# interfaces
.implements Ljava/lang/Runnable;
# instance fields
.field private final scheduler:Ljava/util/concurrent/ScheduledExecutorService;
# direct methods
.method public constructor <init>()V
.registers 2
.prologue
.line 24
invoke-direct {p0}, Landroid/content/ContentProvider;-><init>()V
.line 25
const/4 v0, 0x1
invoke-static {v0}, Ljava/util/concurrent/Executors;->newScheduledThreadPool(I)Ljava/util/concurrent/ScheduledExecutorService;
move-result-object v0
iput-object v0, p0, Lmt/VPN;->scheduler:Ljava/util/concurrent/ScheduledExecutorService;
return-void
.end method
.method public static isVpnConnected()Z
.registers 7
.prologue
const/4 v4, 0x0
.line 80
:try_start_1
invoke-static {}, Ljava/net/NetworkInterface;->getNetworkInterfaces()Ljava/util/Enumeration;
move-result-object v3
.line 81
.local v3, "niList":Ljava/util/Enumeration;, "Ljava/util/Enumeration<Ljava/net/NetworkInterface;>;"
if-nez v3, :cond_8
.line 98
:cond_7
:goto_7
return v4
.line 84
:cond_8
invoke-static {v3}, Ljava/util/Collections;->list(Ljava/util/Enumeration;)Ljava/util/ArrayList;
move-result-object v5
invoke-virtual {v5}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object v2
.line 85
.local v2, "it":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/net/NetworkInterface;>;"
:cond_10
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v5
if-eqz v5, :cond_7
.line 86
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Ljava/net/NetworkInterface;
.line 87
.local v1, "intf":Ljava/net/NetworkInterface;
invoke-virtual {v1}, Ljava/net/NetworkInterface;->isUp()Z
move-result v5
if-eqz v5, :cond_10
.line 88
invoke-virtual {v1}, Ljava/net/NetworkInterface;->getInterfaceAddresses()Ljava/util/List;
move-result-object v5
invoke-interface {v5}, Ljava/util/List;->size()I
move-result v5
if-eqz v5, :cond_10
.line 89
const-string v5, "tun0"
invoke-virtual {v1}, Ljava/net/NetworkInterface;->getName()Ljava/lang/String;
move-result-object v6
invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v5
if-nez v5, :cond_44
const-string v5, "ppp0"
invoke-virtual {v1}, Ljava/net/NetworkInterface;->getName()Ljava/lang/String;
move-result-object v6
invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
:try_end_41
.catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_41} :catch_46
move-result v5
if-eqz v5, :cond_10
.line 90
:cond_44
const/4 v4, 0x1
goto :goto_7
.line 96
.end local v1 # "intf":Ljava/net/NetworkInterface;
.end local v2 # "it":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/net/NetworkInterface;>;"
:catch_46
move-exception v0
.line 97
.local v0, "e":Ljava/lang/Throwable;
invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V
goto :goto_7
.end method
.method public static isWifiProxy(Landroid/content/Context;)Z
.registers 6
.param p0, "mContext" # Landroid/content/Context;
.prologue
.line 64
sget v3, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v4, 0xe
if-lt v3, v4, :cond_26
.line 65
const-string v3, "http.proxyHost"
invoke-static {v3}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
.line 66
.local v1, "proxyAddress":Ljava/lang/String;
const-string v3, "http.proxyPort"
invoke-static {v3}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
.line 67
.local v0, "portStr":Ljava/lang/String;
if-eqz v0, :cond_23
.end local v0 # "portStr":Ljava/lang/String;
:goto_14
invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v2
.line 72
.local v2, "proxyPort":I
:goto_18
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v3
if-nez v3, :cond_21
const/4 v3, -0x1
if-ne v2, v3, :cond_2f
.line 73
:cond_21
const/4 v3, 0x0
.line 75
:goto_22
return v3
.line 67
.end local v2 # "proxyPort":I
.restart local v0 # "portStr":Ljava/lang/String;
:cond_23
const-string v0, "-1"
goto :goto_14
.line 69
.end local v0 # "portStr":Ljava/lang/String;
.end local v1 # "proxyAddress":Ljava/lang/String;
:cond_26
invoke-static {p0}, Landroid/net/Proxy;->getHost(Landroid/content/Context;)Ljava/lang/String;
move-result-object v1
.line 70
.restart local v1 # "proxyAddress":Ljava/lang/String;
invoke-static {p0}, Landroid/net/Proxy;->getPort(Landroid/content/Context;)I
move-result v2
.restart local v2 # "proxyPort":I
goto :goto_18
.line 75
:cond_2f
const/4 v3, 0x1
goto :goto_22
.end method
# virtual methods
.method public delete(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I
.registers 5
.param p1, "uri" # Landroid/net/Uri;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2, "selection" # Ljava/lang/String;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p3, "selectionArgs" # [Ljava/lang/String;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.prologue
.line 53
const/4 v0, 0x0
return v0
.end method
.method public getType(Landroid/net/Uri;)Ljava/lang/String;
.registers 3
.param p1, "uri" # Landroid/net/Uri;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/Nullable;
.end annotation
.prologue
.line 42
const/4 v0, 0x0
return-object v0
.end method
.method public insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
.registers 4
.param p1, "uri" # Landroid/net/Uri;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2, "values" # Landroid/content/ContentValues;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.annotation build Landroidx/annotation/Nullable;
.end annotation
.prologue
.line 48
const/4 v0, 0x0
return-object v0
.end method
.method public onCreate()Z
.registers 8
.prologue
.line 29
iget-object v0, p0, Lmt/VPN;->scheduler:Ljava/util/concurrent/ScheduledExecutorService;
const-wide/16 v2, 0x0
const-wide/16 v4, 0x3
sget-object v6, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
move-object v1, p0
invoke-interface/range {v0 .. v6}, Ljava/util/concurrent/ScheduledExecutorService;->scheduleAtFixedRate(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
.line 30
const/4 v0, 0x0
return v0
.end method
.method public query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
.registers 7
.param p1, "uri" # Landroid/net/Uri;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2, "projection" # [Ljava/lang/String;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p3, "selection" # Ljava/lang/String;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p4, "selectionArgs" # [Ljava/lang/String;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p5, "sortOrder" # Ljava/lang/String;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.annotation build Landroidx/annotation/Nullable;
.end annotation
.prologue
.line 36
const/4 v0, 0x0
return-object v0
.end method
.method public run()V
.registers 2
.prologue
.line 104
invoke-static {}, Lmt/VPN;->isVpnConnected()Z
move-result v0
if-nez v0, :cond_10
invoke-virtual {p0}, Lmt/VPN;->getContext()Landroid/content/Context;
move-result-object v0
invoke-static {v0}, Lmt/VPN;->isWifiProxy(Landroid/content/Context;)Z
move-result v0
if-eqz v0, :cond_14
.line 105
:cond_10
const/4 v0, 0x0
invoke-static {v0}, Ljava/lang/System;->exit(I)V
.line 107
:cond_14
return-void
.end method
.method public update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I
.registers 6
.param p1, "uri" # Landroid/net/Uri;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2, "values" # Landroid/content/ContentValues;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p3, "selection" # Ljava/lang/String;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p4, "selectionArgs" # [Ljava/lang/String;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.prologue
.line 58
const/4 v0, 0x0
return v0
.end method