diff --git a/build.sh b/build.sh index 865f548fa5..7d33f33a42 100755 --- a/build.sh +++ b/build.sh @@ -50,7 +50,9 @@ java --version >/dev/null || abort "\`openjdk 17\` is not installed. install it zip --version >/dev/null || abort "\`zip\` is not installed. install it with 'apt install zip' or equivalent" # ---------------- rm -rf revanced-magisk/bin/*/tmp.* -: >"$TEMP_DIR"/*-rv/changelog.md || : +if [ "$(echo "$TEMP_DIR"/*-rv/changelog.md)" ]; then + : >"$TEMP_DIR"/*-rv/changelog.md || : +fi get_prebuilts diff --git a/utils.sh b/utils.sh index 945b340fb7..5e34beaa13 100755 --- a/utils.sh +++ b/utils.sh @@ -80,13 +80,14 @@ get_rv_prebuilts() { if [ "$tag" = "Integrations" ]; then integs_file=$file; fi echo "$tag: $(cut -d/ -f1 <<<"$src")/${name} " >>"${cl_dir}/changelog.md" else + local for_err=$file if [ "$ver" = "latest" ]; then file=$(grep -v dev <<<"$file" | head -1) else file=$(grep "${ver#v}" <<<"$file" | head -1); fi + if [ -z "$file" ]; then abort "filter fail: '$for_err' with '$ver'"; fi name=$(basename "$file") tag_name=$(cut -d'-' -f3- <<<"$name") tag_name=v${tag_name%.*} - if [ "$tag_name" = "v" ]; then abort "wrong ver"; fi fi echo -n "$file " @@ -543,9 +544,11 @@ build_rv() { fi fi fi - if ! patch_apk "$stock_apk" "$patched_apk" "${patcher_args[*]}" "${args[cli]}" "${args[ptjar]}"; then - epr "Building '${table}' failed!" - return 0 + if [ "${NORB:-}" != true ] || [ ! -f "$patched_apk" ]; then + if ! patch_apk "$stock_apk" "$patched_apk" "${patcher_args[*]}" "${args[cli]}" "${args[ptjar]}"; then + epr "Building '${table}' failed!" + return 0 + fi fi if [ "$build_mode" = apk ]; then local apk_output="${BUILD_DIR}/${app_name_l}-${rv_brand_f}-v${version_f}-${arch_f}.apk"