microG flashable ZIP
Roboe opened this issue · 1 comments
Moved from WeAreFairphone/flashable-zips#1
@Roboe, 21 jun. 2017 20:14 CEST:
This is just an idea I think about sometimes. A flashable ZIP to integrate @microg apps into the system, for those AOSP-based OSes that refuse to apply the required patches.
What the ZIP should do:
- Install official APKs from microg.org to
/system/app
, or/system/priv-app
whether necessary.- Install at least one ready-to-use UnifiedNLP backend to userspace, maybe MozillaNlpBackend and NominatimGeocoderBackend (APKs from F-Droid)
- Install an OTA survival script (
addon.d
), like:
- F-Droid's privileged extension: https://gitlab.com/fdroid/privileged-extension/blob/master/app/src/main/scripts/80-fdroid.sh
- and @opengapps: https://github.com/opengapps/opengapps/blob/master/scripts/bkup_tail.sh
I can't find docs aboutThe script is well-documented in its first commit (it's just a script with life-cycle methods to implement), and LineageOSaddon.d backup
(bulletpoint 3). Help needed with this.50-cm.sh
script is a reference implementation.P.S.: Signature spoofing is not included because it seems to be hard to achieve from inside the phone.
@Roboe, 25 jun. 2017 20:19 CEST:
I've been doing some research for how to retrieve official APKs from microG's F-Droid repo:
- F-Droid repo URL is: https://microg.org/fdroid/repo/
- Repo index is a XML file located here: https://microg.org/fdroid/repo/index.xml
- Root XML tag is
fdroid
and have anapplication
tag child for each app.application
has a childmarketvercode
whose value equals the latest stable release for the app (which IMHO should be the one we should install).application
has multiplepackage
childs, one per version.package
has a childversioncode
with the version code value.package
has a childapkname
with the full name of the APK file (which follows the pattern<appid>-<versioncode>.apk
)- Appending the
apkname
value to the repo URL we get the download URL for each app.This could be automated in a bash script, I need to figure a way to easily parse XML (XPath?) without dependencies, ideally
Edit:
Withpython-lxml
(Bash wrapper, kinda verbose, but preinstalled on most GNU/Linux distros):python2 -c "from lxml.etree import parse; from sys import stdin; print '\n'.join(parse(stdin).xpath('/fdroid/application/@id'))" < index.xml
With
xmlstarlet
:$ VERSION_CODE=$(xmlstarlet select -t -v "/fdroid/application[@id = 'com.google.android.gms']/marketvercode" index.xml) $ xmlstarlet select -t -v "/fdroid/application[@id = 'com.google.android.gms']/package[versioncode = '$VERSION_CODE']/apkname" index.xml com.google.android.gms-9258259.apk