[Android Q&A, Help & Troubleshooting] ptstr:
Hello,

I got the following phone:

Moto G Pure | 2021 | 2-Day battery | Unlocked | Made for US by Motorola | 3/32GB | 13MP Camera | Deep Indigo

https://www.amazon.com/gp/product/B09BTB5MKT/

It has an Android 11 installed.

I'm trying to grant MacroDroid Helper v1.8 the WRITE_SECURE_SETTINGS permissions.

I'm able to connect to the phone through adb from my pc, and I run the following command (some info was censored):

#################################################################################################################

C:\adb>adb -s 192.168.X.X:AAAAA shell pm grant com.arlosoft.macrodroid.helper android.permission.WRITE_SECURE_SETTINGS

C:\adb

#################################################################################################################

As you can see, I don't get any errors, but when I try to check what permissions are granted for it, this is what I get:

#################################################################################################################

C:\adb>adb -s 192.168.X.X:AAAAA shell dumpsys package com.arlosoft.macrodroid.helper

Activity Resolver Table:

Non-Data Actions:

android.intent.action.MAIN:

207d998 com.arlosoft.macrodroid.helper/.ui.HomeScreenActivity filter 53425f1

Action: "android.intent.action.MAIN"

Category: "android.intent.category.LAUNCHER"

Receiver Resolver Table:

Non-Data Actions:

com.arlosoft.macrodroid.helper.COMMAND:

429c5d6 com.arlosoft.macrodroid.helper/.CommandReceiver filter 76cf744

Action: "com.arlosoft.macrodroid.helper.COMMAND"

android.app.action.DEVICE_ADMIN_DISABLED:

8d8eaf3 com.arlosoft.macrodroid.helper/.deviceadmin.MacroDroidDeviceHelperAdminReceiver filter 6e443b0

Action: "android.app.action.DEVICE_ADMIN_ENABLED"

Action: "android.app.action.DEVICE_ADMIN_DISABLED"

android.app.action.DEVICE_ADMIN_ENABLED:

8d8eaf3 com.arlosoft.macrodroid.helper/.deviceadmin.MacroDroidDeviceHelperAdminReceiver filter 6e443b0

Action: "android.app.action.DEVICE_ADMIN_ENABLED"

Action: "android.app.action.DEVICE_ADMIN_DISABLED"

com.arlosoft.macrodroid.settingshelper.COMMAND:

429c5d6 com.arlosoft.macrodroid.helper/.CommandReceiver filter 994a057

Action: "com.arlosoft.macrodroid.settingshelper.COMMAND"

android.intent.action.BOOT_COMPLETED:

5f0a229 com.arlosoft.macrodroid.helper/.StartupReceiver filter d93b9ae

Action: "android.intent.action.BOOT_COMPLETED"

mPriority=2000, mOrder=0, mHasStaticPartialTypes=false, mHasDynamicPartialTypes=false

com.arlosoft.macrodroid.xiaomiwifihelper.LOG_MESSAGE:

429c5d6 com.arlosoft.macrodroid.helper/.CommandReceiver filter d546962

Action: "com.arlosoft.macrodroid.xiaomiwifihelper.LOG_MESSAGE"

com.arlosoft.macrodroid.v21systemsettinghelper.LOG_MESSAGE:

429c5d6 com.arlosoft.macrodroid.helper/.CommandReceiver filter f54302d

Action: "com.arlosoft.macrodroid.v21systemsettinghelper.LOG_MESSAGE"

Permissions:

Permission [com.arlosoft.macrodroid.helper.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION] (953926d):

sourcePackage=com.arlosoft.macrodroid.helper

uid=10381 gids=null type=0 prot=signature

perm=Permission{c80bea2 com.arlosoft.macrodroid.helper.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION}

Registered ContentProviders:

com.arlosoft.macrodroid.helper/androidx.startup.InitializationProvider:

Provider{32b733 com.arlosoft.macrodroid.helper/androidx.startup.InitializationProvider}

com.arlosoft.macrodroid.helper/androidx.core.content.FileProvider:

Provider{ddbbaf0 com.arlosoft.macrodroid.helper/androidx.core.content.FileProvider}

ContentProvider Authorities:

[com.arlosoft.macrodroid.helper.androidx-startup]:

Provider{32b733 com.arlosoft.macrodroid.helper/androidx.startup.InitializationProvider}

applicationInfo=ApplicationInfo{d317b08 com.arlosoft.macrodroid.helper}

