mirror of
https://github.com/MustardChef/WSABuilds.git
synced 2024-11-14 07:35:07 +01:00
Build x86_64 with MindTheGappsBuilder (#94)
Co-authored-by: Howard Wu <40033067+Howard20181@users.noreply.github.com>
This commit is contained in:
parent
29c373b9fd
commit
37b59237d7
@ -306,8 +306,8 @@ if [ -z "${OFFLINE+x}" ]; then
|
|||||||
if [ -z "${CUSTOM_MAGISK+x}" ]; then
|
if [ -z "${CUSTOM_MAGISK+x}" ]; then
|
||||||
python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
|
python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
|
||||||
fi
|
fi
|
||||||
if [ "$GAPPS_BRAND" = "OpenGApps" ]; then
|
if [ "$GAPPS_BRAND" != "none" ]; then
|
||||||
python3 generateGappsLink.py "$ARCH" "$GAPPS_VARIANT" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
|
python3 generateGappsLink.py "$ARCH" "$GAPPS_BRAND" "$GAPPS_VARIANT" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Download Artifacts"
|
echo "Download Artifacts"
|
||||||
|
@ -27,31 +27,43 @@ import re
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
arch = sys.argv[1]
|
arch = sys.argv[1]
|
||||||
variant = sys.argv[2]
|
brand = sys.argv[2]
|
||||||
download_dir = Path.cwd().parent / "download" if sys.argv[3] == "" else Path(sys.argv[3]).resolve()
|
variant = sys.argv[3]
|
||||||
tempScript = sys.argv[4]
|
download_dir = Path.cwd().parent / \
|
||||||
print(f"Generating OpenGApps download link: arch={arch} variant={variant}", flush=True)
|
"download" if sys.argv[4] == "" else Path(sys.argv[4]).resolve()
|
||||||
|
tempScript = sys.argv[5]
|
||||||
|
print(
|
||||||
|
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"}
|
||||||
# TODO: keep it 11.0 since opengapps does not support 12+ yet
|
# TODO: keep it 11.0 since opengapps does not support 12+ yet
|
||||||
# As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and
|
# As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and
|
||||||
# download the corresponding version
|
# download the corresponding version
|
||||||
release = "11.0"
|
release = "11.0"
|
||||||
try:
|
if brand == "OpenGApps":
|
||||||
res = requests.get(f"https://api.opengapps.org/list")
|
try:
|
||||||
j = json.loads(res.content)
|
res = requests.get(f"https://api.opengapps.org/list")
|
||||||
link = {i["name"]: i for i in j["archs"][abi_map[arch]]
|
j = json.loads(res.content)
|
||||||
["apis"][release]["variants"]}[variant]["zip"]
|
link = {i["name"]: i for i in j["archs"][abi_map[arch]]
|
||||||
except Exception:
|
["apis"][release]["variants"]}[variant]["zip"]
|
||||||
print("Failed to fetch from OpenGApps API, fallbacking to SourceForge RSS...")
|
except Exception:
|
||||||
|
print("Failed to fetch from OpenGApps API, fallbacking to SourceForge RSS...")
|
||||||
|
res = requests.get(
|
||||||
|
f'https://sourceforge.net/projects/opengapps/rss?path=/{abi_map[arch]}&limit=100')
|
||||||
|
link = re.search(f'https://.*{abi_map[arch]}/.*{release}.*{variant}.*\.zip/download', res.text).group().replace(
|
||||||
|
'.zip/download', '.zip').replace('sourceforge.net/projects/opengapps/files', 'downloads.sourceforge.net/project/opengapps')
|
||||||
|
elif brand == "MindTheGapps":
|
||||||
res = requests.get(
|
res = requests.get(
|
||||||
f'https://sourceforge.net/projects/opengapps/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://.*{abi_map[arch]}/.*{release}.*{variant}.*\.zip/download', res.text).group().replace(
|
link = re.search(f'https://.*{abi_map[arch]}/.*\.zip/download', res.text).group().replace(
|
||||||
'.zip/download', '.zip').replace('sourceforge.net/projects/opengapps/files', 'downloads.sourceforge.net/project/opengapps')
|
'.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)
|
||||||
|
|
||||||
with open(download_dir/tempScript, 'a') as f:
|
with open(download_dir/tempScript, 'a') as f:
|
||||||
f.writelines(f'{link}\n')
|
f.writelines(f'{link}\n')
|
||||||
f.writelines(f' dir={download_dir}\n')
|
f.writelines(f' dir={download_dir}\n')
|
||||||
f.writelines(f' out=OpenGApps-{arch}-{variant}.zip\n')
|
if brand == "OpenGApps":
|
||||||
|
f.writelines(f' out={brand}-{arch}-{variant}.zip\n')
|
||||||
|
elif brand == "MindTheGapps":
|
||||||
|
f.writelines(f' out={brand}-{arch}.zip\n')
|
||||||
f.close
|
f.close
|
||||||
|
@ -145,17 +145,13 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if (YesNoBox '([title]="Install GApps" [text]="Do you want to install GApps?")'); then
|
if (YesNoBox '([title]="Install GApps" [text]="Do you want to install GApps?")'); then
|
||||||
if [ -f "$DOWNLOAD_DIR"/MindTheGapps-"$ARCH".zip ]; then
|
GAPPS_BRAND=$(
|
||||||
GAPPS_BRAND=$(
|
Radiolist '([title]="Which GApps do you want to install?"
|
||||||
Radiolist '([title]="Which GApps do you want to install?"
|
[default]="OpenGApps")' \
|
||||||
[default]="OpenGApps")' \
|
\
|
||||||
\
|
'OpenGApps' "" 'on' \
|
||||||
'OpenGApps' "" 'on' \
|
'MindTheGapps' "" 'off'
|
||||||
'MindTheGapps' "" 'off'
|
)
|
||||||
)
|
|
||||||
else
|
|
||||||
GAPPS_BRAND="OpenGApps"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
GAPPS_BRAND="none"
|
GAPPS_BRAND="none"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user