Automate superuser permissions

3,542 views
Skip to first unread message

arvi...@gmail.com

unread,
May 29, 2015, 9:43:56 AM5/29/15
to automa...@googlegroups.com
Hi,

Samsung Galaxy S4, rooted android v5.0.1, dutch
Premium Automate user.

The Automate superuser permissions is installed.
SuperSU granted acces for Automate.

However, it does not work (anymore). It did until a few days ago. I did not change a thing.

In my flows, it keeps telling me to install this permission. But it has been installed!

When reinstalled the permissions, it ens with the messege 'Could nog gain permission...'

Please help, my flows nog longer work (and it also seems to mess up my phone).

Thnx.

flyn...@arthomson.com

unread,
May 29, 2015, 3:03:46 PM5/29/15
to automa...@googlegroups.com
I've also just installed this app and am running into the exact same issue. I'm running a Samsung Galaxy S4, model SGH-i337m (Canadian, Telus). I'm running 5.01, rooted (CF-Root for this specific model). 

I've gone into the settings and enabled the super user permissions, selected 'GRANT' when the superuser prompt comes up, then when to the flow and told it to install the permissions.
When it's finished the installation part, it comes back to the flow properties and still says 'Install Permissions'. 
When I try and run a flow, the error in the log says this (in red text): 

2015-05-29 12:06:15.545 FAIL 7@13:  java.lang.SecurityException: WRITE_SECURE_SETTINGS permission required: Neither user 10003 nor current process has android.permission.WRITE_SECURE_SETTINGS.

Automate developer

unread,
May 29, 2015, 4:14:55 PM5/29/15
to automa...@googlegroups.com, arvi...@gmail.com, arvi...@gmail.com
Please use the Help & feedback menu to send me an error log, then i can see the cause.

Did you update SuperSU?

Automate developer

unread,
May 29, 2015, 5:50:12 PM5/29/15
to automa...@googlegroups.com, arvi...@gmail.com, arvi...@gmail.com
I think i know the cause for both cases.

I've read that SuperSU will remove its "android.permission.ACCESS_SUPERUSER" in an (upcoming) version,
other SU apps will probably do the same, and custom Android builds with built-in SU never even had it.

R. Versteeg

unread,
May 30, 2015, 2:59:24 AM5/30/15
to Automate developer, automa...@googlegroups.com

SuperSU PseudoPro v2.46

Automate log:

2015-05-29 15:39:56.092 INFO 1027@1: Flow beginning
2015-05-29 15:39:56.094 INFO 1027@11: Account sync set state
2015-05-29 15:39:56.146 INFO 1027@3: Mobile data set state
2015-05-29 15:39:56.159 FAIL 1027@3: java.lang.IllegalStateException: Superuser shell unavailable
2015-05-29 15:39:56.160 INFO 1027@3: Stopped by failure

Op 29 mei 2015, bij 22:14, Automate developer <henrik.l...@gmail.com> schreef:

ankle...@gmail.com

unread,
May 30, 2015, 12:47:40 PM5/30/15
to automa...@googlegroups.com, arvi...@gmail.com
I took your advice and removed the 'SuperSU' app (the super user app installed by the root image) and installed an older app called 'Superuser'. This seemed to correct the issue. I no longer get the error messages and the flows seem to run without errors. 

Ed T.

unread,
May 30, 2015, 5:18:07 PM5/30/15
to automa...@googlegroups.com, ankle...@gmail.com, arvi...@gmail.com
SuperSU has an option that requires you to reauthorize an app after its been updated.  This seems to play havoc with Automate (I had the above happen to me too).  I would be very handy for automate to have a setting menu entry to test superSU which would trigger the supersu permissions dialog so you can reauthorize.  In my experience superSU is the more stable of the su root type applications.

Ed

Automate developer

unread,
May 30, 2015, 9:07:07 PM5/30/15
to automa...@googlegroups.com, edt...@gmail.com, arvi...@gmail.com, ankle...@gmail.com
Automate could check if the device is using SuperSU when you enable/install the superuser permission the first time, and show a dialog to ask the user to disable the reauthorize after update option.
There's probably no other solution, since users can receive an update at any time without being present at the device.

