From 56a0d4e8bca5cb53407e9d615ed5566e87f34c2b Mon Sep 17 00:00:00 2001 From: Davide Garberi Date: Fri, 1 Mar 2019 21:37:44 +0100 Subject: msm8996-common: Remove readmac * We don't need this anymore, no random mac because the real hardware wlan mac works now Change-Id: I13f85f4eb438b2230408d5bad1c694b2cd39a25b --- msm8996.mk | 1 - readmac/Android.mk | 12 -------- readmac/zuk_readmac.c | 73 ------------------------------------------------ rootdir/etc/init.qcom.rc | 6 ---- sepolicy/file_contexts | 3 -- sepolicy/readmac.te | 12 -------- 6 files changed, 107 deletions(-) delete mode 100644 readmac/Android.mk delete mode 100644 readmac/zuk_readmac.c delete mode 100644 sepolicy/readmac.te diff --git a/msm8996.mk b/msm8996.mk index e4da16b..ed8916c 100755 --- a/msm8996.mk +++ b/msm8996.mk @@ -385,7 +385,6 @@ PRODUCT_PACKAGES += \ libQWiFiSoftApCfg \ libwpa_client \ hostapd \ - readmac \ wpa_supplicant \ wpa_supplicant.conf diff --git a/readmac/Android.mk b/readmac/Android.mk deleted file mode 100644 index 64aee35..0000000 --- a/readmac/Android.mk +++ /dev/null @@ -1,12 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -ifeq ($(strip $(BOARD_HAS_QCOM_WLAN)),true) -include $(CLEAR_VARS) -LOCAL_MODULE := readmac -LOCAL_MODULE_TAGS := optional -LOCAL_PROPRIETARY_MODULE := true -LOCAL_SRC_FILES := zuk_readmac.c -LOCAL_CFLAGS += -Wall -Werror -LOCAL_SHARED_LIBRARIES := libc libcutils libutils liblog -include $(BUILD_EXECUTABLE) -endif diff --git a/readmac/zuk_readmac.c b/readmac/zuk_readmac.c deleted file mode 100644 index a41d6db..0000000 --- a/readmac/zuk_readmac.c +++ /dev/null @@ -1,73 +0,0 @@ -#define LOG_TAG "zuk_readmac" -#define LOG_NDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include - -#define MAC_ADDR_SIZE 6 -#define WLAN_MAC_BIN "/persist/wlan_mac.bin" - -static int check_wlan_mac_bin_file() -{ - char content[1024]; - FILE *fp; - - fp = fopen(WLAN_MAC_BIN, "r"); - if (fp != NULL) { - memset(content, 0, sizeof(content)); - fread(content, 1, sizeof(content)-1, fp); - fclose(fp); - - if (strstr(content, "Intf0MacAddress") == NULL) { - ALOGV("%s is missing Intf0MacAddress entry value", WLAN_MAC_BIN); - return 1; - } - - if (strstr(content, "Intf1MacAddress") == NULL) { - ALOGV("%s is missing Intf1MacAddress entry value", WLAN_MAC_BIN); - return 1; - } - - return 0; - } - return 1; -} - -int main() -{ - int i, wlan_addr3, wlan_addr4, wlan_addr5; - - // First 6 hex number are fix - unsigned char wlan_addr[] = { 0xd8, 0x9a, 0x34 }; - - // Last 6 hex number are random - srand(time(NULL) + getpid()); - for (i = 0; i < 3; i++) { - wlan_addr3 = rand() % 256; - wlan_addr4 = rand() % 256; - wlan_addr5 = rand() % 256; - } - - FILE *fp; - - // Store WLAN MAC address in the persist file, if needed - if (check_wlan_mac_bin_file()) { - fp = fopen(WLAN_MAC_BIN, "w"); - fprintf(fp, "Intf0MacAddress=%02X%02X%02X%02X%02X%02X\n", - wlan_addr[0], wlan_addr[1], wlan_addr[2], wlan_addr3, wlan_addr4, wlan_addr5); - fprintf(fp, "Intf1MacAddress=%02X%02X%02X%02X%02X%02X\n", - wlan_addr[0], wlan_addr[1], wlan_addr[2], wlan_addr3, wlan_addr4, (wlan_addr5+1)); - fprintf(fp, "END\n"); - fclose(fp); - ALOGV("%s was successfully generated", WLAN_MAC_BIN); - } else { - ALOGV("%s already exists and is valid", WLAN_MAC_BIN); - } - - return 0; -} diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 49e0057..dc95d51 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -510,12 +510,6 @@ on property:init.svc.per_mgr=running on property:sys.shutdown.requested=* stop per_proxy -service readmac /vendor/bin/readmac - class main - user root - group root oem_2901 - oneshot - service thermal-engine /vendor/bin/thermal-engine -c /vendor/etc/thermal-engine.conf class main user root diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 7112268..f4b765f 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -11,9 +11,6 @@ /data/decrypt\.txt u:object_r:thermal_data_file:s0 /data/vendor/qcam(/.*)? u:object_r:vendor_camera_data_file:s0 -# Binaries -/vendor/bin/readmac u:object_r:readmac_exec:s0 - # HALs /vendor/bin/hw/android\.hardware\.light@2\.0-service\.zuk_8996 u:object_r:hal_light_default_exec:s0 /vendor/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.0-service\.zuk u:object_r:hal_fingerprint_default_exec:s0 diff --git a/sepolicy/readmac.te b/sepolicy/readmac.te deleted file mode 100644 index 187991a..0000000 --- a/sepolicy/readmac.te +++ /dev/null @@ -1,12 +0,0 @@ -type readmac, domain; -type readmac_exec, exec_type, vendor_file_type, file_type; - -# Allow for transition from init domain to readmac -init_daemon_domain(readmac) - -# Allow readmac to fully access wlan_mac.bin persist file -allow readmac mnt_vendor_file:dir rw_dir_perms; -allow readmac mnt_vendor_file:file create_file_perms; - -allow readmac diag_device:chr_file rw_file_perms; -allow readmac sysfs:file r_file_perms; -- cgit v1.2.3