zoukankan      html  css  js  c++  java
  • android 获得root权限

    public static boolean RootCommand(String command) {
            Process process = null;
            DataOutputStream os = null;
            try {
                process = Runtime.getRuntime().exec("su");
                os = new DataOutputStream(process.getOutputStream());
                os.writeBytes(command + "\n");
                os.writeBytes("exit\n");
                os.flush();
                process.waitFor();
            } catch (Exception e) {
                Log.d("*** DEBUG ***", "ROOT REE" + e.getMessage());
                return false;
            } finally {
                try {
                    if (os != null) {
                        os.close();
                    }
                    process.destroy();
                } catch (Exception e) {
                }
            }
            Log.d("*** DEBUG ***", "Root SUC ");
            return true;
        }
  • 相关阅读:
    WPF应用
    web窗体的运用
    关于计算器的封装
    典型用户、用户故事
    第五次作业
    第四次作业
    四则运算
    git 认识
    First article
    TODO
  • 原文地址:https://www.cnblogs.com/zhouchanwen/p/2471350.html
Copyright © 2011-2022 走看看