From 9f2cdeb5b4f74fedc447c08311de5874ed0d5335 Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Fri, 22 Oct 2021 02:54:58 +0900 Subject: [PATCH] universal7885: SamsungParts: Update relevant SEPolicy Change-Id: I13eb7abd5d0651a52a8a14211c00b5e74798976f Signed-off-by: roynatech2544 --- universal7885-common/BoardConfigCommon.mk | 6 ++-- .../SamsungParts/SamsungParts.rc | 6 ++-- .../init/init_universal7884B.cpp | 2 +- universal7885-common/lineage.dependencies | 30 ------------------- .../sepolicy/samsung_slsi/vendor/file.te | 8 ++--- .../sepolicy/samsungparts/file.te | 6 ++++ .../sepolicy/samsungparts/system_app.te | 7 +++-- 7 files changed, 24 insertions(+), 41 deletions(-) delete mode 100644 universal7885-common/lineage.dependencies create mode 100644 universal7885-common/sepolicy/samsungparts/file.te diff --git a/universal7885-common/BoardConfigCommon.mk b/universal7885-common/BoardConfigCommon.mk index 81c2c5a..1a6203b 100644 --- a/universal7885-common/BoardConfigCommon.mk +++ b/universal7885-common/BoardConfigCommon.mk @@ -85,11 +85,13 @@ ENABLE_VENDOR_RIL_SERVICE := true # Sepolicy SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += \ $(COMMON_PATH)/sepolicy/samsung_slsi/tee/public \ - $(COMMON_PATH)/sepolicy/samsung_slsi/public + $(COMMON_PATH)/sepolicy/samsung_slsi/public \ + $(COMMON_PATH)/sepolicy/samsungparts BOARD_VENDOR_SEPOLICY_DIRS += \ $(COMMON_PATH)/sepolicy/samsung_slsi/tee/vendor \ - $(COMMON_PATH)/sepolicy/vendor + $(COMMON_PATH)/sepolicy/vendor \ + $(COMMON_PATH)/sepolicy/samsung_slsi/vendor SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += \ $(COMMON_PATH)/sepolicy/samsung_slsi/private diff --git a/universal7885-common/SamsungParts/SamsungParts.rc b/universal7885-common/SamsungParts/SamsungParts.rc index 37ce7e4..c7da3fb 100644 --- a/universal7885-common/SamsungParts/SamsungParts.rc +++ b/universal7885-common/SamsungParts/SamsungParts.rc @@ -6,6 +6,8 @@ on property:sys.boot_completed=1 chmod 664 /sys/class/camera/flash/torch_brightness_lvl_enable chown system system /sys/class/camera/flash/torch_brightness_lvl_enable chmod 664 /sys/devices/platform/battery/power_supply/battery/batt_slate_mode - chmod system system /sys/devices/platform/battery/power_supply/battery/batt_slate_mode + chown system system /sys/devices/platform/battery/power_supply/battery/batt_slate_mode chmod 644 /sys/class/sec/switch/afc_disable - chmod system system /sys/class/sec/switch/afc_disable + chown system system /sys/class/sec/switch/afc_disable + chmod 644 /sys/fs/selinux/enforce + chown system system /sys/fs/selinux/enforce diff --git a/universal7885-common/init/init_universal7884B.cpp b/universal7885-common/init/init_universal7884B.cpp index c9f2993..2d08fc0 100644 --- a/universal7885-common/init/init_universal7884B.cpp +++ b/universal7885-common/init/init_universal7884B.cpp @@ -79,7 +79,7 @@ void vendor_load_properties() { model = GetProperty("ro.boot.em.model", ""); } - if (odel == "SM-A205FN" || model == "SM-A205GN" || model == "SM-A202K" || model == "SM-A205YN") { + if (model == "SM-A205FN" || model == "SM-A205GN" || model == "SM-A202K" || model == "SM-A205YN") { property_override("ro.boot.product.hardware.sku", "NFC"); } diff --git a/universal7885-common/lineage.dependencies b/universal7885-common/lineage.dependencies deleted file mode 100644 index ffa7d12..0000000 --- a/universal7885-common/lineage.dependencies +++ /dev/null @@ -1,30 +0,0 @@ -[ - { - "repository": "android_device_samsung_slsi_sepolicy", - "target_path": "device/samsung_slsi/sepolicy" - }, - { - "repository": "android_hardware_samsung", - "target_path": "hardware/samsung" - }, - { - "repository": "android_hardware_samsung_nfc", - "target_path": "hardware/samsung/nfc" - }, - { - "repository": "android_hardware_samsung_slsi_libbt", - "target_path": "hardware/samsung_slsi/libbt" - }, - { - "repository": "android_hardware_samsung_slsi_scsc_wifibt_wifi_hal", - "target_path": "hardware/samsung_slsi/scsc_wifibt/wifi_hal" - }, - { - "repository": "android_hardware_samsung_slsi_scsc_wifibt_wpa_supplicant_lib", - "target_path": "hardware/samsung_slsi/scsc_wifibt/wpa_supplicant_lib" - }, - { - "repository": "android_kernel_samsung_universal7884B", - "target_path": "kernel/samsung/universal7884B" - } -] diff --git a/universal7885-common/sepolicy/samsung_slsi/vendor/file.te b/universal7885-common/sepolicy/samsung_slsi/vendor/file.te index 1e450df..964d946 100644 --- a/universal7885-common/sepolicy/samsung_slsi/vendor/file.te +++ b/universal7885-common/sepolicy/samsung_slsi/vendor/file.te @@ -30,7 +30,7 @@ type epicd_socket, file_type, data_file_type; ### SYSFS type sysfs_argos, sysfs_type, r_fs_type, fs_type; -type sysfs_battery, sysfs_type, r_fs_type, fs_type; +#type sysfs_battery, sysfs_type, r_fs_type, fs_type; type sysfs_bbd, sysfs_type, r_fs_type, fs_type; type sysfs_fingerprint, sysfs_type, r_fs_type, fs_type; type sysfs_iio, sysfs_type, r_fs_type, fs_type; @@ -38,14 +38,14 @@ type sysfs_input, sysfs_type, r_fs_type, fs_type; type sysfs_sec_gps, sysfs_type, r_fs_type, fs_type; type sysfs_sec_key, sysfs_type, r_fs_type, fs_type; type sysfs_sec_sensors, sysfs_type, r_fs_type, fs_type; -type sysfs_sec_switch, sysfs_type, r_fs_type, fs_type; +#type sysfs_sec_switch, sysfs_type, r_fs_type, fs_type; type sysfs_sec_touchscreen, sysfs_type, r_fs_type, fs_type; type sysfs_sim, sysfs_type, r_fs_type, fs_type; type sysfs_sensors, sysfs_type, r_fs_type, fs_type; type sysfs_wifi, sysfs_type, r_fs_type, fs_type; type sysfs_backlight_writable, sysfs_type, rw_fs_type, fs_type; -type sysfs_battery_writable, sysfs_type, rw_fs_type, fs_type; +#type sysfs_battery_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_bt_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_gps_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_lcd_writable, sysfs_type, rw_fs_type, fs_type; @@ -55,7 +55,7 @@ type sysfs_sensorhub_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_sensors_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_sim_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_spi_writeable, sysfs_type, rw_fs_type, fs_type; -type sysfs_sec_switch_writable, sysfs_type, rw_fs_type, fs_type; +#type sysfs_sec_switch_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_touchscreen_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_wifi_writable, sysfs_type, rw_fs_type, fs_type; diff --git a/universal7885-common/sepolicy/samsungparts/file.te b/universal7885-common/sepolicy/samsungparts/file.te new file mode 100644 index 0000000..14559c8 --- /dev/null +++ b/universal7885-common/sepolicy/samsungparts/file.te @@ -0,0 +1,6 @@ +type sysfs_gpu_tmu, sysfs_type, rw_fs_type, fs_type; +type sysfs_flashlight, sysfs_type, rw_fs_type, fs_type; +type sysfs_sec_switch, sysfs_type, r_fs_type, fs_type; +type sysfs_battery, sysfs_type, r_fs_type, fs_type; +type sysfs_battery_writable, sysfs_type, rw_fs_type, fs_type; +type sysfs_sec_switch_writable, sysfs_type, rw_fs_type, fs_type; diff --git a/universal7885-common/sepolicy/samsungparts/system_app.te b/universal7885-common/sepolicy/samsungparts/system_app.te index 4a636cc..b24e241 100644 --- a/universal7885-common/sepolicy/samsungparts/system_app.te +++ b/universal7885-common/sepolicy/samsungparts/system_app.te @@ -2,5 +2,8 @@ allow system_app sysfs_gpu_tmu:file { read open write getattr }; allow system_app sysfs_flashlight:file { read open write getattr }; allow system_app selinuxfs:file rw_file_perms; allow system_app sysfs_sec_switch:dir { search }; -allow system_app sysfs_sec_switch_writable rw_file_perms; -allow system_app sysfs_battery_writeable rw_file_perms; \ No newline at end of file +allow system_app sysfs_sec_switch_writable:file rw_file_perms; +allow system_app sysfs_battery_writeable:file rw_file_perms; +allow system_app sysfs_sec_switch_writable:dir { search }; +allow system_app sysfs_battery_writeable:dir { search }; +allow system_app sysfs_battery:dir { search };