From 7ce7f0cde40bf127196cfac4bedce79ac5c59d77 Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Fri, 25 Jan 2013 09:54:04 -0500 Subject: adding sideload page with wipe cache and dalvik fix variable Change-Id: I72eed7b4d709a184e53cc94165a1817a7dcf041e --- data.cpp | 4 ++- gui/action.cpp | 12 +++++-- gui/devices/1024x600/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ gui/devices/1024x768/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ gui/devices/1280x800/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ gui/devices/1920x1200/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ gui/devices/2560x1600/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ gui/devices/320x480/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ gui/devices/480x800/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ gui/devices/480x854/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ gui/devices/540x960/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ gui/devices/720x1280/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ gui/devices/800x1280/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ gui/devices/800x480/res/ui.xml | 72 ++++++++++++++++++++++++++++++++++------ 14 files changed, 744 insertions(+), 136 deletions(-) diff --git a/data.cpp b/data.cpp index f8b19dd58..7f87b67ee 100644 --- a/data.cpp +++ b/data.cpp @@ -758,7 +758,7 @@ void DataManager::SetDefaultValues() mValues.insert(make_pair(TW_BACKUP_SP2_SIZE, make_pair("0", 0))); mValues.insert(make_pair(TW_BACKUP_SP3_SIZE, make_pair("0", 0))); mValues.insert(make_pair(TW_STORAGE_FREE_SIZE, make_pair("0", 0))); - + mValues.insert(make_pair(TW_REBOOT_AFTER_FLASH_VAR, make_pair("0", 1))); mValues.insert(make_pair(TW_SIGNED_ZIP_VERIFY_VAR, make_pair("0", 1))); mValues.insert(make_pair(TW_FORCE_MD5_CHECK_VAR, make_pair("0", 1))); @@ -785,6 +785,8 @@ void DataManager::SetDefaultValues() mValues.insert(make_pair(TW_RESTORE_AVG_IMG_RATE, make_pair("15000000", 1))); mValues.insert(make_pair(TW_RESTORE_AVG_FILE_RATE, make_pair("3000000", 1))); mValues.insert(make_pair(TW_RESTORE_AVG_FILE_COMP_RATE, make_pair("2000000", 1))); + mValues.insert(make_pair("tw_wipe_cache", make_pair("0", 0))); + mValues.insert(make_pair("tw_wipe_dalvik", make_pair("0", 0))); if (GetIntValue(TW_HAS_INTERNAL) == 1 && GetIntValue(TW_HAS_DATA_MEDIA) == 1 && GetIntValue(TW_HAS_EXTERNAL) == 0) SetValue(TW_HAS_USB_STORAGE, 0, 0); else diff --git a/gui/action.cpp b/gui/action.cpp index 19a8b69a0..22e362177 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -1059,6 +1059,7 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) simulate_progress_bar(); } else { int wipe_cache = 0; + int wipe_dalvik = 0; string result, Sideload_File; if (!PartitionManager.Mount_Current_Storage(true)) { @@ -1070,11 +1071,16 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) unlink(Sideload_File.c_str()); } ui_print("Starting ADB sideload feature...\n"); + DataManager::GetValue("tw_wipe_dalvik", wipe_dalvik); ret = apply_from_adb(ui, &wipe_cache, Sideload_File.c_str()); - if (ret != 0) + if (ret != 0) { ret = 1; // failure - else if (wipe_cache) - PartitionManager.Wipe_By_Path("/cache"); + } else { + if (wipe_cache || DataManager::GetIntValue("tw_wipe_cache")) + PartitionManager.Wipe_By_Path("/cache"); + if (wipe_dalvik) + PartitionManager.Wipe_Dalvik_Cache(); + } if (DataManager::GetIntValue(TW_HAS_INJECTTWRP) == 1 && DataManager::GetIntValue(TW_INJECT_AFTER_ZIP) == 1) { operation_start("ReinjectTWRP"); ui_print("Injecting TWRP into boot image...\n"); diff --git a/gui/devices/1024x600/res/ui.xml b/gui/devices/1024x600/res/ui.xml index 8a14faffd..be6750f8c 100755 --- a/gui/devices/1024x600/res/ui.xml +++ b/gui/devices/1024x600/res/ui.xml @@ -2608,17 +2608,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_cancel_action=adbsideloadcancel - tw_show_reboot=1 - action_page - + sideload @@ -3621,5 +3611,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + diff --git a/gui/devices/1024x768/res/ui.xml b/gui/devices/1024x768/res/ui.xml index 21d429c62..93e7b1f2e 100644 --- a/gui/devices/1024x768/res/ui.xml +++ b/gui/devices/1024x768/res/ui.xml @@ -2608,17 +2608,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_cancel_action=adbsideloadcancel - tw_show_reboot=1 - action_page - + sideload @@ -3621,5 +3611,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + diff --git a/gui/devices/1280x800/res/ui.xml b/gui/devices/1280x800/res/ui.xml index 9c8430453..66d955a82 100644 --- a/gui/devices/1280x800/res/ui.xml +++ b/gui/devices/1280x800/res/ui.xml @@ -2608,17 +2608,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_cancel_action=adbsideloadcancel - tw_show_reboot=1 - action_page - + sideload @@ -3621,5 +3611,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + diff --git a/gui/devices/1920x1200/res/ui.xml b/gui/devices/1920x1200/res/ui.xml index 40df4a877..9b9befde7 100644 --- a/gui/devices/1920x1200/res/ui.xml +++ b/gui/devices/1920x1200/res/ui.xml @@ -2608,17 +2608,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_cancel_action=adbsideloadcancel - tw_show_reboot=1 - action_page - + sideload @@ -3621,5 +3611,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + diff --git a/gui/devices/2560x1600/res/ui.xml b/gui/devices/2560x1600/res/ui.xml index d2f5a1308..f53d720ab 100644 --- a/gui/devices/2560x1600/res/ui.xml +++ b/gui/devices/2560x1600/res/ui.xml @@ -2608,17 +2608,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_cancel_action=adbsideloadcancel - tw_show_reboot=1 - action_page - + sideload @@ -3621,5 +3611,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + diff --git a/gui/devices/320x480/res/ui.xml b/gui/devices/320x480/res/ui.xml index 2cc401b2b..88b366353 100644 --- a/gui/devices/320x480/res/ui.xml +++ b/gui/devices/320x480/res/ui.xml @@ -2607,17 +2607,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_show_reboot=1 - tw_cancel_action=adbsideloadcancel - action_page - + sideload @@ -3575,5 +3565,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + diff --git a/gui/devices/480x800/res/ui.xml b/gui/devices/480x800/res/ui.xml index bb214c8ff..98e4e156d 100644 --- a/gui/devices/480x800/res/ui.xml +++ b/gui/devices/480x800/res/ui.xml @@ -2606,17 +2606,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_show_reboot=1 - tw_cancel_action=adbsideloadcancel - action_page - + sideload @@ -3574,5 +3564,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + diff --git a/gui/devices/480x854/res/ui.xml b/gui/devices/480x854/res/ui.xml index 819d24569..964d9deab 100644 --- a/gui/devices/480x854/res/ui.xml +++ b/gui/devices/480x854/res/ui.xml @@ -2605,17 +2605,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_show_reboot=1 - tw_cancel_action=adbsideloadcancel - action_page - + sideload @@ -3573,5 +3563,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + diff --git a/gui/devices/540x960/res/ui.xml b/gui/devices/540x960/res/ui.xml index e4cf5c03d..1ff4821ac 100644 --- a/gui/devices/540x960/res/ui.xml +++ b/gui/devices/540x960/res/ui.xml @@ -2606,17 +2606,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_show_reboot=1 - tw_cancel_action=adbsideloadcancel - action_page - + sideload @@ -3574,5 +3564,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + diff --git a/gui/devices/720x1280/res/ui.xml b/gui/devices/720x1280/res/ui.xml index e3eabf366..5f39a2f8d 100644 --- a/gui/devices/720x1280/res/ui.xml +++ b/gui/devices/720x1280/res/ui.xml @@ -2611,17 +2611,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_show_reboot=1 - tw_cancel_action=adbsideloadcancel - action_page - + sideload @@ -3579,5 +3569,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + diff --git a/gui/devices/800x1280/res/ui.xml b/gui/devices/800x1280/res/ui.xml index 2b6e3efee..9432466e3 100755 --- a/gui/devices/800x1280/res/ui.xml +++ b/gui/devices/800x1280/res/ui.xml @@ -2607,17 +2607,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_show_reboot=1 - tw_cancel_action=adbsideloadcancel - action_page - + sideload @@ -3575,5 +3565,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + diff --git a/gui/devices/800x480/res/ui.xml b/gui/devices/800x480/res/ui.xml index b41811132..74c80921e 100755 --- a/gui/devices/800x480/res/ui.xml +++ b/gui/devices/800x480/res/ui.xml @@ -2608,17 +2608,7 @@ ADB Sideload - - tw_back=advanced - tw_action=adbsideload - tw_action_text1=ADB Sideload - tw_action_text2=Usage: adb sideload filename.zip - tw_complete_text1=ADB Sideload Complete - tw_has_cancel=1 - tw_cancel_action=adbsideloadcancel - tw_show_reboot=1 - action_page - + sideload @@ -3621,5 +3611,65 @@ terminalfolder + + + + + + + + ADB Sideload + + + + + + Wipe Dalvik Cache. + + + + + + + + Wipe Cache. + + + + + + + + + tw_back=advanced + tw_action=adbsideload + tw_action_text1=ADB Sideload + tw_action_text2=Usage: adb sideload filename.zip + tw_complete_text1=ADB Sideload Complete + tw_has_cancel=1 + tw_show_reboot=1 + tw_cancel_action=adbsideloadcancel + action_page + + + + + + + Swipe to Start Sideload + + + + + main + + + + + advanced + + + + -- cgit v1.2.3