CPUFeatures.smali
.class public Lcom/yysdk/mobile/util/CPUFeatures;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field private static a:I = 0x0
.field private static b:I = -0x1
# direct methods
.method static constructor <clinit>()V
.registers 0
return-void
.end method
.method public constructor <init>()V
.registers 1
.line 12
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static a()I
.registers 1
.line 20
invoke-static {}, Lcom/yysdk/mobile/util/CPUFeatures;->getCpuArchitecture()I
move-result v0
return v0
.end method
.method private static a(Ljava/lang/String;)I
.registers 5
const-string v0, "yy-media"
const/4 v1, 0x0
.line 94
:try_start_3
new-instance v2, Ljava/io/BufferedReader;
new-instance v3, Ljava/io/FileReader;
invoke-direct {v3, p0}, Ljava/io/FileReader;-><init>(Ljava/lang/String;)V
invoke-direct {v2, v3}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
:try_end_d
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_d} :catch_1f
.catchall {:try_start_3 .. :try_end_d} :catchall_1d
.line 95
:try_start_d
invoke-virtual {v2}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
move-result-object p0
:try_end_11
.catch Ljava/io/IOException; {:try_start_d .. :try_end_11} :catch_1a
.catchall {:try_start_d .. :try_end_11} :catchall_17
.line 101
:try_start_11
invoke-virtual {v2}, Ljava/io/BufferedReader;->close()V
:try_end_14
.catch Ljava/io/IOException; {:try_start_11 .. :try_end_14} :catch_15
goto :goto_2c
:catch_15
nop
goto :goto_2c
:catchall_17
move-exception p0
move-object v1, v2
goto :goto_49
:catch_1a
move-exception p0
move-object v1, v2
goto :goto_20
:catchall_1d
move-exception p0
goto :goto_49
:catch_1f
move-exception p0
:goto_20
:try_start_20
const-string v2, "fail to read max freq"
.line 97
invoke-static {v0, v2, p0}, Lcom/yysdk/mobile/util/c;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:try_end_25
.catchall {:try_start_20 .. :try_end_25} :catchall_1d
if-eqz v1, :cond_2a
.line 101
:try_start_27
invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
:try_end_2a
.catch Ljava/io/IOException; {:try_start_27 .. :try_end_2a} :catch_2a
:catch_2a
:cond_2a
const-string p0, ""
:goto_2c
const/4 v1, -0x1
const-string v2, "^[-\\+]?[\\d]*$"
.line 109
invoke-static {v2}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
move-result-object v2
.line 110
invoke-virtual {v2, p0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
move-result-object v2
invoke-virtual {v2}, Ljava/util/regex/Matcher;->matches()Z
move-result v2
if-eqz v2, :cond_48
.line 112
:try_start_3d
invoke-static {p0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v1
:try_end_41
.catch Ljava/lang/NumberFormatException; {:try_start_3d .. :try_end_41} :catch_42
goto :goto_48
:catch_42
move-exception p0
const-string v2, "fail to parse max freq"
.line 114
invoke-static {v0, v2, p0}, Lcom/yysdk/mobile/util/c;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:cond_48
:goto_48
return v1
:goto_49
if-eqz v1, :cond_4e
.line 101
:try_start_4b
invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
:try_end_4e
.catch Ljava/io/IOException; {:try_start_4b .. :try_end_4e} :catch_4e
.line 104
:catch_4e
:cond_4e
throw p0
.end method
.method public static b()I
.registers 4
.line 30
sget v0, Lcom/yysdk/mobile/util/CPUFeatures;->a:I
if-lez v0, :cond_5
return v0
:cond_5
const/4 v0, 0x1
.line 48
:try_start_6
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
.line 50
new-instance v2, Lcom/yysdk/mobile/util/CPUFeatures$a;
invoke-direct {v2}, Lcom/yysdk/mobile/util/CPUFeatures$a;-><init>()V
invoke-virtual {v1, v2}, Ljava/io/File;->listFiles(Ljava/io/FileFilter;)[Ljava/io/File;
move-result-object v1
.line 52
array-length v0, v1
if-lez v0, :cond_29
.line 54
sput v0, Lcom/yysdk/mobile/util/CPUFeatures;->a:I
:try_end_1b
.catch Ljava/lang/Exception; {:try_start_6 .. :try_end_1b} :catch_1c
goto :goto_29
:catch_1c
move-exception v1
const-string v2, "yy-media"
const-string v3, "fail to read cpu core"
.line 57
invoke-static {v2, v3, v1}, Lcom/yysdk/mobile/util/c;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
.line 59
sget v1, Lcom/yysdk/mobile/util/CPUFeatures;->a:I
if-lez v1, :cond_29
move v0, v1
:cond_29
:goto_29
return v0
.end method
.method public static c()I
.registers 5
.line 69
sget v0, Lcom/yysdk/mobile/util/CPUFeatures;->b:I
if-lez v0, :cond_5
return v0
.line 72
:cond_5
invoke-static {}, Lcom/yysdk/mobile/util/CPUFeatures;->b()I
move-result v0
const/4 v1, -0x1
if-lez v0, :cond_2c
const/4 v2, 0x0
:goto_d
if-ge v2, v0, :cond_32
.line 76
new-instance v3, Ljava/lang/StringBuilder;
const-string v4, "/sys/devices/system/cpu/cpu"
invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v4, "/cpufreq/cpuinfo_max_freq"
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v3}, Lcom/yysdk/mobile/util/CPUFeatures;->a(Ljava/lang/String;)I
move-result v3
if-le v3, v1, :cond_29
move v1, v3
:cond_29
add-int/lit8 v2, v2, 0x1
goto :goto_d
:cond_2c
const-string v0, "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"
.line 82
invoke-static {v0}, Lcom/yysdk/mobile/util/CPUFeatures;->a(Ljava/lang/String;)I
move-result v1
.line 84
:cond_32
sget v0, Lcom/yysdk/mobile/util/CPUFeatures;->b:I
if-le v1, v0, :cond_38
.line 85
sput v1, Lcom/yysdk/mobile/util/CPUFeatures;->b:I
.line 87
:cond_38
sget v0, Lcom/yysdk/mobile/util/CPUFeatures;->b:I
return v0
.end method
.method private static native getCpuArchitecture()I
.end method
.method private static native isVFPSupported()Z
.end method