Skip to main content

Granting write access to secure settings

FMD can automatically turn Location Services on when you trigger a fmd locate command, and turn it off again afterwards. This requires the special WRITE_SECURE_SETTINGS permission.

For a functional explanation of how auto on/off works, see this page.

info

TLDR: You need to run pm grant de.nulide.findmydevice android.permission.WRITE_SECURE_SETTINGS.

Grant the permission

Option 1: Grant via adb (from computer)

To grant the permission from a computer via adb (Android Debug Bridge):

  1. Install adb on your computer (e.g. sudo apt-get install android-tools-adb)
  2. Enable Developer Settings on you device. Go to "Settings -> About Phone" and then click several times on "Build Number". You may be asked to enter your device password.
  3. Go to "Settings -> System -> Developer Options" and enable "USB debugging"
  4. Plug your phone into your computer
  5. Open a terminal/cmd on your computer
  6. Check that your device shows up by entering this command: adb devices
  7. Grant the permission by entering this command:

adb shell pm grant de.nulide.findmydevice android.permission.WRITE_SECURE_SETTINGS

If adb returns an error like in #15 you can try the following:

  1. Go to Developer Settings
  2. Enable USB-Debugging
  3. Enable Install via USB
  4. Enable USB-Debugging (Security Settings)
  5. Rerun adb shell pm grant de.nulide.findmydevice android.permission.WRITE_SECURE_SETTINGS

Option 2: Grant via root shell

If you have a rooted device, FMD Android shows a button "Grant via root". This will execute the command for you.

Alternatively:

  1. Open your terminal app of choice
  2. Run su -c 'pm grant de.nulide.findmydevice android.permission.WRITE_SECURE_SETTINGS'

Option 3: Grant via Shizuku

If you have Shizuku installed and running, FMD Android shows a button "Grant via Shizuku". This will execute the command for you.

Alternatively:

  1. Install and open aShell
  2. Run pm grant de.nulide.findmydevice android.permission.WRITE_SECURE_SETTINGS

Check that it worked

If it worked, there should be a checkmark for the permission on FMD's home screen.

Other user profiles

If you have installed FMD in a secondary user profile, you need to pass the user ID to the ADB command:

# Get the user ids
adb shell pm list users

# Grant the permission
adb shell pm grant --user 10 de.nulide.findmydevice android.permission.WRITE_SECURE_SETTINGS