Of course. Granting the android.permission.WRITE_SECURE_SETTINGS permission via ADB is a common requirement for advanced customization apps like Tasker, SystemUI Tuner, and others.
Here is a complete, step-by-step guide on how to do it.
Quick Answer: The Command
If you have ADB set up and know the app's package name, the command is:
bash
adb shell pm grant <package_name> android.permission.WRITE_SECURE_SETTINGS
Replace <package_name> with the actual package name of the app you want to grant the permission to (e.g., com.joaomgcd.taskerm for Tasker).
⚠️ Important Warning
WRITE_SECURE_SETTINGS is a powerful and potentially dangerous permission. It allows an app to change system-level settings that are normally inaccessible to standard applications. These settings can affect your device's stability, security, and core functionality.
Only grant this permission to applications you absolutely trust from reputable developers.
Detailed Step-by-Step Guide
If you're new to ADB, follow these steps carefully.
Step 1: Set Up ADB on Your Computer
If you don't have ADB (Android Debug Bridge) installed, you need to set it up first.
Extract the ZIP file to a memorable location on your computer (e.g., C:\platform-tools on Windows).
Open a command prompt or terminal and navigate to that directory.
Windows: Open the folder, type cmd in the address bar, and press Enter.
macOS/Linux: Open a terminal, type cd , drag the folder into the terminal window, and press Enter.
Step 2: Enable USB Debugging on Your Android Device
Enable Developer Options:
Go to Settings > About phone.
Tap on Build number 7 times in a row. You'll see a toast message saying "You are now a developer!"
Enable USB Debugging:
Go to Settings > System > Developer options. (The location of Developer Options can vary slightly by manufacturer).
Find and enable the USB debugging toggle.
Step 3: Connect Your Device and Verify the Connection
Connect your Android device to your computer with a USB cable.
On your phone, a prompt will appear asking you to "Allow USB debugging?". Check the box for "Always allow from this computer" and tap Allow.
In your command prompt or terminal on your computer, run the following command to check if your device is connected properly:
bash
adb devices
You should see an output like this, where xxxxxxxx is your device's serial number:
code
List of devices attached
xxxxxxxx device
If it says unauthorized, you need to accept the RSA fingerprint prompt on your phone (Step 3.2).
If it's blank, check your cable, drivers, or try a different USB port.
Step 4: Find the App's Package Name
You need the unique package name for the app. Here are three easy ways to find it:
Method A: Play Store URL
Search for the app on the Google Play Store in your web browser. The package name is in the URL after id=.
Example: The URL for Tasker is https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm. The package name is net.dinglisch.android.taskerm.
Method B: Use an App
Install an app like "Package Name Viewer 2.0" from the Play Store. It will list all your installed apps and their package names.
Method C: Use ADB
If you know part of the app's name, you can use this command to find it (use findstr on Windows CMD instead of grep):
bash
# For macOS/Linux
adb shell pm list packages | grep -i 'tasker'
# For Windows CMD
adb shell pm list packages | findstr /i "tasker"
Step 5: Grant the Permission
Now that you have everything ready, run the main command.
In your command prompt/terminal, type the following command, replacing <package_name> with the name you found in Step 4.
bash
adb shell pm grant <package_name> android.permission.WRITE_SECURE_SETTINGS
Example for the "SystemUI Tuner" app (package name com.zacharee1.systemuituner):
bash
adb shell pm grant com.zacharee1.systemuituner android.permission.WRITE_SECURE_SETTINGS
If the command is successful, there will be no output. It will simply go to the next line in the terminal. This is normal.
Step 6: Verify the Permission (Optional)
To confirm that the permission was granted, you can run this command:
error: device not found: Your device isn't properly connected or recognized by ADB. Re-check your cable, drivers, and the adb devices command.
error: device unauthorized: You did not accept the "Allow USB debugging" prompt on your phone. Disconnect and reconnect the device to trigger the prompt again.
SecurityException ... is not a changeable permission type: This usually means the app developer did not request this permission in the app's manifest (AndroidManifest.xml). You can only grant permissions that an app has explicitly requested. You cannot grant this permission to a random app like a game or a social media app.