I am trying to install a system application from my java code, and so far I have not had any success.
Below is what I have done so far:
- My device is rooted.
- The installer application is installed as a system application. (copied it manually to / system / app)
- I signed the apk installer with the platform key, and I have
android:sharedUserId="android.uid.system" in the manifest. I tried (and tried, and then again) for Runtime.getRuntime.exec("su") . I intend to set the system partition as rw , make cat for apk, and then make the system partition ro . The following is a list of commands:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system<br> cat /sdcard/application.apk > /system/app/application.apk<br> mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system<br><br>The application.apk here is the app being installed from the installer app. This app is also signed with platform key, and has the sharedUserId configured.
- I requested
INSTALL_PACKAGES permission in the manifest.
I tried several options for the exec ("") format, including using 'su -c' with each command. I got a Broken Pipe exception and a security exception. Sometimes I do not get an exception, but the file is not copied.
Please let me know what I'm missing here. Has anyone got this job?
Thanks!
Chaitanya
source share