# file.te
+### DATA
+type conn_vendor_data_file, file_type, data_file_type;
+type wifi_vendor_data_file, file_type, data_file_type;
+
### SYSFS
+type sysfs_wifi, sysfs_type, r_fs_type, fs_type;
+
type sysfs_backlight_writable, sysfs_type, rw_fs_type, fs_type;
+type sysfs_wifi_writable, sysfs_type, rw_fs_type, fs_type;
# file_contexts
+### DATA
+/data/vendor/conn(/.*)? u:object_r:conn_vendor_data_file:s0
+/data/vendor/wifi(/.*)? u:object_r:wifi_vendor_data_file:s0
+
### VENDOR
/(vendor|system/vendor)/bin/hw/android\.hardware\.light@[0-9].[0-9]-service\.samsung u:object_r:hal_light_default_exec:s0
/(vendor|system/vendor)/bin/hw/android\.hardware\.power@[0-9].[0-9]-service\.exynos u:object_r:hal_power_default_exec:s0
genfscon sysfs /devices/virtual/timed_output/vibrator/intensity u:object_r:sysfs_vibrator:s0
genfscon sysfs /devices/virtual/timed_output/vibrator/multi_freq u:object_r:sysfs_vibrator:s0
genfscon sysfs /devices/virtual/timed_output/vibrator/cp_trigger_index u:object_r:sysfs_vibrator:s0
+
+genfscon sysfs /module/dhd/parameters u:object_r:sysfs_wifi_writable:s0
+
+genfscon sysfs /wifi u:object_r:sysfs_wifi:s0
+genfscon sysfs /wifi/cid u:object_r:sysfs_wifi_writable:s0
+genfscon sysfs /wifi/mac_addr u:object_r:sysfs_wifi_writable:s0
+genfscon sysfs /wifi/memdump u:object_r:sysfs_wifi_writable:s0
--- /dev/null
+# macloader.te
+
+type macloader, domain;
+type macloader_exec, exec_type, vendor_file_type, file_type;
+
+# macloader is started by init, type transit from init domain to macloader domain
+init_daemon_domain(macloader)
+
+allow macloader self:capability { net_admin };
+
+allow macloader self:udp_socket create_socket_perms;
+allowxperm macloader self:udp_socket ioctl { 0x8913 0x8914 };
+
+# /data/vendor/conn
+allow macloader conn_vendor_data_file:dir rw_dir_perms;
+allow macloader conn_vendor_data_file:file create_file_perms;
+
+# /sys/class/net
+allow macloader sysfs_net:dir r_dir_perms;
+allow macloader sysfs_net:file r_file_perms;
+
+# /sys/module/dhd/parameters/firmware_path
+allow macloader sysfs_wifi_writable:dir r_dir_perms;
+allow macloader sysfs_wifi_writable:file rw_file_perms;
+
+# /sys/wifi
+allow macloader sysfs_wifi:dir r_dir_perms;
+allow macloader sysfs_wifi:file r_file_perms;