Can I connect to sailfish x device with adb?

Hello!
Is there a way to run adb commands to my XA2 device in which I have flashed Sailfish X? I mean, either running adb from a linux host computer or by running adb directly on the device. I have seen some old threads in together.jolla.com but they all assume that there are stuff in /opt/alien/ directory in the device, I only have system.img there.
My end goal is to try to change the default Android webview implementation with this command (taken from here):
adb shell cmd webviewupdate set-webview-implementation <packagename>
And my motivation is this issue with lichess app: https://github.com/veloce/lichobile/issues/1137

Thank you in advance!

Why would you not jave anything in /opt/alien? That’s where the Android system files are… (or is this a new thing with the new Aliendalvik? I’m using X, so not )sure

Yes, this is new for the ‘new’ aliendalvik 8.1.
Under /opt/alien you will find only a packed image file.
Reason why integrating G…gle stuff is a bit more tricky, find it on TJC
https://together.jolla.com/question/200169/howto-install-gapps-on-sailfish-x-xperia-xa2/

I do use built-in package-verification-disabling and MicroG
see for reference only (read the update!):
https://together.jolla.com/question/200448/how-to-install-microg-on-xa2-android-81/

1 Like

You can get a shell with (as root) lxc-attach aliendalvik -- /system/bin/sh, but webviewupdate does not seem to exist.

Alternatively you can try installing Aliendalvik Control, go to Android settings and select webview as instructed in https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/prerelease.md#android-7-through-9-nougat_oreo_pie

3 Likes

Thank you for your answers, I’ve had some progress!
Within the lxc-attach sh shell, I was able to start adbd. Then, I had to copy my adbkey.pub contents (from my linux host) in an adb_keys file inside the aliendalvik container (had to run lxc-attach again in a separate terminal window), in path /data/misc/adb. Afterwards, I was able to run adb connect from my linux host and the device was seen and authorized!
As for the webview part, trying to set the webview implementation to something other than the default gives:

~$ adb shell cmd webviewupdate set-webview-implementation com.android.chrome
Failed to switch to com.android.chrome, the WebView implementation is now provided by com.android.webview.

Any ideas?
@artur I have Aliendalvik Control installed, but the webview setting is hidden inside the Android developer options… is there a way to open Android Developer options in Sailfish X? (Tapping on Build Number several times does nothing)

2 Likes

Im trying to open adb shell through the container, but it is not working.
I tried (with root)
lxc-attach aliendalvik -- /system/bin/sh and
lxc-attach -n aliendalvik /system/bin/sh
Both gives the same error:

lxc-attach: aliendalvik: attach.c: get_attach_context: 403 Failed to get init pid
lxc-attach: aliendalvik: attach.c: lxc_attach: 1430 Failed to get attach context

I also tried pointing it to the default.conf file (if this actually is it) with devel-su lxc-attach -n aliendalvik -f /etc/lxc/ :
lxc-attach: aliendalvik: parse.c: lxc_file_for_each_line_mmap: 98 Is a directory - Failed to copy config file “/etc/lxc/”
lxc-attach: aliendalvik: attach.c: get_attach_context: 403 Failed to get init pid
lxc-attach: aliendalvik: attach.c: lxc_attach: 1430 Failed to get attach context

default.conf contents:
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx

Some notes: I dont know if its remotely related, but for some reason Android support refuses to start upon booting the device(option checked/rechecked). Android Support was up and running normal. system.img was not tinkered with (except for installing Microg).
OS version: 4.5.0.24
Any help would be much appreciated. I know @DrYak is well informed about this stuff, if he could lend his insight, I’d be grateful

Apaprently the new way is appsupport-attach:

(Which of course does roughly the same thing, but with some required parameters - seemingly lxcpath).

Big Thanks!

appsupport-attach /system/bin/sh

Worked just fine

1 Like