Improve handling of settings storage and android secure
Change-Id: I8af92543c2f0c201e7220267c417d74e4561038d
This commit is contained in:
+12
-13
@@ -78,14 +78,11 @@ int TWPartitionManager::Process_Fstab(string Fstab_Filename, bool Display_Error)
|
||||
if (partition->Process_Fstab_Line(line, Display_Error)) {
|
||||
if (!Found_Settings_Storage && partition->Is_Settings_Storage) {
|
||||
Found_Settings_Storage = true;
|
||||
Partitions.push_back(partition);
|
||||
DataManager::SetValue("tw_settings_path", partition->Storage_Path);
|
||||
DataManager::SetValue("tw_storage_path", partition->Storage_Path);
|
||||
LOGINFO("Settings storage is '%s'\n", partition->Storage_Path.c_str());
|
||||
Setup_Settings_Storage_Partition(partition);
|
||||
} else {
|
||||
partition->Is_Settings_Storage = false;
|
||||
Partitions.push_back(partition);
|
||||
}
|
||||
Partitions.push_back(partition);
|
||||
} else {
|
||||
delete partition;
|
||||
}
|
||||
@@ -95,14 +92,7 @@ int TWPartitionManager::Process_Fstab(string Fstab_Filename, bool Display_Error)
|
||||
std::vector<TWPartition*>::iterator iter;
|
||||
for (iter = Partitions.begin(); iter != Partitions.end(); iter++) {
|
||||
if ((*iter)->Is_Storage) {
|
||||
(*iter)->Is_Settings_Storage = true;
|
||||
#ifndef RECOVERY_SDCARD_ON_DATA
|
||||
(*iter)->Setup_AndSec();
|
||||
#endif
|
||||
Found_Settings_Storage = true;
|
||||
DataManager::SetValue("tw_settings_path", (*iter)->Storage_Path);
|
||||
DataManager::SetValue("tw_storage_path", (*iter)->Storage_Path);
|
||||
LOGINFO("Settings storage is '%s'\n", (*iter)->Storage_Path.c_str());
|
||||
Setup_Settings_Storage_Partition((*iter));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -148,6 +138,15 @@ int TWPartitionManager::Write_Fstab(void) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void TWPartitionManager::Setup_Settings_Storage_Partition(TWPartition* Part) {
|
||||
#ifndef RECOVERY_SDCARD_ON_DATA
|
||||
Part->Setup_AndSec();
|
||||
#endif
|
||||
DataManager::SetValue("tw_settings_path", Part->Storage_Path);
|
||||
DataManager::SetValue("tw_storage_path", Part->Storage_Path);
|
||||
LOGINFO("Settings storage is '%s'\n", Part->Storage_Path.c_str());
|
||||
}
|
||||
|
||||
void TWPartitionManager::Output_Partition_Logging(void) {
|
||||
std::vector<TWPartition*>::iterator iter;
|
||||
|
||||
|
||||
@@ -213,6 +213,7 @@ public:
|
||||
void Output_Storage_Fstab(); // Creates a /cache/recovery/storage.fstab file with a list of all potential storage locations for app use
|
||||
|
||||
private:
|
||||
void Setup_Settings_Storage_Partition(TWPartition* Part); // Sets things up for the storage partition
|
||||
bool Make_MD5(bool generate_md5, string Backup_Folder, string Backup_Filename); // Generates an MD5 after a backup is made
|
||||
bool Backup_Partition(TWPartition* Part, string Backup_Folder, bool generate_md5, unsigned long long* img_bytes_remaining, unsigned long long* file_bytes_remaining, unsigned long *img_time, unsigned long *file_time, unsigned long long *img_bytes, unsigned long long *file_bytes);
|
||||
bool Restore_Partition(TWPartition* Part, string Restore_Name, int partition_count);
|
||||
|
||||
Reference in New Issue
Block a user