Download all apks at build time (if they're not present) (#84)

* F-Droid component apks correct
* Put the version number (v0.1.0) in GsfProxy/.version_code
* microG component apks correct
* download_apk function called and implemnted except for call to curl
* Hyphen not underscore in GmsCore anf FakeStore apk filenames
* Get F-Droid components from https://f-droid.org/repo/
* Download apks using curl
* Remove old commented-out code
* Comment out debug 'echo' statements

* add the necessary cd commands

* Delete the stored apks: we download them at build time
This commit is contained in:
Pete Fotheringham
2026-02-01 08:04:49 +00:00
committed by GitHub
parent ce6ed1fbdd
commit 57cacf074c
5 changed files with 68 additions and 17 deletions
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
8
v0.1.0
Binary file not shown.
+67 -16
View File
@@ -5,30 +5,81 @@ set -e
echo "vendor/partner_gms/vendorsetup.sh called"
get_files() {
local name="$1"
local id="$2"
local versionCode=$(cat "$name"/.version_code)
local release=$(cat ".microg_release")
local source_apk_name="$id-$versionCode.apk"
local src="https://github.com/microg/GmsCore/releases/download/$release/$source_apk_name"
local destination_apk="$name/$name.apk"
download_apk() {
local source_apk=$1
local component_name=$2
local destination_apk
destination_apk="$component_name"/"$component_name".apk
if [ -f "$destination_apk" ]; then
echo "$destination_apk exists: not downloading"
## To Do
# Deal with the situation where we have an OLDER version hanging around
# may have to be handled in the Docker image
else
echo "downloading $destination_apk to $destination_apk"
curl -LO "$src"
mv "$source_apk_name" "$destination_apk"
# echo "downloading $source_apk to $destination_apk"
curl -L --output "$destination_apk" "$source_apk"
fi
}
get-fdroid-components() {
local fdroid_repo="https://f-droid.org/repo/"
local name apk_to_download versioncode id
# F-Droid client app
name="FDroid"
versioncode=$(cat "$name"/.version_code)
id="org.fdroid.fdroid"
apk_to_download="$fdroid_repo"/"$id"_"$versioncode".apk
# echo "$name apk_to_download: $apk_to_download"
download_apk "$apk_to_download" "$name"
# FDroid Privileged Extension
name="FDroidPrivilegedExtension"
versioncode=$(cat "$name"/.version_code)
id="org.fdroid.fdroid.privileged"
apk_to_download="$fdroid_repo"/"$id"_"$versioncode".apk
# echo "$name apk_to_download: $apk_to_download"
download_apk "$apk_to_download" "$name"
}
get-microg-components() {
local microg_repo_base="https://github.com/microg"
local name apk_to_download versioncode id
microg_release=$(cat ".microg_release")
# GmsCore
name="GmsCore"
versioncode=$(cat "$name"/.version_code)
id="com.google.android.gms"
apk_to_download="$microg_repo_base"/GMSCore/releases/download/"$microg_release"/"$id"-"$versioncode".apk
# echo "$name apk_to_download: $apk_to_download"
download_apk "$apk_to_download" "$name"
# FakeStore
name="FakeStore"
versioncode=$(cat "$name"/.version_code)
id="com.android.vending"
apk_to_download="$microg_repo_base"/GMSCore/releases/download/"$microg_release"/"$id"-"$versioncode".apk
# echo "$name apk_to_download: $apk_to_download"
download_apk "$apk_to_download" "$name"
# GsfProxy the file we want is
#`https://github.com/microg/android_packages_apps_GsfProxy/releases/download/v0.1.0/GsfProxy.apk`
name="GsfProxy"
versioncode=$(cat "$name"/.version_code)
apk_to_download="$microg_repo_base"/android_packages_apps_GsfProxy/releases/download/"$versioncode"/"$name".apk
# echo "$name apk_to_download: $apk_to_download"
download_apk "$apk_to_download" "$name"
}
# This script is called from the root dierctory, so we need to cd
cd vendor/partner_gms
get_files GmsCore "com.google.android.gms"
get_files FakeStore "com.android.vending"
get-fdroid-components
get-microg-components
# and back to the root directory
cd ../..
set +e