summaryrefslogtreecommitdiffstats
path: root/partition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'partition.cpp')
-rw-r--r--partition.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/partition.cpp b/partition.cpp
index 3f2374a47..78b11ecab 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -43,7 +43,7 @@
#include "twrp-functions.hpp"
#include "twrpDigest.hpp"
#include "twrpTar.hpp"
-#include "twrpDU.hpp"
+#include "exclude.hpp"
#include "infomanager.hpp"
#include "set_metadata.h"
#include "gui/gui.hpp"
@@ -866,9 +866,13 @@ void TWPartition::Setup_Data_Media() {
}
DataManager::SetValue("tw_has_internal", 1);
DataManager::SetValue("tw_has_data_media", 1);
- du.add_absolute_dir(Mount_Point + "/misc/vold");
- du.add_absolute_dir(Mount_Point + "/.layout_version");
- du.add_absolute_dir(Mount_Point + "/system/storage.xml");
+ backup_exclusions.add_absolute_dir("/data/data/com.google.android.music/files");
+ backup_exclusions.add_absolute_dir(Mount_Point + "/misc/vold");
+ wipe_exclusions.add_absolute_dir(Mount_Point + "/misc/vold");
+ backup_exclusions.add_absolute_dir(Mount_Point + "/.layout_version");
+ wipe_exclusions.add_absolute_dir(Mount_Point + "/.layout_version");
+ backup_exclusions.add_absolute_dir(Mount_Point + "/system/storage.xml");
+ wipe_exclusions.add_absolute_dir(Mount_Point + "/system/storage.xml");
} else {
if (Mount(true) && TWFunc::Path_Exists(Mount_Point + "/media/0")) {
Storage_Path = Mount_Point + "/media/0";
@@ -876,7 +880,8 @@ void TWPartition::Setup_Data_Media() {
UnMount(true);
}
}
- du.add_absolute_dir(Mount_Point + "/media");
+ backup_exclusions.add_absolute_dir(Mount_Point + "/media");
+ wipe_exclusions.add_absolute_dir(Mount_Point + "/media");
}
void TWPartition::Find_Real_Block_Device(string& Block, bool Display_Error) {
@@ -2113,7 +2118,7 @@ bool TWPartition::Wipe_Data_Without_Wiping_Media_Func(const string& parent __unu
dir = parent;
dir.append(de->d_name);
- if (du.check_skip_dirs(dir)) {
+ if (wipe_exclusions.check_skip_dirs(dir)) {
LOGINFO("skipped '%s'\n", dir.c_str());
continue;
}
@@ -2168,6 +2173,7 @@ bool TWPartition::Backup_Tar(PartitionSettings *part_settings, pid_t *tar_fork_p
Full_FileName = part_settings->Backup_Folder + "/" + Backup_FileName;
tar.has_data_media = Has_Data_Media;
tar.part_settings = part_settings;
+ tar.backup_exclusions = &backup_exclusions;
tar.setdir(Backup_Path);
tar.setfn(Full_FileName);
tar.setsize(Backup_Size);
@@ -2490,7 +2496,7 @@ bool TWPartition::Update_Size(bool Display_Error) {
if (Has_Data_Media) {
if (Mount(Display_Error)) {
unsigned long long data_media_used, actual_data;
- Used = du.Get_Folder_Size(Mount_Point);
+ Used = backup_exclusions.Get_Folder_Size(Mount_Point);
Backup_Size = Used;
int bak = (int)(Used / 1048576LLU);
int fre = (int)(Free / 1048576LLU);
@@ -2502,7 +2508,7 @@ bool TWPartition::Update_Size(bool Display_Error) {
}
} else if (Has_Android_Secure) {
if (Mount(Display_Error))
- Backup_Size = du.Get_Folder_Size(Backup_Path);
+ Backup_Size = backup_exclusions.Get_Folder_Size(Backup_Path);
else {
if (!Was_Already_Mounted)
UnMount(false);