Advertisement
Guest User

Untitled

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