Compare commits

..

3 Commits

Author SHA1 Message Date
HappyZ 3b2c38bdb1 Merge branch 'master' into develop 2019-07-30 14:08:22 -05:00
HappyZ 3e00cbdda1 Merge branch 'master' into develop 2019-05-18 23:29:47 -05:00
HappyZ 8f618166a5 do not use xposed app to uninstall!!! it'll halt.. no way to turn off device..
have to wait until its power drained..
2019-03-27 10:39:02 -05:00
34 changed files with 361 additions and 11 deletions

View File

@ -1,15 +1,12 @@
# 0x0 Welcome
Donate via [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zhuyanzi@gmail.com&item_name=A+Cup+Of+Coffee&item_number=Thank+You&currency_code=USD) :)
Donate via [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zhuyanzi@gmail.com&item_name=A+Cup+Of+Coffee&item_number=Thank+You&currency_code=USD) or if you use [WeChat](https://github.com/HappyZ/dpt-tools/wiki#donations) :)
Note: Scripts and mods are only tested on MacOS, and are provided AS-IS for study purpose. I do not plan to support all platforms. Use it at your own risks.
04/05/2020: COVID-19 sucks that you have to stay home FOREVER. Well anyhow, came back and updated mod to v1.6.50.14130. As noted below, this is only an update for those "lucky" to have the root already. For devices that have already patched the update script bug, this rooting method would not work.
11/23/2019: Came back and updated to v1.6.03.09261. Also, for devices **manufactured** after September 2019, the updater script bug is fixed already and the rooting package may no longer work.
07/05/2019: I will stop updating this tool and making new PKGs as there is nothing more interesting to explore. Gotta move on, guys and gals. I'll keep an eye on the issues though, and try my best to resolve them when I get time. Thanks.
# 0x1 Special Thanks
Greatly thank

View File

@ -14,9 +14,9 @@ sleep 2
# flash customized boot img
echo "[updater.sh] writing boot.img.." >> $LOG_FP
if [ -f ${UPDATER_BASE}/boot-1.6.50.14130-mod-200405-233932.img ] ;
if [ -f ${UPDATER_BASE}/boot-1.6.02.06240-mod-190730-115824.img ] ;
then
dd if=${UPDATER_BASE}/boot-1.6.50.14130-mod-200405-233932.img of=/dev/mmcblk0p8 bs=4M
dd if=${UPDATER_BASE}/boot-1.6.02.06240-mod-190730-115824.img of=/dev/mmcblk0p8 bs=4M
sync
else
echo "[updater.sh] desired boot.img not exit; nothing did to boot partition" >> $LOG_FP

View File

@ -5,11 +5,11 @@ echo 3 > /proc/sys/vm/drop_caches
LOG_FP=$2
BOOT_IMG_SIZE=`stat -c%s $1/boot-1.6.50.14130-mod-200405-233932.img`
BOOT_IMG_SIZE=`stat -c%s $1/boot-1.6.02.06240-mod-190730-115824.img`
BLK8_MD5=`dd if=/dev/mmcblk0p8 bs=$BOOT_IMG_SIZE count=1 | md5sum | cut -d " " -f1`
BOOT_MD5=`cat $1/boot-1.6.50.14130-mod-200405-233932.img.md5`
BOOT_MD5=`cat $1/boot-1.6.02.06240-mod-190730-115824.img.md5`
echo "BLK08=$BLK8_MD5" >> $LOG_FP
echo " BOOT=$BOOT_MD5" >> $LOG_FP

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
version=89
arch=arm
minsdk=22
maxsdk=22

View File

@ -0,0 +1,197 @@
##########################################################################################
#
# Xposed framework installer zip.
# Modified for DPT running in adb mode
#
# This script installs the Xposed framework files to the system partition.
# The Xposed Installer app is needed as well to manage the installed modules.
#
##########################################################################################
alias cat='busybox cat'
alias cut='busybox cut'
alias sed='busybox sed'
alias head='busybox head'
alias find='busybox find'
grep_prop() {
REGEX="s/^$1=//p"
shift
FILES=$@
if [ -z "$FILES" ]; then
FILES='/system/build.prop'
fi
cat $FILES 2>/dev/null | sed -n $REGEX | head -n 1
}
android_version() {
case $1 in
15) echo '4.0 / SDK'$1;;
16) echo '4.1 / SDK'$1;;
17) echo '4.2 / SDK'$1;;
18) echo '4.3 / SDK'$1;;
19) echo '4.4 / SDK'$1;;
21) echo '5.0 / SDK'$1;;
22) echo '5.1 / SDK'$1;;
23) echo '6.0 / SDK'$1;;
24) echo '7.0 / SDK'$1;;
25) echo '7.1 / SDK'$1;;
26) echo '8.0 / SDK'$1;;
27) echo '8.1 / SDK'$1;;
*) echo 'SDK'$1;;
esac
}
cp_perm() {
cp -f $1 $2 || exit 1
set_perm $2 $3 $4 $5 $6
}
set_perm() {
chown $2:$3 $1 || exit 1
chmod $4 $1 || exit 1
if [ "$5" ]; then
chcon $5 $1 2>/dev/null
else
chcon 'u:object_r:system_file:s0' $1 2>/dev/null
fi
}
install_nobackup() {
cp_perm ./$1 $1 $2 $3 $4 $5
}
install_and_link() {
TARGET=$1
XPOSED="${1}_xposed"
BACKUP="${1}_original"
if [ ! -f ./$XPOSED ]; then
return
fi
cp_perm ./$XPOSED $XPOSED $2 $3 $4 $5
# Don't touch $TARGET if the link was created by something else (e.g. SuperSU)
if [ ! -f $BACKUP ]; then
mv $TARGET $BACKUP || exit 1
ln -s $XPOSED $TARGET || exit 1
chcon -h 'u:object_r:system_file:s0' $TARGET 2>/dev/null
fi
}
install_overwrite() {
TARGET=$1
if [ ! -f ./$TARGET ]; then
return
fi
BACKUP="${1}.orig"
NO_ORIG="${1}.no_orig"
if [ ! -f $TARGET ]; then
touch $NO_ORIG || exit 1
set_perm $NO_ORIG 0 0 600
elif [ -f $BACKUP ]; then
rm -f $TARGET
gzip $BACKUP || exit 1
set_perm "${BACKUP}.gz" 0 0 600
elif [ ! -f "${BACKUP}.gz" -a ! -f $NO_ORIG ]; then
mv $TARGET $BACKUP || exit 1
gzip $BACKUP || exit 1
set_perm "${BACKUP}.gz" 0 0 600
fi
cp_perm ./$TARGET $TARGET $2 $3 $4 $5
}
##########################################################################################
echo "******************************"
echo "Xposed framework installer zip"
echo "******************************"
if [ ! -f "system/xposed.prop" ]; then
echo "! Failed: Extracted file system/xposed.prop not found!"
exit 1
fi
echo "- Mounting /system and /vendor read-write"
# mount /system >/dev/null 2>&1
# mount /vendor >/dev/null 2>&1
mount -o remount,rw /system
# mount -o remount,rw /vendor >/dev/null 2>&1
if [ ! -f '/system/build.prop' ]; then
echo "! Failed: /system could not be mounted!"
exit 1
fi
echo "- Checking environment"
API=$(grep_prop ro.build.version.sdk)
APINAME=$(android_version $API)
ABI=$(grep_prop ro.product.cpu.abi | cut -c-3)
ABI2=$(grep_prop ro.product.cpu.abi2 | cut -c-3)
ABILONG=$(grep_prop ro.product.cpu.abi)
XVERSION=$(grep_prop version system/xposed.prop)
XARCH=$(grep_prop arch system/xposed.prop)
XMINSDK=$(grep_prop minsdk system/xposed.prop)
XMAXSDK=$(grep_prop maxsdk system/xposed.prop)
XEXPECTEDSDK=$(android_version $XMINSDK)
if [ "$XMINSDK" != "$XMAXSDK" ]; then
XEXPECTEDSDK=$XEXPECTEDSDK' - '$(android_version $XMAXSDK)
fi
ARCH=arm
IS64BIT=
if [ "$ABI" = "x86" ]; then ARCH=x86; fi;
if [ "$ABI2" = "x86" ]; then ARCH=x86; fi;
if [ "$API" -ge "21" ]; then
if [ "$ABILONG" = "arm64-v8a" ]; then ARCH=arm64; IS64BIT=1; fi;
if [ "$ABILONG" = "x86_64" ]; then ARCH=x64; IS64BIT=1; fi;
fi
# echo "DBG [$API] [$ABI] [$ABI2] [$ABILONG] [$ARCH] [$XARCH] [$XMINSDK] [$XMAXSDK] [$XVERSION]"
echo " Xposed version: $XVERSION"
XVALID=
if [ "$ARCH" = "$XARCH" ]; then
if [ "$API" -ge "$XMINSDK" ]; then
if [ "$API" -le "$XMAXSDK" ]; then
XVALID=1
else
echo "! Wrong Android version: $APINAME"
echo "! This file is for: $XEXPECTEDSDK"
fi
else
echo "! Wrong Android version: $APINAME"
echo "! This file is for: $XEXPECTEDSDK"
fi
else
echo "! Wrong platform: $ARCH"
echo "! This file is for: $XARCH"
fi
if [ -z $XVALID ]; then
echo "! Please download the correct package"
echo "! for your platform/ROM!"
exit 1
fi
echo "- Placing files"
install_nobackup /system/xposed.prop 0 0 0644
install_nobackup /system/framework/XposedBridge.jar 0 0 0644
install_and_link /system/bin/app_process32 0 2000 0755 u:object_r:zygote_exec:s0
install_overwrite /system/bin/dex2oat 0 2000 0755 u:object_r:dex2oat_exec:s0
install_overwrite /system/bin/oatdump 0 2000 0755
install_overwrite /system/bin/patchoat 0 2000 0755 u:object_r:dex2oat_exec:s0
install_overwrite /system/lib/libart.so 0 0 0644
install_overwrite /system/lib/libart-compiler.so 0 0 0644
install_overwrite /system/lib/libart-disassembler.so 0 0 0644
install_overwrite /system/lib/libsigchain.so 0 0 0644
install_nobackup /system/lib/libxposed_art.so 0 0 0644
if [ "$API" -ge "22" ]; then
find /system /vendor -type f -name '*.odex.gz' 2>/dev/null | while read f; do mv "$f" "$f.xposed"; done
fi
echo "- Done"
exit 0

