Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- cls
- color 0E
- TITLE ║2nd-init Prof of Concept for Kyocera Rise by dtalley11║
- echo ███████████████████████████████████████████████████████████████████████████████
- echo ▌ ▄ ▐
- echo ▌ █ After this script is done, your phone will boot into TWRP. ▐
- echo ▌ ▀ Make sure your phone is ready for adb ▐
- echo ▌ ▀ ▐
- echo ███████████████████████████████████████████████████████████████████████████████
- pause
- cls
- color 0A
- echo ███████████████████████████████████████████████████████████████████████████████
- echo ▌ ▐
- echo ▌ Setting up Files for Temp. Recovery ▐
- echo ▌ ▐
- echo ███████████████████████████████████████████████████████████████████████████████
- adb shell su -c "echo 'started 2nd-init batch file' > /dev/kmsg"
- echo pushing TWRP zip
- adb push TWRP.zip /sdcard/
- echo pushing killall script
- adb push hijack.killall /sdcard/
- echo pushing busybox
- adb push busybox /sdcard/
- echo pushing stage2 script
- adb push stage2.sh /sdcard/
- echo pushing 2nd-init
- adb push 2nd-init /sdcard/
- echo mounting root as writable
- adb shell su -c "echo 'mounting root as writable' > /dev/kmsg"
- adb shell su -c "mount -wo remount rootfs /"
- echo unlinking /etc
- adb shell su -c "echo 'unlinking /etc' > /dev/kmsg"
- adb shell su -c "rm /etc && mkdir /etc"
- echo copying busybox to sbin
- adb shell su -c "cat /sdcard/busybox > /sbin/busybox"
- echo copying 2nd-init to sbin
- adb shell su -c "cat /sdcard/2nd-init > /sbin/2nd-init"
- echo copying stage 2 script to sbin
- adb shell su -c "cat /sdcard/stage2.sh > /sbin/stage2.sh"
- echo copying killall script to sbin
- adb shell su -c "cat /sdcard/hijack.killall > /sbin/hijack.killall"
- echo making busybox executable
- adb shell su -c "chmod 777 /sbin/busybox"
- echo making 2nd-init executable
- adb shell su -c "chmod 777 /sbin/2nd-init"
- echo making killall exicutable
- adb shell su -c "chmod 777 hijack.killall"
- echo extracting TWRP to rootfs
- adb shell su -c "ln -s /sbin/busybox /sbin/unzip"
- adb shell su -c "echo 'extracting TWRP' > /dev/kmsg"
- adb shell su -c "unzip -q -o /sdcard/twrp.zip -d /"
- echo starting stage2 script
- adb shell su -c "echo 'passing off to stage 2' > /dev/kmsg"
- adb shell su -c "sh /sbin/stage2.sh"
- echo .
- echo All Done! The magic should be happining now!
- pause
Advertisement
Add Comment
Please, Sign In to add comment