You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
244 lines
5.3 KiB
244 lines
5.3 KiB
.class public Lcom/viatech/util/WifiHideAPI; |
|
.super Ljava/lang/Object; |
|
.source "WifiHideAPI.java" |
|
|
|
|
|
# static fields |
|
.field public static final EXTRA_WIFI_AP_STATE:Ljava/lang/String; = "wifi_state" |
|
|
|
.field public static final WIFI_AP_STATE_CHANGED_ACTION:Ljava/lang/String; = "android.net.wifi.WIFI_AP_STATE_CHANGED" |
|
|
|
.field public static final WIFI_AP_STATE_DISABLED:I = 0xb |
|
|
|
.field public static final WIFI_AP_STATE_DISABLING:I = 0xa |
|
|
|
.field public static final WIFI_AP_STATE_ENABLED:I = 0xd |
|
|
|
.field public static final WIFI_AP_STATE_ENABLING:I = 0xc |
|
|
|
.field public static final WIFI_AP_STATE_FAILED:I = 0xe |
|
|
|
|
|
# direct methods |
|
.method public constructor <init>()V |
|
.locals 0 |
|
|
|
.prologue |
|
.line 13 |
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V |
|
|
|
return-void |
|
.end method |
|
|
|
.method public static isWifiApEnabled(Landroid/content/Context;)Z |
|
.locals 5 |
|
|
|
.prologue |
|
const/4 v1, 0x0 |
|
|
|
.line 29 |
|
const-string v0, "wifi" |
|
|
|
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Landroid/net/wifi/WifiManager; |
|
|
|
.line 31 |
|
:try_start_0 |
|
invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class; |
|
|
|
move-result-object v2 |
|
|
|
const-string v3, "isWifiApEnabled" |
|
|
|
const/4 v4, 0x0 |
|
|
|
new-array v4, v4, [Ljava/lang/Class; |
|
|
|
invoke-virtual {v2, v3, v4}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; |
|
|
|
move-result-object v2 |
|
|
|
.line 32 |
|
const/4 v3, 0x0 |
|
|
|
new-array v3, v3, [Ljava/lang/Object; |
|
|
|
invoke-virtual {v2, v0, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Ljava/lang/Boolean; |
|
|
|
invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z |
|
:try_end_0 |
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 |
|
|
|
move-result v0 |
|
|
|
.line 36 |
|
:goto_0 |
|
return v0 |
|
|
|
.line 33 |
|
:catch_0 |
|
move-exception v0 |
|
|
|
.line 34 |
|
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V |
|
|
|
move v0, v1 |
|
|
|
.line 36 |
|
goto :goto_0 |
|
.end method |
|
|
|
.method public static isWifiNetworkConnected(Landroid/content/Context;)Z |
|
.locals 3 |
|
|
|
.prologue |
|
const/4 v1, 0x1 |
|
|
|
.line 41 |
|
const-string v0, "connectivity" |
|
|
|
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Landroid/net/ConnectivityManager; |
|
|
|
.line 42 |
|
if-eqz v0, :cond_0 |
|
|
|
.line 43 |
|
invoke-virtual {v0}, Landroid/net/ConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo; |
|
|
|
move-result-object v0 |
|
|
|
.line 44 |
|
if-eqz v0, :cond_0 |
|
|
|
invoke-virtual {v0}, Landroid/net/NetworkInfo;->getType()I |
|
|
|
move-result v2 |
|
|
|
if-ne v2, v1, :cond_0 |
|
|
|
invoke-virtual {v0}, Landroid/net/NetworkInfo;->getState()Landroid/net/NetworkInfo$State; |
|
|
|
move-result-object v0 |
|
|
|
sget-object v2, Landroid/net/NetworkInfo$State;->CONNECTED:Landroid/net/NetworkInfo$State; |
|
|
|
if-ne v0, v2, :cond_0 |
|
|
|
move v0, v1 |
|
|
|
.line 48 |
|
:goto_0 |
|
return v0 |
|
|
|
:cond_0 |
|
const/4 v0, 0x0 |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method public getWifiApState(Landroid/content/Context;)I |
|
.locals 4 |
|
|
|
.prologue |
|
.line 53 |
|
const-string v0, "wifi" |
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Landroid/net/wifi/WifiManager; |
|
|
|
.line 55 |
|
:try_start_0 |
|
invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, "getWifiApState" |
|
|
|
const/4 v3, 0x0 |
|
|
|
new-array v3, v3, [Ljava/lang/Class; |
|
|
|
invoke-virtual {v1, v2, v3}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; |
|
|
|
move-result-object v1 |
|
|
|
.line 56 |
|
const/4 v2, 0x0 |
|
|
|
new-array v2, v2, [Ljava/lang/Object; |
|
|
|
invoke-virtual {v1, v0, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Ljava/lang/Integer; |
|
|
|
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I |
|
:try_end_0 |
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0 |
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_1 |
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_2 |
|
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_3 |
|
|
|
move-result v0 |
|
|
|
.line 66 |
|
:goto_0 |
|
return v0 |
|
|
|
.line 57 |
|
:catch_0 |
|
move-exception v0 |
|
|
|
.line 58 |
|
invoke-virtual {v0}, Ljava/lang/IllegalArgumentException;->printStackTrace()V |
|
|
|
.line 66 |
|
:goto_1 |
|
const/16 v0, 0xe |
|
|
|
goto :goto_0 |
|
|
|
.line 59 |
|
:catch_1 |
|
move-exception v0 |
|
|
|
.line 60 |
|
invoke-virtual {v0}, Ljava/lang/IllegalAccessException;->printStackTrace()V |
|
|
|
goto :goto_1 |
|
|
|
.line 61 |
|
:catch_2 |
|
move-exception v0 |
|
|
|
.line 62 |
|
invoke-virtual {v0}, Ljava/lang/reflect/InvocationTargetException;->printStackTrace()V |
|
|
|
goto :goto_1 |
|
|
|
.line 63 |
|
:catch_3 |
|
move-exception v0 |
|
|
|
.line 64 |
|
invoke-virtual {v0}, Ljava/lang/NoSuchMethodException;->printStackTrace()V |
|
|
|
goto :goto_1 |
|
.end method
|
|
|