[Q] SystemOrSignature permission denied

I am trying to build a very small broadcast receiver only application, that will be in /system/app so it will have access for the permissions i need, and i can broadcast a few intents from my main application (not in /system) to perform a few activities.
I had never programmed using system permissions, so it took me a while to understand why even copying the apk in /system i was still getting permission denied; So i found out that i have to manually run "pm grant PACKAGE PERMISSION" to the manually copied apk and it worked. At least for WRITE_SECURE_SETTINGS permission. The problem is i am trying now to use the android.permission.CHANGE_COMPONENT_ENABLED_STATE, which should also be System|Signature , but i can not make it work.

If i try pm grant PACKAGE android.permission.CHANGE_COMPONENT_ENABLED_STATE, i get:

Operation not allowed: java.lang.SecurityException: Permission android.permission.CHANGE_COMPONENT_ENABLED_STATE is not a changeable permission type

And the error when i try to disable a component from another app is:

W/System.err( 4631): java.lang.SecurityException: Permission Denial: attempt to change component state from pid=4631, uid=10069, package uid=10038
W/System.err( 4631): at android.os.Parcel.readException(Parcel.java:1465)
W/System.err( 4631): at android.os.Parcel.readException(Parcel.java:1419)
W/System.err( 4631): at android.content.pm.IPackageManager$Stub$Proxy.setC omponentEnabledSetting(IPackageManager.java:2943)
W/System.err( 4631): at android.app.ApplicationPackageManager.setComponent EnabledSetting(ApplicationPackageManager.java:1296 )
W/System.err( 4631): at android.app.ActivityThread.handleReceiver(Activity Thread.java:2439)
W/System.err( 4631): at android.app.ActivityThread.access$1700(ActivityThr ead.java:145)
W/System.err( 4631): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1282)
W/System.err( 4631): at android.os.Handler.dispatchMessage(Handler.java:10 2)
W/System.err( 4631): at android.os.Looper.loop(Looper.java:136)
W/System.err( 4631): at android.app.ActivityThread.main(ActivityThread.jav a:5081)
W/System.err( 4631): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 4631): at java.lang.reflect.Method.invoke(Method.java:515)
W/System.err( 4631): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:791)
W/System.err( 4631): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:607)
W/System.err( 4631): at dalvik.system.NativeStart.main(Native Method)

Any ideas how can i get this permission ?
My apk is already in /system/app

Thanks !

Show Accepted Answer

Guest Quick Reply (No URL, BBcode or HTML)

Last post by liliana.rowe
3 hours ago
Last post by bklocko
1 hour ago
Started by autumn09
Last post by lockman.oran
43 minutes ago
Last post by simonis.jacey
4 hours ago
Last post by dgleason
4 hours ago
Last post by kruecker
2 hours ago
Last post by betty51
3 hours ago
Last post by foster.funk
2 hours ago
Last post by dominic17
1 hour ago