Copying to /system - android
Posted
by
user1675783
on Stack Overflow
See other posts from Stack Overflow
or by user1675783
Published on 2012-10-07T03:34:15Z
Indexed on
2012/10/07
3:37 UTC
Read the original article
Hit count: 93
I am been trying to copy a apk from assets of another apk to /system.
Here is what I have done,it was working in my previous app but not in this.I have added permission for wrtiting external storage. It is successfully copying to internal storage,not not to /system. Is there any way to directly copy to /system?
copyStream("y.apk","/sdcard/x.apk");
Process mSuProcess; mSuProcess = Runtime.getRuntime().exec("su"); new DataOutputStream(mSuProcess.getOutputStream()).writeBytes("mount -o remount rw /system"); DataOutputStream mSuDataOutputStream = new DataOutputStream(mSuProcess.getOutputStream()); mSuDataOutputStream.writeBytes("cp /sdcard/x.apk /system/app/x.apk"); mSuDataOutputStream.writeBytes("exit\n");
© Stack Overflow or respective owner