-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AutomatedRoot: update to version 7.0
Signed-off-by: R0rt1z2 <[email protected]>
- Loading branch information
Showing
33 changed files
with
608 additions
and
546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
# mtk-su | ||
files/arm/mtk-su | ||
files/arm64/mtk-su | ||
|
||
# releases | ||
releases | ||
automated_root/files/arm/mtk-su | ||
automated_root/files/arm64/mtk-su | ||
automated_root/__pycache__ | ||
devinfo.txt | ||
automated_root/utils/__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# ~.~ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/system/bin/sh | ||
|
||
CHECK="/data/local/tmp/.check" | ||
|
||
if [ "$(getprop ro.product.cpu.abi)" == "arm64-v8a" ]; | ||
then | ||
ARCH="arm64" | ||
elif [ "$(getprop ro.product.cpu.abi)" == "armeabi-v7a" ]; | ||
then | ||
ARCH="arm" | ||
fi | ||
|
||
mkdir -p {/sdcard/init.d,/sdcard/init.d/bin} > /dev/null 2>&1 | ||
cp -r /data/local/tmp/magisk-boot.sh /sdcard/init.d/ > /dev/null 2>&1 | ||
cp -r /data/local/tmp/${ARCH}/{mtk-su,magiskinit} /sdcard/init.d/bin > /dev/null 2>&1 | ||
|
||
am start com.ryosoftware.initd/.PreferencesActivity > /dev/null 2>&1 | ||
logcat | grep -E --line-buffered 'retcode 0' | while read line; do touch $CHECK; done & | ||
|
||
while [ 1 == 1 ] | ||
do | ||
ls $CHECK > /dev/null 2>&1 | ||
if [ "$?" -eq 0 ]; then | ||
rm $CHECK; logcat -c; break | ||
fi | ||
done | ||
|
||
am start com.topjohnwu.magisk/a.c > /dev/null 2>&1 | ||
|
||
echo "All good" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/system/bin/sh | ||
|
||
readlink -f /vendor | grep system > /dev/null 2>&1 | ||
|
||
if [ $? -eq 1 ]; then | ||
HAS_VENDOR="YES" | ||
fi | ||
|
||
if [ "$(getprop ro.product.cpu.abi)" == "arm64-v8a" ]; | ||
then | ||
ARCH="arm64" | ||
elif [ "$(getprop ro.product.cpu.abi)" == "armeabi-v7a" ]; | ||
then | ||
ARCH="arm" | ||
fi | ||
|
||
if [ "$HAS_VENDOR" -eq "YES" ]; then | ||
cat /vendor/etc/fstab* 2>/dev/null | grep verify | grep system > /dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
echo "Failed\nDevice uses dm-verity" | ||
exit 1 | ||
else | ||
cat /fstab* 2>/dev/null | grep verify | grep system > /dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
echo "Failed\nDevice uses dm-verity" | ||
exit 1 | ||
fi | ||
fi | ||
else | ||
cat /fstab* 2>/dev/null | grep verify | grep system > /dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
echo "Failed\nDevice uses dm-verity" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
mount -o remount -rw /system > /dev/null 2>&1 | ||
|
||
cp /system/bin/app_process /system/bin/app_process_original > /dev/null 2>&1 | ||
cp /system/bin/app_process32 /system/bin/app_process_original32 > /dev/null 2>&1 | ||
cp /system/bin/app_process64 /system/bin/app_process_original64 > /dev/null 2>&1 | ||
|
||
if [ "$ARCH" == "arm64" ]; | ||
then | ||
cp /data/local/tmp/arm64/su /system/xbin/su > /dev/null 2>&1 | ||
mv /data/local/tmp/arm64/su /system/xbin/daemonsu > /dev/null 2>&1 | ||
cp /data/local/tmp/arm64/supolicy /system/xbin/ > /dev/null 2>&1 | ||
cp /data/local/tmp/arm64/libsupol.so /system/lib/ > /dev/null 2>&1 | ||
cp /data/local/tmp/arm64/libsupol.so /system/lib64/ > /dev/null 2>&1 | ||
elif [ "$ARCH" == "arm" ]; | ||
then | ||
cp /data/local/tmp/arm/su /system/xbin/su > /dev/null 2>&1 | ||
mv /data/local/tmp/arm/su /system/xbin/daemonsu > /dev/null 2>&1 | ||
cp /data/local/tmp/arm/supolicy /system/xbin/ > /dev/null 2>&1 | ||
cp /data/local/tmp/arm/libsupol.so /system/lib/ > /dev/null 2>&1 | ||
fi | ||
|
||
chmod 0755 /system/xbin/su > /dev/null 2>&1 | ||
chcon u:object_r:system_file:s0 /system/xbin/su > /dev/null 2>&1 | ||
chmod 0755 /system/xbin/daemonsu > /dev/null 2>&1 | ||
chcon u:object_r:system_file:s0 /system/xbin/daemonsu > /dev/null 2>&1 | ||
|
||
daemonsu --auto-daemon > /dev/null 2>&1 | ||
|
||
rm -rf /data/local/tmp/${ARCH} > /dev/null 2>&1 | ||
rm /data/local/tmp/*.sh > /dev/null 2>&1 | ||
|
||
echo "All good" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/system/bin/sh | ||
BOOLESS=1 | ||
ROOT_FILES_64=" | ||
system/xbin/su | ||
system/xbin/daemonsu | ||
system/xbin/supolicy | ||
system/lib/libsupol.so | ||
system/lib64/libsupol.so | ||
system/bin/app_process_init | ||
system/bin/app_process64 | ||
system/bin/app_process" | ||
ROOT_FILES_32=" | ||
system/xbin/su | ||
system/xbin/daemonsu | ||
system/xbin/supolicy | ||
system/lib/libsupol.so | ||
system/bin/app_process_init | ||
system/bin/app_process" | ||
|
||
if [ "$(getprop ro.product.cpu.abi)" == "arm64-v8a" ]; | ||
then | ||
ARCH="arm64" | ||
elif [ "$(getprop ro.product.cpu.abi)" == "armeabi-v7a" ]; | ||
then | ||
ARCH="arm" | ||
fi | ||
|
||
mount -o remount -rw /system | ||
if [ $? -eq 0 ] && [ ! -d "/sdcard/init.d" ]; then | ||
if [ ! -f "/system/xbin/su" ]; | ||
then | ||
echo "Failed\nDevice not rooted" | ||
exit 1 | ||
fi | ||
|
||
if [ "$ARCH" == "arm64" ]; | ||
then | ||
rm $ROOT_FILES_64 > /dev/null 2>&1 | ||
elif [ "$ARCH" == "arm" ]; | ||
then | ||
rm $ROOT_FILES_32 > /dev/null 2>&1 | ||
fi | ||
|
||
if [ "$ARCH" == "arm64" ]; | ||
then | ||
mv /system/bin/app_process_original32 /system/bin/app_process32 > /dev/null 2>&1 | ||
mv /system/bin/app_process_original64 /system/bin/app_process64 > /dev/null 2>&1 | ||
ln /system/bin/app_process64 /system/bin/app_process > /dev/null 2>&1 | ||
elif [ "$ARCH" == "arm" ]; | ||
then | ||
mv /system/bin/app_process_original /system/bin/app_process > /dev/null 2>&1 | ||
mv /system/bin/app_process_original32 /system/bin/app_process32 > /dev/null 2>&1 | ||
ln /system/bin/app_process32 /system/bin/app_process > /dev/null 2>&1 | ||
fi | ||
|
||
chcon u:object_r:zygote_exec:s0 /system/bin/app_process32 > /dev/null 2>&1 | ||
chcon u:object_r:system_file:s0 /system/bin/app_process > /dev/null 2>&1 | ||
chcon u:object_r:zygote_exec:s0 /system/bin/app_process64 > /dev/null 2>&1 | ||
else | ||
if [ ! -f "/sdcard/init.d/bin/mtk-su" ]; | ||
then | ||
echo "Failed\nDevice not rooted" | ||
exit 1 | ||
else | ||
rm -rf /sdcard/init.d > /dev/null 2>&1 | ||
fi | ||
fi | ||
|
||
echo "All good" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# ~.~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import os | ||
|
||
VERSION = "v7.0\n" | ||
BANNER = """ | ||
_____ _ _ _ _____ _ | ||
| _ |_ _| |_ ___ _____ ___| |_ ___ _| | __ |___ ___| |_ | ||
| | | | _| . | | .'| _| -_| . | -| . | . | _| | ||
|__|__|___|_| |___|_|_|_|__,|_| |___|___|__|__|___|___|_| """ | ||
|
||
# Current supported SoCs/ARCHs (by mtk-su) | ||
REGIDX_ARCH = ["arm", "arm64"] | ||
REGIDX_CPU = "(mt67|mt816|mt817|mt6580|mt6595)\s?(.*)" | ||
|
||
# Menu options | ||
MENU_OPTIONS = """ | ||
-> 1. Root the device (system-mode). | ||
-> 2. Root the device (bootless-mode). | ||
-> 3. Unroot the device. | ||
-> 4. Exit the tool. | ||
""" | ||
|
||
# Magisk Root (manual instructions) | ||
MAGISK_INST = """[I]: Once the Init.d support app pops up, accept its terms and allow it to access media: | ||
-> Set 'Run scripts on boot time' to CHECKED. | ||
-> Set 'Execution delay' to NO DELAY. | ||
-> Set 'Selected folder' to init.d folder located in the Internal Storage. | ||
-> Click on 'Run scripts now' and watch the ad to unlock the feature. (Support the developer!).""" | ||
|
||
# Clean CMD | ||
CLEAN = ("cls" if os.name == "nt" else "clear") | ||
|
||
# List of properties dumped by the script (debug) | ||
REGIDX_PROP = { | ||
"ro.product.model": "Model", | ||
"ro.build.version.release": "Android Version", | ||
"ro.product.manufacturer": "Product Manufracturer", | ||
"ro.build.version.security_patch": "Security Patch" | ||
} | ||
|
||
# ADB (default) client IP | ||
DEFAULT_IP = "127.0.0.1" | ||
|
||
# Wheter mtk-su binaries are present | ||
mtk_su = False | ||
|
||
# Result patterns from mtk-su | ||
RESULT_PATTERN = "(All good|This firmware cannot be supported|Firmware support not implemented|Incompatible platform|permission denied)\s?(.*)" |
Oops, something went wrong.