But an "Authorize Superuser" option in settings could be useful, so user can reauthorize at any time, and not only when a flow happens to use SU.

R. Versteeg

unread,
May 31, 2015, 3:48:13 AM5/31/15
to Automate developer, automa...@googlegroups.com, edt...@gmail.com, ankle...@gmail.com

Hi,

Just installed newest version of Automate from Play Store: version 1.1.0

SuperSU asked for permissions for Automate, as it should.

In the settings it shows the Superuser permission is active. But in the flows it still tells me to install this permission.

Reinstalling and removing the permission with reboots in between does not fix it.

Here is a log file:

2015-05-31 09:34:56.831 INFO 1029@1: Flow beginning
2015-05-31 09:34:56.836 INFO 1029@11: Account sync set state
2015-05-31 09:34:56.883 INFO 1029@3: Mobile data set state
2015-05-31 09:35:11.902 FAIL 1029@3: java.util.concurrent.TimeoutException: Superuser shell timeout
2015-05-31 09:35:11.924 INFO 1029@3: Stopped by failure

Op 31 mei 2015, bij 03:07, Automate developer <henrik.l...@gmail.com> schreef:

Automate developer

unread,
May 31, 2015, 12:47:54 PM5/31/15
to automa...@googlegroups.com, arvi...@gmail.com, edt...@gmail.com, arvi...@gmail.com, ankle...@gmail.com
Did you upgrade manually or was the update applied automatically when you wheren't present at the device?

Apparently SuperSU has an option to require reauthorization after an app has been updated. If it's enabled and the update happends when you're not present, Automate will timeout after 15 seconds while trying to run a root block.

Try running a simple flow with a root block to reauthorize with SuperSU:

Flow beginning
     |
Attention light
    Off


I will have to come up with better solution for this.

If you're still getting superuser timeouts let me know.



On Sunday, May 31, 2015 at 9:48:13 AM UTC+2, R. Versteeg wrote:

Hi,

Just installed newest version of Automate from Play Store: version 1.1.0

SuperSU asked for permissions for Automate, as it should.

In the settings it shows the Superuser permission is active. But in the flows it still tells me to install this permission.

Reinstalling and removing the permission with reboots in between does not fix it.

Here is a log file:

2015-05-31 09:34:56.831 INFO 1029@1: Flow beginning
2015-05-31 09:34:56.836 INFO 1029@11: Account sync set state
2015-05-31 09:34:56.883 INFO 1029@3: Mobile data set state
2015-05-31 09:35:11.902 FAIL 1029@3: java.util.concurrent.TimeoutException: Superuser shell timeout
2015-05-31 09:35:11.924 INFO 1029@3: Stopped by failure

Op 31 mei 2015, bij 03:07, Automate developer  schreef:

R. Versteeg

unread,
May 31, 2015, 1:47:54 PM5/31/15
to Automate developer, automa...@googlegroups.com, edt...@gmail.com, ankle...@gmail.com

Hi

Like I wrote, Automate gained Superuser permissions after I installed the update.

Your simple flow also times out. And it does NOT show that superuser permissions are needed.

In other flows it keeps showing that superuser permission needs to be installed.

Greetz.

Op 31 mei 2015, bij 18:47, Automate developer <henrik.l...@gmail.com> schreef:

Automate developer

unread,
May 31, 2015, 2:09:32 PM5/31/15
to automa...@googlegroups.com, arvi...@gmail.com, arvi...@gmail.com, ankle...@gmail.com, edt...@gmail.com
The newer SuperSU probably no longer use the "android.permission.ACCESS_
SUPERUSER" permission, so Automate will never show an "install permission" button for it.
But i've looked through the code and Automate doesn't use it for anything else, so it should matter if it's present or not.

The timeout must be caused by something else.
It's odd that you got the SuperSU authorization screen after the update, Automate gained the permissions without warning, but it still doesn't work for executing root blocks.
It's the same code used for "gaining superuser permission" and running the root blocks.

Did you granted Automate perpetual (forever) superuser access?

If you try a "Shell command superuser" block with a simple command like "ls", does that work?

