一、整个过程需要修改的内容,不多解释,直接看源码吧 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);
+ }
+}