mirror of
https://github.com/lineageos4microg/docker-lineage-cicd
synced 2024-11-09 10:09:56 +01:00
Fix LineageOS Updater URL
The Updater URL property and format has changed in e930cf7 (cm-14.1) and 5252d60 (lineage-15.1), now the full URL (plus the placeholders) must be specified.
This commit is contained in:
parent
d39ed8fea2
commit
93cc0e5cb5
25
src/build.sh
25
src/build.sh
@ -151,6 +151,10 @@ for branch in $BRANCH_NAME; do
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set up our overlay
|
||||
mkdir -p "vendor/$vendor/overlay/microg/"
|
||||
sed -i "1s;^;PRODUCT_PACKAGE_OVERLAYS := vendor/$vendor/overlay/microg\n;" "vendor/$vendor/config/common.mk"
|
||||
|
||||
los_ver_major=$(sed -n -e 's/^\s*PRODUCT_VERSION_MAJOR = //p' "vendor/$vendor/config/common.mk")
|
||||
los_ver_minor=$(sed -n -e 's/^\s*PRODUCT_VERSION_MINOR = //p' "vendor/$vendor/config/common.mk")
|
||||
los_ver="$los_ver_major.$los_ver_minor"
|
||||
@ -181,7 +185,6 @@ for branch in $BRANCH_NAME; do
|
||||
cd ../..
|
||||
|
||||
# Override device-specific settings for the location providers
|
||||
sed -i "1s;^;PRODUCT_PACKAGE_OVERLAYS := vendor/$vendor/overlay/microg\n;" "vendor/$vendor/config/common.mk"
|
||||
mkdir -p "vendor/$vendor/overlay/microg/frameworks/base/core/res/res/values/"
|
||||
cp /root/signature_spoofing_patches/frameworks_base_config.xml "vendor/$vendor/overlay/microg/frameworks/base/core/res/res/values/config.xml"
|
||||
else
|
||||
@ -194,15 +197,21 @@ for branch in $BRANCH_NAME; do
|
||||
sed -i "/\$(filter .*\$(${vendor^^}_BUILDTYPE)/,+2d" "vendor/$vendor/config/common.mk"
|
||||
|
||||
# Set a custom updater URI if a OTA URL is provided
|
||||
echo ">> [$(date)] Adding OTA URL overlay (for custom URL $OTA_URL)"
|
||||
if ! [ -z "$OTA_URL" ]; then
|
||||
if [ "$los_ver_major" -ge "15" ]; then
|
||||
ota_prop="lineage.updater.uri"
|
||||
else
|
||||
ota_prop="cm.updater.uri"
|
||||
fi
|
||||
updater_url_overlay_dir="vendor/$vendor/overlay/microg/packages/apps/Updater/res/values/"
|
||||
mkdir -p "$updater_url_overlay_dir"
|
||||
|
||||
echo ">> [$(date)] Adding OTA URL '$OTA_URL' to build.prop"
|
||||
sed -i "1s;^;PRODUCT_PROPERTY_OVERRIDES += $ota_prop=$OTA_URL\n\n;" "vendor/$vendor/config/common.mk"
|
||||
if [ -n "$(grep updater_server_url packages/apps/Updater/res/values/strings.xml)" ]; then
|
||||
# "New" updater configuration: full URL (with placeholders {device}, {type} and {incr})
|
||||
sed "s|{name}|updater_server_url|g; s|{url}|$OTA_URL/v1/{device}/{type}/{incr}|g" /root/packages_updater_strings.xml > "$updater_url_overlay_dir/strings.xml"
|
||||
elif [ -n "$(grep conf_update_server_url_def packages/apps/Updater/res/values/strings.xml)" ]; then
|
||||
# "Old" updater configuration: just the URL
|
||||
sed "s|{name}|conf_update_server_url_def|g; s|{url}|$OTA_URL|g" /root/packages_updater_strings.xml > "$updater_url_overlay_dir/strings.xml"
|
||||
else
|
||||
echo ">> [$(date)] ERROR: no known Updater URL property found"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add custom packages to be installed
|
||||
|
7
src/packages_updater_strings.xml
Normal file
7
src/packages_updater_strings.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
|
||||
<!-- Set a custom Updater URL -->
|
||||
<string name="{name}" translatable="false">{url}</string>
|
||||
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user