WRITE_SECURE_SETTINGS permission error even when added in Manifest

前端 未结 6 1084
南方客
南方客 2020-11-28 14:28

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

6条回答
  •  囚心锁ツ
    2020-11-28 15:03

    I recently struggled with this very thing. My client wanted an app that would turn NFC off when the device was charging (wireless charger) and then on when it was removed from the charger. I was running KitKat on my Nexus 7, and even though I had WRITE_SECURE_SETTINGS in the Manifest, and the app in /system/app/, it would not work.

    Turns out, that in 4.4 they added additional security. In 4.3 however, it works if three things are true:

    1. Manifest has WRITE_SECURE_SETTINGS
    2. App is in /system/app/
    3. The package is signed by a key (any key)

    I rooted the device using the awesome Nexus Root Toolkit (NRT) from http://www.wugfresh.com/nrt/ then installed BusyBox and system app mover from:

    https://play.google.com/store/apps/details?id=stericson.busybox https://play.google.com/store/apps/details?id=de.j4velin.systemappmover

    I installed my custom signed APK and moved it into place using system app mover, which then restarted the device. It worked perfectly. Hope this helps.

提交回复
热议问题