Commons.smali
.class public Lcom/cleanmaster/boost/sceneengine/mainengine/deps/Commons;
.super Ljava/lang/Object;
.source "Commons.java"
# direct methods
.method public constructor <init>()V
.registers 1
.prologue
.line 36
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static encodeHex([B)Ljava/lang/String;
.registers 6
.prologue
.line 271
if-nez p0, :cond_4
.line 273
const/4 v0, 0x0
.line 286
:goto_3
return-object v0
.line 276
:cond_4
const-string v0, "0123456789abcdef"
.line 277
array-length v1, p0
.line 278
new-instance v2, Ljava/lang/StringBuilder;
mul-int/lit8 v0, v1, 0x2
invoke-direct {v2, v0}, Ljava/lang/StringBuilder;-><init>(I)V
.line 280
const/4 v0, 0x0
:goto_f
if-ge v0, v1, :cond_30
.line 282
const-string v3, "0123456789abcdef"
aget-byte v4, p0, v0
and-int/lit16 v4, v4, 0xf0
ushr-int/lit8 v4, v4, 0x4
invoke-virtual {v3, v4}, Ljava/lang/String;->charAt(I)C
move-result v3
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
.line 283
const-string v3, "0123456789abcdef"
aget-byte v4, p0, v0
and-int/lit8 v4, v4, 0xf
invoke-virtual {v3, v4}, Ljava/lang/String;->charAt(I)C
move-result v3
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
.line 280
add-int/lit8 v0, v0, 0x1
goto :goto_f
.line 286
:cond_30
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
goto :goto_3
.end method
.method public static getChargingInfo(Landroid/content/Context;)Lcom/cleanmaster/boost/sceneengine/mainengine/models/ChargingInfo;
.registers 6
.prologue
.line 189
new-instance v1, Lcom/cleanmaster/boost/sceneengine/mainengine/models/ChargingInfo;
invoke-direct {v1}, Lcom/cleanmaster/boost/sceneengine/mainengine/models/ChargingInfo;-><init>()V
.line 190
if-eqz p0, :cond_46
.line 192
const/4 v0, 0x0
:try_start_8
new-instance v2, Landroid/content/IntentFilter;
const-string v3, "android.intent.action.BATTERY_CHANGED"
invoke-direct {v2, v3}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v0, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
move-result-object v0
.line 193
if-eqz v0, :cond_46
.line 194
const-string v2, "level"
const/4 v3, 0x0
invoke-virtual {v0, v2, v3}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v2
.line 195
const-string v3, "scale"
const/4 v4, 0x0
invoke-virtual {v0, v3, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v3
.line 196
const/4 v4, 0x1
iput-boolean v4, v1, Lcom/cleanmaster/boost/sceneengine/mainengine/models/ChargingInfo;->mbIsCharging:Z
.line 197
mul-int/lit8 v2, v2, 0x64
div-int/2addr v2, v3
iput v2, v1, Lcom/cleanmaster/boost/sceneengine/mainengine/models/ChargingInfo;->mnCapacity:I
.line 198
const-string/jumbo v2, "voltage"
const/4 v3, 0x0
invoke-virtual {v0, v2, v3}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v2
int-to-long v2, v2
iput-wide v2, v1, Lcom/cleanmaster/boost/sceneengine/mainengine/models/ChargingInfo;->mlVoltageNow:J
.line 199
invoke-static {}, Lcom/cleanmaster/boost/sceneengine/mainengine/deps/Commons;->getCurrentElec()J
move-result-wide v2
iput-wide v2, v1, Lcom/cleanmaster/boost/sceneengine/mainengine/models/ChargingInfo;->mlElectricNow:J
.line 200
const-string v2, "temperature"
const/4 v3, 0x0
invoke-virtual {v0, v2, v3}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v0
int-to-float v0, v0
iput v0, v1, Lcom/cleanmaster/boost/sceneengine/mainengine/models/ChargingInfo;->mBatteryTemp:F
:try_end_46
.catch Ljava/lang/Exception; {:try_start_8 .. :try_end_46} :catch_47
.line 206
:cond_46
:goto_46
return-object v1
.line 202
:catch_47
move-exception v0
.line 203
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_46
.end method
.method public static getCurrentElec()J
.registers 5
.prologue
.line 105
const/4 v1, 0x0
.line 107
:try_start_1
new-instance v2, Ljava/io/BufferedReader;
new-instance v0, Ljava/io/InputStreamReader;
new-instance v3, Ljava/io/FileInputStream;
const-string v4, "/sys/class/power_supply/battery/current_now"
invoke-direct {v3, v4}, Ljava/io/FileInputStream;-><init>(Ljava/lang/String;)V
invoke-direct {v0, v3}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V
invoke-direct {v2, v0}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
:try_end_12
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_12} :catch_29
.catchall {:try_start_1 .. :try_end_12} :catchall_3a
.line 109
:try_start_12
invoke-virtual {v2}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
move-result-object v0
.line 110
invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v0
.line 112
invoke-static {v0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
:try_end_1d
.catch Ljava/lang/Exception; {:try_start_12 .. :try_end_1d} :catch_49
.catchall {:try_start_12 .. :try_end_1d} :catchall_46
move-result-wide v0
.line 117
if-eqz v2, :cond_23
.line 119
:try_start_20
invoke-virtual {v2}, Ljava/io/BufferedReader;->close()V
:try_end_23
.catch Ljava/io/IOException; {:try_start_20 .. :try_end_23} :catch_24
.line 125
:cond_23
:goto_23
return-wide v0
.line 120
:catch_24
move-exception v2
.line 121
invoke-virtual {v2}, Ljava/io/IOException;->printStackTrace()V
goto :goto_23
.line 114
:catch_29
move-exception v0
.line 115
:goto_2a
:try_start_2a
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
:try_end_2d
.catchall {:try_start_2a .. :try_end_2d} :catchall_3a
.line 117
if-eqz v1, :cond_32
.line 119
:try_start_2f
invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
:try_end_32
.catch Ljava/io/IOException; {:try_start_2f .. :try_end_32} :catch_35
.line 125
:cond_32
:goto_32
const-wide/16 v0, 0x0
goto :goto_23
.line 120
:catch_35
move-exception v0
.line 121
invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V
goto :goto_32
.line 117
:catchall_3a
move-exception v0
:goto_3b
if-eqz v1, :cond_40
.line 119
:try_start_3d
invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
:try_end_40
.catch Ljava/io/IOException; {:try_start_3d .. :try_end_40} :catch_41
.line 122
:cond_40
:goto_40
throw v0
.line 120
:catch_41
move-exception v1
.line 121
invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
goto :goto_40
.line 117
:catchall_46
move-exception v0
move-object v1, v2
goto :goto_3b
.line 114
:catch_49
move-exception v0
move-object v1, v2
goto :goto_2a
.end method
.method public static getCurrentGPUUsage()F
.registers 8
.prologue
const/high16 v7, 0x447a0000 # 1000.0f
const/high16 v6, 0x3f800000 # 1.0f
const/4 v0, 0x0
.line 315
const/4 v3, 0x0
.line 316
const-string v1, "/sys/class/kgsl/kgsl-3d0/gpubusy"
.line 318
:try_start_8
new-instance v2, Ljava/io/BufferedReader;
new-instance v1, Ljava/io/InputStreamReader;
new-instance v4, Ljava/io/FileInputStream;
const-string v5, "/sys/class/kgsl/kgsl-3d0/gpubusy"
invoke-direct {v4, v5}, Ljava/io/FileInputStream;-><init>(Ljava/lang/String;)V
invoke-direct {v1, v4}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V
invoke-direct {v2, v1}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
:try_end_19
.catch Ljava/lang/Exception; {:try_start_8 .. :try_end_19} :catch_6e
.catchall {:try_start_8 .. :try_end_19} :catchall_7e
.line 320
:try_start_19
invoke-virtual {v2}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
move-result-object v1
.line 321
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v3
if-nez v3, :cond_63
.line 322
invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v1
.line 324
const/4 v3, 0x0
const-string v4, " "
invoke-virtual {v1, v4}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I
move-result v4
invoke-virtual {v1, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v3
.line 325
invoke-virtual {v3}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v3
.line 327
const-string v4, " "
invoke-virtual {v1, v4}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I
move-result v4
invoke-virtual {v1, v4}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v1
.line 328
invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v1
.line 330
invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v3
.line 331
invoke-static {v1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
:try_end_4b
.catch Ljava/lang/Exception; {:try_start_19 .. :try_end_4b} :catch_8d
.catchall {:try_start_19 .. :try_end_4b} :catchall_8b
move-result v1
.line 333
if-nez v1, :cond_54
.line 338
:goto_4e
if-eqz v2, :cond_53
.line 340
:try_start_50
invoke-virtual {v2}, Ljava/io/BufferedReader;->close()V
:try_end_53
.catch Ljava/io/IOException; {:try_start_50 .. :try_end_53} :catch_5e
.line 346
:cond_53
:goto_53
return v0
.line 333
:cond_54
int-to-float v0, v3
mul-float/2addr v0, v6
int-to-float v1, v1
div-float/2addr v0, v1
mul-float/2addr v0, v7
float-to-int v0, v0
int-to-float v0, v0
mul-float/2addr v0, v6
div-float/2addr v0, v7
goto :goto_4e
.line 341
:catch_5e
move-exception v1
.line 342
invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
goto :goto_53
.line 338
:cond_63
if-eqz v2, :cond_53
.line 340
:try_start_65
invoke-virtual {v2}, Ljava/io/BufferedReader;->close()V
:try_end_68
.catch Ljava/io/IOException; {:try_start_65 .. :try_end_68} :catch_69
goto :goto_53
.line 341
:catch_69
move-exception v1
.line 342
invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
goto :goto_53
.line 335
:catch_6e
move-exception v1
move-object v2, v3
.line 336
:goto_70
:try_start_70
invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
:try_end_73
.catchall {:try_start_70 .. :try_end_73} :catchall_8b
.line 338
if-eqz v2, :cond_53
.line 340
:try_start_75
invoke-virtual {v2}, Ljava/io/BufferedReader;->close()V
:try_end_78
.catch Ljava/io/IOException; {:try_start_75 .. :try_end_78} :catch_79
goto :goto_53
.line 341
:catch_79
move-exception v1
.line 342
invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
goto :goto_53
.line 338
:catchall_7e
move-exception v0
move-object v2, v3
:goto_80
if-eqz v2, :cond_85
.line 340
:try_start_82
invoke-virtual {v2}, Ljava/io/BufferedReader;->close()V
:try_end_85
.catch Ljava/io/IOException; {:try_start_82 .. :try_end_85} :catch_86
.line 343
:cond_85
:goto_85
throw v0
.line 341
:catch_86
move-exception v1
.line 342
invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
goto :goto_85
.line 338
:catchall_8b
move-exception v0
goto :goto_80
.line 335
:catch_8d
move-exception v1
goto :goto_70
.end method
.method public static getMd5SSID(Landroid/content/Context;)Ljava/lang/String;
.registers 5
.prologue
const/4 v1, 0x0
.line 130
if-nez p0, :cond_5
move-object v0, v1
.line 149
:goto_4
return-object v0
.line 134
:cond_5
:try_start_5
const-string/jumbo 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 135
invoke-virtual {v0}, Landroid/net/wifi/WifiManager;->getConnectionInfo()Landroid/net/wifi/WifiInfo;
move-result-object v0
.line 136
if-eqz v0, :cond_42
.line 137
invoke-virtual {v0}, Landroid/net/wifi/WifiInfo;->getSSID()Ljava/lang/String;
move-result-object v0
.line 138
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v2
if-nez v2, :cond_27
const-string/jumbo v2, "unknown ssid"
invoke-virtual {v0, v2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v2
if-eqz v2, :cond_29
:cond_27
move-object v0, v1
.line 139
goto :goto_4
.line 141
:cond_29
const-string v2, "\""
invoke-virtual {v0, v2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v2
if-eqz v2, :cond_39
.line 142
const-string v2, "\""
const-string v3, ""
invoke-virtual {v0, v2, v3}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v0
.line 144
:cond_39
invoke-static {v0}, Lcom/cleanmaster/boost/sceneengine/mainengine/deps/Commons;->getStringMd5(Ljava/lang/String;)Ljava/lang/String;
:try_end_3c
.catch Ljava/lang/Exception; {:try_start_5 .. :try_end_3c} :catch_3e
move-result-object v0
goto :goto_4
.line 146
:catch_3e
move-exception v0
.line 147
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
:cond_42
move-object v0, v1
.line 149
goto :goto_4
.end method
.method public static getStringMd5(Ljava/lang/String;)Ljava/lang/String;
.registers 4
.prologue
const/4 v0, 0x0
.line 249
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-eqz v1, :cond_8
.line 266
:goto_7
return-object v0
.line 257
:cond_8
:try_start_8
const-string v1, "MD5"
invoke-static {v1}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;
move-result-object v1
.line 258
invoke-virtual {p0}, Ljava/lang/String;->getBytes()[B
move-result-object v2
invoke-virtual {v1, v2}, Ljava/security/MessageDigest;->update([B)V
:try_end_15
.catch Ljava/lang/Exception; {:try_start_8 .. :try_end_15} :catch_1e
.line 266
invoke-virtual {v1}, Ljava/security/MessageDigest;->digest()[B
move-result-object v0
invoke-static {v0}, Lcom/cleanmaster/boost/sceneengine/mainengine/deps/Commons;->encodeHex([B)Ljava/lang/String;
move-result-object v0
goto :goto_7
.line 260
:catch_1e
move-exception v1
goto :goto_7
.end method
.method public static isAirModeOn(Landroid/content/Context;)Z
.registers 5
.prologue
const/4 v0, 0x1
const/4 v1, 0x0
.line 290
if-nez p0, :cond_6
move v0, v1
.line 297
:cond_5
:goto_5
return v0
.line 293
:cond_6
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v3, 0x11
if-lt v2, v3, :cond_1a
.line 294
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "airplane_mode_on"
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eq v2, v0, :cond_5
move v0, v1
goto :goto_5
.line 297
:cond_1a
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "airplane_mode_on"
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eq v2, v0, :cond_5
move v0, v1
goto :goto_5
.end method
.method public static isBatteryAC(Landroid/content/Context;)Z
.registers 6
.prologue
const/4 v0, 0x1
const/4 v1, 0x0
.line 172
.line 173
if-eqz p0, :cond_1c
.line 175
const/4 v2, 0x0
:try_start_5
new-instance v3, Landroid/content/IntentFilter;
const-string v4, "android.intent.action.BATTERY_CHANGED"
invoke-direct {v3, v4}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v2, v3}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
move-result-object v2
.line 176
if-eqz v2, :cond_24
.line 177
const-string v3, "plugged"
const/4 v4, -0x1
invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
:try_end_18
.catch Ljava/lang/Exception; {:try_start_5 .. :try_end_18} :catch_1f
move-result v2
.line 178
if-ne v2, v0, :cond_1d
:goto_1b
move v1, v0
.line 184
:cond_1c
:goto_1c
return v1
:cond_1d
move v0, v1
.line 178
goto :goto_1b
.line 180
:catch_1f
move-exception v0
.line 181
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_1c
:cond_24
move v0, v1
goto :goto_1b
.end method
.method public static isBatteryCharging(Landroid/content/Context;)Z
.registers 6
.prologue
const/4 v1, 0x1
const/4 v0, 0x0
.line 154
.line 155
if-eqz p0, :cond_1f
.line 157
const/4 v2, 0x0
:try_start_5
new-instance v3, Landroid/content/IntentFilter;
const-string v4, "android.intent.action.BATTERY_CHANGED"
invoke-direct {v3, v4}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v2, v3}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
move-result-object v2
.line 158
if-eqz v2, :cond_1f
.line 159
const-string v3, "plugged"
const/4 v4, -0x1
invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
:try_end_18
.catch Ljava/lang/Exception; {:try_start_5 .. :try_end_18} :catch_20
move-result v2
.line 160
if-eq v2, v1, :cond_1e
const/4 v3, 0x2
if-ne v2, v3, :cond_1f
:cond_1e
move v0, v1
.line 167
:cond_1f
:goto_1f
return v0
.line 163
:catch_20
move-exception v1
.line 164
invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_1f
.end method
.method public static isHeadSetInStatus(Landroid/content/Context;)Z
.registers 6
.prologue
const/4 v0, 0x1
const/4 v1, 0x0
.line 351
.line 352
if-eqz p0, :cond_24
.line 354
const-string v2, "state"
.line 355
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v3, 0x15
if-lt v2, v3, :cond_25
.line 356
const-string v2, "android.intent.action.HEADSET_PLUG"
.line 361
:goto_e
const/4 v3, 0x0
:try_start_f
new-instance v4, Landroid/content/IntentFilter;
invoke-direct {v4, v2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v3, v4}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
move-result-object v2
.line 362
if-eqz v2, :cond_2f
.line 363
const-string v3, "state"
const/4 v4, -0x1
invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
:try_end_20
.catch Ljava/lang/Exception; {:try_start_f .. :try_end_20} :catch_2a
move-result v2
.line 364
if-ne v2, v0, :cond_28
:goto_23
move v1, v0
.line 370
:cond_24
:goto_24
return v1
.line 358
:cond_25
const-string v2, "android.intent.action.HEADSET_PLUG"
goto :goto_e
:cond_28
move v0, v1
.line 364
goto :goto_23
.line 366
:catch_2a
move-exception v0
.line 367
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_24
:cond_2f
move v0, v1
goto :goto_23
.end method
.method public static isMusicActive(Landroid/content/Context;)Z
.registers 3
.prologue
const/4 v1, 0x0
.line 303
if-nez p0, :cond_5
move v0, v1
.line 310
:goto_4
return v0
.line 306
:cond_5
const-string v0, "audio"
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/media/AudioManager;
.line 307
if-nez v0, :cond_11
move v0, v1
.line 308
goto :goto_4
.line 310
:cond_11
invoke-virtual {v0}, Landroid/media/AudioManager;->isMusicActive()Z
move-result v0
goto :goto_4
.end method
.method public static isNetworkAvailable(Landroid/content/Context;)Z
.registers 6
.prologue
const/4 v3, 0x1
const/4 v2, 0x0
.line 40
const-string v0, "connectivity"
.line 41
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-nez v0, :cond_e
move v0, v2
.line 73
:goto_d
return v0
.line 49
:cond_e
const/4 v1, 0x0
:try_start_f
invoke-virtual {v0, v1}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;
move-result-object v1
.line 50
if-eqz v1, :cond_27
.line 51
invoke-virtual {v1}, Landroid/net/NetworkInfo;->getState()Landroid/net/NetworkInfo$State;
move-result-object v1
.line 52
sget-object v4, Landroid/net/NetworkInfo$State;->CONNECTED:Landroid/net/NetworkInfo$State;
if-eq v1, v4, :cond_21
sget-object v4, Landroid/net/NetworkInfo$State;->CONNECTING:Landroid/net/NetworkInfo$State;
:try_end_1f
.catch Ljava/lang/Exception; {:try_start_f .. :try_end_1f} :catch_23
.catch Ljava/lang/NoSuchMethodError; {:try_start_f .. :try_end_1f} :catch_44
if-ne v1, v4, :cond_27
:cond_21
move v0, v3
.line 53
goto :goto_d
.line 55
:catch_23
move-exception v1
.line 57
:goto_24
invoke-virtual {v1}, Ljava/lang/Throwable;->printStackTrace()V
.line 61
:cond_27
const/4 v1, 0x1
:try_start_28
invoke-virtual {v0, v1}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;
move-result-object v0
.line 62
if-eqz v0, :cond_40
.line 63
invoke-virtual {v0}, Landroid/net/NetworkInfo;->getState()Landroid/net/NetworkInfo$State;
move-result-object v0
.line 65
sget-object v1, Landroid/net/NetworkInfo$State;->CONNECTED:Landroid/net/NetworkInfo$State;
if-eq v0, v1, :cond_3a
sget-object v1, Landroid/net/NetworkInfo$State;->CONNECTING:Landroid/net/NetworkInfo$State;
:try_end_38
.catch Ljava/lang/Exception; {:try_start_28 .. :try_end_38} :catch_3c
.catch Ljava/lang/NoSuchMethodError; {:try_start_28 .. :try_end_38} :catch_42
if-ne v0, v1, :cond_40
:cond_3a
move v0, v3
.line 66
goto :goto_d
.line 68
:catch_3c
move-exception v0
.line 70
:goto_3d
invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V
:cond_40
move v0, v2
.line 73
goto :goto_d
.line 68
:catch_42
move-exception v0
goto :goto_3d
.line 55
:catch_44
move-exception v1
goto :goto_24
.end method
.method public static isScreenOff(Landroid/content/Context;)Z
.registers 5
.prologue
const/4 v1, 0x1
.line 211
if-eqz p0, :cond_27
.line 212
const-string v0, "power"
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
.line 214
if-eqz v0, :cond_27
.line 215
:try_start_d
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v3, 0x14
if-lt v2, v3, :cond_1b
.line 216
invoke-virtual {v0}, Landroid/os/PowerManager;->isInteractive()Z
move-result v0
if-nez v0, :cond_27
move v0, v1
.line 229
:goto_1a
return v0
.line 220
:cond_1b
invoke-virtual {v0}, Landroid/os/PowerManager;->isScreenOn()Z
:try_end_1e
.catch Ljava/lang/Throwable; {:try_start_d .. :try_end_1e} :catch_23
move-result v0
if-nez v0, :cond_27
move v0, v1
.line 221
goto :goto_1a
.line 225
:catch_23
move-exception v0
.line 226
invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V
.line 229
:cond_27
const/4 v0, 0x0
goto :goto_1a
.end method
.method public static isUSBConnect(Landroid/content/Context;)Z
.registers 4
.prologue
.line 233
if-eqz p0, :cond_22
.line 235
const/4 v0, 0x0
:try_start_3
new-instance v1, Landroid/content/IntentFilter;
const-string v2, "android.hardware.usb.action.USB_STATE"
invoke-direct {v1, v2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v0, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
move-result-object v0
.line 236
if-eqz v0, :cond_22
.line 237
invoke-virtual {v0}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
move-result-object v0
const-string v1, "connected"
invoke-virtual {v0, v1}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;)Z
:try_end_19
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_19} :catch_1e
move-result v0
if-eqz v0, :cond_22
.line 238
const/4 v0, 0x1
.line 245
:goto_1d
return v0
.line 241
:catch_1e
move-exception v0
.line 242
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
.line 245
:cond_22
const/4 v0, 0x0
goto :goto_1d
.end method
.method public static isWiFiApOn(Landroid/content/Context;)Z
.registers 5
.prologue
const/4 v0, 0x0
.line 408
.line 409
if-eqz p0, :cond_1e
.line 411
const/4 v1, 0x0
:try_start_4
new-instance v2, Landroid/content/IntentFilter;
const-string v3, "android.net.wifi.WIFI_AP_STATE_CHANGED"
invoke-direct {v2, v3}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v1, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
move-result-object v1
.line 412
if-eqz v1, :cond_1e
.line 413
const-string/jumbo v2, "wifi_state"
const/4 v3, -0x1
invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
:try_end_18
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_18} :catch_1f
move-result v1
.line 415
const/16 v2, 0xd
if-ne v1, v2, :cond_1e
const/4 v0, 0x1
.line 421
:cond_1e
:goto_1e
return v0
.line 417
:catch_1f
move-exception v1
.line 418
invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_1e
.end method
.method public static isWifiNetworkAvailable(Landroid/content/Context;)Z
.registers 6
.prologue
const/4 v2, 0x1
const/4 v1, 0x0
.line 79
const-string v0, "connectivity"
.line 80
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 81
if-nez v0, :cond_e
move v0, v1
.line 101
:goto_d
return v0
.line 85
:cond_e
const/4 v3, 0x0
.line 87
const/4 v4, 0x1
.line 88
:try_start_10
invoke-virtual {v0, v4}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;
:try_end_13
.catch Ljava/lang/Exception; {:try_start_10 .. :try_end_13} :catch_18
.catch Ljava/lang/NoSuchMethodError; {:try_start_10 .. :try_end_13} :catch_2e
move-result-object v0
.line 94
:goto_14
if-nez v0, :cond_1e
move v0, v1
.line 95
goto :goto_d
.line 90
:catch_18
move-exception v0
.line 92
:goto_19
invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V
move-object v0, v3
goto :goto_14
.line 97
:cond_1e
invoke-virtual {v0}, Landroid/net/NetworkInfo;->getState()Landroid/net/NetworkInfo$State;
move-result-object v0
.line 98
sget-object v3, Landroid/net/NetworkInfo$State;->CONNECTED:Landroid/net/NetworkInfo$State;
if-eq v0, v3, :cond_2a
sget-object v3, Landroid/net/NetworkInfo$State;->CONNECTING:Landroid/net/NetworkInfo$State;
if-ne v0, v3, :cond_2c
:cond_2a
move v0, v2
.line 99
goto :goto_d
:cond_2c
move v0, v1
.line 101
goto :goto_d
.line 90
:catch_2e
move-exception v0
goto :goto_19
.end method
.method public static declared-synchronized saveToPath(Ljava/lang/String;)V
.registers 2
.prologue
.line 404
const-class v0, Lcom/cleanmaster/boost/sceneengine/mainengine/deps/Commons;
monitor-enter v0
monitor-exit v0
return-void
.end method