Fix GApps regexp (#284)

This commit is contained in:
Howard Wu 2022-12-08 20:06:42 +08:00 committed by GitHub
parent 042c1e09eb
commit 7c08d33c7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -459,6 +459,7 @@ if [ "$GAPPS_BRAND" != 'none' ]; then
else else
if ! unzip "$GAPPS_PATH" "system/*" -x "system/addon.d/*" "system/system_ext/priv-app/SetupWizard/*" -d "$WORK_DIR"/gapps; then 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?" echo "Unzip MindTheGapps failed, package is corrupted?"
CLEAN_DOWNLOAD_GAPPS=1
abort abort
fi fi
mv "$WORK_DIR"/gapps/system/* "$WORK_DIR"/gapps || abort mv "$WORK_DIR"/gapps/system/* "$WORK_DIR"/gapps || abort

View File

@ -37,7 +37,7 @@ print(
f"Generating {brand} download link: arch={arch} variant={variant}", flush=True) f"Generating {brand} download link: arch={arch} variant={variant}", flush=True)
abi_map = {"x64": "x86_64", "arm64": "arm64"} abi_map = {"x64": "x86_64", "arm64": "arm64"}
android_api_map = {"30": "11.0", "32": "12.1", "33": "13.0"} 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": if brand == "OpenGApps":
try: try:
res = requests.get(f"https://api.opengapps.org/list") res = requests.get(f"https://api.opengapps.org/list")
@ -55,7 +55,7 @@ if brand == "OpenGApps":
elif brand == "MindTheGapps": elif brand == "MindTheGapps":
res = requests.get( res = requests.get(
f'https://sourceforge.net/projects/wsa-mtg/rss?path=/{abi_map[arch]}&limit=100') 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') '.zip/download', '.zip').replace('sourceforge.net/projects/wsa-mtg/files', 'downloads.sourceforge.net/project/wsa-mtg')
print(f"download link: {link}", flush=True) print(f"download link: {link}", flush=True)