2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-10-31 09:20:23 +00:00

nupd is gone in favor of a F-Droid Repository

This commit is contained in:
Christopher Roy Bratusek 2018-10-02 09:35:03 +02:00
parent 75856bc5ea
commit f7f6812564
5 changed files with 13 additions and 278 deletions

View File

@ -854,9 +854,9 @@ install_bash () {
install_nanodroidscripts () {
ui_print " << with NanoDroid Scripts"
for script in npem nupd nutl novl \
nanodroid-perm nanodroid-upd \
nanodroid-util nanodroid-overlay; do
for script in npem nutl novl \
nanodroid-perm nanodroid-util \
nanodroid-overlay; do
nanodroid_install_file xbin/${script} bin
done

View File

@ -1,221 +0,0 @@
#!/system/bin/sh
export NO_MAGISK=0
export MODPATH=@MODPATH@
if [ -z "${MODPATH}" ]; then
OVERLAY_PATH=""
NO_MAGISK=1
elif [ -d "/dev/tmp/magisk_img/$(basename "${MODPATH}")" ]; then
OVERLAY_PATH="/dev/tmp/magisk_img/$(basename "${MODPATH}")"
elif [ -d "${MODPATH}" ]; then
OVERLAY_PATH="${MODPATH}"
else
echo "couldn't find NanoDroid!"
exit 1
fi
error () {
echo "!! ${@}"
exit 1
}
show_help () {
echo "nanodroid-overlay
Magisk Mode: Manages Overlays (Pseudo Debloat feature)
System Mode: Manages Moved-Outs (Force Debloat feature)
Options:
-a | --add [appname] add override for app [appname]
-r | --remove [appname] remove override for app [appname]
-s | --show show non-overriden /system applications
-l | --list show all overriden /system applications
-x | --create create all overrides
-u | --update update all overrides (= clear + create)
-c | --clear remove all overrides
-g | --genconfig (re-)create configuration from existing overrides
"
exit 0
}
test "$(whoami)" != "root" && error "not running as root"
get_config () {
config=""
config_exists=0
for path in ${config_locations}; do
if test -r "${path}/${1}" -a -f "${path}/${1}"; then
config="${path}/${1}"
config_exists=1
return
fi
done
}
overrides_add_intern () {
sysdir=${1}
app=${2}
if [[ ${NO_MAGISK} -eq 0 ]]; then
echo " creating overlay: ${app}"
mkdir -p "${OVERLAY_PATH}/system/${sysdir}/${app}"
touch "${OVERLAY_PATH}/system/${sysdir}/${app}/.replace"
else
mkdir -p "/sdcard/nanodroid_backups/${sysdir}"
echo " moving to /sdcard/nanodroid_backups: ${app}"
rm -rf "/sdcard/nanodroid_backups/${sysdir}/${app}"
mv "/system/${sysdir}/${app}" "/sdcard/nanodroid_backups/${sysdir}/"
fi
grep -q "^${app}" "${config}" || echo "${app}" >> "${config}"
}
overrides_add () {
for app in ${@}; do
[ -d /system/app/${app} ] && overrides_add_intern app ${app}
[ -d /system/priv-app/${app} ] && overrides_add_intern priv-app ${app}
done
}
overrides_remove_intern () {
sysdir=${1}
app=${2}
if [[ ${NO_MAGISK} -eq 0 ]]; then
echo " removing overlay: ${app}"
rm -rf "${OVERLAY_PATH}/system/${sysdir}/${app}"
else
if [[ -d /system/${sysdir}/${app} ]]; then
echo " removing old backup: ${app}"
rm -rf "/sdcard/nanodroid_backups/${sysdir}/${app}"
else
echo " reinstalling: ${app}"
mv "/sdcard/nanodroid_backups/${sysdir}/${app}" "/system/${sysdir}/"
fi
fi
sed -e "/^${app}$/d" -i "${config}"
}
overrides_remove () {
for app in ${@}; do
if [[ ${NO_MAGISK} -eq 0 ]]; then
[ -f ${OVERLAY_PATH}/system/app/${app}/.replace ] && overrides_remove_intern app ${app}
[ -f ${OVERLAY_PATH}/system/priv-app/${app}/.replace ] && overrides_remove_intern priv-app ${app}
else
[ -d /sdcard/nanodroid_backups/app/${app} ] && overrides_remove_intern app ${app}
[ -d /sdcard/nanodroid_backups/priv-app/${app} ] && overrides_remove_intern priv-app ${app}
fi
done
}
overrides_list () {
if [[ ${NO_MAGISK} -eq 0 ]]; then
echo "Overrides for /system/app:"
for app in $(find "${OVERLAY_PATH}/system/app" -name "*.replace"); do
echo " * $(basename $(dirname "${app}"))"
done
echo "Overrides for /system/priv-app:"
for app in $(find "${OVERLAY_PATH}/system/priv-app" -name "*.replace"); do
echo " * $(basename $(dirname "${app}"))"
done
else
echo "Moved-Out apps from /system/app:"
for app in $(find "/sdcard/nanodroid_backups/app" -mindepth 1 -maxdepth 1 -type d); do
echo " * $(basename $(dirname "${app}"))"
done
echo "Moved-Out apps from /system/priv-app:"
for app in $(find "/sdcard/nanodroid_backups/priv-app" -mindepth 1 -maxdepth 1 -type d); do
echo " * $(basename $(dirname "${app}"))"
done
fi
}
overrides_list_non () {
if [[ ${NO_MAGISK} -eq 0 ]]; then
echo "non-overriden apps from /system/app:"
for app in $(find "/system/app" -mindepth 1 -maxdepth 1 -type d); do
[[ ! -f ${OVERLAY_PATH}/${app}/.replace ]] && echo " * $(basename ${app})"
done
echo "non-overriden apps from /system/priv-app:"
for app in $(find "/system/priv-app" -mindepth 1 -maxdepth 1 -type d); do
[[ ! -f ${OVERLAY_PATH}/${app}/.replace ]] && echo " * $(basename ${app})"
done
else
echo "non-moved-out apps from /system/app:"
for app in $(find "/system/app" -mindepth 1 -maxdepth 1 -type d); do
echo " * $(basename ${app})"
done
echo "non-moved-out apps from /system/priv-app:"
for app in $(find "/system/priv-app" -mindepth 1 -maxdepth 1 -type d); do
echo " * $(basename ${app})"
done
fi
}
overrides_clear () {
if [[ ${NO_MAGISK} -eq 0 ]]; then
echo " removing Overlays from ${OVERLAY_PATH}"
for app in $(find "${OVERLAY_PATH}/system/app" -name "*.replace") \
$(find "${OVERLAY_PATH}/system/priv-app" -name "*.replace"); do
echo " removing override: $(basename $(dirname ${app}))"
rm -rf "$(dirname "${app}")"
done
else
echo " overrides_clear() does nothing in System Mode!"
fi
}
overrides_genconfig () {
if [[ ${NO_MAGISK} -eq 0 ]]; then
rm -f ${config}
export config="/data/.nanodroid-overlay"
for app in $(find "${OVERLAY_PATH}/system/app" -name "*.replace") \
$(find "${OVERLAY_PATH}/system/priv-app" -name "*.replace"); do
xapp=$(basename $(dirname ${app}))
echo " adding ${xapp} to configuration"
grep -q "^${xapp}$" "${config}" || echo "${xapp}" >> "${config}"
done
else
echo " overrides_genconfig() does nothing in System Mode!"
fi
}
# check for configuration files
config_locations="/sdcard /external_sd @ZIPDIR@ /data /dev/tmp/install"
get_config .nanodroid-overlay
if [[ -f ${config} ]]; then
export config
else overrides_genconfig
fi
opt=${1}
[[ -z ${opt} ]] && show_help || shift
case ${opt} in
-l | --list ) overrides_list ;;
-a | --add ) overrides_add "${@}" ;;
-r | --remove ) overrides_remove "${@}" ;;
-s | --show ) overrides_list_non ;;
-c | --clear ) overrides_clear ;;
-x | --create ) overrides_add "$(cat "${config}")" ;;
-g | --genconfig ) overrides_genconfig ;;
-u | --update )
overrides_clear
overrides_add "$(cat "${config}")"
;;
* ) show_help ;;
esac

