Add option to wipe android secure

This commit is contained in:
Dees_Troy
2012-09-26 14:53:02 -04:00
parent 4be841b09a
commit 2ff5a8dc5b
14 changed files with 221 additions and 0 deletions
+2
View File
@@ -715,6 +715,8 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
DataManager::GetValue(TW_EXTERNAL_PATH, External_Path);
ret_val = PartitionManager.Wipe_By_Path(External_Path);
} else if (arg == "ANDROIDSECURE") {
ret_val = PartitionManager.Wipe_Android_Secure();
} else
ret_val = PartitionManager.Wipe_By_Path(arg);
+18
View File
@@ -1582,6 +1582,24 @@
</actions>
</object>
<object type="button">
<condition var1="tw_has_data_media" var2="0" />
<placement x="%col3_x%" y="%row2_y%" />
<font resource="font" color="%button_text_color%" />
<text>Android Secure</text>
<image resource="main_button" />
<actions>
<action function="set">tw_back=wipe</action>
<action function="set">tw_action=wipe</action>
<action function="set">tw_action_param=ANDROIDSECURE</action>
<action function="set">tw_text1=Wipe Android Secure?</action>
<action function="set">tw_action_text1=Wiping Android Secure...</action>
<action function="set">tw_complete_text1=Wipe Android Secure Complete</action>
<action function="set">tw_slider_text=Swipe to Format</action>
<action function="page">confirm_action</action>
</actions>
</object>
<object type="button">
<condition var1="tw_has_sdext_partition" var2="1" />
<placement x="%col4_x%" y="%row2_y%" />
+18
View File
@@ -1582,6 +1582,24 @@
</actions>
</object>
<object type="button">
<condition var1="tw_has_data_media" var2="0" />
<placement x="%col3_x%" y="%row2_y%" />
<font resource="font" color="%button_text_color%" />
<text>Android Secure</text>
<image resource="main_button" />
<actions>
<action function="set">tw_back=wipe</action>
<action function="set">tw_action=wipe</action>
<action function="set">tw_action_param=ANDROIDSECURE</action>
<action function="set">tw_text1=Wipe Android Secure?</action>
<action function="set">tw_action_text1=Wiping Android Secure...</action>
<action function="set">tw_complete_text1=Wipe Android Secure Complete</action>
<action function="set">tw_slider_text=Swipe to Format</action>
<action function="page">confirm_action</action>
</actions>
</object>
<object type="button">
<condition var1="tw_has_sdext_partition" var2="1" />
<placement x="%col4_x%" y="%row2_y%" />
+18
View File
@@ -1582,6 +1582,24 @@
</actions>
</object>
<object type="button">
<condition var1="tw_has_data_media" var2="0" />
<placement x="%col3_x%" y="%row2_y%" />
<font resource="font" color="%button_text_color%" />
<text>Android Secure</text>
<image resource="main_button" />
<actions>
<action function="set">tw_back=wipe</action>
<action function="set">tw_action=wipe</action>
<action function="set">tw_action_param=ANDROIDSECURE</action>
<action function="set">tw_text1=Wipe Android Secure?</action>
<action function="set">tw_action_text1=Wiping Android Secure...</action>
<action function="set">tw_complete_text1=Wipe Android Secure Complete</action>
<action function="set">tw_slider_text=Swipe to Format</action>
<action function="page">confirm_action</action>
</actions>
</object>
<object type="button">
<condition var1="tw_has_sdext_partition" var2="1" />
<placement x="%col4_x%" y="%row2_y%" />
+18
View File
@@ -1582,6 +1582,24 @@
</actions>
</object>
<object type="button">
<condition var1="tw_has_data_media" var2="0" />
<placement x="%col3_x%" y="%row2_y%" />
<font resource="font" color="%button_text_color%" />
<text>Android Secure</text>
<image resource="main_button" />
<actions>
<action function="set">tw_back=wipe</action>
<action function="set">tw_action=wipe</action>
<action function="set">tw_action_param=ANDROIDSECURE</action>
<action function="set">tw_text1=Wipe Android Secure?</action>
<action function="set">tw_action_text1=Wiping Android Secure...</action>
<action function="set">tw_complete_text1=Wipe Android Secure Complete</action>
<action function="set">tw_slider_text=Swipe to Format</action>
<action function="page">confirm_action</action>
</actions>
</object>
<object type="button">
<condition var1="tw_has_sdext_partition" var2="1" />
<placement x="%col4_x%" y="%row2_y%" />
+18
View File
@@ -1162,6 +1162,24 @@
</actions>
</object>
<object type="button">
<condition var1="tw_has_data_media" var2="0" />
<placement x="%col1_x%" y="%row4_y%" />
<font resource="font" color="%button_text_color%" />
<text>Android Secure</text>
<image resource="main_button" />
<actions>
<action function="set">tw_back=wipe</action>
<action function="set">tw_action=wipe</action>
<action function="set">tw_action_param=ANDROIDSECURE</action>
<action function="set">tw_text1=Wipe Android Secure?</action>
<action function="set">tw_action_text1=Wiping Android Secure...</action>
<action function="set">tw_complete_text1=Wipe Android Secure Complete</action>
<action function="set">tw_slider_text=Swipe to Format</action>
<action function="page">confirm_action</action>
</actions>
</object>
<object type="button">
<condition var1="tw_has_sdext_partition" var2="1" />
<placement x="%col2_x%" y="%row4_y%" />
+18
View File
@@ -1161,6 +1161,24 @@
</actions>
</object>
<object type="button">
<condition var1="tw_has_data_media" var2="0" />
<placement x="%col1_x%" y="%row4_y%" />
<font resource="font" color="%button_text_color%" />
<text>Android Secure</text>
<image resource="main_button" />
<actions>
<action function="set">tw_back=wipe</action>
<action function="set">tw_action=wipe</action>
<action function="set">tw_action_param=ANDROIDSECURE</action>
<action function="set">tw_text1=Wipe Android Secure?</action>
<action function="set">tw_action_text1=Wiping Android Secure...</action>
<action function="set">tw_complete_text1=Wipe Android Secure Complete</action>
<action function="set">tw_slider_text=Swipe to Format</action>
<action function="page">confirm_action</action>
</actions>
</object>
<object type="button">
<condition var1="tw_has_sdext_partition" var2="1" />
<placement x="%col2_x%" y="%row4_y%" />
+18
View File
@@ -1160,6 +1160,24 @@
</actions>
</object>
<object type="button">
<condition var1="tw_has_data_media" var2="0" />
<placement x="%col1_x%" y="%row4_y%" />
<font resource="font" color="%button_text_color%" />
<text>Android Secure</text>
<image resource="main_button" />
<actions>
<action function="set">tw_back=wipe</action>
<action function="set">tw_action=wipe</action>
<action function="set">tw_action_param=ANDROIDSECURE</action>
<action function="set">tw_text1=Wipe Android Secure?</action>
<action function="set">tw_action_text1=Wiping Android Secure...</action>
<action function="set">tw_complete_text1=Wipe Android Secure Complete</action>
<action function="set">tw_slider_text=Swipe to Format</action>
<action function="page">confirm_action</action>
</actions>
</object>
<object type="button">
<condition var1="tw_has_sdext_partition" var2="1" />
<placement x="%col2_x%" y="%row4_y%" />
+18
View File
@@ -1161,6 +1161,24 @@
</actions>
</object>
<object type="button">
<condition var1="tw_has_data_media" var2="0" />
<placement x="%col1_x%" y="%row4_y%" />
<font resource="font" color="%button_text_color%" />
<text>Android Secure</text>
<image resource="main_button" />
<actions>
<action function="set">tw_back=wipe</action>
<action function="set">tw_action=wipe</action>
<action function="set">tw_action_param=ANDROIDSECURE</action>
<action function="set">tw_text1=Wipe Android Secure?</action>
<action function="set">tw_action_text1=Wiping Android Secure...</action>
<action function="set">tw_complete_text1=Wipe Android Secure Complete</action>
<action function="set">tw_slider_text=Swipe to Format</action>
<action function="page">confirm_action</action>
</actions>
</object>
<object type="button">
<condition var1="tw_has_sdext_partition" var2="1" />
<placement x="%col2_x%" y="%row4_y%" />
+18
View File
@@ -1166,6 +1166,24 @@
</actions>
</object>
<object type="button">
<condition var1="tw_has_data_media" var2="0" />
<placement x="%col1_x%" y="%row4_y%" />
<font resource="font" color="%button_text_color%" />
<text>Android Secure</text>
<image resource="main_button" />
<actions>
<action function="set">tw_back=wipe</action>
<action function="set">tw_action=wipe</action>
<action function="set">tw_action_param=ANDROIDSECURE</action>
<action function="set">tw_text1=Wipe Android Secure?</action>
<action function="set">tw_action_text1=Wiping Android Secure...</action>
<action function="set">tw_complete_text1=Wipe Android Secure Complete</action>
<action function="set">tw_slider_text=Swipe to Format</action>
<action function="page">confirm_action</action>
</actions>
</object>
<object type="button">
<condition var1="tw_has_sdext_partition" var2="1" />
<placement x="%col2_x%" y="%row4_y%" />
+18
View File
@@ -1162,6 +1162,24 @@
</actions>
</object>
<object type="button">
<condition var1="tw_has_data_media" var2="0" />
<placement x="%col1_x%" y="%row4_y%" />
<font resource="font" color="%button_text_color%" />
<text>Android Secure</text>
<image resource="main_button" />
<actions>
<action function="set">tw_back=wipe</action>
<action function="set">tw_action=wipe</action>
<action function="set">tw_action_param=ANDROIDSECURE</action>
<action function="set">tw_text1=Wipe Android Secure?</action>
<action function="set">tw_action_text1=Wiping Android Secure...</action>
<action function="set">tw_complete_text1=Wipe Android Secure Complete</action>
<action function="set">tw_slider_text=Swipe to Format</action>
<action function="page">confirm_action</action>
</actions>
</object>
<object type="button">
<condition var1="tw_has_sdext_partition" var2="1" />
<placement x="%col2_x%" y="%row4_y%" />
+18
View File
@@ -1582,6 +1582,24 @@
</actions>
</object>
<object type="button">
<condition var1="tw_has_data_media" var2="0" />
<placement x="%col3_x%" y="%row2_y%" />
<font resource="font" color="%button_text_color%" />
<text>Android Secure</text>
<image resource="main_button" />
<actions>
<action function="set">tw_back=wipe</action>
<action function="set">tw_action=wipe</action>
<action function="set">tw_action_param=ANDROIDSECURE</action>
<action function="set">tw_text1=Wipe Android Secure?</action>
<action function="set">tw_action_text1=Wiping Android Secure...</action>
<action function="set">tw_complete_text1=Wipe Android Secure Complete</action>
<action function="set">tw_slider_text=Swipe to Format</action>
<action function="page">confirm_action</action>
</actions>
</object>
<object type="button">
<condition var1="tw_has_sdext_partition" var2="1" />
<placement x="%col4_x%" y="%row2_y%" />
+20
View File
@@ -1283,6 +1283,26 @@ int TWPartitionManager::Wipe_Battery_Stats(void) {
return true;
}
int TWPartitionManager::Wipe_Android_Secure(void) {
std::vector<TWPartition*>::iterator iter;
int ret = false;
bool found = false;
// Iterate through all partitions
for (iter = Partitions.begin(); iter != Partitions.end(); iter++) {
if ((*iter)->Has_Android_Secure) {
ret = (*iter)->Wipe_AndSec();
found = true;
}
}
if (found) {
return ret;
} else {
LOGE("No android secure partitions found.\n");
}
return false;
}
int TWPartitionManager::Format_Data(void) {
TWPartition* dat = Find_Partition_By_Path("/data");
+1
View File
@@ -172,6 +172,7 @@ public:
virtual int Wipe_Dalvik_Cache(); // Wipes dalvik cache
virtual int Wipe_Rotate_Data(); // Wipes rotation data --
virtual int Wipe_Battery_Stats(); // Wipe battery stats -- /data/system/batterystats.bin
virtual int Wipe_Android_Secure(); // Wipes android secure
virtual int Format_Data(); // Really formats data on /data/media devices -- also removes encryption
virtual int Wipe_Media_From_Data(); // Removes and recreates the media folder on /data/media devices
virtual void Refresh_Sizes(); // Refreshes size data of partitions