Enabling WRITE_SECURE_SETTINGS permission - RichyHBM/Monochromatic GitHub Wiki

Setting up adb

To use adb with your device, you’ll need to enable developer options and USB debugging:

  • Open Settings, and select "About".
  • Tap on "Build number" seven times.
  • Go back, and select "Developer options". Depending on the version of android this may be under the general settings options of your phone, or under system.
  • Scroll down, and check the "Android debugging" entry under "Debugging".
  • Plug your device into your computer.
  • On the computer, open up a terminal/command prompt and type adb devices.
  • A dialog should show on your device, asking you to allow usb debugging, choose "OK" (and optionally if you are on your computer you may check "always allow").

You must have developer options and USB debugging enabled on the device for this to work.

Using ADB

Download the official package for your OS from the Android Developer Web site.

Extract the downloaded zip package.

Follow the steps for your OS:


Linux/MacOS

Open a terminal session and follow 3 steps:

Check if the device is connected

If adb is not in your PATH, you should cd to the extracted folder.

Enter this command in a terminal session:

adb devices

This is how the output should look like:

Grant WRITE_SECURE_SETTINGS permission

Enter this command in a terminal session:

adb shell pm grant uk.co.richyhbm.monochromatic android.permission.WRITE_SECURE_SETTINGS

This is how the output should look like:

Check for granted permissions

Enter this command in a terminal session:

adb shell dumpsys package uk.co.richyhbm.monochromatic

If you see android.permission.WRITE_SECURE_SETTINGS: granted=true in the install permissions list, you are done.


Windows

Check if the device is connected

Enter the folder of the extracted package and open a PowerShell (or Command Prompt) window here. You can use SHIFT+right click. Or you can search the internet if you like to read more about it.

Enter the following command and hit ENTER:

.\adb.exe devices

Grant WRITE_SECURE_SETTINGS permission

Enter the following command and hit ENTER:

.\adb.exe shell pm grant uk.co.richyhbm.monochromatic android.permission.WRITE_SECURE_SETTINGS

Check for granted permissions

Enter the following command and hit ENTER:

.\adb.exe shell dumpsys package uk.co.richyhbm.monochromatic

If you see android.permission.WRITE_SECURE_SETTINGS: granted=true in the install permissions list, you are done.


Official SDK Platform Tools is available for Windows, Mac and Linux here

WRITE_SECURE_SETTINGS permission documentation is available here

Android Device Bridge (adb) documentation is available here

Based on the Tiles Support Instructions