From 2abdf3da9a14262bf798a2863d406ae4db98fa30 Mon Sep 17 00:00:00 2001 From: ILEX Lin Date: Sat, 18 Jan 2020 10:07:59 +0800 Subject: [PATCH] [ALPS04190424] NFC : W48p0 - Fix SELinux for factory mode [Detail] Factory mode tool for NFC only works with SElinux disabled. [Solution] Update NFC stack to latest release W48p0. Create the communication socket into data/vendor and apply a specific SElinux label. MTK-Commit-Id: 910948f163c96cac14494e5951c504e63a3334ee Change-Id: I9b89e828e344041ef5bb464cc872f442490a6e2a CR-Id: ALPS04190424 Feature: NFC Chipset Capability --- non_plat/factory.te | 7 ++++++- non_plat/file.te | 1 + non_plat/file_contexts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/non_plat/factory.te b/non_plat/factory.te index 71a555f..9c4ce92 100644 --- a/non_plat/factory.te +++ b/non_plat/factory.te @@ -375,4 +375,9 @@ allow factory mtk_audiohal_data_file:file { write create unlink r_file_perms }; allow factory proc_version:file {read open getattr}; # Allow to use persist.radio.multisim.config -allow factory exported3_radio_prop:file { read open getattr }; \ No newline at end of file +allow factory exported3_radio_prop:file { read open getattr }; + +# Purpose : NFC +allow factory vendor_nfc_socket:dir { write add_name remove_name search }; +allow factory vendor_nfc_socket:sock_file { create write unlink setattr }; + diff --git a/non_plat/file.te b/non_plat/file.te index 2de65bd..aa32cde 100644 --- a/non_plat/file.te +++ b/non_plat/file.te @@ -239,6 +239,7 @@ type debugfs_vpu_device_dbg, fs_type, debugfs_type; # SF bqdump type sf_bqdump_data_file, file_type, data_file_type, core_data_file_type; type nfc_socket, file_type, data_file_type, core_data_file_type; +type vendor_nfc_socket, file_type, data_file_type; # factory data file type factory_data_file, file_type, data_file_type, core_data_file_type; # Modem Log folder diff --git a/non_plat/file_contexts b/non_plat/file_contexts index f66bf87..ce48813 100644 --- a/non_plat/file_contexts +++ b/non_plat/file_contexts @@ -45,6 +45,7 @@ #/data/mediacodec(/.*)? u:object_r:mediacodec_data_file:s0 #/data/.tp(/.*)? u:object_r:thermal_manager_data_file:s0 /data/nfc_socket(/.*)? u:object_r:nfc_socket:s0 +/data/vendor/nfc_socket(/.*)? u:object_r:vendor_nfc_socket:s0 #/data/nvram(/.*)? u:object_r:nvram_data_file:s0 #/data/cct(/.*)? u:object_r:cct_data_file:s0 /data/vendor/md3(/.*)? u:object_r:c2k_file:s0