先搜索signatures
[AppleScript] 纯文本查看 复制代码 method private static a(Landroid/content/Context;)[B
.locals 4
invoke-virtual {p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object v0
iget-object v1, v0, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;
const-string v0, "CommUtil"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "package name:"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v0, v2}, Lmm/purchasesdk/core/utils/LogUtil;->d(Ljava/lang/String;Ljava/lang/String;)V
check-cast p0, Landroid/app/Activity;
invoke-virtual {p0}, Landroid/app/Activity;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
[color=#ff00ff] const-string v0, "/sdcard/feiche.apk"[/color]
const/16 v2, 0x40 [color=#ff0ff]/[/color][color=#ff0ff]/ 这个40是啥意思 [/color]
[color=#ff00ff] invoke-virtual {v0, v2}, Landroid/content/pm/PackageManager;->getInstalledPackages(I)Ljava/util/List;[/color]
move-result-object v0
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v2
:cond_0
[color=#ff00ff] invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z[/color] [color=#ff0ff]hasNext这个是啥意思呢,大神求解[/color]
move-result v0
if-eqz v0, :cond_1
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/content/pm/PackageInfo;
iget-object v3, v0, Landroid/content/pm/PackageInfo;->packageName:Ljava/lang/String;
invoke-virtual {v3, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_0
iget-object v0, v0, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
const/4 v1, 0x0
aget-object v0, v0, v1
invoke-virtual {v0}, Landroid/content/pm/Signature;->toByteArray()[B
move-result-object v0
:goto_0
[color=#ff00ff] return-object v0 [/color][color=#ff0ff]/[/color][color=#ff0ff]/ [/color][color=#ff00ff]返回时v0的值,改了v0 还是一样闪退 [/color]
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
|