获取Root之后

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();

apk

相关推荐