If you look in the phone settings > About phone > SELinux, what does it say?



On Sunday, May 31, 2015 at 7:47:54 PM UTC+2, R. Versteeg wrote:

Hi

Like I wrote, Automate gained Superuser permissions after I installed the update.

Your simple flow also times out. And it does NOT show that superuser permissions are needed.

In other flows it keeps showing that superuser permission needs to be installed.

Greetz.

Op 31 mei 2015, bij 18:47, Automate developer schreef:

R. Versteeg

unread,
May 31, 2015, 2:21:01 PM5/31/15
to Automate developer, automa...@googlegroups.com, ankle...@gmail.com, edt...@gmail.com

Thnx for clear explanation.

I gave perpetual superuser access.

The ls command works perfectly.

Don't know what you mean with SElinux. Do not find that in my Dutch settings.

Op 31 mei 2015, bij 20:09, Automate developer <henrik.l...@gmail.com> schreef:

Automate developer

unread,
May 31, 2015, 3:16:06 PM5/31/15
to automa...@googlegroups.com, arvi...@gmail.com, edt...@gmail.com, ankle...@gmail.com, arvi...@gmail.com
Then there must be an issue with the service that's started as the root user. It works the first time when gaining permissions, but not when running blocks.
I'll continue my investigation. But since every thing regarding root are hacks, it's difficult to find the cause.



On Sunday, May 31, 2015 at 8:21:01 PM UTC+2, R. Versteeg wrote:

Thnx for clear explanation.

I gave perpetual superuser access.

The ls command works perfectly.

Don't know what you mean with SElinux. Do not find that in my Dutch settings.

Op 31 mei 2015, bij 20:09, Automate developer schreef:

karstene...@gmail.com

unread,
Jun 17, 2015, 12:23:54 PM6/17/15
to automa...@googlegroups.com, edt...@gmail.com, arvi...@gmail.com, ankle...@gmail.com

Any luck with this issue? I'm trying to toggle airplane mode in a flow but, as the OP originally stated, installing the superuser Automate permissions appears to do nothing as the "install" button is perpetually there, even if Automate has been granted global/perpetual access in Supersu. I have tried uninstalling and reinstalling both the permisssions and Automate to no avail, as well as rebooting my phone, ect, but for the life of me automate will not recognize I've given it write secure settings permission.

I'm using a Galaxy S6 5.0.2 and running Automate v 1.1.0.  

Log below:


Automate developer

unread,
Jun 17, 2015, 2:45:35 PM6/17/15
to automa...@googlegroups.com, karstene...@gmail.com, karstene...@gmail.com, ankle...@gmail.com, arvi...@gmail.com, edt...@gmail.com
This is very difficult for me to investigate without further help, since it varies with Android version, SU app and SELinux build.

I need to know why the Automate superuser service fail. For this, i need a system log that includes the "root" user.
The log attached when using the Help & feedback only includes Automate "user" messages, which isn't enough.

1. Please install a logcat viewer like:
https://play.google.com/store/apps/details?id=com.nolanlawson.logcat

2. Run a flow that use a root block like "Attention light".

3. Send me a system log from the logcat viewer app, this will include messages for all users/apps, even root.
I'am only interested in failures in Automate's superuser service which should have the "SuperuserService" tag.

sumonesu...@gmail.com

unread,
Jun 17, 2015, 2:54:44 PM6/17/15
to automa...@googlegroups.com
Will do later today. Thanks for your help and concise instructions.

karstene...@gmail.com

unread,
Jun 17, 2015, 3:31:55 PM6/17/15
to automa...@googlegroups.com, ankle...@gmail.com, edt...@gmail.com, arvi...@gmail.com, karstene...@gmail.com
3. Send me a system log from the logcat viewer app, this will include messages for all users/apps, even root. 
I'am only interested in failures in Automate's superuser service which should have the "SuperuserService" tag.

Done. After running "Attention Light:"

