What is that supposed to mean ?in a place where WRITE_SECURE_SETTINGS it is necessary to write or it is necessary to write?
my oppo find2 pro phone have give all permissions to MD and helper。。but still not can change themGo to MacroDroid's settings (in the settings app not MacroDroid), there may be other permissions. There you can allow all. Also check MacroDroid's troubleshooting section.
C:\platform-tools>adb devices
List of devices attached
KNLJI7MZONIJPZW4 device
C:\platform-tools>adb shell pm grant com.tombayley.miui android.permission.WRITE_SECURE_SETTINGS
Exception occurred while executing 'grant':
java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
at android.app.ContextImpl.enforce(ContextImpl.java:2189)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:2217)
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1490)
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1472)
at android.permission.PermissionManager.grantRuntimePermission(PermissionManager.java:378)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2384)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:260)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:25118)
at android.os.Binder.shellCommand(Binder.java:956)
at android.os.Binder.onTransact(Binder.java:840)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4818)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:8688)
at android.os.Binder.execTransactInternal(Binder.java:1190)
at android.os.Binder.execTransact(Binder.java:1149)
It can also be caused by not enabling USB debugging (secure settings)Permission error when granting
On some devices there can be an error granting ABD permission that looks like this:
Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS
In this case please check your phone's developer options and look for a setting called "Disable permission monitoring" and disable it.
Hello! I disabled this setting, but still the same error. OnePlus 8, Android 13, firmware IN2013_11_F13, non-root.In this case please check your phone's developer options and look for a setting called "Disable permission monitoring" and disable it.
Also check that USB Debugging (secure settings) is enabled because else this won’t work.Hello! I disabled this setting, but still the same error. OnePlus 8, Android 13, firmware IN2013_11_F13, non-root.
Thanks mate! you save me from downgrade to A12 romAlso check that USB Debugging (secure settings) is enabled because else this won’t work.
2 VERY important things to check :Samsung S21 Helper ADB hack does not work? I have done the ADB programing twice per the instructions and MacroDroid does not connect to the helper app? I'm trying to get the S21 to toggle the WiFi. Any suggestions- recommendations?
Starting with MacroDroid V3.16.11 (with some effort) you can now invoke the following features on a non-rooted device:
Battery Saver Action
Location Mode Action
NFC Enable/Disable Action
Set Language Action
Logcat Trigger
+ others as shown within the app.
In order to do this you will need a Windows/Linux based PC or a Mac plus Google's ADB tool which can be downloaded from the links below:
Windows - https://dl.google.com/android/repositor ... indows.zip
Linux - https://dl.google.com/android/repositor ... -linux.zip
Mac - https://dl.google.com/android/repositor ... darwin.zip
For instructions on configuring your device to connect via adb please see the following information:
https://developer.android.com/studio/co ... e/adb.html
Once you have a working adb connection, you need to run the following command from the command line/terminal on your computer:
adb shell pm grant com.arlosoft.macrodroid android.permission.WRITE_SECURE_SETTINGS
followed by:
adb shell pm grant com.arlosoft.macrodroid android.permission.CHANGE_CONFIGURATION
If you are using the demo mode action you will also need the following permission:
adb shell pm grant com.arlosoft.macrodroid android.permission.DUMP
If you are using the volume button long press trigger you will need the following permission:
adb shell pm grant com.arlosoft.macrodroid android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER
If you are using the Logcat trigger you will need the following permission:
adb shell pm grant com.arlosoft.macrodroid android.permission.READ_LOGS
These commands will give MacroDroid permission to write to some restricted device settings that can normally only be done by system apps (or using root hacks).
It's a little bit of work but hopefully a nice solution for users who are unable to or don't want to root their device.
The features above are currently the only features that can be utilised by this adb permission hack, but I hope in the future I can expand the capability to allow additional features.
Permission error when granting
On some devices there can be an error granting ABD permission that looks like this:
Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS
In this case please check your phone's developer options and look for a setting called "Disable permission monitoring" or "USB debugging (Security settings)" or anything similar and enable/disable it as appropriate.
Additional information for Helper File
Starting with MacroDroid v5.8 a new helper file is available to perform some limited functionality that cannot be done directly in the app. In order to grant ADB access to this helper file please use the following command:
adb shell pm grant com.arlosoft.macrodroid.helper android.permission.WRITE_SECURE_SETTINGS
Well, as described in the action it may not work on all devices. There's nothing else to do else than root I'm afraid.Hello, should the enable/disable mobile data action (via adb, no root) work in Android 13?
I can see the "on/off" slider is actually switching when I attempt to do on/off action from MacroDroid, but it has no real impact on the settings.
Example #1
- Mobile data ON,
- attempt to disable it via Macrodroid,
- outcome: slider = off, actual mobile data = on (visible LTE icon)
View attachment 4560
Example #2 (The other way):
- Mobile data OFF,
- attempt to enable it via Macrodroid,
- outcome: slider = on, actual mobile data = off (no LTE icon)
View attachment 4561
This is Pixel 6a on GrapheneOS (Android 13).
Enabled SECURE_SETTINGS and CHANGE_CONFIGURATION via adb without any issues (the fact that the outcome of MacroDroid attempt is actually switching the slider probably confirms that the initial adb setup is correct, right?).
I tried with Google Pixel 7 Pro but it did not work. If you really want to switch on/off mobile data with MacroDroid, you can use ADB Shell [Tasker Plugin] and use adb command.Hello, should the enable/disable mobile data action (via adb, no root) work in Android 13?