Ask / Submit
31

*Working* microg working on Sailfish X 3.0.0.8 F5121 TL;DR

asked 2018-12-28 01:10:45 +0200

docmathoc gravatar image

updated 2018-12-31 00:48:21 +0200

So thanks to many others posting on this subject (listed below). I presume that you know about command line shells in linux, and how to traverse a file tree to find directories and generally poke about. This is not a HOWTO, but a 'HOWI'.

I needed the Curve banking app working on Sailfish X, to make it my daily driver. I tried adding Google Play (the real google play and play services), but it always hung when it tried to update. The Curve app always requested a google play upgrade, and it always failed.

I mucked about with deodex and signature spoofing tools, and broke alien dalvik completely. So I reinstalled Sailfish X on my Xperia X F5121, using the 3.0.0.8 files from the Jolla store (I paid).

This is the story of how I got micro-g installed and working so that my Curve app now runs.

My setup: A linux laptop, running KDE Neon, based on Ubuntu bionic (18.04). Xperia X, connected to the laptop by USB. Developer settings on, ssh enabled, IP 192.168.2.15.

Getting stuff ready: Plugging the Xperie X into the laptop and choosing developer as the USB connection provided a new wired network adapter. Use whatever GUI tool you have to set this IP to 192.168.2.1. The routing for connecting to the phone over USB should now be ready. Test this link from the linux shell with:

ssh nemo@192.168.2.15

Stop the android services:

systemctl stop aliendalvik

The process in outline.

  1. copy system files from the phone to the pc
  2. Deodex all the files
  3. Apply signature spoofing patch to a few important system files
  4. copy the files back to the phone
  5. Install the required android software

1. Use rsync to get the file you need from the phone: Make a new working directory somewhere simple (like your home directory). Do this at the linux shell.

