2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-11-09 19:10:30 +00:00
NanoDroid/Full/system/xbin/nanodroid-upd

73 lines
1.4 KiB
Plaintext
Raw Normal View History

2018-03-15 19:38:17 +00:00
#!/system/bin/sh
APK_DIR=/sdcard/nanodroid_apks
nlx="https://www.nanolx.org/apk"
update_apk () {
if $(busybox wget --help 2>/dev/null); then
2018-03-15 19:38:17 +00:00
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}"
2018-03-15 19:38:17 +00:00
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"
#;;
2018-03-15 19:38:17 +00:00
2018-03-18 10:41:45 +00:00
mpv | MPV )
update_apk app/MPV/MPV.apk "${nlx}/MPV.apk"
;;
2018-03-15 19:38:17 +00:00
fs | fakestore )
update_apk priv-app/FakeStore/FakeStore.apk "${nlx}/FakeStore.apk"
;;
2018-08-09 19:14:37 +00:00
mg | microG )
update_apk priv-app/GmsCore/GmsCore.apk "${nlx}/GmsCore.apk"
;;
dg | DroidGuard )
update_apk priv-app/DroidGuard/DroidGuard.apk "${nlx}/DroidGuard.apk"
;;
2018-03-15 19:38:17 +00:00
* )
echo "nanodroid-upd
Utility to update custon NanoDroid apks
Usage: nanodroid-upd <apk>
short | long apk name
ps | playstore
2018-03-18 10:41:45 +00:00
fs | fakestore
2018-08-09 19:14:37 +00:00
mpv | MPV
mg | microG
dg | DroidGuard"
2018-03-15 19:38:17 +00:00
;;
esac