Skip to content

Instantly share code, notes, and snippets.

@raphendyr
Last active October 24, 2025 15:01
Show Gist options
  • Save raphendyr/fc0e00a17a69c9054037b478fa4425c1 to your computer and use it in GitHub Desktop.
Save raphendyr/fc0e00a17a69c9054037b478fa4425c1 to your computer and use it in GitHub Desktop.
Google Play Services installation to Sailfish X

Google Play Services for AppSupport in Sailfish OS

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)

Prepare

Using the Phone:

  1. 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)
  1. Save the zip to Downloads folder

  2. Open the zip using file browser

  3. 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

Install

  • 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

Uninstall

# 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

When you install google play services for the first time:

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/

Known issues:

  • 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)

Troubleshooting:

  • 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
@ihusky02
Copy link

ihusky02 commented Oct 8, 2025

(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

Why I must do this? If I had No such file or directory, if I make command cp -a on gapps-support/product and gapos-support/ext

I have android 13 subsystem

@raphendyr
Copy link
Author

(cd "$dir/system/product" && rm -rf app/GoogleTTS app/MarkupGoogle app/talkback priv-app/AndroidMigratePrebuilt priv-app/SetupWizardPrebuilt priv-app/Velvet)

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.

rm -rf /opt/gapps-support/product /opt/gapps-support/system_ext

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 -f is bad way to make rm ignore if these paths are missing already (new setup). As this line has no variables, it should be pretty safe.

dir=${dir:-/mindthegapps-not-found}

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.

Why I must do this? If I had No such file or directory, if I make command cp -a on gapps-support/product and gapos-support/ext

As seen from above, this is true. For new setup, the rm ... does nothing and could be skipped.

I have android 13 subsystem

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!

@ihusky02
Copy link

(cd "$dir/system/product" && rm -rf app/GoogleTTS app/MarkupGoogle app/talkback priv-app/AndroidMigratePrebuilt priv-app/SetupWizardPrebuilt priv-app/Velvet)

Ta część zawiera kilka aplikacji, których nie uznałem za potrzebne. Jeśli coś jest potrzebne, powinno zostać naprawione. W przypadku GApps wymieniłem, do czego służą poszczególne aplikacje, ale z jakiegoś powodu nie ma tego już w kodzie źródłowym strony.

rm -rf /opt/gapps-support/product /opt/gapps-support/system_ext

Dzięki temu w przewodniku nie ma żadnych warunków. Polecenia można uruchamiać dla nowej konfiguracji lub aktualizacji. Przynajmniej taki jest zamysł. To -fzły sposób na rmignorowanie, jeśli te ścieżki już nie występują (nowa konfiguracja). Ponieważ ten wiersz nie zawiera zmiennych, powinien być dość bezpieczny.

dir=${dir:-/mindthegapps-not-found}

Na przykład, ten wiersz istnieje w tym samym celu. Jeśli katalog pobierania nie zostanie znaleziony, zmienna będzie pusta, a kolejne polecenie zakończy się niepowodzeniem. Gwarantuje to, że zmienna jest czymś, co sprawi, że pierwsze polecenie w tym poleceniu będzie bezpieczne.

Dlaczego muszę to zrobić? Jeśli nie mam takiego pliku ani katalogu, jeśli wykonam polecenie cp -a w plikach gapps-support/product i gapos-support/ext

Jak widać powyżej, to prawda. W przypadku nowej konfiguracji, ta opcja rm ...nic nie robi i można ją pominąć.

Mam podsystem Android 13

Od jakiegoś czasu nie zaglądałem do tego poradnika ani do aplikacji Sailfish. Mój Xperia 10 II jest w takim stanie, że nie ruszam go z domu, a moja „nowa” Xperia 10 V nie jest obecnie wystarczająco dobrze obsługiwana, żebym mógł korzystać z aplikacji Sailfish. Mam nadzieję, że to się poprawi w przyszłości, ale kto wie.

Wygląda na to, że Xperia 10 V będzie miała Androida 14, więc pewnie nie będę miał urządzeń z Androidem 13, żeby to zweryfikować. Daj znać, jeśli znajdziesz jakieś problemy! A jeszcze lepiej, jeśli znajdziesz dla nich rozwiązania!

I don`t think so, I am only common user, which want clear Linux on the phone. But have google apps too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment