dtalley11

run.bat

Aug 25th, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. @echo off
  2. cls
  3. color 0E
  4. TITLE ║2nd-init Prof of Concept for Kyocera Rise by dtalley11║
  5. echo ███████████████████████████████████████████████████████████████████████████████
  6. echo ▌ ▄ ▐
  7. echo ▌ █ After this script is done, your phone will boot into TWRP. ▐
  8. echo ▌ ▀ Make sure your phone is ready for adb ▐
  9. echo ▌ ▀ ▐
  10. echo ███████████████████████████████████████████████████████████████████████████████
  11. pause
  12. cls
  13. color 0A
  14. echo ███████████████████████████████████████████████████████████████████████████████
  15. echo ▌ ▐
  16. echo ▌ Setting up Files for Temp. Recovery ▐
  17. echo ▌ ▐
  18. echo ███████████████████████████████████████████████████████████████████████████████
  19. adb shell su -c "echo 'started 2nd-init batch file' > /dev/kmsg"
  20. echo pushing TWRP zip
  21. adb push TWRP.zip /sdcard/
  22. echo pushing killall script
  23. adb push hijack.killall /sdcard/
  24. echo pushing busybox
  25. adb push busybox /sdcard/
  26. echo pushing stage2 script
  27. adb push stage2.sh /sdcard/
  28. echo pushing 2nd-init
  29. adb push 2nd-init /sdcard/
  30. echo mounting root as writable
  31. adb shell su -c "echo 'mounting root as writable' > /dev/kmsg"
  32. adb shell su -c "mount -wo remount rootfs /"
  33. echo unlinking /etc
  34. adb shell su -c "echo 'unlinking /etc' > /dev/kmsg"
  35. adb shell su -c "rm /etc && mkdir /etc"
  36. echo copying busybox to sbin
  37. adb shell su -c "cat /sdcard/busybox > /sbin/busybox"
  38. echo copying 2nd-init to sbin
  39. adb shell su -c "cat /sdcard/2nd-init > /sbin/2nd-init"
  40. echo copying stage 2 script to sbin
  41. adb shell su -c "cat /sdcard/stage2.sh > /sbin/stage2.sh"
  42. echo copying killall script to sbin
  43. adb shell su -c "cat /sdcard/hijack.killall > /sbin/hijack.killall"
  44. echo making busybox executable
  45. adb shell su -c "chmod 777 /sbin/busybox"
  46. echo making 2nd-init executable
  47. adb shell su -c "chmod 777 /sbin/2nd-init"
  48. echo making killall exicutable
  49. adb shell su -c "chmod 777 hijack.killall"
  50. echo extracting TWRP to rootfs
  51. adb shell su -c "ln -s /sbin/busybox /sbin/unzip"
  52. adb shell su -c "echo 'extracting TWRP' > /dev/kmsg"
  53. adb shell su -c "unzip -q -o /sdcard/twrp.zip -d /"
  54. echo starting stage2 script
  55. adb shell su -c "echo 'passing off to stage 2' > /dev/kmsg"
  56. adb shell su -c "sh /sbin/stage2.sh"
  57. echo .
  58. echo All Done! The magic should be happining now!
  59. pause
Advertisement
Add Comment
Please, Sign In to add comment