From 7c08d33c7e07f75789e319f9946e7478e696586f Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Thu, 8 Dec 2022 20:06:42 +0800 Subject: [PATCH] Fix GApps regexp (#284) --- scripts/build.sh | 1 + scripts/generateGappsLink.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index c250821..606e7f6 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -459,6 +459,7 @@ if [ "$GAPPS_BRAND" != 'none' ]; then else if ! unzip "$GAPPS_PATH" "system/*" -x "system/addon.d/*" "system/system_ext/priv-app/SetupWizard/*" -d "$WORK_DIR"/gapps; then echo "Unzip MindTheGapps failed, package is corrupted?" + CLEAN_DOWNLOAD_GAPPS=1 abort fi mv "$WORK_DIR"/gapps/system/* "$WORK_DIR"/gapps || abort diff --git a/scripts/generateGappsLink.py b/scripts/generateGappsLink.py index 7f14801..78c0af2 100644 --- a/scripts/generateGappsLink.py +++ b/scripts/generateGappsLink.py @@ -37,7 +37,7 @@ print( f"Generating {brand} download link: arch={arch} variant={variant}", flush=True) abi_map = {"x64": "x86_64", "arm64": "arm64"} android_api_map = {"30": "11.0", "32": "12.1", "33": "13.0"} -release = [android_api_map[android_api]] +release = android_api_map[android_api] if brand == "OpenGApps": try: res = requests.get(f"https://api.opengapps.org/list") @@ -55,7 +55,7 @@ if brand == "OpenGApps": elif brand == "MindTheGapps": res = requests.get( f'https://sourceforge.net/projects/wsa-mtg/rss?path=/{abi_map[arch]}&limit=100') - link = re.search(f'https://.*{release}.*{abi_map[arch]}/.*\.zip/download', res.text).group().replace( + link = re.search(f'https://.*{release}.*{abi_map[arch]}.*\.zip/download', res.text).group().replace( '.zip/download', '.zip').replace('sourceforge.net/projects/wsa-mtg/files', 'downloads.sourceforge.net/project/wsa-mtg') print(f"download link: {link}", flush=True)