f.smali
.class public Lcom/masala/share/utils/f;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field private static a:Z = false
.field private static b:Ljava/lang/String; = ""
.field private static c:Ljava/lang/String; = "SG"
.field private static d:Ljava/lang/String; = ""
.field private static e:I = 0x0
.field private static f:Ljava/lang/String; = ""
.field private static g:Ljava/lang/String; = ""
.field private static h:Ljava/lang/String; = ""
.field private static i:Ljava/lang/String; = ""
.field private static j:Ljava/lang/String; = ""
.field private static k:F = -1.0f
.field private static l:J = -0x3e8L
.field private static final m:Ljava/io/FileFilter;
.field private static n:Z
.field private static final o:[Ljava/lang/String;
.field private static p:Z
# direct methods
.method static constructor <clinit>()V
.registers 4
.line 303
new-instance v0, Lcom/masala/share/utils/f$1;
invoke-direct {v0}, Lcom/masala/share/utils/f$1;-><init>()V
sput-object v0, Lcom/masala/share/utils/f;->m:Ljava/io/FileFilter;
const/4 v0, 0x0
.line 463
sput-boolean v0, Lcom/masala/share/utils/f;->n:Z
const-string v1, "SM-J327T1"
const-string v2, "Infinix-X521"
const-string v3, "ASUS_T00J"
.line 464
filled-new-array {v1, v2, v3}, [Ljava/lang/String;
move-result-object v1
sput-object v1, Lcom/masala/share/utils/f;->o:[Ljava/lang/String;
.line 465
sput-boolean v0, Lcom/masala/share/utils/f;->p:Z
return-void
.end method
.method public constructor <init>()V
.registers 1
.line 24
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static a(Landroid/content/Context;)I
.registers 1
.line 130
:try_start_0
invoke-static {p0}, Lcom/masala/share/utils/f;->h(Landroid/content/Context;)V
:try_end_3
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_3} :catch_3
.line 134
:catch_3
sget p0, Lcom/masala/share/utils/f;->e:I
return p0
.end method
.method private static a(Ljava/lang/String;)I
.registers 6
const/4 v0, -0x1
.line 277
:try_start_1
new-instance v1, Ljava/io/FileInputStream;
invoke-direct {v1, p0}, Ljava/io/FileInputStream;-><init>(Ljava/lang/String;)V
:try_end_6
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_6} :catch_61
:try_start_6
new-instance p0, Ljava/io/InputStreamReader;
invoke-direct {p0, v1}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V
:try_end_b
.catchall {:try_start_6 .. :try_end_b} :catchall_55
:try_start_b
new-instance v2, Ljava/io/BufferedReader;
invoke-direct {v2, p0}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
:try_end_10
.catchall {:try_start_b .. :try_end_10} :catchall_49
.line 278
:try_start_10
invoke-virtual {v2}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
move-result-object v3
.line 279
invoke-virtual {v2}, Ljava/io/BufferedReader;->close()V
if-eqz v3, :cond_32
const-string v4, "0-[\\d]+$"
.line 2292
invoke-virtual {v3, v4}, Ljava/lang/String;->matches(Ljava/lang/String;)Z
move-result v4
if-nez v4, :cond_22
goto :goto_32
:cond_22
const/4 v4, 0x2
.line 2295
invoke-virtual {v3, v4}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v3
invoke-static {v3}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
move-result v3
:try_end_2f
.catchall {:try_start_10 .. :try_end_2f} :catchall_3d
add-int/lit8 v3, v3, 0x1
goto :goto_33
:cond_32
:goto_32
const/4 v3, -0x1
.line 281
:goto_33
:try_start_33
invoke-virtual {v2}, Ljava/io/BufferedReader;->close()V
:try_end_36
.catchall {:try_start_33 .. :try_end_36} :catchall_49
:try_start_36
invoke-virtual {p0}, Ljava/io/InputStreamReader;->close()V
:try_end_39
.catchall {:try_start_36 .. :try_end_39} :catchall_55
:try_start_39
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
:try_end_3c
.catch Ljava/io/IOException; {:try_start_39 .. :try_end_3c} :catch_61
return v3
:catchall_3d
move-exception v3
.line 277
:try_start_3e
throw v3
:try_end_3f
.catchall {:try_start_3e .. :try_end_3f} :catchall_3f
:catchall_3f
move-exception v4
.line 281
:try_start_40
invoke-virtual {v2}, Ljava/io/BufferedReader;->close()V
:try_end_43
.catchall {:try_start_40 .. :try_end_43} :catchall_44
goto :goto_48
:catchall_44
move-exception v2
:try_start_45
invoke-virtual {v3, v2}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:goto_48
throw v4
:try_end_49
.catchall {:try_start_45 .. :try_end_49} :catchall_49
:catchall_49
move-exception v2
.line 277
:try_start_4a
throw v2
:try_end_4b
.catchall {:try_start_4a .. :try_end_4b} :catchall_4b
:catchall_4b
move-exception v3
.line 281
:try_start_4c
invoke-virtual {p0}, Ljava/io/InputStreamReader;->close()V
:try_end_4f
.catchall {:try_start_4c .. :try_end_4f} :catchall_50
goto :goto_54
:catchall_50
move-exception p0
:try_start_51
invoke-virtual {v2, p0}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:goto_54
throw v3
:try_end_55
.catchall {:try_start_51 .. :try_end_55} :catchall_55
:catchall_55
move-exception p0
.line 277
:try_start_56
throw p0
:try_end_57
.catchall {:try_start_56 .. :try_end_57} :catchall_57
:catchall_57
move-exception v2
.line 281
:try_start_58
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
:try_end_5b
.catchall {:try_start_58 .. :try_end_5b} :catchall_5c
goto :goto_60
:catchall_5c
move-exception v1
:try_start_5d
invoke-virtual {p0, v1}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:goto_60
throw v2
:try_end_61
.catch Ljava/io/IOException; {:try_start_5d .. :try_end_61} :catch_61
:catch_61
return v0
.end method
.method private static a(Ljava/lang/String;Ljava/io/FileInputStream;)I
.registers 12
const/16 v0, 0x400
new-array v1, v0, [B
const/4 v2, -0x1
.line 416
:try_start_5
invoke-virtual {p1, v1}, Ljava/io/FileInputStream;->read([B)I
move-result p1
const/4 v3, 0x0
const/4 v4, 0x0
:goto_b
if-ge v4, p1, :cond_62
.line 418
aget-byte v5, v1, v4
const/16 v6, 0xa
if-eq v5, v6, :cond_15
if-nez v4, :cond_5f
.line 419
:cond_15
aget-byte v5, v1, v4
if-ne v5, v6, :cond_1b
add-int/lit8 v4, v4, 0x1
:cond_1b
move v5, v4
:goto_1c
if-ge v5, p1, :cond_5f
sub-int v7, v5, v4
.line 423
aget-byte v8, v1, v5
invoke-virtual {p0, v7}, Ljava/lang/String;->charAt(I)C
move-result v9
if-ne v8, v9, :cond_5f
.line 427
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v8
add-int/lit8 v8, v8, -0x1
if-ne v7, v8, :cond_5c
:goto_30
if-ge v5, v0, :cond_5b
.line 2448
aget-byte p0, v1, v5
if-eq p0, v6, :cond_5b
.line 2449
aget-byte p0, v1, v5
invoke-static {p0}, Ljava/lang/Character;->isDigit(I)Z
move-result p0
if-eqz p0, :cond_58
add-int/lit8 p0, v5, 0x1
:goto_40
if-ge p0, v0, :cond_4d
.line 2452
aget-byte p1, v1, p0
invoke-static {p1}, Ljava/lang/Character;->isDigit(I)Z
move-result p1
if-eqz p1, :cond_4d
add-int/lit8 p0, p0, 0x1
goto :goto_40
.line 2455
:cond_4d
new-instance p1, Ljava/lang/String;
sub-int/2addr p0, v5
invoke-direct {p1, v1, v3, v5, p0}, Ljava/lang/String;-><init>([BIII)V
.line 2456
invoke-static {p1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result p0
:try_end_57
.catch Ljava/io/IOException; {:try_start_5 .. :try_end_57} :catch_62
.catch Ljava/lang/NumberFormatException; {:try_start_5 .. :try_end_57} :catch_62
return p0
:cond_58
add-int/lit8 v5, v5, 0x1
goto :goto_30
:cond_5b
return v2
:cond_5c
add-int/lit8 v5, v5, 0x1
goto :goto_1c
:cond_5f
add-int/lit8 v4, v4, 0x1
goto :goto_b
:catch_62
:cond_62
return v2
.end method
.method public static a()V
.registers 1
const/4 v0, 0x0
.line 235
sput-boolean v0, Lcom/masala/share/utils/f;->a:Z
return-void
.end method
.method public static b(Landroid/content/Context;)Ljava/lang/String;
.registers 1
.line 139
:try_start_0
invoke-static {p0}, Lcom/masala/share/utils/f;->h(Landroid/content/Context;)V
:try_end_3
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_3} :catch_3
.line 143
:catch_3
sget-object p0, Lcom/masala/share/utils/f;->f:Ljava/lang/String;
return-object p0
.end method
.method public static b()Z
.registers 7
.line 472
sget-boolean v0, Lcom/masala/share/utils/f;->n:Z
if-nez v0, :cond_57
.line 474
sget-object v0, Lcom/masala/share/utils/f;->o:[Ljava/lang/String;
array-length v1, v0
const/4 v2, 0x0
const/4 v3, 0x0
:goto_9
const/4 v4, 0x1
if-ge v3, v1, :cond_22
aget-object v5, v0, v3
.line 475
sget-object v6, Landroid/os/Build;->MODEL:Ljava/lang/String;
if-eqz v6, :cond_1f
sget-object v6, Landroid/os/Build;->MODEL:Ljava/lang/String;
invoke-virtual {v6, v5}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v5
if-eqz v5, :cond_1f
.line 476
sput-boolean v4, Lcom/masala/share/utils/f;->p:Z
.line 477
sput-boolean v4, Lcom/masala/share/utils/f;->n:Z
return v4
:cond_1f
add-int/lit8 v3, v3, 0x1
goto :goto_9
.line 481
:cond_22
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-ge v0, v1, :cond_2a
:cond_28
:goto_28
const/4 v2, 0x1
goto :goto_53
.line 485
:cond_2a
invoke-static {}, Lsg/bigo/common/a;->d()Landroid/content/Context;
move-result-object v0
invoke-static {v0}, Lcom/masala/share/utils/f;->g(Landroid/content/Context;)J
move-result-wide v0
const-wide/16 v5, 0x0
cmp-long v3, v0, v5
if-lez v3, :cond_3f
const-wide/32 v5, 0x60000000
cmp-long v3, v0, v5
if-lez v3, :cond_28
.line 492
:cond_3f
invoke-static {}, Lcom/masala/share/utils/f;->d()I
move-result v0
const/4 v1, 0x4
if-gt v0, v1, :cond_53
invoke-static {}, Lcom/masala/share/utils/f;->e()I
move-result v0
int-to-long v0, v0
const-wide/32 v5, 0x16e360
cmp-long v3, v0, v5
if-gtz v3, :cond_53
goto :goto_28
:cond_53
:goto_53
sput-boolean v2, Lcom/masala/share/utils/f;->p:Z
.line 494
sput-boolean v4, Lcom/masala/share/utils/f;->n:Z
.line 496
:cond_57
sget-boolean v0, Lcom/masala/share/utils/f;->p:Z
return v0
.end method
.method public static c()J
.registers 5
.line 500
sget-wide v0, Lcom/masala/share/utils/f;->l:J
const-wide/16 v2, -0x3e8
cmp-long v4, v0, v2
if-nez v4, :cond_12
.line 501
invoke-static {}, Lsg/bigo/common/a;->d()Landroid/content/Context;
move-result-object v0
invoke-static {v0}, Lcom/masala/share/utils/f;->g(Landroid/content/Context;)J
move-result-wide v0
sput-wide v0, Lcom/masala/share/utils/f;->l:J
.line 503
:cond_12
sget-wide v0, Lcom/masala/share/utils/f;->l:J
return-wide v0
.end method
.method public static c(Landroid/content/Context;)Ljava/lang/String;
.registers 1
.line 148
:try_start_0
invoke-static {p0}, Lcom/masala/share/utils/f;->h(Landroid/content/Context;)V
:try_end_3
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_3} :catch_3
.line 152
:catch_3
sget-object p0, Lcom/masala/share/utils/f;->g:Ljava/lang/String;
return-object p0
.end method
.method private static d()I
.registers 3
.line 247
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0xa
if-gt v0, v1, :cond_8
const/4 v0, 0x1
return v0
:cond_8
const/4 v0, -0x1
:try_start_9
const-string v1, "/sys/devices/system/cpu/possible"
.line 256
invoke-static {v1}, Lcom/masala/share/utils/f;->a(Ljava/lang/String;)I
move-result v1
if-ne v1, v0, :cond_17
const-string v1, "/sys/devices/system/cpu/present"
.line 258
invoke-static {v1}, Lcom/masala/share/utils/f;->a(Ljava/lang/String;)I
move-result v1
:cond_17
if-ne v1, v0, :cond_28
.line 1300
new-instance v1, Ljava/io/File;
const-string v2, "/sys/devices/system/cpu/"
invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V
sget-object v2, Lcom/masala/share/utils/f;->m:Ljava/io/FileFilter;
invoke-virtual {v1, v2}, Ljava/io/File;->listFiles(Ljava/io/FileFilter;)[Ljava/io/File;
move-result-object v1
array-length v0, v1
:try_end_27
.catch Ljava/lang/SecurityException; {:try_start_9 .. :try_end_27} :catch_29
.catch Ljava/lang/NullPointerException; {:try_start_9 .. :try_end_27} :catch_29
goto :goto_29
:cond_28
move v0, v1
:catch_29
:goto_29
return v0
.end method
.method public static d(Landroid/content/Context;)Ljava/lang/String;
.registers 1
.line 157
:try_start_0
invoke-static {p0}, Lcom/masala/share/utils/f;->h(Landroid/content/Context;)V
:try_end_3
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_3} :catch_3
.line 161
:catch_3
sget-object p0, Lcom/masala/share/utils/f;->j:Ljava/lang/String;
return-object p0
.end method
.method private static e()I
.registers 9
const/4 v0, 0x0
const/4 v1, -0x1
const/4 v2, 0x0
const/4 v3, -0x1
.line 329
:goto_4
:try_start_4
invoke-static {}, Lcom/masala/share/utils/f;->d()I
move-result v4
if-ge v2, v4, :cond_6b
.line 330
new-instance v4, Ljava/lang/StringBuilder;
const-string v5, "/sys/devices/system/cpu/cpu"
invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v5, "/cpufreq/cpuinfo_max_freq"
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
.line 332
new-instance v5, Ljava/io/File;
invoke-direct {v5, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 333
invoke-virtual {v5}, Ljava/io/File;->exists()Z
move-result v4
if-eqz v4, :cond_68
invoke-virtual {v5}, Ljava/io/File;->canRead()Z
move-result v4
if-eqz v4, :cond_68
const/16 v4, 0x80
new-array v6, v4, [B
.line 335
new-instance v7, Ljava/io/FileInputStream;
invoke-direct {v7, v5}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
:try_end_37
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_37} :catch_89
.line 337
:try_start_37
invoke-virtual {v7, v6}, Ljava/io/FileInputStream;->read([B)I
const/4 v5, 0x0
.line 340
:goto_3b
aget-byte v8, v6, v5
invoke-static {v8}, Ljava/lang/Character;->isDigit(I)Z
move-result v8
if-eqz v8, :cond_48
if-ge v5, v4, :cond_48
add-int/lit8 v5, v5, 0x1
goto :goto_3b
.line 343
:cond_48
new-instance v4, Ljava/lang/String;
invoke-direct {v4, v6, v0, v5}, Ljava/lang/String;-><init>([BII)V
.line 344
invoke-static {v4}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
.line 345
invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I
move-result v5
if-le v5, v3, :cond_5f
.line 346
invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I
move-result v3
:try_end_5f
.catch Ljava/lang/NumberFormatException; {:try_start_37 .. :try_end_5f} :catch_5f
.catchall {:try_start_37 .. :try_end_5f} :catchall_63
.line 351
:catch_5f
:cond_5f
:try_start_5f
invoke-virtual {v7}, Ljava/io/FileInputStream;->close()V
goto :goto_68
:catchall_63
move-exception v0
invoke-virtual {v7}, Ljava/io/FileInputStream;->close()V
throw v0
:cond_68
:goto_68
add-int/lit8 v2, v2, 0x1
goto :goto_4
:cond_6b
if-ne v3, v1, :cond_88
.line 356
new-instance v0, Ljava/io/FileInputStream;
const-string v2, "/proc/cpuinfo"
invoke-direct {v0, v2}, Ljava/io/FileInputStream;-><init>(Ljava/lang/String;)V
:try_end_74
.catch Ljava/io/IOException; {:try_start_5f .. :try_end_74} :catch_89
:try_start_74
const-string v2, "cpu MHz"
.line 358
invoke-static {v2, v0}, Lcom/masala/share/utils/f;->a(Ljava/lang/String;Ljava/io/FileInputStream;)I
move-result v2
:try_end_7a
.catchall {:try_start_74 .. :try_end_7a} :catchall_83
mul-int/lit16 v2, v2, 0x3e8
if-le v2, v3, :cond_7f
move v3, v2
.line 362
:cond_7f
:try_start_7f
invoke-virtual {v0}, Ljava/io/FileInputStream;->close()V
goto :goto_88
:catchall_83
move-exception v2
invoke-virtual {v0}, Ljava/io/FileInputStream;->close()V
throw v2
:try_end_88
.catch Ljava/io/IOException; {:try_start_7f .. :try_end_88} :catch_89
:cond_88
:goto_88
move v1, v3
:catch_89
return v1
.end method
.method public static e(Landroid/content/Context;)Ljava/lang/String;
.registers 3
.line 176
:try_start_0
invoke-static {p0}, Lcom/masala/share/utils/f;->h(Landroid/content/Context;)V
:try_end_3
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_3} :catch_4
goto :goto_5
:catch_4
nop
.line 180
:goto_5
sget-object p0, Lcom/masala/share/utils/f;->h:Ljava/lang/String;
if-eqz p0, :cond_18
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result p0
const/4 v0, 0x3
if-lt p0, v0, :cond_18
.line 181
sget-object p0, Lcom/masala/share/utils/f;->h:Ljava/lang/String;
const/4 v1, 0x0
invoke-virtual {p0, v1, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object p0
return-object p0
:cond_18
const/4 p0, 0x0
return-object p0
.end method
.method public static f(Landroid/content/Context;)Ljava/lang/String;
.registers 3
.line 188
:try_start_0
invoke-static {p0}, Lcom/masala/share/utils/f;->h(Landroid/content/Context;)V
:try_end_3
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_3} :catch_4
goto :goto_5
:catch_4
nop
.line 192
:goto_5
sget-object p0, Lcom/masala/share/utils/f;->h:Ljava/lang/String;
if-eqz p0, :cond_18
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result p0
const/4 v0, 0x5
if-lt p0, v0, :cond_18
.line 193
sget-object p0, Lcom/masala/share/utils/f;->h:Ljava/lang/String;
const/4 v1, 0x3
invoke-virtual {p0, v1, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object p0
return-object p0
:cond_18
const/4 p0, 0x0
return-object p0
.end method
.method public static g(Landroid/content/Context;)J
.registers 5
.line 380
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x10
if-lt v0, v1, :cond_19
.line 381
new-instance v0, Landroid/app/ActivityManager$MemoryInfo;
invoke-direct {v0}, Landroid/app/ActivityManager$MemoryInfo;-><init>()V
const-string v1, "activity"
.line 382
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Landroid/app/ActivityManager;
.line 383
invoke-virtual {p0, v0}, Landroid/app/ActivityManager;->getMemoryInfo(Landroid/app/ActivityManager$MemoryInfo;)V
.line 385
iget-wide v0, v0, Landroid/app/ActivityManager$MemoryInfo;->totalMem:J
return-wide v0
:cond_19
const-wide/16 v0, -0x1