/* loaded from: classes16.dex */ publicclassZGSafetyMonitor { public static boolean checkSHA1(Context context, String sha1) { return new ZGSignatureChecker(context, sha1).checkSHA1(); } public static boolean checkMD5(Context context, String md5) { return new ZGSignatureChecker(context, md5).checkMD5(); } }
classZGSignatureChecker
public boolean checkSHA1() { if (this.realCer != null) { this.cer = CommonUtil.getMD5(getCertificateSHA1Fingerprint().trim()); String trim = this.realCer.trim(); this.realCer = trim; returnthis.cer.equals(trim); } returnfalse; } public boolean checkMD5() { if (this.realCer != null) { this.cer = CommonUtil.getMD5(getCertificateMD5Fingerprint().trim()); String trim = this.realCer.trim(); this.realCer = trim; returnthis.cer.equals(trim); } returnfalse; }
绕过root检测
frida hook
从jadx内转出frida脚本
1 2 3 4 5 6 7
letZGRootChecker = Java.use("me.suncloud.marrymemo.fragment.login.zg.ZGRootChecker"); ZGRootChecker["isDeviceRooted"].implementation = function () { console.log('isDeviceRooted is called'); let ret = this.isDeviceRooted(); console.log('isDeviceRooted ret value is ' + ret); return ret; };
jscode = """ Java.perform(function(){ let ZGRootChecker = Java.use("me.suncloud.marrymemo.fragment.login.zg.ZGRootChecker"); ZGRootChecker["isDeviceRooted"].implementation = function () { console.log('isDeviceRooted is called'); let ret = this.isDeviceRooted(); console.log('isDeviceRooted ret value is ' + ret); return False; }; }); """
jscode = """ // 这一部分是绕过签名校验 Java.perform(function(){ let ZGSignatureChecker = Java.use("me.suncloud.marrymemo.fragment.login.zg.ZGSignatureChecker"); ZGSignatureChecker["checkSHA1"].implementation = function () { console.log('checkSHA1 is called'); let ret = this.checkSHA1(); console.log('checkSHA1 ret value is ' + ret); return true; }; }); // 这一部分是绕过root检测 Java.perform(function(){ let ZGRootChecker = Java.use("me.suncloud.marrymemo.fragment.login.zg.ZGRootChecker"); ZGRootChecker["isDeviceRooted"].implementation = function () { console.log('isDeviceRooted is called'); let ret = this.isDeviceRooted(); console.log('isDeviceRooted ret value is ' + ret); return False; }; }); """