From a0d164e4c628f838caadc79dec31c8da8d08a190 Mon Sep 17 00:00:00 2001 From: j-hc Date: Tue, 31 Mar 2026 23:20:16 +0300 Subject: [PATCH 01/19] refactor dpi handling --- build.sh | 3 +-- utils.sh | 45 +++++++++++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/build.sh b/build.sh index 27b507a..beab089 100755 --- a/build.sh +++ b/build.sh @@ -33,7 +33,6 @@ DEF_CLI_VER=$(toml_get "$main_config_t" cli-version) || DEF_CLI_VER="latest" DEF_PATCHES_SRC=$(toml_get "$main_config_t" patches-source) || DEF_PATCHES_SRC="ReVanced/revanced-patches" DEF_CLI_SRC=$(toml_get "$main_config_t" cli-source) || DEF_CLI_SRC="ReVanced/revanced-cli" DEF_RV_BRAND=$(toml_get "$main_config_t" rv-brand) || DEF_RV_BRAND="ReVanced" -DEF_DPI_LIST=$(toml_get "$main_config_t" dpi) || DEF_DPI_LIST="nodpi anydpi" mkdir -p "$TEMP_DIR" "$BUILD_DIR" if [ "${2-}" = "--config-update" ]; then @@ -119,7 +118,7 @@ for table_name in $(toml_get_table_names); do fi app_args[include_stock]=$(toml_get "$t" include-stock) || app_args[include_stock]=true && vtf "${app_args[include_stock]}" "include-stock" - app_args[dpi]=$(toml_get "$t" dpi) || app_args[dpi]="$DEF_DPI_LIST" + app_args[dpi]=$(toml_get "$t" dpi) || app_args[dpi]="" table_name_f=${table_name,,} table_name_f=${table_name_f// /-} app_args[module_prop_name]=$(toml_get "$t" module-prop-name) || app_args[module_prop_name]="${table_name_f}-jhc" diff --git a/utils.sh b/utils.sh index dbf1d06..cfa4f22 100755 --- a/utils.sh +++ b/utils.sh @@ -330,10 +330,18 @@ merge_splits() { # -------------------- apkmirror -------------------- apkmirror_search() { local resp="$1" dpi="$2" arch="$3" apk_bundle="$4" - local apparch dlurl="" node app_table emptyCheck - if [ "$arch" = all ]; then - apparch=(universal noarch 'arm64-v8a + armeabi-v7a') - else apparch=("$arch" universal noarch 'arm64-v8a + armeabi-v7a'); fi + local dlurl="" node app_table emptyCheck + + local apparch=('universal' 'noarch' 'arm64-v8a + armeabi-v7a') + if [ "$arch" != all ]; then + apparch+=("$arch") + fi + + local appdpi=("nodpi" "anydpi") + if [ "$dpi" ]; then + appdpi+=("$dpi") + fi + for ((n = 1; n < 40; n++)); do node=$($HTMLQ "div.table-row.headerFont:nth-last-child($n)" -r "span:nth-child(n+3)" <<<"$resp") if [ -z "$node" ]; then break; fi @@ -343,7 +351,7 @@ apkmirror_search() { else break; fi app_table=$($HTMLQ --text --ignore-whitespace <<<"$node") if [ "$(sed -n 3p <<<"$app_table")" = "$apk_bundle" ] && - [ "$(sed -n 6p <<<"$app_table")" = "$dpi" ] && + isoneof "$(sed -n 6p <<<"$app_table")" "${appdpi[@]}" && isoneof "$(sed -n 4p <<<"$app_table")" "${apparch[@]}"; then echo "$dlurl" return 0 @@ -369,15 +377,15 @@ dl_apkmirror() { resp=$(req "$url" -) || return 1 node=$($HTMLQ "div.table-row.headerFont:nth-last-child(1)" -r "span:nth-child(n+3)" <<<"$resp") if [ "$node" ]; then - for current_dpi in $dpi; do - for type in APK BUNDLE; do - if dlurl=$(apkmirror_search "$resp" "$current_dpi" "${arch}" "$type"); then - [[ "$type" == "BUNDLE" ]] && is_bundle=true || is_bundle=false - break 2 - fi - done + for type in APK BUNDLE; do + if dlurl=$(apkmirror_search "$resp" "$dpi" "$arch" "$type"); then + if [ "$type" = "BUNDLE" ]; then + is_bundle=true + else is_bundle=false; fi + break 2 + fi done - [ -z "$dlurl" ] && return 1 + if [ -z "$dlurl" ]; then return 1; fi resp=$(req "$dlurl" -) fi url=$(echo "$resp" | $HTMLQ --base https://www.apkmirror.com --attribute href "a.btn") || return 1 @@ -421,11 +429,12 @@ get_uptodown_resp() { get_uptodown_vers() { $HTMLQ --text ".version" <<<"$__UPTODOWN_RESP__"; } dl_uptodown() { local uptodown_dlurl=$1 version=$2 output=$3 arch=$4 _dpi=$5 - local apparch if [ "$arch" = "arm-v7a" ]; then arch="armeabi-v7a"; fi - if [ "$arch" = all ]; then - apparch=('arm64-v8a, armeabi-v7a, x86_64' 'arm64-v8a, armeabi-v7a, x86, x86_64' 'arm64-v8a, armeabi-v7a') - else apparch=("$arch" 'arm64-v8a, armeabi-v7a, x86_64' 'arm64-v8a, armeabi-v7a, x86, x86_64' 'arm64-v8a, armeabi-v7a'); fi + + local apparch=('arm64-v8a, armeabi-v7a, x86_64' 'arm64-v8a, armeabi-v7a, x86, x86_64' 'arm64-v8a, armeabi-v7a') + if [ "$arch" != all ]; then + apparch+=("$arch") + fi local op resp data_code data_code=$($HTMLQ "#detail-app-name" --attribute data-code <<<"$__UPTODOWN_RESP__") @@ -493,7 +502,7 @@ get_archive_pkg_name() { echo "$__ARCHIVE_PKG_NAME__"; } # -------------------- direct -------------------- dl_direct() { - local url=$1 version=${2// /-} output=$3 arch=$4 dpi=$5 + local url=$1 version=${2// /-} output=$3 arch=$4 _dpi=$5 req "$url" "${output}" || return 1 } get_direct_vers() { cut -d- -f2 <<<"$__DIRECT_APKNAME__"; } From 3eea1d48bb74b091fd1849f3c74830dfc89e55d2 Mon Sep 17 00:00:00 2001 From: j-hc Date: Mon, 6 Apr 2026 17:53:32 +0300 Subject: [PATCH 02/19] module: fix issues occuring from stock system app being installed --- module/customize.sh | 62 +++++++++++++++++---------------------------- module/service.sh | 2 +- module/uninstall.sh | 14 ++++------ 3 files changed, 29 insertions(+), 49 deletions(-) diff --git a/module/customize.sh b/module/customize.sh index 6ce2220..5ad87a2 100755 --- a/module/customize.sh +++ b/module/customize.sh @@ -37,20 +37,29 @@ pmex() { return $RET } -if ! pmex path "$PKG_NAME" >&2; then - if pmex install-existing "$PKG_NAME" >&2; then - pmex uninstall-system-updates "$PKG_NAME" +if pmex path "$PKG_NAME" >&2; then + pmex uninstall-system-updates "$PKG_NAME" >/dev/null 2>&1 +else + if pmex install-existing "$PKG_NAME" >/dev/null 2>&1; then + pmex uninstall-system-updates "$PKG_NAME" >/dev/null 2>&1 fi fi -IS_SYS=false INS=true if BASEPATH=$(pmex path "$PKG_NAME"); then echo >&2 "'$BASEPATH'" BASEPATH=${BASEPATH##*:} BASEPATH=${BASEPATH%/*} if [ "${BASEPATH:1:4}" != data ]; then - ui_print "* $PKG_NAME is a system app." - IS_SYS=true + ui_print "* Detected $PKG_NAME as a system app" + SCNM="/data/adb/post-fs-data.d/$PKG_NAME-uninstall.sh" + mkdir -p /data/adb/post-fs-data.d + echo "mount -t tmpfs none $BASEPATH" >"$SCNM" + chmod +x "$SCNM" + ui_print "* Created the uninstall script." + ui_print "" + ui_print "* Reboot and reflash the module!" + + abort elif [ ! -f "$MODPATH/$PKG_NAME.apk" ]; then ui_print "* Stock $PKG_NAME APK was not found" VERSION=$(dumpsys package "$PKG_NAME" 2>&1 | grep -m1 versionName) VERSION="${VERSION#*=}" @@ -81,7 +90,7 @@ install() { settings put global package_verifier_enable 0 SZ=$(stat -c "%s" "$MODPATH/$PKG_NAME.apk") for IT in 1 2; do - if ! SES=$(pmex install-create --user 0 -i com.android.vending -r -d -S "$SZ"); then + if ! SES=$(pmex install-create --user 0 -i com.android.vending -r -S "$SZ"); then ui_print "ERROR: install-create failed" install_err="$SES" break @@ -96,39 +105,15 @@ install() { if ! op=$(pmex install-commit "$SES"); then ui_print "$op" if echo "$op" | grep -q -e INSTALL_FAILED_VERSION_DOWNGRADE -e INSTALL_FAILED_UPDATE_INCOMPATIBLE; then - ui_print "* Handling install error" - pmex uninstall-system-updates "$PKG_NAME" - if BASEPATH=$(pmex path "$PKG_NAME"); then - BASEPATH=${BASEPATH##*:} BASEPATH=${BASEPATH%/*} - if [ "${BASEPATH:1:4}" != data ]; then IS_SYS=true; fi - fi - if [ "$IS_SYS" = true ]; then - SCNM="/data/adb/post-fs-data.d/$PKG_NAME-uninstall.sh" - if [ -f "$SCNM" ]; then - ui_print "* Remove the old module. Reboot and reflash!" - ui_print "" - install_err=" " + ui_print "* Uninstalling..." + if ! op=$(pmex uninstall -k --user 0 "$PKG_NAME"); then + ui_print "$op" + if [ $IT = 2 ]; then + install_err="ERROR: pm uninstall failed." break fi - mkdir -p /data/adb/rvhc/empty /data/adb/post-fs-data.d - echo "mount -o bind /data/adb/rvhc/empty $BASEPATH" >"$SCNM" - chmod +x "$SCNM" - ui_print "* Created the uninstall script." - ui_print "" - ui_print "* Reboot and reflash the module!" - install_err=" " - break - else - ui_print "* Uninstalling..." - if ! op=$(pmex uninstall -k --user 0 "$PKG_NAME"); then - ui_print "$op" - if [ $IT = 2 ]; then - install_err="ERROR: pm uninstall failed." - break - fi - fi - continue fi + continue fi ui_print "ERROR: install-commit failed" install_err="$op" @@ -145,8 +130,7 @@ install() { settings put global verifier_verify_adb_installs "$VERIF1" settings put global package_verifier_enable "$VERIF2" if [ "$install_err" ]; then - ui_print "$install_err" - abort "ERROR: disable the module, reboot, install $PKG_NAME manually and reflash again" + abort "$install_err" fi } if [ $INS = true ] && ! install; then abort; fi diff --git a/module/service.sh b/module/service.sh index bd83d9e..86a7e93 100755 --- a/module/service.sh +++ b/module/service.sh @@ -25,7 +25,7 @@ run() { BASEPATH=${BASEPATH##*:} BASEPATH=${BASEPATH%/*} if [ ! -d "$BASEPATH/lib" ]; then - err "mount failed (ROM issue). Dont report this, consider using rvmm-zygisk-mount." + err "mount failed. Dont report this, consider using rvmm-zygisk-mount" return fi VERSION=$(dumpsys package "$PKG_NAME" 2>&1 | grep -m1 versionName) VERSION="${VERSION#*=}" diff --git a/module/uninstall.sh b/module/uninstall.sh index 7854a99..9e0f7b4 100755 --- a/module/uninstall.sh +++ b/module/uninstall.sh @@ -1,13 +1,9 @@ #!/system/bin/sh -{ - until [ "$(getprop sys.boot_completed)" = 1 ]; do sleep 1; done - until [ -d "/sdcard/Android" ]; do sleep 1; done +MODDIR=${0%/*} +. "$MODDIR/config" - MODDIR=${0%/*} - . "$MODDIR/config" +rm -f "/data/adb/rvhc/${MODDIR##*/}.apk" +rmdir "/data/adb/rvhc" - rm "/data/adb/rvhc/${MODDIR##*/}.apk" - rmdir "/data/adb/rvhc" - rm "/data/adb/post-fs-data.d/$PKG_NAME-uninstall.sh" -} & +rm -f "/data/adb/post-fs-data.d/$PKG_NAME-uninstall.sh" From f8292fe35bc5b95a7b22e8770046e474eb4b95a4 Mon Sep 17 00:00:00 2001 From: j-hc Date: Wed, 8 Apr 2026 18:31:40 +0300 Subject: [PATCH 03/19] update gh actions --- .github/workflows/build.yml | 45 ++++++++++++++++++++++--------------- config.toml | 27 ---------------------- 2 files changed, 27 insertions(+), 45 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 871e38e..61dc2ec 100755 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,19 +59,21 @@ jobs: cat build.md >> "$GITHUB_OUTPUT" echo "${DELIM}" >> "$GITHUB_OUTPUT" cp -f build.md build.tmp + + - name: Upload release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }} + BODY: ${{ steps.get_output.outputs.BUILD_LOG }} + run: | + if gh release view "$TAG" >/dev/null 2>&1; then + gh release edit "$TAG" --title "Release" --notes "$BODY" + gh release upload "$TAG" ./build/* --clobber + else + gh release create "$TAG" ./build/* --title "Release" --notes "$BODY" + fi - - name: Upload modules to release - uses: svenstaro/upload-release-action@v2 - with: - body: ${{ steps.get_output.outputs.BUILD_LOG }} - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ./build/* - release_name: ReVanced - tag: ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }} - file_glob: true - overwrite: true - - - name: Update changelog and update json + - name: Update modules changelog and update json id: update_config run: | git checkout -f update || git switch --discard-changes --orphan update @@ -100,12 +102,19 @@ jobs: find . -name "*-update.json" | grep . || : >dummy-update.json - - uses: stefanzweifel/git-auto-commit-action@v7 - with: - branch: update - skip_checkout: true - file_pattern: build.md *-update.json - commit_message: Bump version ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }} + - name: Commit module json changes + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + git add build.md *-update.json + + if ! git diff --cached --quiet; then + git commit -m "Bump version ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}" + git push origin HEAD:update + else + echo "no changes!" + fi - name: Report to Telegram env: diff --git a/config.toml b/config.toml index 705d2c0..1e9b3a8 100755 --- a/config.toml +++ b/config.toml @@ -58,34 +58,7 @@ apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/photos/" uptodown-dlurl = "https://google-photos.en.uptodown.com/android" archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.google.android.apps.photos" -[Spotify] -enabled = false -uptodown-dlurl = "https://spotify.en.uptodown.com/android" -archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.spotify.music" - [Twitch] enabled = false apkmirror-dlurl = "https://www.apkmirror.com/apk/twitch-interactive-inc/twitch/" uptodown-dlurl = "https://twitch.en.uptodown.com/android" -# archive-dlurl = "https://archive.org/download/jhc-apks/apks/tv.twitch.android.app" - -[Twitter] -enabled = false -apkmirror-dlurl = "https://www.apkmirror.com/apk/x-corp/twitter" -build-mode = "apk" -dpi = "120-640dpi" -# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.twitter.android" - -[TikTok] -enabled = false -# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.zhiliaoapp.musically" -included-patches = "'SIM spoof'" - -[Messenger] -enabled = false -apkmirror-dlurl = "https://www.apkmirror.com/apk/facebook-2/messenger/" -arch = "arm64-v8a" - -[IconPackStudio] -enabled = false -apkmirror-dlurl = "https://www.apkmirror.com/apk/smart-launcher-team/icon-pack-studio/" From 52e6daf18540c2106bbb206870c11dc616f28721 Mon Sep 17 00:00:00 2001 From: j-hc Date: Fri, 10 Apr 2026 20:44:01 +0300 Subject: [PATCH 04/19] module: update pm uninstall --- module/customize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/customize.sh b/module/customize.sh index 5ad87a2..eded89d 100755 --- a/module/customize.sh +++ b/module/customize.sh @@ -106,7 +106,7 @@ install() { ui_print "$op" if echo "$op" | grep -q -e INSTALL_FAILED_VERSION_DOWNGRADE -e INSTALL_FAILED_UPDATE_INCOMPATIBLE; then ui_print "* Uninstalling..." - if ! op=$(pmex uninstall -k --user 0 "$PKG_NAME"); then + if ! op=$(pmex uninstall --user 0 "$PKG_NAME"); then ui_print "$op" if [ $IT = 2 ]; then install_err="ERROR: pm uninstall failed." From 471962a40ddcf7a088aa608eb8654dcae77cd618 Mon Sep 17 00:00:00 2001 From: j-hc Date: Fri, 10 Apr 2026 21:09:09 +0300 Subject: [PATCH 05/19] add apk bundle support for check_sig and dl_archive --- sig.txt | 1 - utils.sh | 81 ++++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 53 insertions(+), 29 deletions(-) diff --git a/sig.txt b/sig.txt index e2f24c1..5bec539 100644 --- a/sig.txt +++ b/sig.txt @@ -1,5 +1,4 @@ a2a1ad7ba7f41dfca4514e2afeb90691719af6d0fdbed4b09bbf0ed897701ceb com.google.android.apps.youtube.music 3d7a1223019aa39d9ea0e3436ab7c0896bfb4fb679f4de5fe7c23f326c8f994a com.google.android.youtube 970b91143813b4c9d5f3634f672c9fcaa5621b4efaaedafd6c235cbbb869736f com.reddit.frontpage -9041803e91bcb814b4b4399fb5c85a91640b755e5e8ba76813814bf4cf2ab5ba com.zhiliaoapp.musically 1338f9b049893cc70b78432a177582f90bd4bc6296ea4ed35bcc7df59687ac53 tv.twitch.android.app diff --git a/utils.sh b/utils.sh index cfa4f22..520c185 100755 --- a/utils.sh +++ b/utils.sh @@ -366,31 +366,33 @@ apkmirror_search() { } dl_apkmirror() { local url=$1 version=${2// /-} output=$3 arch=$4 dpi=$5 is_bundle=false + if [ -f "${output}.apkm" ]; then - is_bundle=true - else - if [ "$arch" = "arm-v7a" ]; then arch="armeabi-v7a"; fi - local resp node app_table apkmname dlurl="" - apkmname=$($HTMLQ "h1.marginZero" --text <<<"$__APKMIRROR_RESP__") - apkmname="${apkmname,,}" apkmname="${apkmname// /-}" apkmname="${apkmname//[^a-z0-9-]/}" - url="${url}/${apkmname}-${version//./-}-release/" - resp=$(req "$url" -) || return 1 - node=$($HTMLQ "div.table-row.headerFont:nth-last-child(1)" -r "span:nth-child(n+3)" <<<"$resp") - if [ "$node" ]; then - for type in APK BUNDLE; do - if dlurl=$(apkmirror_search "$resp" "$dpi" "$arch" "$type"); then - if [ "$type" = "BUNDLE" ]; then - is_bundle=true - else is_bundle=false; fi - break 2 - fi - done - if [ -z "$dlurl" ]; then return 1; fi - resp=$(req "$dlurl" -) - fi - url=$(echo "$resp" | $HTMLQ --base https://www.apkmirror.com --attribute href "a.btn") || return 1 - url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "span > a[rel = nofollow]") || return 1 + merge_splits "${output}.apkm" "${output}" + return 0 fi + + if [ "$arch" = "arm-v7a" ]; then arch="armeabi-v7a"; fi + local resp node app_table apkmname dlurl="" + apkmname=$($HTMLQ "h1.marginZero" --text <<<"$__APKMIRROR_RESP__") + apkmname="${apkmname,,}" apkmname="${apkmname// /-}" apkmname="${apkmname//[^a-z0-9-]/}" + url="${url}/${apkmname}-${version//./-}-release/" + resp=$(req "$url" -) || return 1 + node=$($HTMLQ "div.table-row.headerFont:nth-last-child(1)" -r "span:nth-child(n+3)" <<<"$resp") + if [ "$node" ]; then + for type in APK BUNDLE; do + if dlurl=$(apkmirror_search "$resp" "$dpi" "$arch" "$type"); then + if [ "$type" = "BUNDLE" ]; then + is_bundle=true + else is_bundle=false; fi + break 2 + fi + done + if [ -z "$dlurl" ]; then return 1; fi + resp=$(req "$dlurl" -) + fi + url=$(echo "$resp" | $HTMLQ --base https://www.apkmirror.com --attribute href "a.btn") || return 1 + url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "span > a[rel = nofollow]") || return 1 if [ "$is_bundle" = true ]; then req "$url" "${output}.apkm" || return 1 @@ -487,9 +489,23 @@ get_uptodown_pkg_name() { $HTMLQ --text "tr.full:nth-child(1) > td:nth-child(3)" # -------------------- archive -------------------- dl_archive() { local url=$1 version=$2 output=$3 arch=$4 - local path version=${version// /} - path=$(grep "${version_f#v}-${arch// /}" <<<"$__ARCHIVE_RESP__") || return 1 - req "${url}/${path}" "$output" + local path output_m version=${version// /} + + if [ -f "${output}.apkm" ]; then + merge_splits "${output}.apkm" "$output" + return 0 + fi + + path=$(grep -m1 "${version_f#v}-${arch// /}" <<<"$__ARCHIVE_RESP__") || return 1 + if [ "${path##*.}" = "apkm" ]; then + output_m="${output}.apkm" + else + output_m=$output + fi + req "${url}/${path}" "$output_m" || return 1 + if [ "${path##*.}" = "apkm" ]; then + merge_splits "$output_m" "$output" + fi } get_archive_resp() { local r @@ -631,10 +647,19 @@ build_rv() { return 0 fi fi - if [ ! -f "${stock_apk}.apkm" ] && ! OP=$(check_sig "$stock_apk" "$pkg_name" 2>&1) && ! grep -qFx "ERROR: Missing META-INF/MANIFEST.MF" <<<"$OP"; then - epr "Not building $table, apk signature mismatch '$stock_apk': $OP" + + local sig_check_apk + if [ -f "${stock_apk}.apkm" ]; then + unzip -j "${stock_apk}.apkm" "base.apk" -d "${stock_apk}.base" >/dev/null + sig_check_apk="${stock_apk}.base/base.apk" + else + sig_check_apk="${stock_apk}" + fi + if ! sig_op=$(check_sig "$sig_check_apk" "$pkg_name" 2>&1); then + epr "Not building $table, apk signature mismatch '$stock_apk': $sig_op" return 0 fi + rm -rf "${stock_apk}.base" || : log "${table}: ${version}" local microg_patch From 7210831f75715c34f2b98977f74b1dd339cac45d Mon Sep 17 00:00:00 2001 From: j-hc <25510067+j-hc@users.noreply.github.com> Date: Sun, 12 Apr 2026 19:14:55 +0300 Subject: [PATCH 06/19] Update utils.sh --- utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.sh b/utils.sh index 520c185..fa19528 100755 --- a/utils.sh +++ b/utils.sh @@ -339,7 +339,7 @@ apkmirror_search() { local appdpi=("nodpi" "anydpi") if [ "$dpi" ]; then - appdpi+=("$dpi") + appdpi+=($dpi) fi for ((n = 1; n < 40; n++)); do From 908f8d38cccd598c0ac0c918dddecd7b61db4d0e Mon Sep 17 00:00:00 2001 From: j-hc <25510067+j-hc@users.noreply.github.com> Date: Wed, 15 Apr 2026 19:22:29 +0300 Subject: [PATCH 07/19] module: update --- module/customize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/customize.sh b/module/customize.sh index eded89d..27b556f 100755 --- a/module/customize.sh +++ b/module/customize.sh @@ -82,7 +82,6 @@ install() { if [ ! -f "$MODPATH/$PKG_NAME.apk" ]; then abort "ERROR: Stock $PKG_NAME apk was not found" fi - ui_print "* Updating $PKG_NAME to $PKG_VER" install_err="" VERIF1=$(settings get global verifier_verify_adb_installs) VERIF2=$(settings get global package_verifier_enable) @@ -90,6 +89,7 @@ install() { settings put global package_verifier_enable 0 SZ=$(stat -c "%s" "$MODPATH/$PKG_NAME.apk") for IT in 1 2; do + ui_print "* Updating $PKG_NAME to $PKG_VER" if ! SES=$(pmex install-create --user 0 -i com.android.vending -r -S "$SZ"); then ui_print "ERROR: install-create failed" install_err="$SES" @@ -106,7 +106,7 @@ install() { ui_print "$op" if echo "$op" | grep -q -e INSTALL_FAILED_VERSION_DOWNGRADE -e INSTALL_FAILED_UPDATE_INCOMPATIBLE; then ui_print "* Uninstalling..." - if ! op=$(pmex uninstall --user 0 "$PKG_NAME"); then + if ! op=$(pmex uninstall "$PKG_NAME"); then ui_print "$op" if [ $IT = 2 ]; then install_err="ERROR: pm uninstall failed." From 3b6fbd6b89cd8358f9a89a49ffcbe9a1527af689 Mon Sep 17 00:00:00 2001 From: j-hc Date: Thu, 23 Apr 2026 15:44:35 +0300 Subject: [PATCH 08/19] fix apkm sig_check --- utils.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/utils.sh b/utils.sh index fa19528..5a91697 100755 --- a/utils.sh +++ b/utils.sh @@ -371,7 +371,7 @@ dl_apkmirror() { merge_splits "${output}.apkm" "${output}" return 0 fi - + if [ "$arch" = "arm-v7a" ]; then arch="armeabi-v7a"; fi local resp node app_table apkmname dlurl="" apkmname=$($HTMLQ "h1.marginZero" --text <<<"$__APKMIRROR_RESP__") @@ -648,18 +648,23 @@ build_rv() { fi fi - local sig_check_apk + local sig_op if [ -f "${stock_apk}.apkm" ]; then - unzip -j "${stock_apk}.apkm" "base.apk" -d "${stock_apk}.base" >/dev/null - sig_check_apk="${stock_apk}.base/base.apk" + rm -rf "${stock_apk}-zip" || : + unzip -j "${stock_apk}.apkm" -d "${stock_apk}-zip" >/dev/null + for a in "${stock_apk}"-zip/*.apk; do + if ! sig_op=$(check_sig "$a" "$pkg_name" 2>&1); then + epr "Not building $table, apk signature mismatch '$a': $sig_op" + return 0 + fi + done + rm -rf "${stock_apk}-zip" || : else - sig_check_apk="${stock_apk}" - fi - if ! sig_op=$(check_sig "$sig_check_apk" "$pkg_name" 2>&1); then - epr "Not building $table, apk signature mismatch '$stock_apk': $sig_op" - return 0 + if ! sig_op=$(check_sig "$stock_apk" "$pkg_name" 2>&1); then + epr "Not building $table, apk signature mismatch '$stock_apk': $sig_op" + return 0 + fi fi - rm -rf "${stock_apk}.base" || : log "${table}: ${version}" local microg_patch From 006fa58ed3e120f18b797f3faafb49cc608cc4ec Mon Sep 17 00:00:00 2001 From: j-hc Date: Sat, 2 May 2026 21:12:22 +0300 Subject: [PATCH 09/19] module: update --- module/customize.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/customize.sh b/module/customize.sh index 27b556f..cec910e 100755 --- a/module/customize.sh +++ b/module/customize.sh @@ -37,8 +37,10 @@ pmex() { return $RET } -if pmex path "$PKG_NAME" >&2; then - pmex uninstall-system-updates "$PKG_NAME" >/dev/null 2>&1 +if OP=$(dumpsys package "$PKG_NAME") && [ "$OP" ]; then + if echo "$OP" | grep -m1 pkgFlags | grep -Fq UPDATED_SYSTEM_APP; then + pmex uninstall-system-updates "$PKG_NAME" >/dev/null 2>&1 + fi else if pmex install-existing "$PKG_NAME" >/dev/null 2>&1; then pmex uninstall-system-updates "$PKG_NAME" >/dev/null 2>&1 @@ -160,7 +162,7 @@ fi am force-stop "$PKG_NAME" ui_print "* Optimizing $PKG_NAME" -cmd package compile -m speed-profile -f "$PKG_NAME" +cmd package compile -m speed-profile -f "$PKG_NAME" >/dev/null 2>&1 # nohup cmd package compile -m speed-profile -f "$PKG_NAME" >/dev/null 2>&1 if [ "$KSU" ]; then @@ -175,7 +177,7 @@ if [ "$KSU" ]; then ui_print " $OP" ui_print "* Because you are using a fork of KernelSU, " ui_print " you need to go to your root manager app and" - ui_print " disable 'Unmount modules' option for $PKG_NAME" + ui_print " disable 'Unmount modules' for $PKG_NAME" fi else ui_print "ERROR: UID could not be found for $PKG_NAME" From 067eca2a52025ebf93ae5c072a1b710f656cb44c Mon Sep 17 00:00:00 2001 From: j-hc Date: Sat, 2 May 2026 21:12:46 +0300 Subject: [PATCH 10/19] fix get_patch_last_supported_ver --- utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.sh b/utils.sh index 5a91697..242c4f3 100755 --- a/utils.sh +++ b/utils.sh @@ -271,7 +271,7 @@ get_patch_last_supported_ver() { fi fi op=$(patches_list_versions "$cli_jar" "$patches_jar" "$pkg_name") || return 1 - op=$(sed -n '/(.* patch.*/,$p' <<<"$op" | awk '{$1=$1}1') + op=$(sed -n '/Most common compatible versions:/,$p' <<<"$op" | sed '1d' | awk '{$1=$1}1') if [ "$op" = "Any" ]; then return; fi pcount=$(head -1 <<<"$op") pcount=${pcount#*(} pcount=${pcount% *} if [ -z "$pcount" ]; then From 6e3614d04781a955e171d3fa098653292b9cda97 Mon Sep 17 00:00:00 2001 From: j-hc Date: Sat, 2 May 2026 21:29:14 +0300 Subject: [PATCH 11/19] fix patches_list_versions --- utils.sh | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/utils.sh b/utils.sh index 242c4f3..4be5e9f 100755 --- a/utils.sh +++ b/utils.sh @@ -281,14 +281,28 @@ get_patch_last_supported_ver() { } patches_list_versions() { - local cli_jar=$1 patches_jar=$2 pkg_name=$3 op - if ! op=$(java -jar "$cli_jar" list-versions -p "$patches_jar" -f "$pkg_name" -b 2>&1); then - if ! op=$(java -jar "$cli_jar" list-versions "$patches_jar" -f "$pkg_name" 2>&1); then - epr "Could not list versions $cli_jar: '$op'" - return 1 - fi + local cli_jar=$1 patches_jar=$2 pkg_name=$3 op cmd + local cmd_base="java -jar '$cli_jar' list-versions" + + # TODO: remove this later + local cli_name + cli_name=$(basename "$cli_jar") + if [ "${cli_name::8}" = revanced ]; then cmd_base+=" -b"; fi + + cmd="${cmd_base} --patches='$patches_jar' -f '$pkg_name'" + if op=$(eval "$cmd" 2>&1); then + echo "$op" + return fi - echo "$op" + + cmd="${cmd_base} '$patches_jar' -f '$pkg_name'" + if op=$(eval "$cmd" 2>&1); then + echo "$op" + return + fi + + epr "Could not list versions $cli_jar: '$op'" + return 1 } patches_list() { local cli_jar=$1 patches_jar=$2 pkg_name=$3 op From 42065dc7203884856360e76844507a116ef6cb50 Mon Sep 17 00:00:00 2001 From: j-hc Date: Sat, 2 May 2026 22:15:27 +0300 Subject: [PATCH 12/19] update apkmirror_search --- utils.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utils.sh b/utils.sh index 4be5e9f..0dd8807 100755 --- a/utils.sh +++ b/utils.sh @@ -360,12 +360,11 @@ apkmirror_search() { node=$($HTMLQ "div.table-row.headerFont:nth-last-child($n)" -r "span:nth-child(n+3)" <<<"$resp") if [ -z "$node" ]; then break; fi emptyCheck=$($HTMLQ -t -w "div.table-cell:nth-child(1) > a:nth-child(1)" <<<"$node" | xargs) - if [ "$emptyCheck" ]; then - dlurl=$($HTMLQ --base https://www.apkmirror.com --attribute href "div:nth-child(1) > a:nth-child(1)" <<<"$node") - else break; fi + if [ -z "$emptyCheck" ]; then break; fi app_table=$($HTMLQ --text --ignore-whitespace <<<"$node") - if [ "$(sed -n 3p <<<"$app_table")" = "$apk_bundle" ] && - isoneof "$(sed -n 6p <<<"$app_table")" "${appdpi[@]}" && + if [ "$(sed -n 3p <<<"$app_table")" != "$apk_bundle" ]; then continue; fi + dlurl=$($HTMLQ --base https://www.apkmirror.com --attribute href "div:nth-child(1) > a:nth-child(1)" <<<"$node") + if isoneof "$(sed -n 6p <<<"$app_table")" "${appdpi[@]}" && isoneof "$(sed -n 4p <<<"$app_table")" "${apparch[@]}"; then echo "$dlurl" return 0 From 9eb51025e17f37bd2b3b6334366906f2e353d969 Mon Sep 17 00:00:00 2001 From: j-hc Date: Sat, 2 May 2026 22:57:22 +0300 Subject: [PATCH 13/19] module: update --- module/customize.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/module/customize.sh b/module/customize.sh index cec910e..1d64d15 100755 --- a/module/customize.sh +++ b/module/customize.sh @@ -166,10 +166,10 @@ cmd package compile -m speed-profile -f "$PKG_NAME" >/dev/null 2>&1 # nohup cmd package compile -m speed-profile -f "$PKG_NAME" >/dev/null 2>&1 if [ "$KSU" ]; then - UID=$(dumpsys package "$PKG_NAME" 2>&1 | grep -m1 uid) + UID=$(dumpsys package "$PKG_NAME" 2>&1 | grep -m1 uid=) UID=${UID#*=} UID=${UID%% *} if [ -z "$UID" ]; then - UID=$(dumpsys package "$PKG_NAME" 2>&1 | grep -m1 userId) + UID=$(dumpsys package "$PKG_NAME" 2>&1 | grep -m1 userId=) UID=${UID#*=} UID=${UID%% *} fi if [ "$UID" ]; then @@ -181,7 +181,6 @@ if [ "$KSU" ]; then fi else ui_print "ERROR: UID could not be found for $PKG_NAME" - dumpsys package "$PKG_NAME" >&2 fi fi From eb4640a1fb152ee7f387176e02e5da163fe7e724 Mon Sep 17 00:00:00 2001 From: j-hc Date: Sun, 3 May 2026 16:42:05 +0300 Subject: [PATCH 14/19] add include-stock=split option and split apks support for module --- CONFIG.md | 2 +- build.sh | 7 ++++- module/customize.sh | 63 +++++++++++++++++++++++++-------------------- utils.sh | 61 ++++++++++++++++++++++++++++++++----------- 4 files changed, 88 insertions(+), 45 deletions(-) diff --git a/CONFIG.md b/CONFIG.md index 4c95c56..e1a9201 100755 --- a/CONFIG.md +++ b/CONFIG.md @@ -52,7 +52,7 @@ excluded-patches = """\ """ included-patches = "'Some Patch'" # whitespace seperated list of non-default patches to include. default: "" -include-stock = true # includes stock apk in the module. default: true +include-stock = "merged" # 'merged', 'split' or 'disable'. default: merged exclusive-patches = false # exclude all patches by default. default: false apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app" diff --git a/build.sh b/build.sh index beab089..f5d57d1 100755 --- a/build.sh +++ b/build.sh @@ -100,6 +100,11 @@ for table_name in $(toml_get_table_names); do abort "ERROR: build-mode '${app_args[build_mode]}' is not a valid option for '${table_name}': only 'both', 'apk' or 'module' is allowed" fi } || app_args[build_mode]=apk + app_args[include_stock]=$(toml_get "$t" include-stock) && { + if ! isoneof "${app_args[include_stock]}" disable merged split; then + abort "ERROR: include-stock '${app_args[include_stock]}' is not a valid option for '${table_name}': only 'disable', 'merged' or 'split' is allowed" + fi + } || app_args[include_stock]=merged for dl_from in "${DL_SRCS[@]}"; do if app_args[${dl_from}_dlurl]=$(toml_get "$t" "${dl_from}-dlurl"); then @@ -117,7 +122,7 @@ for table_name in $(toml_get_table_names); do abort "wrong arch '${app_args[arch]}' for '$table_name'" fi - app_args[include_stock]=$(toml_get "$t" include-stock) || app_args[include_stock]=true && vtf "${app_args[include_stock]}" "include-stock" + app_args[pkg_name]=$(toml_get "$t" pkg-name) || app_args[pkg_name]="" app_args[dpi]=$(toml_get "$t" dpi) || app_args[dpi]="" table_name_f=${table_name,,} table_name_f=${table_name_f// /-} diff --git a/module/customize.sh b/module/customize.sh index 1d64d15..3117d8e 100755 --- a/module/customize.sh +++ b/module/customize.sh @@ -60,28 +60,29 @@ if BASEPATH=$(pmex path "$PKG_NAME"); then ui_print "* Created the uninstall script." ui_print "" ui_print "* Reboot and reflash the module!" - abort - elif [ ! -f "$MODPATH/$PKG_NAME.apk" ]; then - ui_print "* Stock $PKG_NAME APK was not found" - VERSION=$(dumpsys package "$PKG_NAME" 2>&1 | grep -m1 versionName) VERSION="${VERSION#*=}" - if [ "$VERSION" = "$PKG_VER" ] || [ -z "$VERSION" ]; then - ui_print "* Skipping stock installation" - INS=false - else - abort "ERROR: Version mismatch - installed: $VERSION - module: $PKG_VER - " - fi - elif "${MODPATH:?}/bin/$ARCH/cmpr" "$BASEPATH/base.apk" "$MODPATH/$PKG_NAME.apk"; then - ui_print "* $PKG_NAME is up-to-date" + fi + + VERSION=$(dumpsys package "$PKG_NAME" 2>&1 | grep -m1 versionName=) VERSION="${VERSION#*=}" + if [ "$VERSION" ] && [ "$VERSION" = "$PKG_VER" ]; then + ui_print "* $PKG_NAME is up-to-date ($VERSION)" INS=false + elif [ ! -f "$MODPATH/stock/base.apk" ]; then + ui_print "ERROR: Version mismatch + installed: '$VERSION' + module: '$PKG_VER'" + abort fi + + # TODO: + # elif "${MODPATH:?}/bin/$ARCH/cmpr" "$BASEPATH/base.apk" "$MODPATH/$PKG_NAME.apk"; then + # ui_print "* $PKG_NAME is up-to-date" + # INS=false + # fi fi install() { - if [ ! -f "$MODPATH/$PKG_NAME.apk" ]; then + if [ ! -f "$MODPATH/stock/base.apk" ]; then abort "ERROR: Stock $PKG_NAME apk was not found" fi install_err="" @@ -89,7 +90,8 @@ install() { VERIF2=$(settings get global package_verifier_enable) settings put global verifier_verify_adb_installs 0 settings put global package_verifier_enable 0 - SZ=$(stat -c "%s" "$MODPATH/$PKG_NAME.apk") + + SZ=$(stat -c "%s" "$MODPATH/stock/base.apk" | awk '{sum += $0} END {print sum}') for IT in 1 2; do ui_print "* Updating $PKG_NAME to $PKG_VER" if ! SES=$(pmex install-create --user 0 -i com.android.vending -r -S "$SZ"); then @@ -98,12 +100,17 @@ install() { break fi SES=${SES#*[} SES=${SES%]*} - set_perm "$MODPATH/$PKG_NAME.apk" 1000 1000 644 u:object_r:apk_data_file:s0 - if ! op=$(pmex install-write -S "$SZ" "$SES" "$PKG_NAME.apk" "$MODPATH/$PKG_NAME.apk"); then - ui_print "ERROR: install-write failed" - install_err="$op" - break - fi + + for apki in "$MODPATH/stock"/*.apk; do + set_perm "${apki}" 1000 1000 644 u:object_r:apk_data_file:s0 + if ! op=$(pmex install-write -S "$SZ" "$SES" "$(basename "${apki}")" "${apki}"); then + ui_print "ERROR: install-write failed" + install_err="$op" + break + fi + done + if [ "$install_err" ]; then break; fi + if ! op=$(pmex install-commit "$SES"); then ui_print "$op" if echo "$op" | grep -q -e INSTALL_FAILED_VERSION_DOWNGRADE -e INSTALL_FAILED_UPDATE_INCOMPATIBLE; then @@ -140,11 +147,11 @@ BASEPATHLIB=${BASEPATH}/lib/${ARCH} if [ $INS = true ] || [ -z "$(ls -A1 "$BASEPATHLIB")" ]; then ui_print "* Extracting native libs" if [ ! -d "$BASEPATHLIB" ]; then mkdir -p "$BASEPATHLIB"; else rm -f "$BASEPATHLIB"/* >/dev/null 2>&1 || :; fi - if ! op=$(unzip -o -j "$MODPATH/$PKG_NAME.apk" "lib/${ARCH_LIB}/*" -d "$BASEPATHLIB" 2>&1); then - ui_print "ERROR: extracting native libs failed" - abort "$op" + if op=$(unzip -o -j "$MODPATH/stock/base.apk" "lib/${ARCH_LIB}/*" -d "$BASEPATHLIB" 2>&1); then + set_perm_recursive "${BASEPATH}/lib" 1000 1000 755 755 u:object_r:apk_data_file:s0 + else + echo >&2 "ERROR: extracting native libs failed: '$op'" fi - set_perm_recursive "${BASEPATH}/lib" 1000 1000 755 755 u:object_r:apk_data_file:s0 fi ui_print "* Setting Permissions" @@ -184,7 +191,7 @@ if [ "$KSU" ]; then fi fi -rm -rf "${MODPATH:?}/bin" "$MODPATH/$PKG_NAME.apk" +rm -rf "${MODPATH:?}/bin" "$MODPATH/stock/" ui_print "* Done" ui_print " by j-hc (github.com/j-hc)" diff --git a/utils.sh b/utils.sh index 0dd8807..35eb467 100755 --- a/utils.sh +++ b/utils.sh @@ -585,17 +585,22 @@ build_rv() { [ "${args[exclusive_patches]}" = true ] && p_patcher_args+=("--exclusive") local tried_dl=() - for dl_p in "${DL_SRCS[@]}"; do - if [ -z "${args[${dl_p}_dlurl]}" ]; then continue; fi - if ! get_${dl_p}_resp "${args[${dl_p}_dlurl]}" || ! pkg_name=$(get_"${dl_p}"_pkg_name); then - args[${dl_p}_dlurl]="" - epr "ERROR: Could not find ${table} in ${dl_p}" - continue - fi - tried_dl+=("$dl_p") - dl_from=$dl_p - break - done + if [ "${args[pkg_name]}" ]; then + pkg_name="${args[pkg_name]}" + else + for dl_p in "${DL_SRCS[@]}"; do + if [ -z "${args[${dl_p}_dlurl]}" ]; then continue; fi + if ! get_${dl_p}_resp "${args[${dl_p}_dlurl]}" || ! pkg_name=$(get_"${dl_p}"_pkg_name); then + args[${dl_p}_dlurl]="" + epr "ERROR: Could not find ${table} in ${dl_p}" + continue + fi + tried_dl+=("$dl_p") + dl_from=$dl_p + break + done + fi + if [ -z "$pkg_name" ]; then epr "empty pkg name, not building ${table}." return 0 @@ -724,7 +729,9 @@ build_rv() { zip -d "$stock_apk_to_patch" "lib/x86_64/*" "lib/x86/*" >/dev/null 2>&1 || : fi fi - if [ "${NORB:-}" != true ] || [ ! -f "$patched_apk" ]; then + + local apk_output="${BUILD_DIR}/${app_name_l}-${rv_brand_f}-v${version_f}-${arch_f}.apk" + if [ "${NORB:-}" = false ] || { [ ! -f "$patched_apk" ] && [ ! -f "$apk_output" ]; }; then if ! patch_apk "$stock_apk_to_patch" "$patched_apk" "${patcher_args[*]}" "${args[cli]}" "${args[ptjar]}"; then epr "Building '${table}' failed!" return 0 @@ -732,8 +739,9 @@ build_rv() { fi rm "$stock_apk_to_patch" if [ "$build_mode" = apk ]; then - local apk_output="${BUILD_DIR}/${app_name_l}-${rv_brand_f}-v${version_f}-${arch_f}.apk" - mv -f "$patched_apk" "$apk_output" + if [ "${NORB:-}" = false ] || { [ ! -f "$patched_apk" ] && [ ! -f "$apk_output" ]; }; then + mv -f "$patched_apk" "$apk_output" + fi pr "Built ${table} (non-root): '${apk_output}'" continue fi @@ -756,7 +764,30 @@ build_rv() { local module_output="${app_name_l}-${rv_brand_f}-module-v${version_f}-${arch_f}.zip" pr "Packing module ${table}" cp -f "$patched_apk" "${base_template}/base.apk" - if [ "${args[include_stock]}" = true ]; then cp -f "$stock_apk" "${base_template}/${pkg_name}.apk"; fi + + if [ "${args[include_stock]}" != "disable" ]; then + mkdir -p "${base_template}/stock/" + if [ "${args[include_stock]}" = "merged" ]; then + cp -f "$stock_apk" "${base_template}/stock/base.apk" + elif [ "${args[include_stock]}" = "split" ]; then + if [ ! -f "${stock_apk}.apkm" ]; then + epr "Cannot include as 'split' because stock apk of $table_name is not a bundle" + return 0 + fi + if [ "$arch" = "arm64-v8a" ]; then + unzip -j "${stock_apk}.apkm" '*.apk' -x '*x86_64.apk' -x '*x86.apk' -x '*armeabi_v7a.apk' -d "${base_template}/stock/" >/dev/null 2>&1 + elif [ "$arch" = "arm-v7a" ]; then + unzip -j "${stock_apk}.apkm" '*.apk' -x '*x86_64.apk' -x '*x86.apk' -x '*arm64_v8a.apk' -d "${base_template}/stock/" >/dev/null 2>&1 + elif [ "$arch" = "x86" ]; then + unzip -j "${stock_apk}.apkm" '*.apk' -x '*x86_64.apk' -x '*arm64_v8a.apk' -x '*armeabi_v7a.apk' -d "${base_template}/stock/" >/dev/null 2>&1 + elif [ "$arch" = "x86_64" ]; then + unzip -j "${stock_apk}.apkm" '*.apk' -x '*x86.apk' -x '*arm64_v8a.apk' -x '*armeabi_v7a.apk' -d "${base_template}/stock/" >/dev/null 2>&1 + else + unzip -j "${stock_apk}.apkm" '*.apk' -x '*x86_64.apk' -x '*x86.apk' -d "${base_template}/stock/" >/dev/null 2>&1 + fi + fi + fi + pushd >/dev/null "$base_template" || abort "Module template dir not found" zip -"$COMPRESSION_LEVEL" -FSqr "${CWD}/${BUILD_DIR}/${module_output}" . popd >/dev/null || : From 6bfb0c4c19c1e760d16bafbfb092f90b2fa7e297 Mon Sep 17 00:00:00 2001 From: j-hc Date: Sun, 3 May 2026 16:42:35 +0300 Subject: [PATCH 15/19] add Twitter piko in the config --- config.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config.toml b/config.toml index 1e9b3a8..5346ffb 100755 --- a/config.toml +++ b/config.toml @@ -51,6 +51,16 @@ archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.reddit.frontpage uptodown-dlurl = "https://reddit-official-app.en.uptodown.com/android" dpi = "120-640dpi" +[Twitter] +patches-source = "crimera/piko" +cli-source = "MorpheApp/morphe-cli" +rv-brand = "Piko" +apkmirror-dlurl = "https://www.apkmirror.com/apk/x-corp/twitter/" +archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.twitter.android" +build-mode = "module" +version = "11.81.0-release.0" +include-stock = "split" + [GooglePhotos] build-mode = "both" arch = "both" From 5e2d728c683b60e7a42b0f54511bdc59dbb9e3a8 Mon Sep 17 00:00:00 2001 From: j-hc Date: Sun, 3 May 2026 19:11:54 +0300 Subject: [PATCH 16/19] module: typo --- module/customize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/customize.sh b/module/customize.sh index 3117d8e..872bd73 100755 --- a/module/customize.sh +++ b/module/customize.sh @@ -91,7 +91,7 @@ install() { settings put global verifier_verify_adb_installs 0 settings put global package_verifier_enable 0 - SZ=$(stat -c "%s" "$MODPATH/stock/base.apk" | awk '{sum += $0} END {print sum}') + SZ=$(stat -c "%s" "$MODPATH"/stock/*.apk | awk '{sum += $0} END {print sum}') for IT in 1 2; do ui_print "* Updating $PKG_NAME to $PKG_VER" if ! SES=$(pmex install-create --user 0 -i com.android.vending -r -S "$SZ"); then From 4d5a755192b87706ceaa18774edc60e5b1283e7c Mon Sep 17 00:00:00 2001 From: j-hc Date: Mon, 4 May 2026 18:28:04 +0300 Subject: [PATCH 17/19] get_prebuilts fix minor bug --- .gitignore | 1 + utils.sh | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 7cb0124..1307bf0 100755 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ test* /logs build.md cmpr +*-temporary-files diff --git a/utils.sh b/utils.sh index 35eb467..bdefbba 100755 --- a/utils.sh +++ b/utils.sh @@ -89,6 +89,11 @@ get_prebuilts() { local url file tag_name matches file=$(find "$dir" -name "*${fprefix}-${name_ver#v}.*" -type f 2>/dev/null) + if [ "$ver" = "latest" ]; then + file=$(grep -v '/[^/]*dev[^/]*$' <<<"$file" | head -1) + else + file=$(grep "/[^/]*${ver#v}[^/]*\$" <<<"$file" | head -1) + fi if [ -z "$file" ]; then local resp asset name resp=$(gh_req "$rv_rel" -) || return 1 @@ -115,11 +120,6 @@ get_prebuilts() { echo "$tag: $(cut -d/ -f1 <<<"$src")/${name} " >>"${cl_dir}/changelog.md" else grab_cl=false - 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%.*} From dd308423ee79db378812f8a61f878f6c04d79037 Mon Sep 17 00:00:00 2001 From: j-hc Date: Mon, 4 May 2026 18:35:53 +0300 Subject: [PATCH 18/19] fix NORB --- utils.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.sh b/utils.sh index bdefbba..72c41e6 100755 --- a/utils.sh +++ b/utils.sh @@ -731,7 +731,7 @@ build_rv() { fi local apk_output="${BUILD_DIR}/${app_name_l}-${rv_brand_f}-v${version_f}-${arch_f}.apk" - if [ "${NORB:-}" = false ] || { [ ! -f "$patched_apk" ] && [ ! -f "$apk_output" ]; }; then + if [ "${NORB:-}" != true ] || { [ ! -f "$patched_apk" ] && [ ! -f "$apk_output" ]; }; then if ! patch_apk "$stock_apk_to_patch" "$patched_apk" "${patcher_args[*]}" "${args[cli]}" "${args[ptjar]}"; then epr "Building '${table}' failed!" return 0 @@ -739,7 +739,7 @@ build_rv() { fi rm "$stock_apk_to_patch" if [ "$build_mode" = apk ]; then - if [ "${NORB:-}" = false ] || { [ ! -f "$patched_apk" ] && [ ! -f "$apk_output" ]; }; then + if [ "${NORB:-}" != true ] || { [ ! -f "$patched_apk" ] && [ ! -f "$apk_output" ]; }; then mv -f "$patched_apk" "$apk_output" fi pr "Built ${table} (non-root): '${apk_output}'" From 4d9aefdd466566cda943e525cf9e0ade902b051a Mon Sep 17 00:00:00 2001 From: j-hc Date: Mon, 4 May 2026 18:44:02 +0300 Subject: [PATCH 19/19] fix abort --- utils.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils.sh b/utils.sh index 72c41e6..7f831b6 100755 --- a/utils.sh +++ b/utils.sh @@ -47,8 +47,10 @@ wpr() { } abort() { epr "ABORT: ${1-}" - rm -rf ./${TEMP_DIR}/*tmp.* ./${TEMP_DIR}/*/*tmp.* ./${TEMP_DIR}/*-temporary-files - kill -n 9 0 + rm -rf ./${TEMP_DIR}/*tmp.* ./${TEMP_DIR}/*/*tmp.* ./${TEMP_DIR}/*-temporary-files ./*-temporary-files + trap - SIGTERM SIGINT EXIT + kill -- -$$ 2>/dev/null + exit 1 } java() { env -i java --enable-native-access=ALL-UNNAMED "$@"; }