mirror of
https://github.com/MustardChef/WSABuilds.git
synced 2024-11-23 19:59:17 +01:00
Merge branch 'main' of https://github.com/LSPosed/MagiskOnWSALocal
This commit is contained in:
commit
9e39211eb9
@ -29,8 +29,7 @@ if [ "$HOST_ARCH" != "x86_64" ] && [ "$HOST_ARCH" != "aarch64" ]; then
|
|||||||
fi
|
fi
|
||||||
cd "$(dirname "$0")" || exit 1
|
cd "$(dirname "$0")" || exit 1
|
||||||
trap umount_clean EXIT
|
trap umount_clean EXIT
|
||||||
PARENT_DIR="$(dirname "$PWD")"
|
# export TMPDIR=$(dirname "$PWD")/WORK_DIR_
|
||||||
# export TMPDIR=$PARENT_DIR/WORK_DIR_
|
|
||||||
if [ "$TMPDIR" ] && [ ! -d "$TMPDIR" ]; then
|
if [ "$TMPDIR" ] && [ ! -d "$TMPDIR" ]; then
|
||||||
mkdir -p "$TMPDIR"
|
mkdir -p "$TMPDIR"
|
||||||
fi
|
fi
|
||||||
@ -93,7 +92,7 @@ default() {
|
|||||||
ARCH=x64
|
ARCH=x64
|
||||||
RELEASE_TYPE=retail
|
RELEASE_TYPE=retail
|
||||||
MAGISK_VER=stable
|
MAGISK_VER=stable
|
||||||
GAPPS_BRAND=OpenGApps
|
GAPPS_BRAND=MindTheGapps
|
||||||
GAPPS_VARIANT=pico
|
GAPPS_VARIANT=pico
|
||||||
ROOT_SOL=magisk
|
ROOT_SOL=magisk
|
||||||
}
|
}
|
||||||
@ -306,8 +305,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,36 +27,50 @@ 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"}
|
||||||
if arch == "x64" and variant == "pico":
|
if brand == "OpenGApps":
|
||||||
link = "http://peternjeim.ddns.net:8081/ipfs/QmPDiAyqUvZHo9QU7WfoEE9XMqC8ppGyUsSwKQY7chfwHX"
|
# Use Android 12.1 build of OpenGApps (also supports more variants like Full)
|
||||||
elif arch == "x64" and variant == "full":
|
if arch == "x64" and variant == "pico":
|
||||||
link = "http://peternjeim.ddns.net:8081/ipfs/QmULfSMwWuukQR7r9KEvwD2XzsChHTvpswmNqJyEU64jwM"
|
link = "http://peternjeim.ddns.net:8081/ipfs/QmPDiAyqUvZHo9QU7WfoEE9XMqC8ppGyUsSwKQY7chfwHX"
|
||||||
else:
|
elif arch == "x64" and variant == "full":
|
||||||
# TODO: keep it 11.0 since official opengapps does not support 12+ yet
|
link = "http://peternjeim.ddns.net:8081/ipfs/QmULfSMwWuukQR7r9KEvwD2XzsChHTvpswmNqJyEU64jwM"
|
||||||
# As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and
|
# Use official Android 11.0 build of OpenGApps (since I didn't build all variants)
|
||||||
# download the corresponding version
|
else:
|
||||||
release = "11.0"
|
# TODO: keep it 11.0 since official opengapps does not support 12+ yet
|
||||||
try:
|
# As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and
|
||||||
res = requests.get(f"https://api.opengapps.org/list")
|
# download the corresponding version
|
||||||
j = json.loads(res.content)
|
release = "11.0"
|
||||||
link = {i["name"]: i for i in j["archs"][abi_map[arch]]
|
try:
|
||||||
["apis"][release]["variants"]}[variant]["zip"]
|
res = requests.get(f"https://api.opengapps.org/list")
|
||||||
except Exception:
|
j = json.loads(res.content)
|
||||||
print("Failed to fetch from OpenGApps API, fallbacking to SourceForge RSS...")
|
link = {i["name"]: i for i in j["archs"][abi_map[arch]]
|
||||||
res = requests.get(
|
["apis"][release]["variants"]}[variant]["zip"]
|
||||||
f'https://sourceforge.net/projects/opengapps/rss?path=/{abi_map[arch]}&limit=100')
|
except Exception:
|
||||||
link = re.search(f'https://.*{abi_map[arch]}/.*{release}.*{variant}.*\.zip/download', res.text).group().replace(
|
print("Failed to fetch from OpenGApps API, fallbacking to SourceForge RSS...")
|
||||||
'.zip/download', '.zip').replace('sourceforge.net/projects/opengapps/files', 'downloads.sourceforge.net/project/opengapps')
|
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(
|
||||||
|
f'https://sourceforge.net/projects/wsa-mtg/rss?path=/{abi_map[arch]}&limit=100')
|
||||||
|
link = re.search(f'https://.*{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)
|
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
|
||||||
|
@ -32,8 +32,13 @@ print(f"Generating Magisk download link: release type={magisk_ver}", flush=True)
|
|||||||
if not magisk_ver:
|
if not magisk_ver:
|
||||||
magisk_ver = "stable"
|
magisk_ver = "stable"
|
||||||
if magisk_ver == "stable" or magisk_ver == "beta" or magisk_ver == "canary" or magisk_ver == "debug":
|
if magisk_ver == "stable" or magisk_ver == "beta" or magisk_ver == "canary" or magisk_ver == "debug":
|
||||||
magisk_link = json.loads(requests.get(
|
try:
|
||||||
f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['link']
|
magisk_link = json.loads(requests.get(
|
||||||
|
f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['link']
|
||||||
|
except Exception:
|
||||||
|
print("Failed to fetch from GitHub API, fallbacking to jsdelivr...")
|
||||||
|
magisk_link = json.loads(requests.get(
|
||||||
|
f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json").content)['magisk']['link']
|
||||||
print(f"download link: {magisk_link}", flush=True)
|
print(f"download link: {magisk_link}", flush=True)
|
||||||
|
|
||||||
with open(download_dir/tempScript, 'a') as f:
|
with open(download_dir/tempScript, 'a') as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user