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?
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:
then do your
pm uninstall package, and finally put the mount point back to readonly.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 whenpm uninstallruns, and it just assumes its a permissions issue, which it sort of is.