- Posts no fórum: 1 987
18/12/2013, 19:19:14 via Web
18/12/2013 19:19:14 via Web
Veja um exemplo de um updater-script :
2 getprop("ro.product.device") == "i9070" || getprop("ro.build.product") == "i9070" ||
3 getprop("ro.product.device") == "GT-I9070" || getprop("ro.build.product") == "GT-I9070");
4mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");
5package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
6package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
7set_perm(0, 0, 0777, "/tmp/backuptool.sh");
8set_perm(0, 0, 0644, "/tmp/backuptool.functions");
9run_program("/tmp/backuptool.sh", "backup");
10unmount("/system");
11show_progress(0.500000, 0);
12unmount("/system");
13format("ext4", "EMMC", "/dev/block/mmcblk0p3", "0", "/system");
14mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");
15package_extract_dir("recovery", "/system");
16package_extract_dir("system", "/system");
17symlink("../xbin/su", "/system/bin/su");
18symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
19symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
20symlink("libGLESv2.so", "/system/lib/libGLESv3.so");
21symlink("logcat", "/system/bin/lolcat");
22symlink("mksh", "/system/bin/sh");
23symlink("mount.exfat", "/system/bin/fsck.exfat",
24 "/system/bin/mkfs.exfat");
25symlink("pigz", "/system/xbin/unpigz");
26symlink("toolbox", "/system/bin/cat", "/system/bin/chcon",
27 "/system/bin/chmod", "/system/bin/chown", "/system/bin/clear",
28 "/system/bin/cmp", "/system/bin/cp", "/system/bin/date",
29 "/system/bin/dd", "/system/bin/df", "/system/bin/dmesg",
30 "/system/bin/du", "/system/bin/getenforce", "/system/bin/getevent",
31 "/system/bin/getprop", "/system/bin/getsebool", "/system/bin/grep",
32 "/system/bin/hd", "/system/bin/id", "/system/bin/ifconfig",
33 "/system/bin/iftop", "/system/bin/insmod", "/system/bin/ioctl",
34 "/system/bin/ionice", "/system/bin/kill", "/system/bin/ln",
35 "/system/bin/load_policy", "/system/bin/log", "/system/bin/ls",
36 "/system/bin/lsmod", "/system/bin/lsof", "/system/bin/md5",
37 "/system/bin/mkdir", "/system/bin/mount", "/system/bin/mv",
38 "/system/bin/nandread", "/system/bin/netstat",
39 "/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
40 "/system/bin/ps", "/system/bin/r", "/system/bin/reboot",
41 "/system/bin/renice", "/system/bin/restart", "/system/bin/restorecon",
42 "/system/bin/rm", "/system/bin/rmdir", "/system/bin/rmmod",
43 "/system/bin/route", "/system/bin/runcon", "/system/bin/schedtop",
44 "/system/bin/sendevent", "/system/bin/setconsole",
45 "/system/bin/setenforce", "/system/bin/setfattr", "/system/bin/setprop",
46 "/system/bin/setsebool", "/system/bin/sleep", "/system/bin/smd",
47 "/system/bin/start", "/system/bin/stop", "/system/bin/sync",
48 "/system/bin/top", "/system/bin/touch", "/system/bin/umount",
49 "/system/bin/uptime", "/system/bin/vmstat", "/system/bin/watchprops",
50 "/system/bin/wipe");
51set_perm_recursive(0, 0, 0755, 0644, "/system");
52set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");
53set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
54set_perm(0, 3003, 02750, "/system/bin/netcfg");
55set_perm(0, 0, 0755, "/system/bin/ping");
56set_perm(0, 2000, 0750, "/system/bin/run-as");
57set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
58set_perm_recursive(0, 2000, 0755, 0755, "/system/etc/init.d");
59set_perm(0, 0, 0755, "/system/etc/init.d");
60set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
61set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
62set_perm(0, 2000, 0755, "/system/vendor");
63set_perm(0, 2000, 0755, "/system/vendor/etc");
64set_perm(0, 2000, 0755, "/system/vendor/firmware");
65set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/lib");
66set_perm(0, 0, 0644, "/system/vendor/lib/libbt-vendor.so");
67set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
68set_perm(0, 0, 06755, "/system/xbin/librank");
69set_perm(0, 0, 06755, "/system/xbin/procmem");
70set_perm(0, 0, 06755, "/system/xbin/procrank");
71set_perm(0, 0, 06755, "/system/xbin/su");
72set_perm(0, 0, 06755, "/system/xbin/tcpdump");
73show_progress(0.200000, 0);
74show_progress(0.200000, 10);
75package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
76package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
77set_perm(0, 0, 0777, "/tmp/backuptool.sh");
78set_perm(0, 0, 0644, "/tmp/backuptool.functions");
79run_program("/tmp/backuptool.sh", "restore");
80delete("/system/bin/backuptool.sh");
81delete("/system/bin/backuptool.functions");
82show_progress(0.200000, 10);
83assert(package_extract_file("boot.img", "/tmp/boot.img"),
84 write_raw_image("/tmp/boot.img", "/dev/block/mmcblk0p15"),
85 delete("/tmp/boot.img"));
86show_progress(0.100000, 0);
87unmount("/system");
— alterado em 18/12/2013, 20:02:44
Lost in Amsterdam?
Conteúdo editorial recomendado
Com o seu consentimento, o conteúdo externo é carregado aqui.
Ao clicar no botão acima, concorda que o conteúdo externo poderá ser-lhe exibido. Os dados pessoais podem ser transmitidos a fornecedores terceiros no processo. Pode encontrar mais informações sobre isto no nosso Política de Privacidade.