Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WRITE_SECURE_SETTINGS permission error even when added in Manifest

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/
like image 201
Louisth Avatar asked Oct 24 '12 08:10

Louisth


People also ask

Where do I put permission in a manifest file?

xml in the Android Manifest Editor (should be the default action for opening AndroidManifest. xml from the project files list). Afterwards, select the Permissions tab along the bottom of the editor ( Manifest - Application - Permissions - Instrumentation - AndroidManifest.

How do I declare permissions in Android manifest?

Add declaration to app manifest To declare a permission that your app might request, include the appropriate <uses-permission> element in your app's manifest file. For example, an app that needs to access the camera has this line in AndroidManifest. xml : <manifest ...>

What is the use of Android Protectionlevel in permission tag in manifest?

A permission that the system grants only if the requesting application is signed with the same certificate as the application that declared the permission. If the certificates match, the system automatically grants the permission without notifying the user or asking for the user's explicit approval.


2 Answers

I would like to add that WRITE_SECURE_SETTINGS permission can be granted over adb and this approach does NOT require root. Here is a command:

adb shell pm grant your.package.name android.permission.WRITE_SECURE_SETTINGS
like image 170
JustHobby Avatar answered Sep 22 '22 18:09

JustHobby


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.

like image 32
Royston Pinto Avatar answered Sep 19 '22 18:09

Royston Pinto