We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2019-11-22 22:41:51 +0200

MindTheGapps on Xperia XA2 (3.2.0.12)

Inspired by this OpenGapps Wiki here is the simple guide how to get fully functioning Google Play Services on your Xperia X2 (tested on latest version 3.2.0.12). Following this guide you will have full Google Play Services with minimum number of google components. This method test and developed by @mjun.

Couple of notes:

  1. You will have to prepare the new system.img on your computer and not on the phone itself. The reason is rsync crashing sfos.
  2. You do not have to uninstall your currently installed android apps
  3. It's advisable to make backup of your current /opt/alien/system.img
  4. You will have to remove microG applications if you have them installed as they will conflict with Google apks
  5. If you are on 3.2.0.12 version of SFOS you don't have to do steps below manually - just download pre-patched system.img from here

Let's get started

  1. First things first - make backup of your current /opt/alien/system.img
  2. Copy /opt/alien/system.img to your computer as system.img.orig
  3. Get MindTheGapps zip from here
  4. unzip MindTheGapps zip:

    unzip MindTheGapps-8.1.0-arm64-20180808_153856.zip -d mindthegapps_sfos;
  5. Remove unnecessary google components and config:

    rm -rf mindthegapps_sfos/system/addon.d;
    rm -rf mindthegapps_sfos/system/app/GoogleExtShared;
    rm -rf mindthegapps_sfos/system/app/PrebuiltExchange3Google;
    rm -rf mindthegapps_sfos/system/etc/permissions/com.google.android.dialer.support.xml;
    rm -rf mindthegapps_sfos/system/etc/sysconfig/google_build.xml;
    rm -rf mindthegapps_sfos/system/framework/com.google.android.dialer.support.jar;
    rm -rf mindthegapps_sfos/system/priv-app/AndroidMigratePrebuilt/AndroidMigratePrebuilt.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleExtServices/GoogleExtServices.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleFeedback/GoogleFeedback.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleOneTimeInitializer/GoogleOneTimeInitializer.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk;
    rm -rf mindthegapps_sfos/system/priv-app/SetupWizard/SetupWizard.apk;
    rm -rf mindthegapps_sfos/system/priv-app/Velvet/Velvet.apk;
  6. Unsquash system.img.orig with rsync (we use rsync to avoid file permissions problems)

    mkdir -p tmp-mount squashfs-root;
    mount -o loop,ro system.img.orig ./tmp-mount;
    rsync -avPSHAX --inplace tmp-mount/ squashfs-root;
    umount ./tmp-mount;
    rmdir tmp-mount;
  7. Copy google apps to unsquashed system.img.org:

    cp -r mindthegapps_sfos/system/* squashfs-root/system/
  8. Create new system.img:

    mksquashfs squashfs-root system.img.gapps -comp lz4 -Xhc -noappend -no-exports -no-duplicates -no-fragments

Almost done! Now let's update the image on the phone itself!

  1. Stop android support on your phone
  2. Copy system.img.gapps to your XA2 as /opt/alien/system.img (thus overwriting the original image)
  3. Start android support
  4. Go to aliendalvik settings Users & accounts and add google account (or open play store and sign in)
  5. Open play store and disable Play protect and auto-updates

Known problems

  1. Play store might briefly work but will eventually update itself and your app installs will get stuck in 'pending' state - just use Aurora Store
  2. GPS assisted positioning might be a bit of a hit and miss. Go to aliendalvik settings and under Security & location set Location to ON / High accuracy. Additionally Install F-Droid and add microG repository. Install All of the NLP packages in (GAPPS) variant. Configure UnifiedNlp providers. You might also want to install XposedUnifiedNlp

Tested google apps that work OK

  1. YouTube - everything including the floating mini player
  2. Gmail
  3. Google Photos - with photo backup and sync
  4. Chrome

Other non-google apps tested (latest versions)

  1. Uber (latest version)
  2. HERE WeGo maps
  3. Facebook Messenger Lite
  4. Revolut
  5. Slack
  6. WhatsApp

Feel free to improve this guide and/or ask any questions!

[HowTo] MindTheGapps on Xperia XA2 (3.2.0.12)

Inspired by this OpenGapps Wiki here is the simple guide how to get fully functioning Google Play Services on your Xperia X2 (tested on latest version 3.2.0.12). Following this guide you will have full Google Play Services with minimum number of google components. This method test and developed by @mjun.

Couple of notes:

  1. You will have to prepare the new system.img on your computer and not on the phone itself. The reason is rsync crashing sfos.
  2. You do not have to uninstall your currently installed android apps
  3. It's advisable to make backup of your current /opt/alien/system.img
  4. You will have to remove microG applications if you have them installed as they will conflict with Google apks
  5. If you are on 3.2.0.12 version of SFOS you don't have to do steps below manually - just download pre-patched system.img from here

Let's get started

  1. First things first - make backup of your current /opt/alien/system.img
  2. Copy /opt/alien/system.img to your computer as system.img.orig
  3. Get MindTheGapps zip from here
  4. unzip MindTheGapps zip:

    unzip MindTheGapps-8.1.0-arm64-20180808_153856.zip -d mindthegapps_sfos;
  5. Remove unnecessary google components and config:

    rm -rf mindthegapps_sfos/system/addon.d;
    rm -rf mindthegapps_sfos/system/app/GoogleExtShared;
    rm -rf mindthegapps_sfos/system/app/PrebuiltExchange3Google;
    rm -rf mindthegapps_sfos/system/etc/permissions/com.google.android.dialer.support.xml;
    rm -rf mindthegapps_sfos/system/etc/sysconfig/google_build.xml;
    rm -rf mindthegapps_sfos/system/framework/com.google.android.dialer.support.jar;
    rm -rf mindthegapps_sfos/system/priv-app/AndroidMigratePrebuilt/AndroidMigratePrebuilt.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleExtServices/GoogleExtServices.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleFeedback/GoogleFeedback.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleOneTimeInitializer/GoogleOneTimeInitializer.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk;
    rm -rf mindthegapps_sfos/system/priv-app/SetupWizard/SetupWizard.apk;
    rm -rf mindthegapps_sfos/system/priv-app/Velvet/Velvet.apk;
  6. Unsquash system.img.orig with rsync (we use rsync to avoid file permissions problems)

    mkdir -p tmp-mount squashfs-root;
    mount -o loop,ro system.img.orig ./tmp-mount;
    rsync -avPSHAX --inplace tmp-mount/ squashfs-root;
    umount ./tmp-mount;
    rmdir tmp-mount;
  7. Copy google apps to unsquashed system.img.org:

    cp -r mindthegapps_sfos/system/* squashfs-root/system/
  8. Create new system.img:

    mksquashfs squashfs-root system.img.gapps -comp lz4 -Xhc -noappend -no-exports -no-duplicates -no-fragments

Almost done! Now let's update the image on the phone itself!

  1. Stop android support on your phone
  2. Copy system.img.gapps to your XA2 as /opt/alien/system.img (thus overwriting the original image)
  3. Start android support
  4. Go to aliendalvik settings Users & accounts and add google account (or open play store and sign in)
  5. Open play store and disable Play protect and auto-updates

Known problems

  1. Play store might briefly work but will eventually update itself and your app installs will get stuck in 'pending' state - just use Aurora Store
  2. GPS assisted positioning might be a bit of a hit and miss. Go to aliendalvik settings and under Security & location set Location to ON / High accuracy. Additionally Install F-Droid and add microG repository. Install All of the NLP packages in (GAPPS) variant. Configure UnifiedNlp providers. You might also want to install XposedUnifiedNlp

Tested google apps that work OK

  1. YouTube - everything including the floating mini player
  2. Gmail
  3. Google Photos - with photo backup and sync
  4. Chrome

Other non-google apps tested (latest versions)

  1. Uber (latest version)
  2. HERE WeGo maps
  3. Facebook Messenger Lite
  4. Revolut
  5. Slack
  6. WhatsApp

Feel free to improve this guide and/or ask any questions!

[HowTo] MindTheGapps on Xperia XA2 (3.2.0.12)

Inspired by this OpenGapps Wiki here is the simple guide how to get fully functioning Google Play Services on your Xperia X2 with minimum number of google components (tested on latest version 3.2.0.12). Following this guide you will have full Google Play Services with minimum number of google components. This method test and was developed and tested by @mjun.

Couple of notes:

  1. You will have to prepare the new system.img on your computer and not on the phone itself. The reason is rsync crashing sfos.
  2. You do not have to uninstall your currently installed android apps
  3. It's advisable to make backup of your current /opt/alien/system.img
  4. You will have to remove microG applications if you have them installed as they will conflict with Google apks
  5. If you are on 3.2.0.12 version of SFOS you don't have to do steps below manually - just download pre-patched system.img from here

Let's get started

  1. First things first - make backup of your current /opt/alien/system.img
  2. Copy /opt/alien/system.img to your computer as system.img.orig
  3. Get MindTheGapps zip from here
  4. unzip MindTheGapps zip:

    unzip MindTheGapps-8.1.0-arm64-20180808_153856.zip -d mindthegapps_sfos;
  5. Remove unnecessary google components and config:

    rm -rf mindthegapps_sfos/system/addon.d;
    rm -rf mindthegapps_sfos/system/app/GoogleExtShared;
    rm -rf mindthegapps_sfos/system/app/PrebuiltExchange3Google;
    rm -rf mindthegapps_sfos/system/etc/permissions/com.google.android.dialer.support.xml;
    rm -rf mindthegapps_sfos/system/etc/sysconfig/google_build.xml;
    rm -rf mindthegapps_sfos/system/framework/com.google.android.dialer.support.jar;
    rm -rf mindthegapps_sfos/system/priv-app/AndroidMigratePrebuilt/AndroidMigratePrebuilt.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleExtServices/GoogleExtServices.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleFeedback/GoogleFeedback.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleOneTimeInitializer/GoogleOneTimeInitializer.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk;
    rm -rf mindthegapps_sfos/system/priv-app/SetupWizard/SetupWizard.apk;
    rm -rf mindthegapps_sfos/system/priv-app/Velvet/Velvet.apk;
  6. Unsquash system.img.orig with rsync (we use rsync to avoid file permissions problems)

    mkdir -p tmp-mount squashfs-root;
    mount -o loop,ro system.img.orig ./tmp-mount;
    rsync -avPSHAX --inplace tmp-mount/ squashfs-root;
    umount ./tmp-mount;
    rmdir tmp-mount;
  7. Copy google apps to unsquashed system.img.org:

    cp -r mindthegapps_sfos/system/* squashfs-root/system/
  8. Create new system.img:

    mksquashfs squashfs-root system.img.gapps -comp lz4 -Xhc -noappend -no-exports -no-duplicates -no-fragments

Almost done! Now let's update the image on the phone itself!

  1. Stop android support on your phone
  2. Copy system.img.gapps to your XA2 as /opt/alien/system.img (thus overwriting the original image)
  3. Start android support
  4. Go to aliendalvik settings Users & accounts and add google account (or open play store and sign in)
  5. Open play store and disable Play protect and auto-updates

Known problems

  1. Play store might briefly work but will eventually update itself and your app installs will get stuck in 'pending' state - just use Aurora Store
  2. GPS assisted positioning might be a bit of a hit and miss. Go to aliendalvik settings and under Security & location set Location to ON / High accuracy. Additionally Install F-Droid and add microG repository. Install All of the NLP packages in (GAPPS) variant. Configure UnifiedNlp providers. You might also want to install XposedUnifiedNlp

Tested google apps that work OK

  1. YouTube - everything including the floating mini player
  2. Gmail
  3. Google Photos - with photo backup and sync
  4. Chrome

Other non-google apps tested (latest versions)

  1. Uber (latest version)
  2. HERE WeGo maps
  3. Facebook Messenger Lite
  4. Revolut
  5. Slack
  6. WhatsApp

Feel free to improve this guide and/or ask any questions!

[HowTo] MindTheGapps on Xperia XA2 (3.2.0.12)(3.2.0.12 / 3.2.1.19)

###Updated for version 3.2.1.19!

Inspired by this OpenGapps Wiki here is the simple guide how to get fully functioning Google Play Services on your Xperia X2 with minimum number of google components (tested on latest version 3.2.0.12). 3.2.0.12 and 3.2.1.19). This method was developed and tested by @mjun.

Couple of notes:

  1. You will have to prepare the new system.img on your computer and not on the phone itself. The reason is rsync crashing sfos.
  2. You do not have to uninstall your currently installed android apps
  3. It's advisable to make backup of your current /opt/alien/system.img
  4. You will have to remove microG applications if you have them installed as they will conflict with Google apks
  5. If you are on 3.2.0.12 or 3.2.1.19 version of SFOS you don't have to do steps below manually - just download pre-patched system.img from for here3.2.0.12 or 3.2.1.19

Let's get started

  1. First things first - make backup of your current /opt/alien/system.img
  2. Copy /opt/alien/system.img to your computer as system.img.orig
  3. Get MindTheGapps zip from here
  4. unzip MindTheGapps zip:

    unzip MindTheGapps-8.1.0-arm64-20180808_153856.zip -d mindthegapps_sfos;
  5. Remove unnecessary google components and config:

    rm -rf mindthegapps_sfos/system/addon.d;
    rm -rf mindthegapps_sfos/system/app/GoogleExtShared;
    rm -rf mindthegapps_sfos/system/app/PrebuiltExchange3Google;
    rm -rf mindthegapps_sfos/system/etc/permissions/com.google.android.dialer.support.xml;
    rm -rf mindthegapps_sfos/system/etc/sysconfig/google_build.xml;
    rm -rf mindthegapps_sfos/system/framework/com.google.android.dialer.support.jar;
    rm -rf mindthegapps_sfos/system/priv-app/AndroidMigratePrebuilt/AndroidMigratePrebuilt.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleExtServices/GoogleExtServices.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleFeedback/GoogleFeedback.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleOneTimeInitializer/GoogleOneTimeInitializer.apk;
    rm -rf mindthegapps_sfos/system/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk;
    rm -rf mindthegapps_sfos/system/priv-app/SetupWizard/SetupWizard.apk;
    rm -rf mindthegapps_sfos/system/priv-app/Velvet/Velvet.apk;mindthegapps_sfos/system/priv-app/AndroidMigratePrebuilt;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleExtServices;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleFeedback;
    rm -rf mindthegapps_sfos/system/priv-app/GoogleOneTimeInitializer;
    rm -rf mindthegapps_sfos/system/priv-app/GooglePartnerSetup;
    rm -rf mindthegapps_sfos/system/priv-app/SetupWizard;
    rm -rf mindthegapps_sfos/system/priv-app/Velvet;
  6. Unsquash system.img.orig with rsync (we use rsync to avoid file permissions problems)

    mkdir -p tmp-mount squashfs-root;
    sudo mount -o loop,ro system.img.orig ./tmp-mount;
    sudo rsync -avPSHAX --inplace tmp-mount/ squashfs-root;
    sudo umount ./tmp-mount;
    sudo rmdir tmp-mount;
  7. Copy google apps to unsquashed system.img.org:

    sudo cp -r mindthegapps_sfos/system/* squashfs-root/system/
  8. Create new system.img:

    sudo mksquashfs squashfs-root system.img.gapps -comp lz4 -Xhc -noappend -no-exports -no-duplicates -no-fragments

Almost done! Now let's update the image on the phone itself!

  1. Stop android support on your phone
  2. Copy system.img.gapps to your XA2 as /opt/alien/system.img (thus overwriting the original image)
  3. Start android support

If this is your first time setting up patched system.img you can additionally: 4. Go to aliendalvik settings Users & accounts and add google account (or open play store and sign in)

  • in) 5. Open play store and disable Play protect and auto-updates
  • Known problems

    1. Play store might briefly work but will eventually update itself and your app installs will get stuck in 'pending' state - just use Aurora Store
    2. GPS assisted positioning might be a bit of a hit and miss. Go to aliendalvik settings and under Security & location set Location to ON / High accuracy. Additionally Install F-Droid and add microG repository. Install All of the NLP packages in (GAPPS) variant. Configure UnifiedNlp providers. You might also want to install XposedUnifiedNlp

    Tested google apps that work OK

    1. YouTube - everything including the floating mini player
    2. Gmail
    3. Google Photos - with photo backup and sync
    4. Chrome

    Other non-google apps tested (latest versions)

    1. Uber (latest version)
    2. HERE WeGo maps
    3. Facebook Messenger Lite
    4. Revolut
    5. Slack
    6. WhatsApp

    Feel free to improve this guide and/or ask any questions!

    [HowTo] MindTheGapps on Xperia XA2 (3.2.0.12 / 3.2.1.19)3.2.1.20 / 3.3.0.14)

    ###Updated for version 3.2.1.19!3.3.0.14!

    Inspired by this OpenGapps Wiki here is the simple guide how to get fully functioning Google Play Services on your Xperia X2 with minimum number of google components (tested on 3.2.0.12 and 3.2.1.19). 3.2.0.12, 3.2.1.20 and 3.3.0.14). This method was developed and tested by @mjun.

    Couple of notes:

    1. You will have to prepare the new system.img on your computer and not on the phone itself. The reason is rsync crashing sfos.
    2. You do not have to uninstall your currently installed android apps
    3. It's advisable to make backup of your current /opt/alien/system.img
    4. You will have to remove microG applications if you have them installed as they will conflict with Google apks
    5. If you are on 3.2.0.12 3.2.0.12, 3.2.1.20 or 3.2.1.19 3.3.0.14 version of SFOS you don't have to do steps below manually - just download pre-patched system.img for 3.2.0.12, 3.2.1.20 or 3.2.1.19(https://drive.google.com/file/d/1OcMnEmXWPEjES1ybqiebEA0U_0bR6FOU/view?usp=sharing)[3.3.0.14]

    Let's get started

    1. First things first - make backup of your current /opt/alien/system.img
    2. Copy /opt/alien/system.img to your computer as system.img.orig
    3. Get MindTheGapps zip from here
    4. unzip MindTheGapps zip:

      unzip MindTheGapps-8.1.0-arm64-20180808_153856.zip -d mindthegapps_sfos;
    5. Remove unnecessary google components and config:

      rm -rf mindthegapps_sfos/system/addon.d;
      rm -rf mindthegapps_sfos/system/app/GoogleExtShared;
      rm -rf mindthegapps_sfos/system/app/PrebuiltExchange3Google;
      rm -rf mindthegapps_sfos/system/etc/permissions/com.google.android.dialer.support.xml;
      rm -rf mindthegapps_sfos/system/etc/sysconfig/google_build.xml;
      rm -rf mindthegapps_sfos/system/framework/com.google.android.dialer.support.jar;
      rm -rf mindthegapps_sfos/system/priv-app/AndroidMigratePrebuilt;
      rm -rf mindthegapps_sfos/system/priv-app/GoogleExtServices;
      rm -rf mindthegapps_sfos/system/priv-app/GoogleFeedback;
      rm -rf mindthegapps_sfos/system/priv-app/GoogleOneTimeInitializer;
      rm -rf mindthegapps_sfos/system/priv-app/GooglePartnerSetup;
      rm -rf mindthegapps_sfos/system/priv-app/SetupWizard;
      rm -rf mindthegapps_sfos/system/priv-app/Velvet;
    6. Unsquash system.img.orig with rsync (we use rsync to avoid file permissions problems)

      mkdir -p tmp-mount squashfs-root;
      sudo mount -o loop,ro system.img.orig ./tmp-mount;
      sudo rsync -avPSHAX --inplace tmp-mount/ squashfs-root;
      sudo umount ./tmp-mount;
      sudo rmdir tmp-mount;
    7. Copy google apps to unsquashed system.img.org:

      sudo cp -r mindthegapps_sfos/system/* squashfs-root/system/
    8. Create new system.img:

      sudo mksquashfs squashfs-root system.img.gapps -comp lz4 -Xhc -noappend -no-exports -no-duplicates -no-fragments

    Almost done! Now let's update the image on the phone itself!

    1. Stop android support on your phone
    2. Copy system.img.gapps to your XA2 as /opt/alien/system.img (thus overwriting the original image)
    3. Start android support

    If this is your first time setting up patched system.img you can additionally: 4. Go to aliendalvik settings Users & accounts and add google account (or open play store and sign in) 5. Open play store and disable Play protect and auto-updates

    Known problems

    1. Play store might briefly work but will eventually update itself and your app installs will get stuck in 'pending' state - just use Aurora Store
    2. GPS assisted positioning might be a bit of a hit and miss. Go to aliendalvik settings and under Security & location set Location to ON / High accuracy. Additionally Install F-Droid and add microG repository. Install All of the NLP packages in (GAPPS) variant. Configure UnifiedNlp providers. You might also want to install XposedUnifiedNlp

    Tested google apps that work OK

    1. YouTube - everything including the floating mini player
    2. Gmail
    3. Google Photos - with photo backup and sync
    4. Chrome

    Other non-google apps tested (latest versions)

    1. Uber (latest version)
    2. HERE WeGo maps
    3. Facebook Messenger Lite
    4. Revolut
    5. Slack
    6. WhatsApp
    7. Telegram
    8. Firefox (stable)

    Feel free to improve this guide and/or ask any questions!

    [HowTo] MindTheGapps on Xperia XA2 (3.2.0.12 / 3.2.1.20 / 3.3.0.14)

    ###Updated for version 3.3.0.14!

    Inspired by this OpenGapps Wiki here is the simple guide how to get fully functioning Google Play Services on your Xperia X2 with minimum number of google components (tested on 3.2.0.12, 3.2.1.20 and 3.3.0.14). This method was developed and tested by @mjun.

    Couple of notes:

    1. You will have to prepare the new system.img on your computer and not on the phone itself. The reason is rsync crashing sfos.
    2. You do not have to uninstall your currently installed android apps
    3. It's advisable to make backup of your current /opt/alien/system.img
    4. You will have to remove microG applications if you have them installed as they will conflict with Google apks
    5. If you are on 3.2.0.12, 3.2.1.20 or 3.3.0.14 version of SFOS you don't have to do steps below manually - just download pre-patched system.img for 3.2.0.12, 3.2.1.20 or (https://drive.google.com/file/d/1OcMnEmXWPEjES1ybqiebEA0U_0bR6FOU/view?usp=sharing)[3.3.0.14]3.3.0.14

    Let's get started

    1. First things first - make backup of your current /opt/alien/system.img
    2. Copy /opt/alien/system.img to your computer as system.img.orig
    3. Get MindTheGapps zip from here
    4. unzip MindTheGapps zip:

      unzip MindTheGapps-8.1.0-arm64-20180808_153856.zip -d mindthegapps_sfos;
    5. Remove unnecessary google components and config:

      rm -rf mindthegapps_sfos/system/addon.d;
      rm -rf mindthegapps_sfos/system/app/GoogleExtShared;
      rm -rf mindthegapps_sfos/system/app/PrebuiltExchange3Google;
      rm -rf mindthegapps_sfos/system/etc/permissions/com.google.android.dialer.support.xml;
      rm -rf mindthegapps_sfos/system/etc/sysconfig/google_build.xml;
      rm -rf mindthegapps_sfos/system/framework/com.google.android.dialer.support.jar;
      rm -rf mindthegapps_sfos/system/priv-app/AndroidMigratePrebuilt;
      rm -rf mindthegapps_sfos/system/priv-app/GoogleExtServices;
      rm -rf mindthegapps_sfos/system/priv-app/GoogleFeedback;
      rm -rf mindthegapps_sfos/system/priv-app/GoogleOneTimeInitializer;
      rm -rf mindthegapps_sfos/system/priv-app/GooglePartnerSetup;
      rm -rf mindthegapps_sfos/system/priv-app/SetupWizard;
      rm -rf mindthegapps_sfos/system/priv-app/Velvet;
    6. Unsquash system.img.orig with rsync (we use rsync to avoid file permissions problems)

      mkdir -p tmp-mount squashfs-root;
      sudo mount -o loop,ro system.img.orig ./tmp-mount;
      sudo rsync -avPSHAX --inplace tmp-mount/ squashfs-root;
      sudo umount ./tmp-mount;
      sudo rmdir tmp-mount;
    7. Copy google apps to unsquashed system.img.org:

      sudo cp -r mindthegapps_sfos/system/* squashfs-root/system/
    8. Create new system.img:

      sudo mksquashfs squashfs-root system.img.gapps -comp lz4 -Xhc -noappend -no-exports -no-duplicates -no-fragments

    Almost done! Now let's update the image on the phone itself!

    1. Stop android support on your phone
    2. Copy system.img.gapps to your XA2 as /opt/alien/system.img (thus overwriting the original image)
    3. Start android support

    If this is your first time setting up patched system.img you can additionally: 4. Go to aliendalvik settings Users & accounts and add google account (or open play store and sign in) 5. Open play store and disable Play protect and auto-updates

    Known problems

    1. Play store might briefly work but will eventually update itself and your app installs will get stuck in 'pending' state - just use Aurora Store
    2. GPS assisted positioning might be a bit of a hit and miss. Go to aliendalvik settings and under Security & location set Location to ON / High accuracy. Additionally Install F-Droid and add microG repository. Install All of the NLP packages in (GAPPS) variant. Configure UnifiedNlp providers. You might also want to install XposedUnifiedNlp

    Tested google apps that work OK

    1. YouTube - everything including the floating mini player
    2. Gmail
    3. Google Photos - with photo backup and sync
    4. Chrome

    Other non-google apps tested (latest versions)

    1. Uber (latest version)
    2. HERE WeGo maps
    3. Facebook Messenger Lite
    4. Revolut
    5. Slack
    6. WhatsApp
    7. Telegram
    8. Firefox (stable)

    Feel free to improve this guide and/or ask any questions!

    [HowTo] MindTheGapps on Xperia XA2 (3.2.0.12 / 3.2.1.20 / 3.3.0.14)3.3.0.16)

    ###Updated for version 3.3.0.14!3.3.0.16!

    Inspired by this OpenGapps Wiki here is the simple guide how to get fully functioning Google Play Services on your Xperia X2 with minimum number of google components (tested on 3.2.0.12, 3.2.1.20 and 3.3.0.14). 3.3.0.16). This method was developed and tested by @mjun.

    Couple of notes:

    1. You will have to prepare the new system.img on your computer and not on the phone itself. The reason is rsync crashing sfos.
    2. You do not have to uninstall your currently installed android apps
    3. It's advisable to make backup of your current /opt/alien/system.img
    4. You will have to remove microG applications if you have them installed as they will conflict with Google apks
    5. If you are on 3.2.0.12, 3.2.1.20 or 3.3.0.14 3.3.0.16 version of SFOS you don't have to do steps below manually - just download pre-patched system.img for 3.2.0.12, 3.2.1.20 or 3.3.0.143.3.0.16

    Let's get started

    1. First things first - make backup of your current /opt/alien/system.img
    2. Copy /opt/alien/system.img to your computer as system.img.orig
    3. Get MindTheGapps zip from here
    4. unzip MindTheGapps zip:

      unzip MindTheGapps-8.1.0-arm64-20180808_153856.zip -d mindthegapps_sfos;
    5. Remove unnecessary google components and config:

      rm -rf mindthegapps_sfos/system/addon.d;
      rm -rf mindthegapps_sfos/system/app/GoogleExtShared;
      rm -rf mindthegapps_sfos/system/app/PrebuiltExchange3Google;
      rm -rf mindthegapps_sfos/system/etc/permissions/com.google.android.dialer.support.xml;
      rm -rf mindthegapps_sfos/system/etc/sysconfig/google_build.xml;
      rm -rf mindthegapps_sfos/system/framework/com.google.android.dialer.support.jar;
      rm -rf mindthegapps_sfos/system/priv-app/AndroidMigratePrebuilt;
      rm -rf mindthegapps_sfos/system/priv-app/GoogleExtServices;
      rm -rf mindthegapps_sfos/system/priv-app/GoogleFeedback;
      rm -rf mindthegapps_sfos/system/priv-app/GoogleOneTimeInitializer;
      rm -rf mindthegapps_sfos/system/priv-app/GooglePartnerSetup;
      rm -rf mindthegapps_sfos/system/priv-app/SetupWizard;
      rm -rf mindthegapps_sfos/system/priv-app/Velvet;
    6. Unsquash system.img.orig with rsync (we use rsync to avoid file permissions problems)

      mkdir -p tmp-mount squashfs-root;
      sudo mount -o loop,ro system.img.orig ./tmp-mount;
      sudo rsync -avPSHAX --inplace tmp-mount/ squashfs-root;
      sudo umount ./tmp-mount;
      sudo rmdir tmp-mount;
    7. Copy google apps to unsquashed system.img.org:

      sudo cp -r mindthegapps_sfos/system/* squashfs-root/system/
    8. Create new system.img:

      sudo mksquashfs squashfs-root system.img.gapps -comp lz4 -Xhc -noappend -no-exports -no-duplicates -no-fragments

    Almost done! Now let's update the image on the phone itself!

    1. Stop android support on your phone
    2. Copy system.img.gapps to your XA2 as /opt/alien/system.img (thus overwriting the original image)
    3. Start android support

    If this is your first time setting up patched system.img you can additionally: 4. Go to aliendalvik settings Users & accounts and add google account (or open play store and sign in) 5. Open play store and disable Play protect and auto-updates

    Known problems

    1. Play store might briefly work but will eventually update itself and your app installs will get stuck in 'pending' state - just use Aurora Store
    2. GPS assisted positioning might be a bit of a hit and miss. Go to aliendalvik settings and under Security & location set Location to ON / High accuracy. Additionally Install F-Droid and add microG repository. Install All of the NLP packages in (GAPPS) variant. Configure UnifiedNlp providers. You might also want to install XposedUnifiedNlp

    Tested google apps that work OK

    1. YouTube - everything including the floating mini player
    2. Gmail
    3. Google Photos - with photo backup and sync
    4. Chrome

    Other non-google apps tested (latest versions)

    1. Uber (latest version)
    2. HERE WeGo maps
    3. Facebook Messenger Lite
    4. Revolut
    5. Slack
    6. WhatsApp
    7. Telegram
    8. Firefox (stable)

    Feel free to improve this guide and/or ask any questions!