How do I make my mod menus have root protection? I wanna prevent rooted devices from using them.
LGL mod 2.8
LGL mod 2.8
Could you send me the code for the si.ple root checks? Idk how to do itYou can either codify simple root-checks in the main activity of lgl, or utilize tools specifically created to protect APKs, so it could implement an algorithm to verify if rooted or not.
I dont need anything too complex, just a simple root checkIf they have root, surely they'll be able to hide root. So what's the point?
Simple exemplification:Could you send me the code for the si.ple root checks? Idk how to do it
if (isDeviceRooted()) {
Toast.makeText(this, "This device is rooted. App cannot run on rooted devices.", Toast.LENGTH_SHORT).show();
finish();
} else {
// implement your logic
}
}
private boolean isDeviceRooted() {
String[] rootIndicators = {
"/system/app/Superuser.apk",
"/sbin/su",
"/system/bin/su",
"/system/xbin/su",
"/data/local/xbin/su",
"/data/local/bin/su",
"/system/sd/xbin/su",
"/system/bin/failsafe/su",
"/data/local/su"
};
for (String indicator : rootIndicators) {
if (new File(indicator).exists()) {
return true;
}
}
return false;
Which library do i import for thiswrite it in any language you want...
if you cannot write a simple check like this, then you have bigger problems than root detection.C:string pathFile = "/system/bin/su"; if(pathFile.Exist()){ print("Root detected"); }
i did not even write in one language i just used i guess 3 languages in this 2 liners lol.Which library do i import for this
String[] rootIndicators = {
"/system/app/Superuser.apk",
"/sbin/su",
"/system/bin/su",
"/system/xbin/su",
"/data/local/xbin/su",
"/data/local/bin/su",
"/system/sd/xbin/su",
"/system/bin/failsafe/su",
"/data/local/su"
};