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