Question

I want to uninstall some useless apps from /system. I have super access, and the permission DELETE_PACKAGE in the manifest. But when I run

Runtime.exec("pm uninstall package")

I get

ERROR/AndroidRuntime(10981): java.lang.SecurityException: Neither user 10094 nor current process has android.permission.DELETE_PACKAGES.

Anyone know how to solve this?

Was it helpful?

Solution

It wouldn't matter if you have root access or not. You will not be able to uninstall anything in /system without remounting it as read/write. /system is readonly.

you will have to run something like this:

mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system

then do your pm uninstall package, and finally put the mount point back to readonly.

mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system 

chmod doesn't change the fact that everything in /system is readonly. that means NOTHING has permissions to modify or delete files. you have to remount it to remove it. just an FYI, you can edit your original question to add your manifest, but I don't need it, I know that is your issue.

if /system is readonly, you wont even be able to do rm /system/somefile.ext. you will get an error that /system is readonly. The same thing is probably happening when pm uninstall runs, and it just assumes its a permissions issue, which it sort of is.

OTHER TIPS

As I just read, /system on the galaxy s is rw at stock. I agree with you that /system must be mounted before, but as I am testing on a galaxy s this can't solve the error posted above. (mount is not even a valid command on the galaxy s).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top