From e1ff05dc06d07cb85c152fe821f43f24f7d982ec Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Fri, 18 Aug 2023 08:19:16 +0200 Subject: [PATCH] Update build-apps patch Signed-off-by: Nikolaos Karaolidis --- config.toml | 2 ++ patches/0001-build-apps.patch | 51 ----------------------------------- 2 files changed, 2 insertions(+), 51 deletions(-) diff --git a/config.toml b/config.toml index e348a3a..e5bf048 100644 --- a/config.toml +++ b/config.toml @@ -1,3 +1,5 @@ +parallel-jobs = 3 +cli-source = "revanced/revanced-cli" compression-level = 9 logging-to-file = true enable-magisk-update = true diff --git a/patches/0001-build-apps.patch b/patches/0001-build-apps.patch index b69b849..926a47c 100644 --- a/patches/0001-build-apps.patch +++ b/patches/0001-build-apps.patch @@ -1,58 +1,7 @@ -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