GKLBB

当你经历了暴风雨,你也就成为了暴风雨

导航

软件安全 --- 安卓安全 之 花指令

花指令就是永远不会执行的指令,目的是为了打乱分析者的思路或者使得反编译工具报错

比如:

大量的无用的Android API调用

条件判断永远不成立的分支语句

比如比利时的gsuqare加固

// 方法 1: zze
public static /* synthetic */ String zze(boolean z, String str, zzj zzjVar) {
    String str2 = true != (!z ? zzf(str, zzjVar, true, false).zza : false) 
                  ? "not allowed" 
                  : "debug cert rejected";
    MessageDigest zza2 = AndroidUtilsLight.zza("SHA-256");
    Preconditions.checkNotNull(zza2);
    return String.format("%s: pkg=%s, sha256=%s, atk=%s, ver=%s", 
           str2, str, Hex.bytesToStringLowercase(zza2.digest(zzjVar.zzc())), 
           Boolean.valueOf(z), "12451000.false");
}

// 方法 2: zzd
static String zzd(boolean z, String str, zzj zzjVar) throws Exception {
    String str2;
    int i2 = 2 % 2;                    // 🔴 混淆/反调试代码
    int i3 = h + 109;                  // 🔴
    i = i3 % 128;                      // 🔴
    if (i3 % 2 != 0) {                 // 🔴
        throw null;                    // 🔴
    }
    if (z || !zzh(str, zzjVar, true, false).zza) {
        str2 = "not allowed";
    } else {
        str2 = "debug cert rejected";
    }
    MessageDigest zza2 = AndroidUtilsLight.zza("SHA-256");
    Preconditions.checkNotNull(zza2);
    String format = String.format("%s: pkg=%s, sha256=%s, atk=%s, ver=%s", 
           str2, str, Hex.bytesToStringLowercase(zza2.digest(zzjVar.zzf())), 
           Boolean.valueOf(z), "12451000.false");
    int i4 = i + 67;                   // 🔴 混淆/反调试代码
    h = i4 % 128;                      // 🔴
    int i5 = i4 % 2;                   // 🔴
    return format;
}

 

posted on 2025-11-28 16:56  GKLBB  阅读(6)  评论(0)    收藏  举报