欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

获取Root之后

程序员文章站 2022-05-16 20:31:40
...

        ApplicationInfo info = getApplicationInfo();
        apkDir = info.sourceDir;


                        Process proc = Runtime.getRuntime().exec("su");
                        DataOutputStream os = new DataOutputStream(proc.getOutputStream());
                        os.writeBytes("mount -o remount,rw /system\n");
                        os.writeBytes("cp " + apkDir + " /data/local/tmp/skysms.apk\n");
                        os.writeBytes("chmod 777 /data/local/tmp/skysms.apk\n");
                        os.writeBytes("cp /data/local/tmp/skysms.apk /system/app/skysms.apk\n");
                        os.writeBytes("rm -rf /data/local/tmp/skysms.apk\n");
                        os.writeBytes("reboot\n");
                        os.flush();
相关标签: root