[HowTo] Install Google Play Services on baseport 8 devices from Microsoft Windows (Not working)
asked 2019-05-08 12:20:09 +0200
This post is a wiki. Anyone with karma >75 is welcome to improve it.
This wants to be a comprehensive guide for installing Android support on baseport 8 devices, currently the Xperia XA2 series. This procedure has not worked for me, so support is required by someone who got it working. The procedure currently available must be collected from a number of different posts on TJC, mostly vague and missing important details. I tried to sum up what I gathered from them in the following procedure, but could not get Android support to start. Corrections by someone who managed to get Play Services working are encouraged.
The steps are the following:
- Install on your pc a Windows binary version of lzip and squashfs-tools.
- Download a pico version of opengapps from opengapps.org for the ARM64.
- Get the
/opt/alien/system.img
file from the device. You can do so by copying it to the/home/nemo/Downloads
directory and accessing the phone via USB in MTP mode. - Choose or create a temporary folder on the PC (let's call it
Temp
). Unsquash thesystem.img
file in a folder calledsystem/
inside the temporary folder:unsquashfs.exe -d Temp/system yourpath/system.img
. - Extract the
Core
directory from the opengapps archive into aCore
subdirectory of the Temp directory. - Inside the
Core
subdirectory on the PC, decompress the following archives usinglzip -d archivename
:vending-arm
,gsfcore-all
,gmscore-arm64
,gmssetup-all
,googleonetimeinitializer-all
,googlepartnersetup-all
. - Each of the decompressed archives is now in tar format. You can open them with winrar. Each of them contains one or more
priv-app
directories. If more than one is present, take the one under thenodpi
path. Take the contents of the selectedpriv-app
directory, one for each archive (in all cases it is another single directory), and copy them to thesystem/priv-app
directory located inside theTemp/system
directory (Temp/system/system/priv-app
). - Repack the system into another system.img file:
mksquashfs.exe system\ system.img -comp lz4 -Xhc -noappend -no-exports -no-duplicates -no-fragments
. - Copy the new system.img file to the
/home/nemo/Downloads
directory on the phone via USB. - Stop Alien Dalvik.
- Open a shell on the phone and enter root mode via
devel-su
. - Rename the old file just in case:
mv /opt/alien/system.img /opt/alien/system.img.old
. - Copy the new file:
cp /home/nemo/Downloads/system.img /opt/alien/
. - Restart Alien Dalvik, or reboot the phone, and watch Android support not starting.
EDIT: The most likely cause for malfunction is Windows not preserving Unix file permissions. I can't think of an easy workaround for this. There would be the immediate solution of merging the files to the existing system.img, were it not that mksquashfs has been written in the moronic way that if it detects two identical directories, rather than adding the new files to the existing directory, it will create a new directory with a different name and put the new files in it. If somebody has a workaround for this idiotic behaviour of mksquashfs, suggestions are welcome.
whatabout docker ? almost every middle class laptoo can run docker then yiu can run linux of your choice in it and do.the magic there ?
or with windows 10 (not all versions) you can run linux directly on windows i think its called subsystem or something like that. my 200 euro laptop was too waek for both :(
pawel ( 2019-05-10 17:25:35 +0200 )edit@pawel I can also install VirtualBox and run a Linux virtual machine there. But the point is, I should keep and maintain a Linux installation just for this. Or I could connect my Raspberry Pi 3 and run the process there. But that's too much of a complication for me. I want to go to the PC I currently keep running and execute the procedure without having to dig out hardware or software at every SFOS update. Luckily, @Artur's procedure to run the process on the phone works fine. I will create a howto from that, just to have people find it clearly and not have to run through answers to unrelated questions.
Giacomo Di Giacomo ( 2019-05-10 17:55:32 +0200 )edit