您现在的位置是:首页 > 编程 > 

Android获取超级用户权限删除文件

2025-07-20 10:37:32
获取超级用户权限的windows代码如下: 打开命令提示符,进入sdk\platform-tools文件夹,到adb.exe。然后输入如下代码: adb.exe shell su mount -orw,remount rootfs / chm

获取超级用户权限的windows代码如下:
打开命令提示符,进入sdk\platform-tools文件夹,到。然后输入如下代码:

 shell  
su  
mount -orw,remount rootfs /  
chmod 777 /mnt/shell

这样就可以删除/mnt/shell文件夹下的文件。在Android中,上面的代码可以用如下代码替换

/**
     * 获取系统管理员权限
     * 手机必须要root
     * 
     * @param command
     * @return
     * @throws InterruptedException
     */
    private boolean runRootCommand() throws InterruptedException {
        Process process = null;
        DataOutputStream os = null;
        try {
            Log.i(test, su);
            process = Runtime.getRuntime().exec(su);
            os = new DataOutputStream(process.getOutputStream());
            Log.i(test, mount -orw,remount rootfs /);
            os.writeBytes(mount -orw,remount rootfs /  \n);
            Log.i(test, chmod 777 /mnt/shell);
            //可以在这里修改你想要的文件夹的路径
            os.writeBytes(chmod 777 /mnt/shell  \n);
            os.writeBytes(exit\n);
            os.flush();
            process.waitFor();
        } catch (Exception e) {
            Log.d(*** DEBUG ***, Unexpected error - Here is what I know: 
                     e.getMessage());
            return false;
        } finally {
            try {
                if (os != null) {
                    ();
                }
                process.destroy();
            } catch (Exception e) {
            }
        }
        return true;
    }

#感谢您对电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格的认可,转载请说明来源于"电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格

本文地址:http://www.dnpztj.cn/biancheng/1110117.html

相关标签:无
上传时间: 2025-07-16 19:25:09
留言与评论(共有 17 条评论)
本站网友 吴建峰
23分钟前 发表
然后输入如下代码: shell su mount -orw
本站网友 秃顶头发种植
29分钟前 发表
然后输入如下代码: shell su mount -orw
本站网友 大国起飞
30分钟前 发表
mount -orw
本站网友 湖北省武穴市房价
8分钟前 发表
Unexpected error - Here is what I know
本站网友 焦作市住房公积金
13分钟前 发表
Unexpected error - Here is what I know
本站网友 恩替卡韦片
12分钟前 发表
  e.getMessage()); return false; } finally { try { if (os != null) { (); } process.destroy(); } catch (Exception e) { } } return true; }
本站网友 杜子建简介
5分钟前 发表
获取超级用户权限的windows代码如下: 打开命令提示符,进入sdk\platform-tools文件夹,到
本站网友 大成国际
26分钟前 发表
然后输入如下代码: shell su mount -orw
本站网友 bumblebee
29分钟前 发表
获取超级用户权限的windows代码如下: 打开命令提示符,进入sdk\platform-tools文件夹,到
本站网友 3p3
26分钟前 发表
remount rootfs / chmod 777 /mnt/shell 这样就可以删除/mnt/shell文件夹下的文件
本站网友 失荣
20分钟前 发表
mount -orw
本站网友 上网小助手
5分钟前 发表
remount rootfs / chmod 777 /mnt/shell 这样就可以删除/mnt/shell文件夹下的文件
本站网友 一年生
3分钟前 发表
然后输入如下代码: shell su mount -orw
本站网友 荔枝的功效与作用
26分钟前 发表
chmod 777 /mnt/shell); //可以在这里修改你想要的文件夹的路径 os.writeBytes(chmod 777 /mnt/shell  \n); os.writeBytes(exit\n); os.flush(); process.waitFor(); } catch (Exception e) { Log.d(*** DEBUG ***
本站网友 天麻种植基地
6分钟前 发表
remount rootfs / chmod 777 /mnt/shell 这样就可以删除/mnt/shell文件夹下的文件
本站网友 汉中二手房出售
24分钟前 发表
获取超级用户权限的windows代码如下: 打开命令提示符,进入sdk\platform-tools文件夹,到