2023-12-18 AndroidR RK356X 新增一个分区,这个分区可写入读取,恢复出厂后数据也不会被删除。

一、整个过程需要修改的内容,不多解释,直接看源码吧 read the fuck code。

diff --git a/bootable/recovery/install/include/install/wipe_data.h b/bootable/recovery/install/include/install/wipe_data.h
old mode 100644
new mode 100755
index c177f59274..6e1987d990
--- a/bootable/recovery/install/include/install/wipe_data.h
+++ b/bootable/recovery/install/include/install/wipe_data.h
@@ -30,5 +30,7 @@ bool WipeCache(RecoveryUI* ui, const std::function<bool()>& confirm);
 bool WipeData(Device* device, bool convert_fbe);
 
 void SureMetadataMount();
+void SurePrivateMount();
+
 void WipeFrp();
 int ResizeData(Device* device);
diff --git a/bootable/recovery/install/wipe_data.cpp b/bootable/recovery/install/wipe_data.cpp
old mode 100644
new mode 100755
index a16e62c1d7..6017f807e1
--- a/bootable/recovery/install/wipe_data.cpp
+++ b/bootable/recovery/install/wipe_data.cpp
@@ -36,6 +36,7 @@
 constexpr const char* CACHE_ROOT = "/cache";
 constexpr const char* DATA_ROOT = "/data";
 constexpr const char* METADATA_ROOT = "/metadata";
+constexpr const char* PRIVATE_ROOT = "/cameradata";
 
 /**
  * reset hdmi after restore factory.
@@ -152,6 +153,11 @@ bool WipeData(Device* device, bool convert_fbe) {
     if (has_cache) {
       success &= EraseVolume(CACHE_ROOT, ui, false);
     }
+/*
+	if (volume_for_mount_point(PRIVATE_ROOT) != nullptr) {
+	   success &= EraseVolume(PRIVATE_ROOT, ui, false);
+	 }
+*/
     if (volume_for_mount_point(METADATA_ROOT) != nullptr) {
       success &= EraseVolume(METADATA_ROOT, ui, false);
     }
@@ -172,6 +178,16 @@ void SureMetadataMount() {
     ensure_path_mounted(METADATA_ROOT);
   }
 }
+
+void SurePrivateMount() {
+  if (ensure_path_mounted(PRIVATE_ROOT)) {
+    printf("mount private fail,so formate...\n");
+    reset_tmplog_offset();
+    format_volume(PRIVATE_ROOT);
+    ensure_path_mounted(PRIVATE_ROOT);
+  }
+}
+
 void WipeFrp() {
   printf("begin to wipe frp partion!\n");
   int ret = 
  • 8
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值