View File

@ -0,0 +1,152 @@
##########################################################################################
#
# Xposed framework uninstaller zip.
# Modified for DPT running in adb mode
#
# This script removes the Xposed framework files from the system partition.
# It doesn't touch the Xposed Installer app.
#
##########################################################################################
alias cat='busybox cat'
alias cut='busybox cut'
alias sed='busybox sed'
alias head='busybox head'
alias find='busybox find'
alias gunzip='busybox gunzip'
grep_prop() {
REGEX="s/^$1=//p"
shift
FILES=$@
if [ -z "$FILES" ]; then
FILES=$PREFIX/system/build.prop
fi
cat $FILES 2>/dev/null | sed -n $REGEX | head -n 1
}
mv_perm() {
mv -f $1 $2 || exit 1
set_perm $2 $3 $4 $5 $6
}
set_perm() {
chown $2:$3 $1 || exit 1
chmod $4 $1 || exit 1
if [ "$5" ]; then
chcon $5 $1 2>/dev/null
else
chcon 'u:object_r:system_file:s0' $1 2>/dev/null
fi
}
restore_link() {
TARGET="${PREFIX}${1}"
LINK_TARGET="${1}_xposed"
XPOSED="${PREFIX}${1}_xposed"
BACKUP="${PREFIX}${1}_original"
# Don't touch $TARGET if the link was created by something else (e.g. SuperSU)
if [ -f $BACKUP -a -L $TARGET -a "$(readlink $TARGET)" = $LINK_TARGET ]; then
rm -f $TARGET
mv_perm $BACKUP $TARGET $2 $3 $4 $5
fi
rm -f $XPOSED
}
restore_backup() {
TARGET="${PREFIX}${1}"
BACKUP="${PREFIX}${1}.orig"
NO_ORIG="${PREFIX}${1}.no_orig"
if [ -f $BACKUP ]; then
mv_perm $BACKUP $TARGET $2 $3 $4 $5
rm -f $NO_ORIG
elif [ -f "${BACKUP}.gz" ]; then
rm -f $TARGET $NO_ORIG
gunzip "${BACKUP}.gz"
mv_perm $BACKUP $TARGET $2 $3 $4 $5
elif [ -f $NO_ORIG ]; then
rm -f $TARGET $NO_ORIG
fi
}
##########################################################################################
echo "************************************"
echo " Xposed Framework uninstaller zip"
echo "************************************"
echo "- Mounting /system and /vendor read-write"
# mount /system >/dev/null 2>&1
mount -o remount,rw /system
# mount /vendor >/dev/null 2>&1
# mount -o remount,rw /vendor >/dev/null 2>&1
PREFIX=
# if [ "$SYSTEM_ROOT_IMAGE" = "true" -a -f /twres/twrp -a -f /system/system/build.prop ]; then
# # TWRP might mount the full system partion to /system, so files are actually in /system/system.
# PREFIX=/system
# fi
# Check if build.prop is accessible now.
if [ ! -f $PREFIX/system/build.prop ]; then
echo "! Failed: /system could not be mounted!"
exit 1
fi
echo "- Checking environment"
API=$(grep_prop ro.build.version.sdk)
ABI=$(grep_prop ro.product.cpu.abi | cut -c-3)
ABI2=$(grep_prop ro.product.cpu.abi2 | cut -c-3)
ABILONG=$(grep_prop ro.product.cpu.abi)
ARCH=arm
IS64BIT=
if [ "$ABI" = "x86" ]; then ARCH=x86; fi;
if [ "$ABI2" = "x86" ]; then ARCH=x86; fi;
if [ "$API" -ge "21" ]; then
if [ "$ABILONG" = "arm64-v8a" ]; then ARCH=arm64; IS64BIT=1; fi;
if [ "$ABILONG" = "x86_64" ]; then ARCH=x64; IS64BIT=1; fi;
else
echo "! This script doesn't work for SDK < 21 (yet)"
exit 1
fi
# echo "DBG [$API] [$ABI] [$ABI2] [$ABILONG] [$ARCH]"
echo "- Restoring/removing files"
rm -f $PREFIX/system/xposed.prop
rm -f $PREFIX/system/framework/XposedBridge.jar
restore_link /system/bin/app_process32 0 2000 0755 u:object_r:zygote_exec:s0
restore_backup /system/bin/dex2oat 0 2000 0755 u:object_r:dex2oat_exec:s0
restore_backup /system/bin/dexdiag 0 2000 0755
restore_backup /system/bin/dexlist 0 2000 0755
restore_backup /system/bin/dexoptanalyzer 0 2000 0755 u:object_r:dexoptanalyzer_exec:s0
restore_backup /system/bin/oatdump 0 2000 0755
restore_backup /system/bin/patchoat 0 2000 0755 u:object_r:dex2oat_exec:s0
restore_backup /system/bin/profman 0 2000 0755 u:object_r:profman_exec:s0
restore_backup /system/lib/libart.so 0 0 0644
restore_backup /system/lib/libart-compiler.so 0 0 0644
restore_backup /system/lib/libart-dexlayout.so 0 0 0644
restore_backup /system/lib/libart-disassembler.so 0 0 0644
restore_backup /system/lib/libsigchain.so 0 0 0644
restore_backup /system/lib/libopenjdkjvm.so 0 0 0644
restore_backup /system/lib/libopenjdkjvmti.so 0 0 0644
rm -f $PREFIX/system/lib/libxposed_art.so
rm -f $PREFIX/system/lib/libxposed_art.so.no_orig
if [ "$API" -ge "22" -a "$API" -le "23" ]; then
find $PREFIX/system $PREFIX/vendor -type f -name '*.odex.gz.xposed' 2>/dev/null | while read f; do mv "$f" "${f%.xposed}"; done
fi
echo "- Done"
echo " "
echo "************************************"
echo "It's recommended that you wipe the"
echo "Dalvik cache now."
echo "************************************"
echo " "
exit 0