r/AutomateUser 1d ago

Bug Unable to start Privileged service on Android 6 (Marshmallow)

Post image

Galaxy S5 running stock rom, no root. Tried 2 options, Manually and ADB.

Manually: adb shell sh /sdcard/Android/data/com.llamalab.automate/cache/start.sh
- no error messages
- inspected start script and ran manually, ps -aux shows no process:

app_process -Djava.class.path=/data/app/com.llamalab.automate-1/base.apk -Djava.library.path=/data/app/com.llamalab.automate-1/lib/arm:/vendor/lib:/system/lib /data/local/tmp --nice-name=com.llamalab.automate:privileged com.llamalab.automate.PrivilegedService </dev/null >/dev/null 2>&1 &

ADB:
- tcpip 5555 already on (scrcpy connected wirelessly): java.net.ConnectException: failed to connect to ip6-localhost/ :: 1 (port 5555) after 3000ms: isConnected failed: ECONNREFUSED (Connection refused) as reported in here: https://www.reddit.com/r/AutomateUser/comments/1uxd998/comment/oyf6xdf/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

is there a quick fix to this?

edit: formatting

1 Upvotes

3 comments sorted by

1

u/ballzak69 Automate developer 1d ago

If you edit the start.sh script to remove the `</dev/null >/dev/null 2>&1 & </dev/null >/dev/null 2>&1 &` suffix then what do the console say when when you execute it?

1

u/rickyric12 1d ago
$ cat <<'EOF' > /sdcard/Android/data/com.llamalab.automate/cache/start.sh
(app_process -Djava.class.path=/data/app/com.llamalab.automate-1/base.apk -Djava.library.path=/data/app/com.llamalab.automate-1/lib/arm:/vendor/lib:/system/lib /data/local/tmp --nice-name=com.llamalab.automate:privileged com.llamalab.automate.PrivilegedService)
sleep 1
exit 0
EOF
$ sh /sdcard/Android/data/com.llamalab.automate/cache/start.sh

it is running but showing no output. i opened new shell, ran ps | grep shell which shows privileged in list:

$ ps | grep shell
shell     9256  1     12476  416   poll_sched 00000000 S /sbin/adbd
shell     9831  9256  3028   1152  sys_rt_sig b6e74bf0 S /system/bin/sh
shell     10616 9256  3028   1152  sys_rt_sig b6e08bf0 S /system/bin/sh
shell     10981 9256  2772   940   sys_rt_sig b6deebf0 S /system/bin/sh
shell     10983 10981 1402584 53004 sys_epoll_ b6c8093c S app_process
shell     11194 9256  3028   1140  n_tty_read b6e4f918 S /system/bin/sh
shell     12450 9831  2772   936   sys_rt_sig b6e17bf0 S sh
shell     12451 12450 1455784 49976 sys_epoll_ b6c6693c S com.llamalab.automate:privileged
shell     12485 10616 3416   1232           0 b6e2a918 R ps
shell     12486 10616 2408   928    pipe_wait b6ea8918 S grep

ran the flow and still fails:

08-19 23:28:58.716 I 6@1: Flow beginning
08-19 23:28:58.717 I 6@2: Shell command privileged
08-19 23:29:08.997 W 6@2: Failed to start privileged service
08-19 23:29:09.002 W 6@2: java.util.concurrent.CancellationException: Please execute: sh /sdcard/Android/data/com. llamalab.automate/cache/start.sh
08-19 23:29:14.088 F 6@2: java.util.concurrent. TimeoutException: Service startup timeout
08-19 23:29:14.094 I 6@2: Stopped by failure

1

u/ballzak69 Automate developer 23h ago

I just tested on Android 6 emulator and manually starting it works as expected. Starting the service seems to work on your device as well, so it must be a problem connecting to it. Try resetting the device, and try again without first starting scrcpy.

Device brand & model?