android
안드로이드 루팅 체크
관절분리
2022. 5. 30. 15:29
반응형
boolean chk_root2(){
final String[] files = {
"/sbin/su",
"/system/su",
"/system/bin/su",
"/system/sbin/su",
"/system/xbin/su",
"/system/xbin/mu",
"/system/bin/.ext/.su",
"/system/usr/su-backup",
"/data/data/com.noshufou.android.su",
"/system/app/Superuser.apk",
"/system/app/su.apk",
"/system/bin/.ext",
"/system/xbin/.ext",
"/data/local/xbin/su",
"/data/local/bin/su",
"/system/sd/xbin/su",
"/system/bin/failsafe/su",
"/data/local/su",
"/su/bin/su"};
for(int i = 0; i<files.length; i++){
File file = new File(files[i]);
if(null != file && file.exists()){
return true;
}
}
return false;
}
boolean chk_root3(){
try {
Runtime.getRuntime().exec("su");
return true;
} catch (Error e){
} catch (Exception e){
}
return false;
}
void rooting_chk(){
if(chk_root1() || chk_root2() || chk_root3() ){
new AlertDialog.Builder(this,AlertDialog.THEME_DEVICE_DEFAULT_LIGHT)
.setTitle("종료")
.setMessage("변경된 OS(루팅)의 기기는 사용이 제한됩니다.")
.setPositiveButton("확인",new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog,int whichButton)
{
finish();
}
}).setCancelable(false).show();
}
}
참고
반응형