I recommend to consider microG instead. It's officially promoted in the changelog forum post. Additionally, it doesn't bundle Google products and should provide better secrecy. However, it might not include all features. Check out the guide from the official forum.
In contrast, this guide is based on MindTheGapps, as mentioned in LineageOS wiki. Before, we used OpenGApps, but that is not maintained anymore.
This guide is currently updated to Sailfish 5.0 and the Google Apps package is changed. Please, check the document history for support of older versions.
Devices I have tested the guide:
- Xperia 10 II (AppSupport 11)
Using the Phone:
- Download MindTheGapps package from https://mindthegapps.com/, see version below.
- Xperia 10 II: Android 11 and ARM64
- Xperia XA 2: Android 11 and ARM (add a comment if this is wrong)
-
Save the zip to Downloads folder
-
Open the zip using file browser
-
Extract all files using the archive app
There is no upstream sha1 sum for chekcking. Here are outputs for me:
52bbb853cc03c92755ea1c5c5f1ffa9a67d39e7b /home/defaultuser/Downloads/MindTheGapps-11.0.0-arm64-20230922_081122.zip
-
Setup "gapps-support", i.e., MindTheGapps as mounts to the Appsupport LXC container. This uses
/product
and/system_ext
Android mounts, which were not used by Sailfish at the time.mkdir -p /opt/gapps-support # install system packages dir=$(find /home/defaultuser/Downloads -type d -iname 'MindTheGapps*' | sort -rn -k2,4 -t- | head -n1) dir=${dir:-/mindthegapps-not-found} (cd "$dir/system/product" && rm -rf app/GoogleTTS app/MarkupGoogle app/talkback priv-app/AndroidMigratePrebuilt priv-app/SetupWizardPrebuilt priv-app/Velvet) rm -rf /opt/gapps-support/product /opt/gapps-support/system_ext cp -a "$dir/system/product" /opt/gapps-support/product cp -a "$dir/system/system_ext" /opt/gapps-support/system_ext chown -R appsupport-root:appsupport-root /opt/gapps-support/product /opt/gapps-support/system_ext # make mount script echo '#!/bin/sh' > /opt/gapps-support/prepare-hook.sh echo 'echo "lxc.mount.entry = /opt/gapps-support/product product none rbind,nodev,nosuid,ro,create=dir 0 0" >> $CONTAINER_CONFIG_PATH/41-gapps_config' >> /opt/gapps-support/prepare-hook.sh echo 'echo "lxc.mount.entry = /opt/gapps-support/system_ext system/system_ext none rbind,nodev,nosuid,ro,create=dir 0 0" >> $CONTAINER_CONFIG_PATH/41-gapps_config' >> /opt/gapps-support/prepare-hook.sh chmod +x /opt/gapps-support/prepare-hook.sh # enable script mkdir -p /etc/appsupport.conf.d/init/prepare-hook.d ln -s /opt/gapps-support/prepare-hook.sh /etc/appsupport.conf.d/init/prepare-hook.d/61-gapps-support.sh
-
Note that startup after the installation will take a long time as the Android is caching and compiling files. You can follow the progress with the following command. However, it will show a lot of errors and warnings, so it might be alarming, even though everything is ok.
appsupport-attach /system/bin/logcat
# system link, this can be removed to just disable GApps:
rm -rf /etc/appsupport.conf.d/init/prepare-hook.d/61-gapps-support.sh
# remove all data
rm -rf /opt/gapps-support
THIS STEP HAS NOT BEEN CHECKED AFTER Sailfish 5.0 and MindTheGApps
-
open google play and sign in
-
retrieve GSF ID:
Sadly, neither Sailfish 4 or Android contains
sqlite3
anymore, so you need to do some manual work. Either copy the database to your computer or install sqlite3 to your phone.Copy:
# on sailfish after devel-su cp /home/.android/data/data/com.google.android.gsf/databases/gservices.db /tmp/ chmod a+r /tmp/gservices.db # on your computer scp defaultuser@PHONE_IP:/tmp/gservices.db sqlite gservices.db 'select * from main where name = "android_id";' # copy the id from the output rm gservices.db # on sailfish after devel-su rm /tmp/gservices.db
Or Install:
# on sailfish after devel-su pkcon install python3-sqlite python3 -c 'import sqlite3; c = sqlite3.connect("/home/.android/data/data/com.google.android.gsf/databases/gservices.db").cursor(); c.execute("select value from main where name=\"android_id\";"); print(c.fetchone()[0])'
-
Register your device: https://www.google.com/android/uncertified/
- Android/apps believe the device is rooted (well, it is, but they shouldn't know that).
- Fast location doesn't work with wi-fi polling
- Google Backup Transport doesn't seem to work (requires investication)
-
To check logs of appsupport service, run as root:
journalctl -u appsupport@defaultuser -e
-
For location service, disable google wi-fi checking, it doesn't work. This means that accurate location will take some time, of course (e.g. Jodel will take few minutes to login).
-
When appsupport is running, you can stream android logs with
appsupport-attach /system/bin/logcat
-
If google backup is disabled, you can re-enable it:
# enter Android shell appsupport-attach /system/bin/sh # in Android system bmgr transport com.google.android.backup/.BackupTransportService
Hmm.. I didn't check the first time case. I would love to have another device for that (I could reset the Android). However, I did check that the db file is there in my phone, but it's hard to say if that is in use or left from before. So, if you get the Store working, but you won't find the file, then I or you need to do some debugging.
Any how, the Play Store icon should be visible as long as the correct image is in use. Every (or most) OS updates do reset the
/opt/alien/system.img
to the original version from Jolla, so the above steps need to be done after every update (well, not the first time part, but creating the image part).A script would be nice, but making it work for everyone is bit too much work. In addition, I prefer not to install too many packages in the phone. However, there exists some in forums (seems to attempt to work for everyone quite well), which you can check out. It seems to do mostly the same things. Didn't have
# force rerunning permission and storage migrations
step at the moment.Any how, my guess is that you don't have the correct image in use. Thus repeat from the start and try to keep track of files. Make extra copies or write notes where needed.