Can't grant MacroDroid Helper v1.8 WRITE_SECURE_SETTINGS permissions

Dimlos

Well-known member
I used a USB cable and turned on USB debugging to permission granted a PC.

How about this app for testing WRITE_SECURE_SETTINGS?
It would be easy to understand because if permission is not granted, a warning will be displayed and it will not work.

I will try to update the firmware and see if I can granted permission this app.
 

aitn

Member
I used a USB cable and turned on USB debugging to permission granted a PC.

How about this app for testing WRITE_SECURE_SETTINGS?
It would be easy to understand because if permission is not granted, a warning will be displayed and it will not work.

I will try to update the firmware and see if I can granted permission this app.
If you try adb through wireless debugging, does it still grant the permissions?

The thing is when you try to grant the permissions, it doesn’t really give any warning or anything as you saw above. It seems like it was successful but then when you do the dumpsys you see it’s not. I don’t think I saw any errors in logcat either.

Yes I doubt it’s the security updates/firmware but will be interesting to see.
 

Dimlos

Well-known member
I have successfully granted permission with RRHS31.Q3-46-123-5-4.
I will try it with wireless debugging.
 

Attachments

  • terminal.jpg
    terminal.jpg
    72 KB · Views: 3

Dimlos

Well-known member
We were able to grant permissions without any problems even with wireless debugging.
 

Attachments

  • terminal.jpg
    terminal.jpg
    115.5 KB · Views: 2

aitn

Member
We were able to grant permissions without any problems even with wireless debugging.
Ok, I just tried it, and it worked:

pm grant com.vegardit.grayswitch android.permission.WRITE_SECURE_SETTINGS

dumpsys package com.vegardit.grayswitch

requested permissions:
android.permission.WRITE_SECURE_SETTINGS
android.permission.FOREGROUND_SERVICE
android.permission.RECEIVE_BOOT_COMPLETED
install permissions:
android.permission.FOREGROUND_SERVICE: granted=true
android.permission.RECEIVE_BOOT_COMPLETED: granted=true
android.permission.WRITE_SECURE_SETTINGS: granted=true

So maybe it's only an issue with Macrodroid Helper v1.8 app, but why? We have the same phone, same firmeware/OS and similar settings.

Are you able to attach a full text output that you get when doing:

dumpsys package com.arlosoft.macrodroid.helper

I would like to compare it to see if there are any special differences other than the

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

That I'm getting.

By the way, where did you download the app from? Do you have a link? Maybe something is wrong with the APK that I downloaded.

I also tried to install Macrodroid Helper v1.5, v1.7 and I couldn't grant it permissions either (v1.0 is too old to run properly on my device).
 
Last edited:

Dimlos

Well-known member
You can download it from the link in this thread and try it out.
 

aitn

Member
You can download it from the link in this thread and try it out.
Just tried it. Same thing. Could you do me a favor please and upload these two dumpsys command output files:

1.) Could you uninstall MDHelper, reninstall it and then re-run (before granting the permission) the full dumpsys command (dumpsys package com.arlosoft.macrodroid.helper) output it into a file.

2..) Then grant the permission (pm grant com.arlosoft.macrodroid.helper android.permission.WRITE_SECURE_SETTINGS) and then re-run the full dumpsys command (dumpsys package com.arlosoft.macrodroid.helper) output it into a second file.

I want to see the initial state of the permissions for this app for you when you first install it, compared to the state of the permissions after you grant that setting.
I noticed that unlike the example app that you gave that's called "Gray-Switch (Grayscale)" that's working for me to grant the permissions, that the WRITE SECURE SETTINGS was initially only showing under "requested permissions" for it, and only after granting it the permission, it added a line for it under runtime permissions with granted=true. With MDHelper, when I run the dumpsys command before granting it the permission, it appears as that setting is already showing under installed permissions as: "android.permission.WRITE_SECURE_SETTINGS: granted=false, flags=[ USER_SET]", so I'm wondering if I need to somehow first remove it from the installed permissions, and then run the grant permission for it to show there... Really interesting to see how it's on yours.

