1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
| AXML添加权限<uses-permission android:name="android.permission.READ_PHONE_STATE" /> 调用 invoke-static {p0}, 类名->getDeviceId(Landroid/content/Context;)Ljava/lang/String;
move-result-object v0
.method public static getDeviceId(Landroid/content/Context;)Ljava/lang/String; .registers 4
.line 193 :try_start_0 sget v0, Landroid/os/Build$VERSION;->SDK_INT:I :try_end_2 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_2} :catch_48
const/16 v1, 0x1d
const-string v2, "android_id"
if-ge v0, v1, :cond_3b
:try_start_8 const-string v0, "phone"
.line 194 invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/telephony/TelephonyManager;
if-eqz v0, :cond_2e
.line 196 invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getDeviceId()Ljava/lang/String;
move-result-object v1
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_21
.line 197 invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getDeviceId()Ljava/lang/String;
move-result-object p0
goto :goto_4e
.line 199 :cond_21 invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object p0
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object p0
invoke-static {p0, v2}, Landroid/provider/Settings$Secure;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
goto :goto_4e
.line 203 :cond_2e invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object p0
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object p0
invoke-static {p0, v2}, Landroid/provider/Settings$Secure;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
goto :goto_4e
.line 207 :cond_3b invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object p0
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object p0
invoke-static {p0, v2}, Landroid/provider/Settings$Secure;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;
move-result-object p0 :try_end_47 .catch Ljava/lang/Exception; {:try_start_8 .. :try_end_47} :catch_48
goto :goto_4e
:catch_48 move-exception p0
.line 210 invoke-virtual {p0}, Ljava/lang/Exception;->printStackTrace()V
const-string p0, ""
:goto_4e return-object p0 .end method
|