Advertisement
Guest User

Untitled

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