[com.arlosoft.macrodroid.helper.provider]:

Provider{ddbbaf0 com.arlosoft.macrodroid.helper/androidx.core.content.FileProvider}

applicationInfo=ApplicationInfo{1be02a1 com.arlosoft.macrodroid.helper}

Key Set Manager:

[com.arlosoft.macrodroid.helper]

Signing KeySets: 113

Packages:

Package [com.arlosoft.macrodroid.helper] (7d7938f):

userId=10381

pkg=Package{559961c com.arlosoft.macrodroid.helper}

codePath=/data/app/~~afgYbukceb_f-4q_jLrdKQ==/com.arlosoft.macrodroid.helper-FXiSkoM2DKdMrjDBQKSmbQ==

resourcePath=/data/app/~~afgYbukceb_f-4q_jLrdKQ==/com.arlosoft.macrodroid.helper-FXiSkoM2DKdMrjDBQKSmbQ==

legacyNativeLibraryDir=/data/app/~~afgYbukceb_f-4q_jLrdKQ==/com.arlosoft.macrodroid.helper-FXiSkoM2DKdMrjDBQKSmbQ==/lib

primaryCpuAbi=null

secondaryCpuAbi=null

versionCode=8 minSdk=21 targetSdk=21

versionName=1.8

splits=[base]

apkSigningVersion=2

applicationInfo=ApplicationInfo{559961c com.arlosoft.macrodroid.helper}

flags=[ HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]

privateFlags=[ PRIVATE_FLAG_REQUEST_LEGACY_EXTERNAL_STORAGE PARTIALLY_DIRECT_BOOT_AWARE PRIVATE_FLAG_ALLOW_NATIVE_HEAP_POINTER_TAGGING ]

forceQueryable=false

queriesPackages=[]

dataDir=/data/user/0/com.arlosoft.macrodroid.helper

supportsScreens=[small, medium, large, xlarge, resizeable, anyDensity]

usesLibraries:

android.test.base

org.apache.http.legacy

usesLibraryFiles:

/system/framework/android.test.base.jar

/system/framework/org.apache.http.legacy.jar

timeStamp=2023-04-25 20:55:46

firstInstallTime=2023-04-25 20:55:52

lastUpdateTime=2023-04-25 20:55:52

installerPackageName=com.google.android.packageinstaller

signatures=PackageSignatures{889a225 version:2, signatures:[e04398e4], past signatures:[]}

installPermissionsFixed=true

pkgFlags=[ HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]

declared permissions:

com.arlosoft.macrodroid.helper.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION: prot=signature, INSTALLED

requested permissions:

android.permission.DUMP

com.android.vending.CHECK_LICENSE

com.android.vending.BILLING

android.permission.RECEIVE_BOOT_COMPLETED

android.permission.WAKE_LOCK

android.permission.ACCESS_COARSE_LOCATION

android.permission.ACCESS_FINE_LOCATION

android.permission.ACCESS_BACKGROUND_LOCATION: restricted=true

android.permission.BLUETOOTH

android.permission.BLUETOOTH_ADMIN

android.permission.VIBRATE

android.permission.SET_WALLPAPER

android.permission.WRITE_SETTINGS

android.permission.DISABLE_KEYGUARD

android.permission.CHANGE_WIFI_STATE

android.permission.WRITE_EXTERNAL_STORAGE: restricted=true

android.permission.ACCESS_WIFI_STATE

android.permission.CHANGE_CONFIGURATION

android.permission.MODIFY_AUDIO_SETTINGS

android.permission.READ_PHONE_STATE

android.permission.CHANGE_NETWORK_STATE

android.permission.ACCESS_NETWORK_STATE

android.permission.READ_SYNC_SETTINGS

android.permission.WRITE_SYNC_SETTINGS

android.permission.KILL_BACKGROUND_PROCESSES

android.permission.SYSTEM_ALERT_WINDOW

android.permission.BIND_ACCESSIBILITY_SERVICE

android.permission.UPDATE_DEVICE_STATS

android.permission.GET_TASKS

android.permission.FLASHLIGHT

android.permission.STATUS_BAR_SERVICE

android.permission.EXPAND_STATUS_BAR

com.google.android.providers.gsf.permission.READ_GSERVICES

android.permission.ACCESS_SUPERUSER

android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS

android.permission.ACCESS_NOTIFICATION_POLICY

android.permission.BROADCAST_PACKAGE_REPLACED

