Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
NoName-exe authored Jul 27, 2023
2 parents 3a4c893 + 243ddad commit 5426e66
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
3 changes: 2 additions & 1 deletion scripts/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions scripts/service.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 7 additions & 6 deletions scripts/uninstall.sh
Original file line number Diff line number Diff line change
@@ -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
} &
8 changes: 4 additions & 4 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 5426e66

Please sign in to comment.