Guest User

Untitled

a guest
Feb 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.99 KB | None | 0 0
  1. assert(getprop("ro.product.device") == "speedy" || getprop("ro.build.product") == "speedy" || getprop("ro.product.board") == "speedy");
  2. show_progress(1, 30);
  3. ui_print("-Wiping system");
  4. format("ext4", "EMMC", "/dev/block/mmcblk0p26");
  5. ui_print("-Wiping system cahce and dalvik-cache");
  6. run_program("/sbin/sh","-c","rm -rf /cache/*;
  7. mount -o noatime,nodiratime -t auto $PARTITION $ANDROID_ROOT;
  8. mount -o noatime,nodiratime -t auto $PARTITION $ANDROID_DATA;");
  9. if [ -d /data/dalvik-cache ];
  10. then
  11. rm -rf /data/dalvik-cache/*
  12. fi;
  13. if [ -e /dev/block/mmcblk1p2 ];
  14. then
  15. SD_EXT_DIRECTORY=/sd-ext;
  16. mount /dev/block/mmcblk1p2 /sd-ext;
  17. if [ -d /sd-ext/dalvik-cache ];
  18. then
  19. rm -rf /sd-ext/dalvik-cache/*;
  20. fi;
  21. if [ -d /sd-ext/app ];
  22. then
  23. if [ -d /data/app ];
  24. then
  25. mount -o sync /sd-ext/app /data/app;
  26. else
  27. mkdir $ANDROID_DATA/app;
  28. mount -o sync /sd-ext/app /data/app;
  29. fi;
  30. else
  31. mkdir $SD_EXT_DIRECTORY/app;
  32. if [ -d /data/app ];
  33. then
  34. mount -o sync /sd-ext/app /data/app;
  35. else
  36. mkdir $ANDROID_DATA/app;
  37. mount -o sync /sd-ext/app /data/app;
  38. fi;
  39. fi;
  40. else
  41. if [ -d /data/app ];
  42. then
  43. exit;
  44. else
  45. mkdir $ANDROID_DATA/app;
  46. fi;
  47. fi;");
  48. ui_print("-Installing CM7-RM-Nightly-20111026");
  49. ui_print("-Writing System");
  50. package_extract_dir("system", "/system");
  51. ui_print("-Decompressing rom");
  52. run_program("/sbin/sh","-c","gunzip /system/app/*;");
  53. ui_print("Finishing up installation");
  54. package_extract_dir("data", "/data");
  55. ui_print("-Creating symlinks");
  56. symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
  57. "/system/xbin/arp", "/system/xbin/ash", "/system/xbin/awk",
  58. "/system/xbin/base64", "/system/xbin/basename", "/system/xbin/bbconfig",
  59. "/system/xbin/blockdev", "/system/xbin/brctl", "/system/xbin/bunzip2",
  60. "/system/xbin/bzcat", "/system/xbin/bzip2", "/system/xbin/cal",
  61. "/system/xbin/cat", "/system/xbin/catv", "/system/xbin/chattr",
  62. "/system/xbin/chgrp", "/system/xbin/chmod", "/system/xbin/chown",
  63. "/system/xbin/chroot", "/system/xbin/clear", "/system/xbin/cmp",
  64. "/system/xbin/comm", "/system/xbin/cp", "/system/xbin/cpio",
  65. "/system/xbin/crond", "/system/xbin/crontab", "/system/xbin/cut",
  66. "/system/xbin/date", "/system/xbin/dc", "/system/xbin/dd",
  67. "/system/xbin/depmod", "/system/xbin/devmem", "/system/xbin/df",
  68. "/system/xbin/diff", "/system/xbin/dirname", "/system/xbin/dmesg",
  69. "/system/xbin/dnsd", "/system/xbin/dos2unix", "/system/xbin/du",
  70. "/system/xbin/echo", "/system/xbin/ed", "/system/xbin/egrep",
  71. "/system/xbin/env", "/system/xbin/expand", "/system/xbin/expr",
  72. "/system/xbin/false", "/system/xbin/fdisk", "/system/xbin/fgrep",
  73. "/system/xbin/find", "/system/xbin/flash_lock",
  74. "/system/xbin/flash_unlock", "/system/xbin/flashcp",
  75. "/system/xbin/flock", "/system/xbin/fold", "/system/xbin/free",
  76. "/system/xbin/freeramdisk", "/system/xbin/fsync", "/system/xbin/ftpget",
  77. "/system/xbin/ftpput", "/system/xbin/fuser", "/system/xbin/getopt",
  78. "/system/xbin/grep", "/system/xbin/groups", "/system/xbin/gunzip",
  79. "/system/xbin/gzip", "/system/xbin/halt", "/system/xbin/head",
  80. "/system/xbin/hexdump", "/system/xbin/id", "/system/xbin/ifconfig",
  81. "/system/xbin/insmod", "/system/xbin/install", "/system/xbin/iostat",
  82. "/system/xbin/ip", "/system/xbin/kill", "/system/xbin/killall",
  83. "/system/xbin/killall5", "/system/xbin/length", "/system/xbin/less",
  84. "/system/xbin/ln", "/system/xbin/losetup", "/system/xbin/ls",
  85. "/system/xbin/lsattr", "/system/xbin/lsmod", "/system/xbin/lsusb",
  86. "/system/xbin/lzcat", "/system/xbin/lzma", "/system/xbin/lzop",
  87. "/system/xbin/lzopcat", "/system/xbin/man", "/system/xbin/md5sum",
  88. "/system/xbin/mesg", "/system/xbin/mkdir", "/system/xbin/mke2fs",
  89. "/system/xbin/mkfifo", "/system/xbin/mkfs.ext2",
  90. "/system/xbin/mkfs.vfat", "/system/xbin/mknod", "/system/xbin/mkswap",
  91. "/system/xbin/mktemp", "/system/xbin/modinfo", "/system/xbin/modprobe",
  92. "/system/xbin/more", "/system/xbin/mount", "/system/xbin/mountpoint",
  93. "/system/xbin/mpstat", "/system/xbin/mv", "/system/xbin/nanddump",
  94. "/system/xbin/nandwrite", "/system/xbin/netstat", "/system/xbin/nice",
  95. "/system/xbin/nohup", "/system/xbin/nslookup", "/system/xbin/ntpd",
  96. "/system/xbin/od", "/system/xbin/patch", "/system/xbin/pgrep",
  97. "/system/xbin/pidof", "/system/xbin/ping", "/system/xbin/pkill",
  98. "/system/xbin/pmap", "/system/xbin/poweroff", "/system/xbin/printenv",
  99. "/system/xbin/printf", "/system/xbin/ps", "/system/xbin/pstree",
  100. "/system/xbin/pwd", "/system/xbin/pwdx", "/system/xbin/rdev",
  101. "/system/xbin/readlink", "/system/xbin/realpath", "/system/xbin/renice",
  102. "/system/xbin/reset", "/system/xbin/resize", "/system/xbin/rev",
  103. "/system/xbin/rm", "/system/xbin/rmdir", "/system/xbin/rmmod",
  104. "/system/xbin/route", "/system/xbin/run-parts", "/system/xbin/rx",
  105. "/system/xbin/sed", "/system/xbin/seq", "/system/xbin/setconsole",
  106. "/system/xbin/setserial", "/system/xbin/setsid", "/system/xbin/sh",
  107. "/system/xbin/sha1sum", "/system/xbin/sha256sum",
  108. "/system/xbin/sha512sum", "/system/xbin/sleep", "/system/xbin/sort",
  109. "/system/xbin/split", "/system/xbin/stat", "/system/xbin/strings",
  110. "/system/xbin/stty", "/system/xbin/sum", "/system/xbin/swapoff",
  111. "/system/xbin/swapon", "/system/xbin/sync", "/system/xbin/sysctl",
  112. "/system/xbin/tac", "/system/xbin/tail", "/system/xbin/tar",
  113. "/system/xbin/tee", "/system/xbin/telnet", "/system/xbin/telnetd",
  114. "/system/xbin/test", "/system/xbin/tftp", "/system/xbin/tftpd",
  115. "/system/xbin/time", "/system/xbin/timeout", "/system/xbin/top",
  116. "/system/xbin/touch", "/system/xbin/tr", "/system/xbin/traceroute",
  117. "/system/xbin/true", "/system/xbin/tty", "/system/xbin/ttysize",
  118. "/system/xbin/tune2fs", "/system/xbin/umount", "/system/xbin/uname",
  119. "/system/xbin/uncompress", "/system/xbin/unexpand", "/system/xbin/uniq",
  120. "/system/xbin/unix2dos", "/system/xbin/unlzma", "/system/xbin/unlzop",
  121. "/system/xbin/unxz", "/system/xbin/unzip", "/system/xbin/uptime",
  122. "/system/xbin/usleep", "/system/xbin/uudecode", "/system/xbin/uuencode",
  123. "/system/xbin/vi", "/system/xbin/watch", "/system/xbin/wc",
  124. "/system/xbin/wget", "/system/xbin/which", "/system/xbin/whoami",
  125. "/system/xbin/xargs", "/system/xbin/xz", "/system/xbin/xzcat",
  126. "/system/xbin/yes",
  127. "/system/xbin/zcat");
  128. symlink("iwmulticall", "/system/xbin/iwconfig", "/system/xbin/iwgetid",
  129. "/system/xbin/iwlist", "/system/xbin/iwpriv",
  130. "/system/xbin/iwspy");
  131. symlink("toolbox", "/system/bin/cat", "/system/bin/cmp",
  132. "/system/bin/date", "/system/bin/dd", "/system/bin/dmesg",
  133. "/system/bin/getevent", "/system/bin/getprop", "/system/bin/hd",
  134. "/system/bin/id", "/system/bin/ifconfig", "/system/bin/iftop",
  135. "/system/bin/insmod", "/system/bin/ioctl", "/system/bin/ionice",
  136. "/system/bin/kill", "/system/bin/log", "/system/bin/lsmod",
  137. "/system/bin/nandread", "/system/bin/netstat",
  138. "/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
  139. "/system/bin/ps", "/system/bin/reboot", "/system/bin/renice",
  140. "/system/bin/rmdir", "/system/bin/rmmod", "/system/bin/route",
  141. "/system/bin/schedtop", "/system/bin/sendevent",
  142. "/system/bin/setconsole", "/system/bin/setprop", "/system/bin/sleep",
  143. "/system/bin/smd", "/system/bin/start", "/system/bin/stop",
  144. "/system/bin/sync", "/system/bin/top", "/system/bin/uptime",
  145. "/system/bin/vmstat", "/system/bin/watchprops",
  146. "/system/bin/wipe");
  147. ui_print("-Setting permissions");
  148. set_perm_recursive(0, 0, 0755, 0644, "/system");
  149. set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
  150. set_perm(0, 3003, 02750, "/system/bin/netcfg");
  151. set_perm(0, 3004, 02755, "/system/bin/ping");
  152. set_perm(0, 2000, 06750, "/system/bin/run-as");
  153. set_perm(1000, 1003, 02755, "/system/bin/screenshot");
  154. set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
  155. set_perm(0, 0, 0755, "/system/etc/bluetooth");
  156. set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
  157. set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
  158. set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
  159. set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
  160. set_perm_recursive(0, 2000, 0755, 0750, "/system/etc/init.d");
  161. set_perm(0, 0, 0755, "/system/etc/init.d");
  162. set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
  163. set_perm(0, 0, 0544, "/system/etc/install-recovery.sh");
  164. set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
  165. set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
  166. set_perm_recursive(0, 0, 0755, 0644, "/system/vendor/firmware");
  167. set_perm(0, 2000, 0755, "/system/vendor/firmware");
  168. set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
  169. set_perm(0, 0, 06755, "/system/xbin/hcitool");
  170. set_perm(0, 0, 06755, "/system/xbin/librank");
  171. set_perm(0, 0, 06755, "/system/xbin/procmem");
  172. set_perm(0, 0, 06755, "/system/xbin/procrank");
  173. set_perm(0, 0, 06755, "/system/xbin/su");
  174. set_perm(0, 0, 06755, "/system/xbin/tcpdump");
  175. set_perm(0, 0, 0777, "/system/etc/init.d/06sdcardspeed");
  176. set_perm(0, 0, 0777, "/system/etc/init.d/97swap2sd");
  177. set_perm(0, 0, 0777, "/system/etc/init.d/98rambooster");
  178. package_extract_file("system/bin/modelid_cfg.sh", "/tmp/modelid_cfg.sh");
  179. set_perm(0, 0, 0777, "/tmp/modelid_cfg.sh");
  180. run_program("/tmp/modelid_cfg.sh");
  181. package_extract_file("system/bin/verify_cache_partition_size.sh", "/tmp/verify_cache_partition_size.sh");
  182. set_perm(0, 0, 0777, "/tmp/verify_cache_partition_size.sh");
  183. run_program("/tmp/verify_cache_partition_size.sh");
  184. ui_print("-Writing boot image");
  185. package_extract_file("RM-boot.img", "/tmp/boot.img");
  186. write_raw_image("/tmp/boot.img", "boot"); delete("/tmp/boot.img");
  187. ui_print("Installing Google Applications");
  188. package_extract_dir(".gapps", "/system");
  189. ui_print("-Syncing");
  190. run_program("/sbin/sh","-c","sync;");
  191. ui_print("-Install Complete"); ui_print("-unmounting partitions");
  192. run_program("/sbin/sh","-c","if [ -e /dev/block/mmcblk1p2 ];
  193. then
  194. umount /data/app;
  195. umount /sd-ext;
  196. else
  197. exit;
  198. fi;");
  199. run_program("/sbin/sh","-c","umount /data;
  200. umount /system;");
  201. ui_print("-All done :)");
Add Comment
Please, Sign In to add comment