android.permission.WRITE_SECURE_SETTINGS

android.permission.WRITE_GLOBAL_SETTINGS

android.permission.REQUEST_DELETE_PACKAGES

oppo.permission.OPPO_COMPONENT_SAFE

android.permission.FORCE_STOP_PACKAGES

com.huawei.permission.external_app_settings.USE_COMPONENT

android.permission.BLUETOOTH_PRIVILEGED

com.termux.permission.RUN_COMMAND

android.permission.NEARBY_WIFI_DEVICES

com.arlosoft.macrodroid.helper.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION

android.permission.READ_EXTERNAL_STORAGE: restricted=true

android.permission.ACCESS_MEDIA_LOCATION

install permissions:

android.permission.WRITE_SETTINGS: granted=true, flags=[ USER_SET]

android.permission.MODIFY_AUDIO_SETTINGS: granted=true, flags=[ USER_SET]

android.permission.ACCESS_NOTIFICATION_POLICY: granted=true, flags=[ USER_SET]

com.google.android.providers.gsf.permission.READ_GSERVICES: granted=true, flags=[ USER_SET]

android.permission.SYSTEM_ALERT_WINDOW: granted=true, flags=[ USER_SET]

android.permission.CHANGE_NETWORK_STATE: granted=true, flags=[ USER_SET]

android.permission.WRITE_SYNC_SETTINGS: granted=true, flags=[ USER_SET]

android.permission.RECEIVE_BOOT_COMPLETED: granted=true, flags=[ USER_SET]

android.permission.EXPAND_STATUS_BAR: granted=true, flags=[ USER_SET]

android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS: granted=true, flags=[ USER_SET]

android.permission.BLUETOOTH: granted=true, flags=[ USER_SET]

android.permission.GET_TASKS: granted=true, flags=[ USER_SET]

com.android.vending.CHECK_LICENSE: granted=true, flags=[ USER_SET]

com.android.vending.BILLING: granted=true, flags=[ USER_SET]

android.permission.BLUETOOTH_ADMIN: granted=true, flags=[ USER_SET]

android.permission.CHANGE_WIFI_STATE: granted=true, flags=[ USER_SET]

android.permission.FLASHLIGHT: granted=true, flags=[ USER_SET]

android.permission.ACCESS_NETWORK_STATE: granted=true, flags=[ USER_SET]

android.permission.DISABLE_KEYGUARD: granted=true, flags=[ USER_SET]

android.permission.SET_WALLPAPER: granted=true, flags=[ USER_SET]

android.permission.KILL_BACKGROUND_PROCESSES: granted=true, flags=[ USER_SET]

android.permission.REQUEST_DELETE_PACKAGES: granted=true, flags=[ USER_SET]

android.permission.READ_SYNC_SETTINGS: granted=true, flags=[ USER_SET]

com.arlosoft.macrodroid.helper.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION: granted=true, flags=[ USER_SET]

android.permission.VIBRATE: granted=true, flags=[ USER_SET]

android.permission.ACCESS_WIFI_STATE: granted=true, flags=[ USER_SET]

android.permission.WAKE_LOCK: granted=true, flags=[ USER_SET]

User 0: ceDataInode=73781 installed=true hidden=false suspended=false distractionFlags=0 stopped=false notLaunched=false enabled=0 instant=false virtual=false

overlay paths:

/product/overlay/NavigationBarMode3Button/NavigationBarMode3ButtonOverlay.apk

gids=[3002, 3001]

runtime permissions:

android.permission.ACCESS_FINE_LOCATION: granted=true, flags=[ USER_SET|USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]

android.permission.UPDATE_DEVICE_STATS: granted=false, flags=[ USER_SET]

android.permission.READ_EXTERNAL_STORAGE: granted=true, flags=[ USER_SET|REVOKE_WHEN_REQUESTED|USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED|RESTRICTION_INSTALLER_EXEMPT|RESTRICTION_UPGRADE_EXEMPT]

com.termux.permission.RUN_COMMAND: granted=true, flags=[ USER_SET]

android.permission.WRITE_SECURE_SETTINGS: granted=false, flags=[ USER_SET]

android.permission.ACCESS_COARSE_LOCATION: granted=true, flags=[ USER_SET|USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]

android.permission.STATUS_BAR_SERVICE: granted=false, flags=[ USER_SET]

android.permission.READ_PHONE_STATE: granted=true, flags=[ USER_SET|USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]

