65 lines
3.7 KiB
Diff
65 lines
3.7 KiB
Diff
diff --git a/build.sh b/build.sh
|
|
index b4e09f0..14cc185 100755
|
|
--- a/build.sh
|
|
+++ b/build.sh
|
|
@@ -28,7 +28,7 @@ if [ "$BUILD_MINDETACH_MODULE" = true ] && [ ! -f "mindetach-magisk/mindetach/de
|
|
BUILD_MINDETACH_MODULE=false
|
|
fi
|
|
if ! PARALLEL_JOBS=$(toml_get "$main_config_t" parallel-jobs); then
|
|
- if [ "$OS" = Android ]; then PARALLEL_JOBS=1; else PARALLEL_JOBS=$(nproc); fi
|
|
+ if [ "$OS" = Android ]; then PARALLEL_JOBS=1; else PARALLEL_JOBS=2; fi
|
|
fi
|
|
LOGGING_F=$(toml_get "$main_config_t" logging-to-file) && vtf "$LOGGING_F" "logging-to-file" || LOGGING_F=false
|
|
DEF_PATCHES_VER=$(toml_get "$main_config_t" patches-version) || DEF_PATCHES_VER=""
|
|
diff --git a/utils.sh b/utils.sh
|
|
index dec04d5..b92fc60 100755
|
|
--- a/utils.sh
|
|
+++ b/utils.sh
|
|
@@ -53,7 +53,7 @@ get_rv_prebuilts() {
|
|
pr "Getting prebuilts (${patches_src%/*})" >&2
|
|
local rv_cli_url rv_integrations_url rv_patches rv_patches_changelog rv_patches_dl rv_patches_url rv_patches_json
|
|
|
|
- rv_cli_url=$(gh_req "https://api.github.com/repos/j-hc/revanced-cli/releases/latest" - | json_get 'browser_download_url') || return 1
|
|
+ rv_cli_url=$(gh_req "https://api.github.com/repos/revanced/revanced-cli/releases/latest" - | json_get 'browser_download_url') || return 1
|
|
local rv_cli_jar="${TEMP_DIR}/jhc-rv/${rv_cli_url##*/}"
|
|
echo "CLI: $(cut -d/ -f4 <<<"$rv_cli_url")/$(cut -d/ -f9 <<<"$rv_cli_url") " >"$patches_dir/changelog.md"
|
|
|
|
@@ -182,7 +182,9 @@ dl_apkmirror() {
|
|
return 0
|
|
}
|
|
local resp node app_table dlurl=""
|
|
- [ "$arch" = universal ] && apparch=(universal noarch 'arm64-v8a + armeabi-v7a') || apparch=("$arch")
|
|
+ if [ "$arch" = universal ]; then apparch=(universal noarch 'arm64-v8a + armeabi-v7a');
|
|
+ elif [ "$arch" = arm64-v8a ]; then apparch=(arm64-v8a 'arm64-v8a + x86_64');
|
|
+ else apparch=("$arch"); fi
|
|
url="${url}/${url##*/}-${version//./-}-release/"
|
|
resp=$(req "$url" -) || return 1
|
|
for ((n = 1; n < 40; n++)); do
|
|
@@ -192,14 +194,14 @@ dl_apkmirror() {
|
|
if [ "$(sed -n 3p <<<"$app_table")" = "$apkorbundle" ] && { [ "$apkorbundle" = BUNDLE ] ||
|
|
{ [ "$apkorbundle" = APK ] && [ "$(sed -n 6p <<<"$app_table")" = "$dpi" ] &&
|
|
isoneof "$(sed -n 4p <<<"$app_table")" "${apparch[@]}"; }; }; then
|
|
- dlurl=https://www.apkmirror.com$($HTMLQ --attribute href "div:nth-child(1) > a:nth-child(1)" <<<"$node")
|
|
+ dlurl=$($HTMLQ --base https://www.apkmirror.com --attribute href "div:nth-child(1) > a:nth-child(1)" <<<"$node")
|
|
break
|
|
fi
|
|
done
|
|
[ -z "$dlurl" ] && return 1
|
|
- url="https://www.apkmirror.com$(req "$dlurl" - | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p' | tail -1)"
|
|
+ url=$(req "$dlurl" - | $HTMLQ --base https://www.apkmirror.com --attribute href "a.btn")
|
|
if [ "$apkorbundle" = BUNDLE ] && [[ "$url" != *"&forcebaseapk=true" ]]; then url="${url}&forcebaseapk=true"; fi
|
|
- url="https://www.apkmirror.com$(req "$url" - | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
|
|
+ url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "span > a[rel = nofollow]")
|
|
req "$url" "$output"
|
|
}
|
|
get_apkmirror_vers() {
|
|
@@ -252,7 +254,7 @@ get_apkmonk_pkg_name() { grep -oP '.*apkmonk\.com\/app\/\K([,\w,\.]*)' <<<"$1";
|
|
patch_apk() {
|
|
local stock_input=$1 patched_apk=$2 patcher_args=$3 rv_cli_jar=$4 rv_patches_jar=$5
|
|
declare -r tdir=$(mktemp -d -p $TEMP_DIR)
|
|
- local cmd="java -jar $rv_cli_jar --rip-lib x86_64 --rip-lib x86 --temp-dir=$tdir -c -a $stock_input -o $patched_apk -b $rv_patches_jar --keystore=ks.keystore $patcher_args"
|
|
+ local cmd="java -jar $rv_cli_jar --temp-dir=$tdir -c -a $stock_input -o $patched_apk -b $rv_patches_jar --keystore=ks.keystore --options=options.json $patcher_args"
|
|
if [ "$OS" = Android ]; then cmd+=" --custom-aapt2-binary=${TEMP_DIR}/aapt2"; fi
|
|
pr "$cmd"
|
|
if [ "${DRYRUN:-}" = true ]; then
|