06-17 12:19:07.041 D/AndroidRuntime(19179): Calling main entry com.llamalab.automate.SuperuserService
06-17 12:19:07.061 E/SuperuserService(19179): Startup failed
06-17 12:19:07.061 E/SuperuserService(19179): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
06-17 12:19:07.061 E/SuperuserService(19179): at com.llamalab.automate.SuperuserService.broadcastIntent(Unknown Source)
06-17 12:19:07.061 E/SuperuserService(19179): at com.llamalab.automate.SuperuserService.main(Unknown Source)
06-17 12:19:07.061 E/SuperuserService(19179): at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
06-17 12:19:07.061 E/SuperuserService(19179): at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:255)
06-17 12:19:08.241 E/StandaloneServiceManager(5407): Superuser shell exit (1): ComponentInfo{com.llamalab.automate/com.llamalab.automate.SuperuserService}

Device Info:
build.board: universal7420
build.bootloader: G920TUVU1AOCG
build.brand: samsung
build.cpu_abi: arm64-v8a
build.cpu_abi2: 
build.device: zerofltetmo
build.display: LRX22G.G920TUVU1AOCG
build.fingerprint: samsung/zerofltetmo/zerofltetmo:5.0.2/LRX22G/G920TUVU1AOCG:user/release-keys
build.hardware: samsungexynos7420
build.host: SWDD6108
build.id: LRX22G
build.manufacturer: samsung
build.model: SM-G920T
build.product: zerofltetmo
build.radio: unknown
build.serial: 03157df359937b17
build.tags: release-keys
build.time: 1427392572000
build.type: user
build.user: dpi
version.codename: REL
version.incremental: G920TUVU1AOCG
version.release: 5.0.2
version.sdk_int: 21


Automate developer

unread,
Jun 17, 2015, 3:36:42 PM6/17/15
to automa...@googlegroups.com, karstene...@gmail.com, edt...@gmail.com, karstene...@gmail.com, arvi...@gmail.com, ankle...@gmail.com
Perfect! Thanks, i'll investigate.

karstene...@gmail.com

unread,
Jun 23, 2015, 2:50:16 PM6/23/15
to automa...@googlegroups.com, ankle...@gmail.com, edt...@gmail.com, karstene...@gmail.com, arvi...@gmail.com
Any headway?

Automate developer

unread,
Jun 23, 2015, 3:06:52 PM6/23/15
to automa...@googlegroups.com, karstene...@gmail.com, karstene...@gmail.com, ankle...@gmail.com, arvi...@gmail.com, edt...@gmail.com
I think i've found the cause, the following system call don't return a value:
https://github.com/android/platform_frameworks_base/blob/master/core/java/android/app/ActivityManagerNative.java#L81
https://github.com/android/platform_frameworks_base/blob/master/core/java/android/app/ActivityManagerNative.java#L2392

I tested a workaround, sadly it didn't work.

Could anyone execute a "am" command using the Shell command block (use the Log append for the Standard output text), so i can see if the following system call are working:
https://github.com/android/platform_frameworks_base/blob/master/cmds/am/src/com/android/commands/am/Am.java#L296

For the next release i've made changes so that errors in the SuperuserService are visible in the Automate log. That should make debugging alot easier.


On Tuesday, June 23, 2015 at 8:50:16 PM UTC+2, karstenerikjensen wrote:
Any headway?

u...@focusweb.co.il

unread,
Oct 18, 2015, 3:19:05 AM10/18/15
to Automate, karstene...@gmail.com, ankle...@gmail.com, arvi...@gmail.com, edt...@gmail.com
Hi, 
I'm also getting a "failed to gain superuser permissions" error on my Lg G3, what can be the solution? 
I don't want to unroot my device... what can I do ? 
Thanks
Uri 

Automate developer

unread,
Oct 18, 2015, 1:08:03 PM10/18/15
to Automate, karstene...@gmail.com, ankle...@gmail.com, arvi...@gmail.com, edt...@gmail.com, u...@focusweb.co.il
Please read teh following post, and run the test flow:
https://groups.google.com/d/msg/automate-user/xMNgMjH4x_U/KhxYtEIJ3FcJ

If Automate fails to gain superuser access, uninstall the Superuser permission add-on, since it's not working anyway.
Reply all
Reply to author
Forward
0 new messages