.class public Lcom/ta/utdid2/android/utils/SystemUtils; .super Ljava/lang/Object; .source "SystemUtils.java" # direct methods .method public constructor ()V .registers 1 .line 16 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method public static getAppLabel(Landroid/content/Context;)Ljava/lang/String; .registers 3 .line 80 :try_start_0 invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager; move-result-object v0 .line 81 invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String; move-result-object p0 if-eqz v0, :cond_20 if-eqz p0, :cond_20 const/4 v1, 0x1 .line 83 invoke-virtual {v0, p0, v1}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo; move-result-object p0 .line 85 iget-object p0, p0, Landroid/content/pm/PackageInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo; invoke-virtual {v0, p0}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence; move-result-object p0 invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p0 :try_end_1b .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_1b} :catch_1c return-object p0 :catch_1c move-exception p0 .line 90 invoke-virtual {p0}, Landroid/content/pm/PackageManager$NameNotFoundException;->printStackTrace()V :cond_20 const/4 p0, 0x0 return-object p0 .end method .method public static getCpuInfo()Ljava/lang/String; .registers 4 const/4 v0, 0x0 .line 23 :try_start_1 new-instance v1, Ljava/io/FileReader; const-string v2, "/proc/cpuinfo" invoke-direct {v1, v2}, Ljava/io/FileReader;->(Ljava/lang/String;)V :try_end_8 .catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_8} :catch_25 .line 26 :try_start_8 new-instance v2, Ljava/io/BufferedReader; const/16 v3, 0x400 invoke-direct {v2, v1, v3}, Ljava/io/BufferedReader;->(Ljava/io/Reader;I)V .line 28 invoke-virtual {v2}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String; move-result-object v0 .line 29 invoke-virtual {v2}, Ljava/io/BufferedReader;->close()V .line 30 invoke-virtual {v1}, Ljava/io/FileReader;->close()V :try_end_19 .catch Ljava/io/IOException; {:try_start_8 .. :try_end_19} :catch_1a .catch Ljava/io/FileNotFoundException; {:try_start_8 .. :try_end_19} :catch_25 goto :goto_2f :catch_1a move-exception v1 .line 32 :try_start_1b const-string v2, "Could not read from file /proc/cpuinfo" invoke-virtual {v1}, Ljava/io/IOException;->toString()Ljava/lang/String; move-result-object v1 invoke-static {v2, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I :try_end_24 .catch Ljava/io/FileNotFoundException; {:try_start_1b .. :try_end_24} :catch_25 goto :goto_2f :catch_25 move-exception v1 .line 36 const-string v2, "BaseParameter-Could not open file /proc/cpuinfo" invoke-virtual {v1}, Ljava/io/FileNotFoundException;->toString()Ljava/lang/String; move-result-object v1 invoke-static {v2, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I :goto_2f if-eqz v0, :cond_42 const/16 v1, 0x3a .line 40 invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I move-result v1 add-int/lit8 v1, v1, 0x1 .line 41 invoke-virtual {v0, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String; move-result-object v0 .line 42 invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String; move-result-object v0 return-object v0 .line 44 :cond_42 const-string v0, "" return-object v0 .end method .method public static getRootFolder(Ljava/lang/String;)Ljava/io/File; .registers 4 .line 66 invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File; move-result-object v0 if-eqz v0, :cond_25 .line 68 new-instance v1, Ljava/io/File; invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String; move-result-object v0 sget-object v2, Ljava/io/File;->separator:Ljava/lang/String; filled-new-array {v0, v2, p0}, [Ljava/lang/Object; move-result-object p0 const-string v0, "%s%s%s" invoke-static {v0, p0}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; move-result-object p0 invoke-direct {v1, p0}, Ljava/io/File;->(Ljava/lang/String;)V .line 70 invoke-virtual {v1}, Ljava/io/File;->exists()Z move-result p0 if-nez p0, :cond_24 .line 71 invoke-virtual {v1}, Ljava/io/File;->mkdirs()Z :cond_24 return-object v1 :cond_25 const/4 p0, 0x0 return-object p0 .end method .method public static getSystemVersion()I .registers 3 const/4 v0, 0x0 .line 50 :try_start_1 const-class v1, Landroid/os/Build$VERSION; const-string v2, "SDK_INT" invoke-virtual {v1, v2}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field; move-result-object v1 invoke-virtual {v1, v0}, Ljava/lang/reflect/Field;->getInt(Ljava/lang/Object;)I move-result v0 :try_end_d .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_d} :catch_e goto :goto_26 .line 54 :catch_e :try_start_e const-class v1, Landroid/os/Build$VERSION; const-string v2, "SDK" invoke-virtual {v1, v2}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field; move-result-object v1 invoke-virtual {v1, v0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 check-cast v0, Ljava/lang/String; invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I move-result v0 :try_end_20 .catch Ljava/lang/Exception; {:try_start_e .. :try_end_20} :catch_21 goto :goto_26 :catch_21 move-exception v0 .line 59 invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V const/4 v0, 0x2 :goto_26 return v0 .end method