By the way, do you get a warning from Google Play Protect when installing MDHelper v 1.8 about:
"Google Play Protect
Unsafe app blocked
MD Helper
This app Was built for an older version Of
Android and doesn't include the latest privacy
protections"
click More details (click Install anyway, then it does install) or click Got it (doesn't install)? Just want to make sure it's normal.
 
Last edited:

Dimlos

Well-known member
Google Play Protect warnings are fine, everyone else is getting them too.
Upload the indicated files.
 

Attachments

  • 1.txt
    11.7 KB · Views: 2
  • 2.txt
    11.8 KB · Views: 1

aitn

Member
Google Play Protect warnings are fine, everyone else is getting them too.
Upload the indicated files.
Yes, so just like I suspected the WRITE SECURE SETTINGS was initially only showing under "requested permissions" (or declared permissions) in yours for it, and only after granting it the permission, it added a line for it under runtime permissions (or installed permissions) with granted=true.

For me, when I just install it before trying to grant it any permissions, it appears as that setting is already showing under installed permissions as: "android.permission.WRITE_SECURE_SETTINGS: granted=false, flags=[ USER_SET]", so I'm wondering if I need to somehow first remove it from the installed permissions, and then run the grant permission for it to show there... The other questions is why does mine says “flags=[ USER_SET]” and yours doesn’t after you grant it the permissions.

Any ideas/suggestions?

Thank you.
 

Dimlos

Well-known member
It may have something to do with the fact that I am using Linux and not Windows.

adb shell pm revoke com.arlosoft.macrodroid.helper android.permission.WRITE_SECURE_SETTINGS
What happens when I run this command? This command revokes permission.
 

aitn

Member
It may have something to do with the fact that I am using Linux and not Windows.

adb shell pm revoke com.arlosoft.macrodroid.helper android.permission.WRITE_SECURE_SETTINGS
What happens when I run this command? This command revokes permission.
Nothing happens when I run it. It still shows under installed permissions as granted=false. The question is why it shows there from the beginning and what is flags property.
 

Dimlos

Well-known member
I was able to reproduce the granted=false, flags=[ USER_SET].
I can't imagine why this would happen except that I executed the wrong command.
I tried to remove the flags in this state, but it did not work.
However, when I uninstalled the application, the flag disappeared.
 

aitn

Member
Uninstall the helper then use adb install -g 'file path to helper apk'.
That seem to work! It was no longer showing initially under installed permissions when installing it, then I granted it the permission, and now it shows under installed permissions:
android.permission.WRITE_SECURE_SETTINGS: granted=true

@Dimlos Thank you both! Solved!

Weird that it only works when installing it through adb and using the -g parameter (which is: grant all runtime permissions
Grant all permissions listed in the app manifest).

Now when I try to test an action with MD to do a System Setting [SECURE] adb_wifi_enabled = 0, nothing happens (it doesn't turn off wireless debugging which is currently turned on).
But in MD Helper v1.8 log, it shows:

Setting changed for adb_wifi_enabled to 0
Received request to set system setting adb_wifi_enabled to 0

Is it the wrong property? @Dimlos Does the same action work for you?
 
Last edited:

aitn

Member
It does work for me, maybe your device doesn't listen for this change ?
Why would it not listen to it? Are there other secure settings I could try to adjust to see if they work - Do you have something easy I could test and see?
At least now MD Helper is not saying in the log that it doesn't have these permissions granted when it receives the request.
 
Last edited:

aitn

Member
Try toggling the pointer_location setting in the system table using the helper.
Is it supposed to turn on the pointer location? I tried it, nothing, it's still turned off, I tried to use global secure setting this time. it shouldn't matter if I do test actions or actually trigger a macro right? Also I haven't restarted my phone after granting permissions, wonder if that's needed or not.
 

Endercraft

Moderator (& bug finder :D)
Is it supposed to turn on the pointer location? I tried it, nothing, it's still turned off, I tried to use global secure setting this time. it shouldn't matter if I do test actions or actually trigger a macro right? Also I haven't restarted my phone after granting permissions, wonder if that's needed or not.
Weird, so permissions are granted... but they aren't ?

MacroDroid doesn't display any warning ?
 
Top