rsync -rv nemo@192.168.2.15:/opt/alien/system/* .

2. Go to github and get simple-deodex github.com/jareddantis/simple-deodexer. You will need to install the Oracle version of Java 8 to run simple-deodex. Download it as a zip and unpack it. This gives you a file tree under directory 'simple-deodexer-master'. This software operates by processing all the files that you put under a directory 'triage'. Copy the files you got from the phone into this triage directory. You should copy all three directories 'framework', 'app' and 'priv-app' under 'triage' Run

./deodex.sh -l 19

NB '-l 19' states that you have Android API level 19, which is what Alien Dalvik has (Android 4.4).

The files are now deodex'ed. You can delete any *.odex files that remain in the framework, app, priv-app directories.

3. Get haystack signature spoofing patches github.com/Lanchon/haystack This has two steps. Unpack the zip file into your working directory. You will have a directory tree under 'haystack-master'. The script to run is patch-fileset. The shell command I used for this:

./patch-fileset patches/sigspoof-hook-4.1-6.0/ 19 ../simple-deodexer-master/triage/framework/

This stores the processed file, by default, in the 'framework__sigspoof-hook-4.1-6.0' directory. Then apply the second , core, patch to the files in this directory:

./patch-fileset patches/sigspoof-core 19 framework__sigspoof-hook-4.1-6.0/

This step leaves the processed files, by default, in the 'framework__sigspoof-hook-4.1-6.0__sigspoof-core' directory.

From this you can see that I didn't move the deodex'ed files from their previous position, just pointed the haystack script to where they are. Also you notice only the 'framework' directory needs to be processed.

4. Put the files back with rsync, and get the permissions corrected. So as root on the phone (by devel-su), make the /opt/alien/system/{framework,app,priv-app} directories writable:

cd /opt/alien/system
chmod a+w framework app priv-app

Then put the files back - from the linux shell:

    rsync -v haystack-master/framework__sigspoof-4.1-6.0__sigspoof-core/* nemo@192.168.2.15:/opt/alien/system/framework/

rsync -v simple-deodexer-master/triage/app/* nemo@192.168.2.15:/opt/alien/system/app/

rsync -v simple-deodexer-master/triage/priv-app/* nemo@192.168.2.15:/opt/alien/system/priv-app/

Now your three directories framework, app, priv-app on the phone will have some new files owned by your linux user, and some old files owned by root. Delete all the old files owned by root. CAREFULLY! These will be any now unwanted .odex files.

Change the ownership of the files in each directory (framework, app, priv-app) back to root: Change the permissions on the directories back to 755.

Tun the android services back on:

systemctl restart aliendalvik

5. Android stuffGo to f-droid.org and download and install the f-droid app. Add the micro-g repository. Install the signature spoofing check app (see the haystack page). If it works, then you have done the same as me. Cool beanz. Install micro-g core. Do the self-check. Be happy.

Others' work https://github.com/vermut/sailfish-signature-spoofing https://together.jolla.com/question/169496/xperia-x-microg/ https://together.jolla.com/question/117350/microg-on-alien-dalvik/ Plus many bits'n'pieces from other people on the internet, and of course http://forum.xda-developers.com.

HTH docmathoc

edit retag flag offensive close delete

Comments

1

Thank you, this could potentially allow us on old Android Runtime to use newer apps.

magullo ( 2018-12-28 11:55:37 +0200 )edit

@docmathoc: Thank you very much for this 'hack log'!
I believe there was a typo in the second command of step 3: The line said ./patch-fileset patches/sigspoof-core 19 sigspoof-hook-4.1-6.0. I corrected it to ./patch-fileset patches/sigspoof-core 19 framework__sigspoof-hook-4.1-6.0 in order to point the second round of patching to the already processed files

However, following your steps and transfering the deodexed & patched files back do Sailfish X with correct root:root permissions (as per step 4) does not work. Both MicroG core and Spoofing Checker say spoofing is disabled. Persits after App reinstall and OS reboot.
Can you advise me on what might have gone wrong?

rozgwi ( 2018-12-30 19:19:13 +0200 )edit

@magullo Well, I don't think so, as it is probably fixed to the Xperia X Android blobs for 6.0 which go with the Sailfish X installation. But many apps seem to be compatible with Android back to 4.0 or 4.4, which surprised me! I cannot find any info on AlienDalvik's upgrade plans. Sailfish X on XA2 devices does install the later Sony Android blobs for 8.0, so that may indicate an upgrade in the future. Do report back if you anything surprising or exciting.

docmathoc ( 2018-12-31 00:32:06 +0200 )edit

@rozgwi Glad it's getting you part of the way, anyway. Did you chown root:root * and also chmod 755 * ? You are correct on the typo, thank you. From tracing discussions elsewhere, the spoofing will all be in the framework files. Of course, if the deodexing didn't work for some reason, then the spoofing patches will not work. If both deodexing and spoofing patches reported success, then I would ensure that you really have the processed files on your phone. I would clear out the phone directories before the rsync, just to make sure. There were a couple of times I tried rsync -u, and the timestamps meant that the old files were not in fact overwritten. All I can think of for now, but feel free to post deodex and haystack terminal output if you are still stuck. Can't promise to solve it, but I'll certainly look it over. HTH

docmathoc ( 2018-12-31 00:40:50 +0200 )edit

@rozgwi BTW submitted tag 'hack-log' for moderator approval. A precise suggestion :)

docmathoc ( 2018-12-31 00:50:29 +0200 )edit

6 Answers

Sort by » oldest newest most voted
6

answered 2019-01-18 12:16:24 +0200

Cryx gravatar image

Nice to read, but as a „normal“ user I finally stopped to think about using this when you start with that deodex thing. Sure, I’ve heard and read of this before, but at this point it becomes some kind of hack which is more dedicated to semi-professional developers (from my point of view). What I want to say is the following: Sailfish needs a running package to install Micro-G, maybe the same way you need to use to flash a Sony to sailfish. All things going further are much to difficult to understand if you’re not daily doing this.

edit flag offensive delete publish link more

Comments

1

I can tell you from my own experience that installing microG isn't more complicated than flashing Sailfish X. Someone even made a docker container with all necessary tools and scripts.

The bigger issue (from my point of view) is that microG seems to lack some recent SSL/TLS libraries, so more and more Android apps may refuse to work with it: see here.

ziellos ( 2019-01-18 13:01:00 +0200 )edit
2

assume we.have a.user base of 10.000 do all have to play with linux (or docker and linux) just.to get some android apps running ?

comme on !

pawel ( 2019-01-18 14:41:41 +0200 )edit
5

answered 2019-02-04 17:19:04 +0200

Maximilian1st gravatar image

updated 2019-02-05 13:33:44 +0200

The easy way to install on the Xperia X and XA2 using the f-droid store is explained by Leszek Lesner on this youtube video https://www.youtube.com/watch?v=1K05m3EJJ9A

edit flag offensive delete publish link more

Comments

Does the installation of MicroG work on XperiaX with 'old' dalvik (AKA Android 4.4) or does it also work on new XA2 with 'new' Android support, version 8.1?

jollajo ( 2019-02-04 18:08:16 +0200 )edit

Certainly works upon the latter XA2.

aspergerguy ( 2019-02-04 18:19:44 +0200 )edit

@aspergerguy can you make tutorial for Xperia XA 2?

Please

Stanislav1988 ( 2019-02-04 20:04:35 +0200 )edit

Unfortunately premature in conclusion as "signature spoofing" does not work as might expect, when checking self-test in MicroG.

aspergerguy ( 2019-02-04 22:38:36 +0200 )edit
1

answered 2019-01-18 08:20:11 +0200

pawel gravatar image

And now for a windows pc please ;-)

edit flag offensive delete publish link more

Comments

Given that you have Windows 10 you should be able to do this using the Windows Subsystem for Linux

rozgwi ( 2019-01-18 17:13:38 +0200 )edit

yes i have. i know that docker is.now.much easier to install. but dong wnt to do.that on my private crap of laptop. i do not know limux subsystem

pawel ( 2019-01-19 09:59:43 +0200 )edit

Ok, did google that, but.is not an available option for my windows 10. Seems i need to install docker on my 200 € laptop :-)

pawel ( 2019-01-20 15:18:03 +0200 )edit
0

answered 2019-01-15 22:03:14 +0200

sonny gravatar image

Thanks a lot, that worked for me. I had to correct the first rsync command, the path was wrong

instead of
rsync -v haystack-master/framework__sigspoof-4.1-6.0__sigspoof-core/* nemo@192.168.2.15:/opt/alien/system/framework/

this worked:

sync -v haystack-master/framework__sigspoof-hook-4.1-6.0__sigspoof-core/* nemo@192.168.2.15:/opt/alien/system/framework/

edit flag offensive delete publish link more
0

answered 2019-02-04 17:46:06 +0200

Stanislav1988 gravatar image

Great work, but did you have Sony Xperia XA 2 or someone to make similar tutorial?

edit flag offensive delete publish link more

Comments

But this is for Xperia X and old kernel and alien dalvik, we have separated Alien Dalvik form LXC and we don`t have opt/alien/system/priv-app directory

Stanislav1988 ( 2019-02-04 19:59:39 +0200 )edit
0

answered 2019-02-04 18:41:19 +0200

xsetiadi gravatar image

just tips from me, if you fail to sign in on MicroG GMS CORE, using old version first (0.2.4) than sign in. after that you can update to the new one.

if someone need alien dalvik deodexed files (app, priv-app, framework) you can pm me on telegram @xsetiadiku

edit flag offensive delete publish link more

Comments

it stuck in 'just sec' when add account

TMavica ( 2019-02-05 01:44:21 +0200 )edit

really? mine is working like charm. make sure use MicroG GMS CORE 0.2.4 without any number after 4. (very old version available on MicroG web)

xsetiadi ( 2019-02-05 04:45:30 +0200 )edit

U do it in xa2 or X?

TMavica ( 2019-02-05 12:44:32 +0200 )edit
Login/Signup to Answer

Question tools

Follow
28 followers

Stats

Asked: 2018-12-28 01:10:45 +0200

Seen: 1,843 times

Last updated: Feb 05