How can I ensure that the file /data/misc/vold/user_keys/ce/0/current/keymaster_key_blob cannot be deleted?

I am an Android system engineer and currently need to modify the system on the Android 11 of the rk3568 platform. I have received feedback from customers that several devices cannot enter the system and are stuck in the boot animation interface. The analysis results show that this is because the file /data/misc/vold/user_keys/ce/0/current/keymaster_key_blob has been deleted. I want to ensure that this file is not deleted by modifying the permissions. I tried to modify the following code and then compile and flash the device, but it didn’t work. What should I do? Thank you

code:

/device/rockchip/rk356x$ git df AndroidProducts.mk
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index f8a1e06..67bd2a9 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -36,4 +36,8 @@ COMMON_LUNCH_CHOICES := 
     rk3566_einkw6-userdebug 
     rk3566_einkw6-user

+#evan add
+# device/rockchip/rk356x/rk3568_r/AndroidProducts.mk
+
+PRODUCT_PACKAGES += evan_init

device/rockchip/rk356x$ git df BoardConfig.mk
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 96ad890..0a87db7 100755
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -110,8 +110,8 @@ BOARD_SHOW_HDMI_SETTING ?= true

 # for dynamaic afbc target
 BOARD_HS_DYNAMIC_AFBC_TARGET := false
-
-PRODUCT_HAVE_OPTEE := true
+# evan set false for can't enter system for keymaster_key_blob
+PRODUCT_HAVE_OPTEE := false

 #trust is merging into uboot
 BOARD_ROCKCHIP_TRUST_MERGE_TO_UBOOT := true

device/rockchip/rk356x$ git df init.rk356x.rc
diff --git a/init.rk356x.rc b/init.rk356x.rc
index 7d3f564..fee54c5 100644
--- a/init.rk356x.rc
+++ b/init.rk356x.rc
@@ -8,6 +8,15 @@ on property:sys.boot_completed=1
     chmod 0664 /sys/class/devfreq/ff400000.gpu/max_freq

     write /sys/devices/system/cpu/cpufreq/policy0/interactive/target_loads 65
+    # evan add
+    start evan_init
+
+#evan add
+service evan_init /system/bin/evan_init
+    class main
+    user root
+    group root
+    oneshot

 on boot
     chown system system /sys/class/thermal/thermal_zone0/policy
@@ -22,6 +31,8 @@ on boot

     # reduce schedul time to improve io performance
     write /sys/kernel/debug/sched_features NO_ENERGY_AWARE
+    # evan add
+    class_start default

 on init
     # Increased power consumption and CPU in exchange for memory

devicerockchiprk356xrk3566_revan_initmain.cpp
// device/rockchip/rk356x/rk3568_r/can_init/main.cpp

#include <iostream>
#include <sys/stat.h>
#include <cstdlib>

int main() {
     std::cout << "xwg nt test-----" << std::endl;
    // 修改 keymaster_key_blob 文件权限为 0444
    const char* filePath = "/data/misc/vold/user_keys/ce/0/current/keymaster_key_blob";
    mode_t mode = 0444;

    if (chmod(filePath, mode) != 0) {
        std::cerr << "Failed to chmod " << filePath << std::endl;
        return 1;
    }

    return 0;
}

Z:sky-8200devicerockchiprk356xrk3566_revan_initAndroid.mk


# device/rockchip/rk356x/rk3568_r/can_init/Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := evan_init
LOCAL_SRC_FILES := main.cpp
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLE
LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)

include $(BUILD_EXECUTABLE)

`

build the code with order blow:

`#!/bin/bash

# 获取开始时间
startTime=$(date +%s)

# 执行编译
echo "请稍候,系统即将编译中……n"
source build/envsetup.sh
lunch rk3568_r-userdebug
#make clean
make installclean
rm -rf out/target/product/rk3568_r/obj/APPS/
rm -rf out/target/product/rk3568_r/system*
#mmm packages/apps/RKUpdateService/
#mmm external/e2fsprogs/misc/
#make dtboimage  2>&1 | tee build_evan.log
./build.sh -UKAu 2>&1 | tee build_evan.log`

New contributor

yhm yhm is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật