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
/productand/system_extAndroid 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-supportTHIS 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
sqlite3anymore, 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
This part includes some apps I have not seen to be needed. If there is something that is needed, that should be fixed. For GApps I had listed what different apps are used for, for some reason that doesn't exist anymore in the page source.
This ensures there are no conditions in the guide. The commands can be run for new setup or for upgrades. At least, the is the idea. The
-fis bad way to makermignore if these paths are missing already (new setup). As this line has no variables, it should be pretty safe.As an example, this line exists for the same purpose. If the Download directory is not found the variable would be empty and the next command would fail. This ensures the variable is something, which will the first command in this command safe.
As seen from above, this is true. For new setup, the
rm ...does nothing and could be skipped.I have not looked into this guide, or sailfish, for while now. My Xperia 10 II is in a shape that I don't move it out of home and my "new" Xperia 10 V is not supported well enough for me to use Sailfish on it at the moment. Hopefully that will be fixed in in future, but who knows.
Apparently Xperia 10 V would be Android 14, so I guess I won't have Android 13 devices to verify there. Let me know if you find problems! Even better if you find solutions for those too!