2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-11-09 19:10:30 +00:00
NanoDroid/Full/system/xbin/nanodroid-upd
Christopher Roy Bratusek dfc6c29c25 Revert "nupd: minor change"
This reverts commit f8bfecf9f8
2018-09-07 17:13:24 +02:00

73 lines
1.4 KiB
Bash
Executable File

#!/system/bin/sh
APK_DIR=/sdcard/nanodroid_apks
nlx="https://www.nanolx.org/apk"
update_apk () {
if $(busybox wget --help 2>/dev/null); then
mkdir -p ${APK_DIR}
apk=${1}
apk_p=$(basename ${apk} .apk)
apk_o=$(basename ${apk})
if [[ -f ${MODPATH}/system/${apk} ]]; then
echo -e "\nUpdating: ${apk_p}"
rm -f ${APK_DIR}/${apk_o}
busybox wget ${2} -O ${APK_DIR}/${apk_o} || error "failed to download ${apk_p}"
pm install -r ${APK_DIR}/${apk_o} || error "failed to install ${apk_p}"
fi
else
error "wget is not installed, install Busybox"
fi
}
error () {
echo "!! ${@}"
exit 1
}
[[ $(whoami) != "root" ]] && error "not running as root"
case ${1} in
ps | playstore )
update_apk priv-app/Phonesky/Phonesky.apk "${nlx}/Phonesky.apk"
;;
#ol | openlauncher )
# update_apk app/OpenLauncher/OpenLauncher.apk "${nlx}/OpenLauncher.apk"
#;;
mpv | MPV )
update_apk app/MPV/MPV.apk "${nlx}/MPV.apk"
;;
fs | fakestore )
update_apk priv-app/FakeStore/FakeStore.apk "${nlx}/FakeStore.apk"
;;
mg | microG )
update_apk priv-app/GmsCore/GmsCore.apk "${nlx}/GmsCore.apk"
;;
dg | DroidGuard )
update_apk priv-app/DroidGuard/DroidGuard.apk "${nlx}/DroidGuard.apk"
;;
* )
echo "nanodroid-upd
Utility to update custon NanoDroid apks
Usage: nanodroid-upd <apk>
short | long apk name
ps | playstore
fs | fakestore
mpv | MPV
mg | microG
dg | DroidGuard"
;;
esac