android.permission.BLUETOOTH_PRIVILEGED: granted=false, flags=[ USER_SET]

android.permission.CHANGE_CONFIGURATION: granted=false, flags=[ USER_SET]

android.permission.FORCE_STOP_PACKAGES: granted=false, flags=[ USER_SET]

android.permission.WRITE_EXTERNAL_STORAGE: granted=true, flags=[ USER_SET|USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED|RESTRICTION_INSTALLER_EXEMPT|RESTRICTION_UPGRADE_EXEMPT]

android.permission.BIND_ACCESSIBILITY_SERVICE: granted=false, flags=[ USER_SET]

android.permission.DUMP: granted=false, flags=[ USER_SET]

android.permission.ACCESS_BACKGROUND_LOCATION: granted=true, flags=[ USER_SET|USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED|RESTRICTION_INSTALLER_EXEMPT|RESTRICTION_UPGRADE_EXEMPT]

android.permission.ACCESS_MEDIA_LOCATION: granted=true, flags=[ USER_SET|REVOKE_WHEN_REQUESTED|USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]

Queries:

system apps queryable: false

queries via package name:

queries via intent:

com.motorola.actions:

com.arlosoft.macrodroid.helper

com.motorola.gamemode:

com.arlosoft.macrodroid.helper

com.motorola.appforecast:

com.arlosoft.macrodroid.helper

com.digitalturbine.android.apps.news.uscellular:

com.arlosoft.macrodroid.helper

com.logmein.rescuemobile:

com.arlosoft.macrodroid.helper

com.microsoft.office.outlook:

com.arlosoft.macrodroid.helper

io.github.visnkmr.bapl:

com.arlosoft.macrodroid.helper

queryable via interaction:

User 0:

[com.android.keychain,com.android.inputdevices,com.android.location.fused,com.mediatek.location.lppe.main,com.android.wallpaperbackup,com.android.dynsystem,com.android.settings,android,com.trustonic.teeservice,com.android.server.telecom,com.motorola.android.providers.settings,com.android.providers.settings,com.android.localtransport,com.motorola.android.jvtcmd]:

com.arlosoft.macrodroid.helper

[com.google.android.gsf,com.google.android.gms]:

com.arlosoft.macrodroid.helper

com.google.android.inputmethod.latin:

com.arlosoft.macrodroid.helper

Package Changes:

Sequence number=22

User 0:

seq=1, package=com.motorola.audiofx

seq=5, package=com.google.android.apps.chromecast.app

seq=9, package=com.google.android.gms

seq=19, package=com.draco.ladb

seq=21, package=com.google.android.apps.docs

Dexopt state:

[com.arlosoft.macrodroid.helper]

path: /data/app/~~afgYbukceb_f-4q_jLrdKQ==/com.arlosoft.macrodroid.helper-FXiSkoM2DKdMrjDBQKSmbQ==/base.apk

arm: [status=speed-profile] [reason=bg-dexopt]

Compiler stats:

[com.arlosoft.macrodroid.helper]

base.apk - 8493

APEX session state:

Session ID: 688202563

State: SUCCESS

Session ID: 1489407315

State: ACTIVATION FAILED

Session ID: 2048686725

State: SUCCESS

Session ID: 988187568

State: SUCCESS

Session ID: 604776754

State: ACTIVATION FAILED

Session ID: 400702231

State: ACTIVATION FAILED

Session ID: 12641955

State: ACTIVATION FAILED

Session ID: 595830009

State: SUCCESS

Session ID: 1157901944

State: SUCCESS

Session ID: 212497497

State: ACTIVATION FAILED

Session ID: 3719936

State: SUCCESS

Session ID: 2134833241

State: SUCCESS

Session ID: 560012993

State: ACTIVATION FAILED

Session ID: 167305734

State: SUCCESS

Active APEX packages:

Inactive APEX packages:

Factory APEX packages:

#################################################################################################################

As you can see it says under the granted permissions section the following:

android.permission.WRITE_SECURE_SETTINGS: granted=false, flags=[ USER_SET]

I tried to restart the phone, reconnect to adb and what not but to no avail. Strangely enough other permissions did stick as you can. So not sure why it's blocking it or preventing from setting it to true? I didn't see any errors in logcat either when I ran the command. I'm doing this so I can enable the wireless debugging setting with Macrodroid with the help of the Macrodroid Helper (v1.8 is the latest version of the helper).

Any idea how can I resolve this?

Thank you.