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

PatcherAddon: fix DalvikVM crashes, fix printing messages

This commit is contained in:
Christopher Roy Bratusek 2018-09-08 21:43:28 +02:00
parent 8b53243740
commit 05a8918296
3 changed files with 19 additions and 28 deletions

View File

@ -7,6 +7,9 @@
* CommonAddon, PatcherAddon
* fix printing messages
* PatcherAddon
* fix DalvikVM crash
* Uninstaller
* fix error in error-printing (sic!)

View File

@ -13,6 +13,7 @@
setup_environment () {
TMPDIR=/dev/tmp/install
export ANDROID_DATA=${TMPDIR}
export PATCHER_ADDOND_DATA=/data/adb/nanodroid_patcher
MAGISK_IMG=/data/adb/magisk.img
@ -20,12 +21,8 @@ setup_environment () {
}
ui_print() {
if $BOOTMODE; then
echo "$1"
else
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
fi
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
is_mounted () {
@ -222,6 +219,8 @@ detect_arch () {
V_EX=${BASEDIR}/vdexExtractor.${ARCH}
chmod 0755 ${BUSY}
rm -rf ${BASEDIR}/busybox
mkdir -p ${BASEDIR}/busybox
ln -sf ${BUSY} ${BASEDIR}/busybox/busybox

View File

@ -12,7 +12,7 @@
#
##########################################################################################
. /tmp/backuptool.functions
source /tmp/backuptool.functions
if [ ! -f /data/adb/nanodroid_patcher/CommonPatcher ]; then
echo " !! failed to load CommonPatcher"
@ -22,28 +22,13 @@ else
fi
setup_environment
OUTFD=
BASEDIR=/data/adb/nanodroid_patcher
export ANDROID_DATA=${BASEDIR}
PATCH_CORE="${BASEDIR}/core_services.jar.dex"
detect_outfd () {
if [ -z $OUTFD ] || readlink /proc/$$/fd/$OUTFD | grep -q /tmp; then
# We will have to manually find out OUTFD
for FD in `ls /proc/$$/fd`; do
if readlink /proc/$$/fd/$FD | grep -q pipe; then
if ps | grep -v grep | grep -q " 3 $FD "; then
OUTFD=$FD
break
fi
fi
done
fi
}
detect_outfd
NanoDroidPatcher () {
sleep 5
ui_print " "
ui_print "*******************************"
ui_print " NanoDroid Framework Patcher "
@ -60,7 +45,8 @@ NanoDroidPatcher () {
[ -f /data/adb/NanoDroid_Patched ] && \
rm -f /data/adb/NanoDroid_Patched
for artifact in busybox classes.dex oat services.jar services.jar-mod;
for artifact in classes.dex oat dalvik-cache \
services.jar services.jar-mod; do
rm -rf ${BASEDIR}/${artifact}
done
@ -91,7 +77,10 @@ NanoDroidPatcher () {
# Check environment
##########################################################################################
if [ ! -d /data/adb/nanodroid_patcher ]; then
OUTFD=
detect_outfd
if ! test -d /data/adb/nanodroid_patcher ; then
ui_print " "
ui_print " !! NanoDroid-Patcher environment missing"
ui_print " !! guessing, you've wiped /data ?"
@ -121,7 +110,7 @@ case "${1}" in
# Stub
;;
post-restore)
NanoDroidPatcher
(NanoDroidPatcher) &
;;
esac