第六句依旧是一个整体
刷入了这么多文件,有些文件需要改动权限。所以要用到以下命令
下面的set_perm_recursive 是给文件夹赋予相应的权限,以后自己做包的时候可以直接参考下面的内容。
set_perm 是给文件赋予权限。大家自几看下不同文件夹和文件需要的权限,看到下面的数字是不是不懂什么意思?
读r=4写w=2执行x=1对应的数相加 就是相应的权限。
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 06755, "/system/bin/ip");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
set_perm(0, 2000, 0755, "/system/vendor/lib");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/su");
show_progress(0.200000, 10);
ui_print("Updating BOOT Image...");(刷入BOOT内核)
package_extract_file("boot.img", "/dev/block/mmcblk0p12");
ui_print("Updating cust partition...");
format("ext4", "EMMC", "/dev/block/mmcblk0p16", "0");
mount("ext4", "EMMC", "/dev/block/mmcblk0p16", "/cust");
package_extract_dir("cust", "/cust");
show_progress(0.1, 0);
unmount("/system");(卸载system分区 )
unmount("/cust");(卸载cust分区 )
ui_print("Installation complete!");(安装结束)