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
I have not yet installed the update (I know, I'm bad). I hope to do that on the weekend. I like to reserve some time without need for my phone, as this process sometimes requires some engineering.
Sadly, I have only one phone currently as the XA 2 didn't work without battery.