Can't Get ADB to grant secure_settings permissions to AutoTools

2,804 views
Skip to first unread message

SteveG

unread,
Jun 27, 2018, 6:39:04 AM6/27/18
to Tasker
Hi,
I've been trying to install Autotools on my Samsung Galaxy 7 (running Nougat) so I can use the Secure_Settings feature with Tasker.  As you outlined, I enabled USB debugging on the Samsung, then downloaded ADB to my HP computer running Windows 7.  But when I connect the Samsung to my computer, then open a command window and type "adb shell pm grant com.joaomgcd.autotools android.permission.WRITE_SECURE_SETTINGS" (without quotes), I get "error: no devices/emulators found".  In fact, if I just type "adb shell" I get the same error message.  I've checked the USB cable and it's good.

What am I doing wrong?

SteveG

joaomgcd

unread,
Jun 27, 2018, 9:28:10 AM6/27/18
to Tasker
Does your device say that it's debugging through USB in a notification?

SteveG

unread,
Jun 27, 2018, 6:48:34 PM6/27/18
to Tasker
When I first enable USB debugging (with no USB cable plugged in), a popup asks "Allow USB Debugging?"  I tap "OK" and the popup goes away.  There is no notification after that.  
Then I plug in the USB cable and connect it to my computer.  Then another Popup on my phone says "Allow access to device data - An MTP connection will be established to access the data on the connected  device."  I tap "Allow" and the popup goes away.  Now TWO notifications appear.  One says "Cable charging 78%".  The other notification (from Android System) says "Transferring media files via USB.  Tap for other USB options."  When I tap on the notification, I am presented with a radio-button menu, which says "Use USB for: (1) Transfer media files; (2) Transfer images; (3) connect to a MIDI Device; (4) Charge this phone."  None of these seem correct, so I just leave it on the default "Transfer media files."  However, there is still no notification saying it's debugging through USB.  And when I run ADB on my computer, I still get "error: no devices/emulators found."

Yesterday, I tried tapping "Revoke USB debugging authorizations," thinking that it would reset the USB debugging permission.  But it didn't seem to make a difference.  Or did I make things worse?  Or is Samsung not allowing USB debugging?  Or does it have anything to do with me using Nova Launcher instead of the built-in launcher?  I'm stumped.

Sergio Velardez

unread,
Jun 27, 2018, 7:01:30 PM6/27/18
to Tasker
Try to clean again connections from your device, enable adb connections on developer options. Then, type 'adb list devices' to verify your PC is currently seeing the smartphone. If yes, enter command to grant permission, if not, try again.

Robert Ryan

unread,
Jun 27, 2018, 7:11:38 PM6/27/18
to tas...@googlegroups.com

Are you using the data cable that came with your phone? Some third-party cables aren't useable for this.

It's a long shot, but you never know.

SteveG

unread,
Jun 27, 2018, 7:51:40 PM6/27/18
to Tasker
I've tried substituting different USB cables, different computers and even different Samsung phones (my wife's Samsung S6, running Marshmallow), and I always get the same results.  When I type "adb devices" on a command line in the computer, the list comes up empty.  I can't seem to connect ADB on either of my Windows computers with either Samsung phone.  At least not for USB debugging (file transfer seems okay).  

I did notice one thing: when I first plugged the phone into the computer, Windows checked the internet for drivers.  It found and installed the Samsung Galaxy S7 driver, but then gave me the message "CDC Serial doesn't have a driver."  Is that something I need for USB debugging?

ktmom

unread,
Jun 27, 2018, 9:11:42 PM6/27/18
to Tasker
Let me start by saying I don’t have any samsung devices, nor have I used Windows since XP ;-)

That said, these type of issues were recently discussed on XDA and the suggestion there was to try installing Samsung Kies. It should uninstall any improper drivers then install the proper ones. You can’t get anywhere installing new drivers if there are non-working ones still left behind. Then reboot and you can uninstall Kies choosing the option to keep the drivers. Reboot again and ADB should be good to go.

Matthew Carter

unread,
Jun 28, 2018, 1:55:19 AM6/28/18
to Tasker
I wouldn't ever recommend installing Samsung Kies. I'm not sure if they ever fixed it, but the older versions =< 3.0 had some rootkit like features that corrupted media files. It ran a background process that tagged all media files with serial numbers for comparing files so they could make a database of music pirates aka, anyone with a file shared between 2 of their computers.

Matthew Carter

unread,
Jun 28, 2018, 2:11:52 AM6/28/18
to Tasker
Not sure if people might have a problem getting everything to work right with finding their ADB files, but the bxActions author came up with a novel approach. He encapsulated and embedded the adb.exe, dlls and a batch script into his apk. If you wanted to use his features that needed the extra permissions, it dropped the executable capsule onto the SDcard, then explained to users (what it does and some steps) to connect the phone to your PC, and run the EXE from the SDcard. I'm not sure if you want to go with this kind of approach as it would add extra (unneeded for some) bloat to the apk, but you could easily publish another auto___ app as an option. That would give you more options to customize the batch script to enable secure settings with just Tasker, or multiple sub apps of yours like AutoTools.

SteveG

unread,
Jun 28, 2018, 3:59:25 AM6/28/18
to Tasker
Solved it!

Recap: Before, when trying to give AutoTools Secure_Settings write permission, I connected my Samsung S7 to my computer after enabling USB Debugging -- but the Samsung wouldn't register at all in the ADB device list.  The list came up blank.  And "ADB Shell" resulted in "error: no emulators/devices found."  Although I could transfer media files, etc. via the connection, there seemed to be no debugging function.

But today I checked the Windows 7 driver for the Samsung S7, and found there was a button to update it.  I clicked on it, the driver updated, and Bingo!  The phone now registered in ADB.  So I guess the whole problem was an outdated driver.  It would have been nice if Windows had automatically updated the driver when I connected my phone, or at least let me know it was out of date, without me having to guess at it.  The weird thing is that it happened on two different computers, both running Windows 7.

So once the connection was made, I was able to give AutoTools Secure_Settings write permission, and everything worked!  

Thanks to everyone for their input.  Maybe my experience can save someone else some time and aggravation.

SteveG
Reply all
Reply to author
Forward
0 new messages