From 820a7cc3408372b9f49542629c6ba46cbb007396 Mon Sep 17 00:00:00 2001 From: j-hc Date: Thu, 27 Jul 2023 12:02:53 +0300 Subject: [PATCH 1/3] fix dl_apkmirror --- utils.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils.sh b/utils.sh index 1279348..2b4d03e 100755 --- a/utils.sh +++ b/utils.sh @@ -125,7 +125,7 @@ _req() { while [ -f "$dlp" ]; do sleep 1; done return fi - wget -nv -O "$dlp" --header="$3" "$1" + wget -nv -O "$dlp" --header="$3" "$1" || return 1 mv -f "$dlp" "$2" fi } @@ -195,14 +195,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() { From 9702eb8dae20ea31e6e9e92d54b66e6804e9811a Mon Sep 17 00:00:00 2001 From: j-hc Date: Thu, 27 Jul 2023 12:38:31 +0300 Subject: [PATCH 2/3] update module scripts --- scripts/customize.sh | 3 ++- scripts/service.sh | 5 +++-- scripts/uninstall.sh | 13 +++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/customize.sh b/scripts/customize.sh index 1bd4242..a4cc098 100755 --- a/scripts/customize.sh +++ b/scripts/customize.sh @@ -94,7 +94,7 @@ set_perm $MODPATH/base.apk 1000 1000 644 u:object_r:apk_data_file:s0 ui_print "* Mounting __PKGNAME" mkdir -p $NVBASE/rvhc -RVPATH=$NVBASE/rvhc/__PKGNAME_rv.apk +RVPATH=$NVBASE/rvhc/${MODPATH##*/}.apk mv -f $MODPATH/base.apk $RVPATH if ! op=$(nsenter -t1 -m -- mount -o bind $RVPATH $BASEPATH/base.apk 2>&1); then @@ -107,6 +107,7 @@ nohup cmd package compile --reset __PKGNAME >/dev/null 2>&1 & ui_print "* Cleanup" rm -rf $MODPATH/bin $MODPATH/__PKGNAME.apk +rm -rf $NVBASE/rvhc/__PKGNAME_rv.apk # rm this later for s in "uninstall.sh" "service.sh"; do sed -i "2 i\NVBASE=${NVBASE}" $MODPATH/$s diff --git a/scripts/service.sh b/scripts/service.sh index 7593e4e..01d0cc3 100755 --- a/scripts/service.sh +++ b/scripts/service.sh @@ -1,15 +1,16 @@ #!/system/bin/sh # shellcheck disable=SC2086 MODDIR=${0%/*} -RVPATH=${NVBASE}/rvhc/__PKGNAME_rv.apk +RVPATH=$NVBASE/rvhc/${MODDIR##*/}.apk until [ "$(getprop sys.boot_completed)" = 1 ]; do sleep 1; done +until [ -d "/sdcard/Android" ]; do sleep 1; done while BASEPATH=$(pm path __PKGNAME) svcl=$? [ $svcl = 20 ] do sleep 2; done -sleep 4 +sleep 5 err() { [ ! -f $MODDIR/err ] && cp $MODDIR/module.prop $MODDIR/err diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 1cd9079..e83f7ca 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -1,10 +1,11 @@ #!/system/bin/sh { - rm $NVBASE/rvhc/__PKGNAME_rv.apk + MODDIR=${0%/*} + rm $NVBASE/rvhc/${MODDIR##*/}.apk rmdir $NVBASE/rvhc - if __ISBNDL; then - until [ "$(getprop sys.boot_completed)" = 1 ]; do sleep 1; done - sleep 15 - pm uninstall __PKGNAME - fi + # if __ISBNDL; then + # until [ "$(getprop sys.boot_completed)" = 1 ]; do sleep 1; done + # sleep 15 + # pm uninstall __PKGNAME + # fi } & From 243ddad2f9c33a7c31df8c245833f7c23869bb57 Mon Sep 17 00:00:00 2001 From: j-hc <25510067+j-hc@users.noreply.github.com> Date: Thu, 27 Jul 2023 12:46:56 +0300 Subject: [PATCH 3/3] Update config.toml --- config.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/config.toml b/config.toml index bdc8209..f9d5809 100755 --- a/config.toml +++ b/config.toml @@ -39,12 +39,9 @@ apkmirror-arch = "both" [Twitter] build-mode = "apk" -excluded-patches = "hide-views-stats" -version = "auto" apkmirror-dlurl = "https://www.apkmirror.com/apk/twitter-inc/twitter/" [Twitch] -build-mode = "apk" apkmirror-dlurl = "https://www.apkmirror.com/apk/twitch-interactive-inc/twitch/" [TikTok]