View File

@ -1,3 +0,0 @@
#!/system/bin/sh
nanodroid-upd "${@}"

View File

@ -56,19 +56,13 @@ The `build-package` script additionally supports the following parameters:
* `ver [version] [date]` change project version
* `bump` increment Magisk module version by 1
The following applications are custom builds:
The following applications are custom builds (F-Droid Repository below):
* Play Store (reason: re-signed and modified to support (in-)app-purchases with microG GmsCore)
* [Download Link](https://www.nanolx.org/apk/Phonesky.apk)
* Fake Store (reason: built with CHECK_LICENSE permission)
* [Download Link](https://www.nanolx.org/apk/FakeStore.apk)
* microG GmsCore (reason: built with more recent spoofed Play Services Version, more)
* [Download Link](https://www.nanolx.org/apk/GmsCore.apk)
* [source](https://github.com/Nanolx/android_packages_apps_GmsCore)
* microG GmsCore (reason: built with additions)
* microG DroidGuard Helper (reason: built with fix for non 32bit arm devices failing SafetyNet attestation)
* [Download Link](https://www.nanolx.org/apk/DroidGuard.apk)
* MPV (reason: infrequent updates, merge-requests included)
* [Download Link](https://www.nanolx.org/apk/MPV.apk)
* MPV (reason: infrequent updates)
* OpenLauncher (reason: infrequent updates)
Also `build-package` looks if the configuration files
@ -213,6 +207,12 @@ Extra packages, always flash through TWRP.
* restores GApps and location services auto-removed during installation (System Mode)
* restores `services.jar` patched by NanoDroid-Patcher (System Mode)
### F-Droid Repository
In order to ease updating NanoDroid's custom application builds you can use it's companion [F-Droid Repository](https://www.nanolx.org/fdroid/repo)
* `https://www.nanolx.org/fdroid/repo?fingerprint=862ED9F13A3981432BF86FE93D14596B381D75BE83A1D616E2D44A12654AD015`
### Scripts
Misc. Scripts for use from PC/Notebook, while device is in TWRP, they are found in this repository:
@ -255,18 +255,6 @@ The `nanodroid-perm` script grants microG and Co. required permissions, if lacki
Full details on the NanoDroid-Perm Script [> Details](doc/NanoDroidPerm.md)
#### NanoDroid-UPD
The `nanodroid-upd` script allows to update NanoDroid's custom apks
* Play Store
* Fake Store
* MPV
which can't be updated through Play/Yalp Store or F-Droid otherwise
Full details on the NanoDroid-UPD Script [> Details](doc/NanoDroidUPD.md)
#### NanoDroid-Util
The `nanodroid-util` script contains the following features

View File

@ -1,29 +0,0 @@
# NanoDroid-UPD Script
## Purpose
The `nanodroid-upd` Script, respectively it's shortcut `nupd` is used by NanoDroid to update NanoDroid's custom apks
* Fake Store
* Play Store
* MPV
* microG GmsCore
* microG DroidGuard Helper
Applications are only updated if they are installed already during NanoDroid installation
**`nanodroid-upd` requires Busybox to be installed!**
## Invocation
From within a terminal on your device, for example `adb shell` or `Termux` invoke the script using either
`nanodroid-upd [apk]`
or
`nupd [apk]`
where **apk** can be
`ps`, `playstore`, `fs`, `fakestore`, `mpv`, `MPV`, `mg`, `microG`, `dg` or `DroidGuard`