WRITE_SECURE_SETTINGS permission error even when added in Manifest

Louisth picture Louisth · Oct 24, 2012 · Viewed 50.7k times · Source

I have added "android.permission.WRITE_SECURE_SETTINGS" in the Manifest. But still i get an error message saying - required "WRITE_SECURE_SETTINGS".

I have seen a lot of talks about this, and that this setting is prevented for third party software.

It is any other way that i can add my application can gain this permission?

I have see this adb command, but i not so familiar how to use this to add my application to my device, is below command is require root my device before it can be use because it failed to copy by Read-only file system?

adb remount
adb push app.apk /system/app/

Answer

Royston Pinto picture Royston Pinto · Oct 24, 2012

Firstly, as you have read before, WRITE_SECURE_SETTINGS is NOT available to applications! So you cannot use this permission regardless whether you are on rooted or production builds.

So, if you wish to enable this setting, create your own firmware that does what you need and load that firmware on whatever devices you wish. Or, contribute your changes to existing firmware mods (e.g., Cyanogen).

Some other applications use techniques like Reflection using Java to gain access to functions not exposed via API, you can probably try the same.

Secondly, adb remount does not work as is with production builds unless the phone is rooted or firmware enables it by default.