autojs 判断root

function isRoot() {
    var file = null;
    var paths = ["/system/bin/", "/system/xbin/", "/system/sbin/", "/sbin/", "/vendor/bin/", "/su/bin/"];
    try {
        for (let path in paths) {
            let file = new java.io.File(paths[path] + "su");
            if (file.exists() && file.canExecute()) return true;
        }
    } catch (x) {
        toast("错误" + x)
    }
    return false;
}
点赞
  1. 千道流说道:
    WebView Android 11
    评论你

发表评论

电子邮件地址不会被公开。必填项已用 * 标注