Bypassing Root Detection android

 Thông thường lập trình viên thường check root theo luồng logic lập trình dưới.



  1. /system/bin/su
  2. /system/xbin/su
  3. /sbin/su (less common)
  4. /system/sbin/su (less common)
  5. /system/bin/.ext/.su (sometimes used for hiding the binary)
  6. /system/xbin/mu (another hidden location)
  7. “/system/sd/xbin/su
  8. /data/local/xbin/su
  9. /data/local/bin/su
  10. /data/local/su
  11. /system/bin/failsafe/su

1 số kiểu check detect

privatestaticboolean isDebug; //check máy có debugs hay không?
privatestaticboolean isEmulator; //check máy ảo
privatestaticboolean isIntegrity;
privatestaticboolean isRoot; // check root


publicenum Architecture {
X86_32,
X86_64,
ARM_UNKNOWN,
PPC,
PPC64,
ARMV6,
ARMV7,
UNKNOWN,
ARMV7S,
ARM64;

/

publicstaticboolean isRooted(Context context) {
boolean isEmulator = isEmulator(context);
String str = Build.TAGS;
if ((isEmulator || str == null || !str.contains("test-keys")) && !new File("/system/app/Superuser.apk").exists()) {
return !isEmulator && new File("/system/xbin/su").exists();
}
returntrue;
}

Mới hơn Cũ hơn

نموذج الاتصال