Advertisement
nicklovell123

Untitled

Feb 8th, 2014
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.77 KB | None | 0 0
  1. package_extract_file("updater.sh", "/tmp/updater.sh");
  2. set_perm(0, 0, 0777, "/tmp/updater.sh");
  3. package_extract_file("make_ext4fs", "/tmp/make_ext4fs");
  4. set_perm(0, 0, 0777, "/tmp/make_ext4fs");
  5. package_extract_file("busybox", "/tmp/busybox");
  6. set_perm(0, 0, 0777, "/tmp/busybox");
  7. package_extract_file("flash_image", "/tmp/flash_image");
  8. set_perm(0, 0, 0777, "/tmp/flash_image");
  9. package_extract_file("erase_image", "/tmp/erase_image");
  10. set_perm(0, 0, 0777, "/tmp/erase_image");
  11. package_extract_file("bml_over_mtd", "/tmp/bml_over_mtd");
  12. set_perm(0, 0, 0777, "/tmp/bml_over_mtd");
  13. package_extract_file("bml_over_mtd.sh", "/tmp/bml_over_mtd.sh");
  14. set_perm(0, 0, 0777, "/tmp/bml_over_mtd.sh");
  15. package_extract_file("boot.img", "/tmp/boot.img");
  16. package_extract_file("boot_p1ln.img", "/tmp/boot_p1ln.img");
  17. assert(run_program("/tmp/p1ln.sh") == 0);
  18. assert(run_program("/tmp/updater.sh") == 0);
  19. mount("yaffs2", "MTD", "system", "/system");
  20. package_extract_dir("system/addon.d", "/system/addon.d");
  21. package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
  22. package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
  23. set_perm(0, 0, 0777, "/tmp/backuptool.sh");
  24. set_perm(0, 0, 0644, "/tmp/backuptool.functions");
  25. run_program("/tmp/backuptool.sh", "backup");
  26. unmount("/system");
  27. show_progress(0.500000, 0);
  28. ui_print("");
  29. ui_print("");
  30. ui_print("Slim Roms");
  31. ui_print("");
  32. ui_print(" www.slimroms.net ");
  33. ui_print("");
  34. ui_print("");
  35. ui_print("Format and Mount System, Mount Data...");
  36. format("yaffs2", "MTD", "system", "0", "/system");
  37. mount("yaffs2", "MTD", "system", "/system");
  38. mount("ext4", "EMMC", "/dev/block/mmcblk0p2", "/data");
  39. package_extract_dir("system", "/system");
  40. package_extract_dir("data", "/data");
  41. ui_print("Symlinks and permissions...");
  42. symlink("../xbin/su", "/system/bin/su");
  43. symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
  44. symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
  45. symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
  46. "/system/xbin/adjtimex", "/system/xbin/arp", "/system/xbin/ash",
  47. "/system/xbin/awk", "/system/xbin/base64", "/system/xbin/basename",
  48. "/system/xbin/bbconfig", "/system/xbin/blkid", "/system/xbin/blockdev",
  49. "/system/xbin/brctl", "/system/xbin/bunzip2", "/system/xbin/bzcat",
  50. "/system/xbin/bzip2", "/system/xbin/cal", "/system/xbin/cat",
  51. "/system/xbin/catv", "/system/xbin/chattr", "/system/xbin/chgrp",
  52. "/system/xbin/chmod", "/system/xbin/chown", "/system/xbin/chroot",
  53. "/system/xbin/clear", "/system/xbin/cmp", "/system/xbin/comm",
  54. "/system/xbin/cp", "/system/xbin/cpio", "/system/xbin/crond",
  55. "/system/xbin/crontab", "/system/xbin/cut", "/system/xbin/date",
  56. "/system/xbin/dc", "/system/xbin/dd", "/system/xbin/depmod",
  57. "/system/xbin/devmem", "/system/xbin/df", "/system/xbin/diff",
  58. "/system/xbin/dirname", "/system/xbin/dmesg", "/system/xbin/dnsd",
  59. "/system/xbin/dos2unix", "/system/xbin/du", "/system/xbin/echo",
  60. "/system/xbin/ed", "/system/xbin/egrep", "/system/xbin/env",
  61. "/system/xbin/expand", "/system/xbin/expr", "/system/xbin/false",
  62. "/system/xbin/fbsplash", "/system/xbin/fdisk", "/system/xbin/fgrep",
  63. "/system/xbin/find", "/system/xbin/flash_lock",
  64. "/system/xbin/flash_unlock", "/system/xbin/flashcp",
  65. "/system/xbin/flock", "/system/xbin/fold", "/system/xbin/free",
  66. "/system/xbin/freeramdisk", "/system/xbin/fstrim", "/system/xbin/fsync",
  67. "/system/xbin/ftpget", "/system/xbin/ftpput", "/system/xbin/fuser",
  68. "/system/xbin/getopt", "/system/xbin/grep", "/system/xbin/groups",
  69. "/system/xbin/gunzip", "/system/xbin/gzip", "/system/xbin/halt",
  70. "/system/xbin/head", "/system/xbin/hexdump", "/system/xbin/id",
  71. "/system/xbin/ifconfig", "/system/xbin/inetd", "/system/xbin/insmod",
  72. "/system/xbin/install", "/system/xbin/ionice", "/system/xbin/iostat",
  73. "/system/xbin/ip", "/system/xbin/kill", "/system/xbin/killall",
  74. "/system/xbin/killall5", "/system/xbin/less", "/system/xbin/ln",
  75. "/system/xbin/losetup", "/system/xbin/ls", "/system/xbin/lsattr",
  76. "/system/xbin/lsmod", "/system/xbin/lsusb", "/system/xbin/lzcat",
  77. "/system/xbin/lzma", "/system/xbin/lzop", "/system/xbin/lzopcat",
  78. "/system/xbin/man", "/system/xbin/md5sum", "/system/xbin/mesg",
  79. "/system/xbin/mkdir", "/system/xbin/mke2fs", "/system/xbin/mkfifo",
  80. "/system/xbin/mkfs.ext2", "/system/xbin/mkfs.vfat",
  81. "/system/xbin/mknod", "/system/xbin/mkswap", "/system/xbin/mktemp",
  82. "/system/xbin/modinfo", "/system/xbin/modprobe", "/system/xbin/more",
  83. "/system/xbin/mount", "/system/xbin/mountpoint", "/system/xbin/mpstat",
  84. "/system/xbin/mv", "/system/xbin/nanddump", "/system/xbin/nandwrite",
  85. "/system/xbin/nbd-client", "/system/xbin/netstat", "/system/xbin/nice",
  86. "/system/xbin/nohup", "/system/xbin/nslookup", "/system/xbin/ntpd",
  87. "/system/xbin/od", "/system/xbin/patch", "/system/xbin/pgrep",
  88. "/system/xbin/pidof", "/system/xbin/ping", "/system/xbin/pipe_progress",
  89. "/system/xbin/pkill", "/system/xbin/pmap", "/system/xbin/poweroff",
  90. "/system/xbin/printenv", "/system/xbin/printf", "/system/xbin/ps",
  91. "/system/xbin/pstree", "/system/xbin/pwd", "/system/xbin/pwdx",
  92. "/system/xbin/rdev", "/system/xbin/readlink", "/system/xbin/realpath",
  93. "/system/xbin/renice", "/system/xbin/reset", "/system/xbin/resize",
  94. "/system/xbin/rev", "/system/xbin/rm", "/system/xbin/rmdir",
  95. "/system/xbin/rmmod", "/system/xbin/route", "/system/xbin/run-parts",
  96. "/system/xbin/rx", "/system/xbin/sed", "/system/xbin/seq",
  97. "/system/xbin/setconsole", "/system/xbin/setserial",
  98. "/system/xbin/setsid", "/system/xbin/sh", "/system/xbin/sha1sum",
  99. "/system/xbin/sha256sum", "/system/xbin/sha3sum",
  100. "/system/xbin/sha512sum", "/system/xbin/sleep", "/system/xbin/sort",
  101. "/system/xbin/split", "/system/xbin/stat", "/system/xbin/strings",
  102. "/system/xbin/stty", "/system/xbin/sum", "/system/xbin/swapoff",
  103. "/system/xbin/swapon", "/system/xbin/sync", "/system/xbin/sysctl",
  104. "/system/xbin/tac", "/system/xbin/tail", "/system/xbin/tar",
  105. "/system/xbin/taskset", "/system/xbin/tee", "/system/xbin/telnet",
  106. "/system/xbin/telnetd", "/system/xbin/test", "/system/xbin/tftp",
  107. "/system/xbin/tftpd", "/system/xbin/time", "/system/xbin/timeout",
  108. "/system/xbin/top", "/system/xbin/touch", "/system/xbin/tr",
  109. "/system/xbin/traceroute", "/system/xbin/true", "/system/xbin/ttysize",
  110. "/system/xbin/tune2fs", "/system/xbin/umount", "/system/xbin/uname",
  111. "/system/xbin/uncompress", "/system/xbin/unexpand", "/system/xbin/uniq",
  112. "/system/xbin/unix2dos", "/system/xbin/unlzma", "/system/xbin/unlzop",
  113. "/system/xbin/unxz", "/system/xbin/unzip", "/system/xbin/uptime",
  114. "/system/xbin/usleep", "/system/xbin/uudecode", "/system/xbin/uuencode",
  115. "/system/xbin/vi", "/system/xbin/watch", "/system/xbin/wc",
  116. "/system/xbin/wget", "/system/xbin/which", "/system/xbin/whoami",
  117. "/system/xbin/xargs", "/system/xbin/xz", "/system/xbin/xzcat",
  118. "/system/xbin/yes",
  119. "/system/xbin/zcat");
  120. symlink("libGLESv2.so", "/system/lib/libGLESv3.so");
  121. symlink("mksh", "/system/bin/sh");
  122. symlink("toolbox", "/system/bin/cat", "/system/bin/chcon",
  123. "/system/bin/chmod", "/system/bin/chown", "/system/bin/clear",
  124. "/system/bin/cmp", "/system/bin/cp", "/system/bin/date",
  125. "/system/bin/dd", "/system/bin/df", "/system/bin/dmesg",
  126. "/system/bin/du", "/system/bin/getenforce", "/system/bin/getevent",
  127. "/system/bin/getprop", "/system/bin/getsebool", "/system/bin/grep",
  128. "/system/bin/hd", "/system/bin/id", "/system/bin/ifconfig",
  129. "/system/bin/iftop", "/system/bin/insmod", "/system/bin/ioctl",
  130. "/system/bin/ionice", "/system/bin/kill", "/system/bin/ln",
  131. "/system/bin/load_policy", "/system/bin/log", "/system/bin/ls",
  132. "/system/bin/lsmod", "/system/bin/lsof", "/system/bin/md5",
  133. "/system/bin/mkdir", "/system/bin/mkswap", "/system/bin/mount",
  134. "/system/bin/mv", "/system/bin/nandread", "/system/bin/netstat",
  135. "/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
  136. "/system/bin/ps", "/system/bin/r", "/system/bin/readlink",
  137. "/system/bin/renice", "/system/bin/restorecon", "/system/bin/rm",
  138. "/system/bin/rmdir", "/system/bin/rmmod", "/system/bin/route",
  139. "/system/bin/runcon", "/system/bin/schedtop", "/system/bin/sendevent",
  140. "/system/bin/setconsole", "/system/bin/setenforce",
  141. "/system/bin/setprop", "/system/bin/setsebool", "/system/bin/sleep",
  142. "/system/bin/smd", "/system/bin/start", "/system/bin/stop",
  143. "/system/bin/swapoff", "/system/bin/swapon", "/system/bin/sync",
  144. "/system/bin/top", "/system/bin/touch", "/system/bin/umount",
  145. "/system/bin/uptime", "/system/bin/vmstat", "/system/bin/watchprops",
  146. "/system/bin/wipe");
  147. set_metadata_recursive("/system", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  148. set_metadata_recursive("/system/addon.d", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  149. set_metadata_recursive("/system/bin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  150. set_metadata("/system/bin/app_process", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:zygote_exec:s0");
  151. set_metadata("/system/bin/clatd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:clatd_exec:s0");
  152. set_metadata("/system/bin/debuggerd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:debuggerd_exec:s0");
  153. set_metadata("/system/bin/dhcpcd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dhcp_exec:s0");
  154. set_metadata("/system/bin/dnsmasq", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dnsmasq_exec:s0");
  155. set_metadata("/system/bin/drmserver", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:drmserver_exec:s0");
  156. set_metadata("/system/bin/hostapd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:hostapd_exec:s0");
  157. set_metadata("/system/bin/installd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:installd_exec:s0");
  158. set_metadata("/system/bin/keystore", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:keystore_exec:s0");
  159. set_metadata("/system/bin/mediaserver", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mediaserver_exec:s0");
  160. set_metadata("/system/bin/mksh", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:shell_exec:s0");
  161. set_metadata("/system/bin/mtpd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtp_exec:s0");
  162. set_metadata("/system/bin/netcfg", "uid", 0, "gid", 3003, "mode", 02750, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  163. set_metadata("/system/bin/netd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:netd_exec:s0");
  164. set_metadata("/system/bin/ping", "uid", 0, "gid", 0, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ping_exec:s0");
  165. set_metadata("/system/bin/pppd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ppp_exec:s0");
  166. set_metadata("/system/bin/qemud", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:qemud_exec:s0");
  167. set_metadata("/system/bin/racoon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:racoon_exec:s0");
  168. set_metadata("/system/bin/rild", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:rild_exec:s0");
  169. set_metadata("/system/bin/run-as", "uid", 0, "gid", 2000, "mode", 0750, "capabilities", 0xc0, "selabel", "u:object_r:runas_exec:s0");
  170. set_metadata("/system/bin/sdcard", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:sdcardd_exec:s0");
  171. set_metadata("/system/bin/servicemanager", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:servicemanager_exec:s0");
  172. set_metadata("/system/bin/surfaceflinger", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:surfaceflinger_exec:s0");
  173. set_metadata("/system/bin/tvouthack", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:tvouthack_exec:s0");
  174. set_metadata("/system/bin/tvoutserver", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:tvoutserver_exec:s0");
  175. set_metadata("/system/bin/vold", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:vold_exec:s0");
  176. set_metadata("/system/bin/wpa_supplicant", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wpa_exec:s0");
  177. set_metadata_recursive("/system/etc/dhcpcd", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:dhcp_system_file:s0");
  178. set_metadata("/system/etc/dhcpcd/dhcpcd-run-hooks", "uid", 1014, "gid", 2000, "mode", 0550, "capabilities", 0x0, "selabel", "u:object_r:dhcp_system_file:s0");
  179. set_metadata_recursive("/system/etc/init.d", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  180. set_metadata("/system/etc/init.d", "uid", 0, "gid", 0, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  181. set_metadata("/system/etc/init.goldfish.sh", "uid", 0, "gid", 2000, "mode", 0550, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  182. set_metadata_recursive("/system/etc/ppp", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0555, "capabilities", 0x0, "selabel", "u:object_r:ppp_system_file:s0");
  183. set_metadata("/system/vendor", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  184. set_metadata_recursive("/system/vendor/bin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:gpsd_exec:s0");
  185. set_metadata("/system/vendor/bin", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  186. set_metadata("/system/vendor/bin/set-macaddr", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  187. set_metadata("/system/vendor/etc", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  188. set_metadata("/system/vendor/firmware", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  189. set_metadata("/system/vendor/lib", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  190. set_metadata("/system/vendor/lib/egl", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  191. set_metadata_recursive("/system/vendor/lib/hw", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  192. set_metadata("/system/vendor/lib/hw/gralloc.s5pc110.so", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  193. set_metadata_recursive("/system/xbin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  194. set_metadata("/system/xbin/librank", "uid", 0, "gid", 0, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  195. set_metadata("/system/xbin/procmem", "uid", 0, "gid", 0, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  196. set_metadata("/system/xbin/procrank", "uid", 0, "gid", 0, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
  197. set_metadata("/system/xbin/su", "uid", 0, "gid", 0, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:su_exec:s0");
  198. show_progress(0.200000, 0);
  199. show_progress(0.200000, 10);
  200. package_extract_dir("system/addon.d", "/system/addon.d");
  201. package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
  202. package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
  203. set_perm(0, 0, 0777, "/tmp/backuptool.sh");
  204. set_perm(0, 0, 0644, "/tmp/backuptool.functions");
  205. run_program("/tmp/backuptool.sh", "restore");
  206. delete("/system/bin/backuptool.sh");
  207. delete("/system/bin/backuptool.functions");
  208. show_progress(0.200000, 10);
  209. ui_print("Flashing Boot Image...");
  210. show_progress(0.100000, 0);
  211. unmount("/data");
  212. unmount("/system");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement