日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

安卓給文件賦777讀寫權(quán)限

作者:短腿姑娘 更新時(shí)間: 2022-02-12 編程語(yǔ)言
private static boolean upgradeRootPermission(String path){
    Process process =null;
    DataOutputStream os = null;
    try {
        String cmd = "chmod 777 " + path;
        process = Runtime.getRuntime().exec("su");
        os = new DataOutputStream(process.getOutputStream());
        os.writeBytes(cmd + "\n");
        os.writeBytes("exit\n");
        os.flush();
        process.waitFor();
    }catch (Exception e){
    }finally {
        try {
            if (os != null){
                os.close();
            }
            process.destroy();
        }catch (Exception e){

        }
    }
try {
    return process.waitFor() == 0;
}catch (InterruptedException e){
    e.printStackTrace();
}
return false;
}

原文鏈接:https://blog.csdn.net/qq_42834405/article/details/117817687

欄目分類
最近更新