[HowTo] MindTheGapps on Xperia XA2 (3.2.0.12 / 3.2.1.20 / 3.3.0.16)
asked 2019-11-22 22:41:51 +0200
This post is a wiki. Anyone with karma >75 is welcome to improve it.
###Updated for version 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.16). This method was developed and tested by @mjun.
Couple of notes:
- You will have to prepare the new
system.img
on your computer and not on the phone itself. The reason is rsync crashing sfos. - You do not have to uninstall your currently installed android apps
- It's advisable to make backup of your current /opt/alien/system.img
- You will have to remove microG applications if you have them installed as they will conflict with Google apks
- If you are on 3.2.0.12, 3.2.1.20 or 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.16
Let's get started
- First things first - make backup of your current
/opt/alien/system.img
- Copy
/opt/alien/system.img
to your computer assystem.img.orig
- Get MindTheGapps zip from here
unzip MindTheGapps zip:
unzip MindTheGapps-8.1.0-arm64-20180808_153856.zip -d mindthegapps_sfos;
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;
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;
Copy google apps to unsquashed system.img.org:
sudo cp -r mindthegapps_sfos/system/* squashfs-root/system/
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!
- Stop android support on your phone
- Copy
system.img.gapps
to your XA2 as/opt/alien/system.img
(thus overwriting the original image) - 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
- Play store might briefly work but will eventually update itself and your app installs will get stuck in 'pending' state - just use Aurora Store
- 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
- YouTube - everything including the floating mini player
- Gmail
- Google Photos - with photo backup and sync
- Chrome
Other non-google apps tested (latest versions)
- Uber (latest version)
- HERE WeGo maps
- Facebook Messenger Lite
- Revolut
- Slack
- Telegram
- Firefox (stable)
Feel free to improve this guide and/or ask any questions!
will a google calendar work (either on Google itself or via DavX5)? are there any notable differences to the microG implenetation?
danfin ( 2019-11-23 15:05:06 +0200 )editIf we are talking about this app then yes - it works just fine. I haven't tested it thoroughly though, as I didn't like google's concept of calendar app.
mjun ( 2019-11-23 22:14:07 +0200 )editCopied system.img.gapps to /opt/alien/system.img. Play store is stuck at Checking info. Clicking on "Add account" does nothing. Not sure if this works.
ashakunt ( 2019-11-24 02:38:17 +0200 )editThis is what I did and seemed to work:
- Copy the system.img.gapps to /opt/alien/system.img
- Installed Fdroid
- Installed Aurura Store
- Login to Aurora Store and update google services
- Installed Instagram; it worked.
ashakunt ( 2019-11-24 03:49:55 +0200 )edit@ashakunt If you had microG apps installed prior to replacing system.img try uninstalling microG apps and restart your phone, then try again. You can also go to aliendalvik settings -> Apps & notifications, then open "google play services" and "google play store" and for both apps go to "Storage" option and then "clear cache" and "Manage space"/"clear data". Restart android support and try again. It should work.
When google account sign-in gets stuck on "Checking info" it usually means either broken permission when unpacking original system.img or previously installed apps that interact with google in some way.
As a last resort, if you don't mind losing all of your currently installed android apps you can try this:
- stop android support
mjun ( 2019-11-24 18:34:25 +0200 )editssh to your phone and remove everything under /home/.android directory and /home/nemo/android_storage:
start android support and try to add google accont in settings (or sign in with play store)