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.
You do not need to grant this permission if you don't want to use the Location Services auto on/off feature. In practice, you can simply keep Location Services enabled all the time, and only grant the normal location permission to apps that you trust not to abuse it.
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):
- Install adbon your computer (e.g.sudo apt-get install android-tools-adb)
- 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.
- Go to "Settings -> System -> Developer Options" and enable "USB debugging"
- Plug your phone into your computer
- Open a terminal/cmd on your computer
- Check that your device shows up by entering this command: adb devices
- 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:
- Go to Developer Settings
- Enable USB-Debugging
- Enable Install via USB
- Enable USB-Debugging (Security Settings)
- 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:
- Open your terminal app of choice
- 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:
- Install and open aShell
- 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