You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NanoDroid/Full/system/xbin/nanodroid-upd

68 lines
1.3 KiB
Bash

#!/system/bin/sh
APK_DIR=/sdcard/nanodroid_apks
nlx="https://www.nanolx.org/apk"
update_apk () {
if $(which wget >/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}
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"
;;
bt | bucket )
update_apk app/Bucket/Bucket.apk "${nlx}/Bucket.apk"
;;
* )
echo "nanodroid-upd
Utility to update custon NanoDroid apks
Usage: nanodroid-upd <apk>
short | long apk name
ps | playstore
fs | fakestore
mpv | MPV
bt | Bucket (LibreSubstratum)"
;;
esac