diff --git a/Android.mk b/Android.mk index 44149736..0ac82ba9 100644 --- a/Android.mk +++ b/Android.mk @@ -374,7 +374,11 @@ ifneq ($(TW_NO_EXFAT), true) LOCAL_ADDITIONAL_DEPENDENCIES += mkexfatfs fsckexfat endif ifeq ($(BOARD_HAS_NO_REAL_SDCARD),) - LOCAL_ADDITIONAL_DEPENDENCIES += parted + ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0) + LOCAL_ADDITIONAL_DEPENDENCIES += sgdisk + else + LOCAL_ADDITIONAL_DEPENDENCIES += sgdisk_static + endif endif ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true) LOCAL_ADDITIONAL_DEPENDENCIES += openaes ../openaes/LICENSE diff --git a/data.cpp b/data.cpp index 5cca3a10..c945f2af 100644 --- a/data.cpp +++ b/data.cpp @@ -794,8 +794,8 @@ void DataManager::SetDefaultValues() mValues.insert(make_pair(TW_RM_RF_VAR, make_pair("0", 1))); mValues.insert(make_pair(TW_SKIP_MD5_CHECK_VAR, make_pair("0", 1))); mValues.insert(make_pair(TW_SKIP_MD5_GENERATE_VAR, make_pair("0", 1))); - mValues.insert(make_pair(TW_SDEXT_SIZE, make_pair("512", 1))); - mValues.insert(make_pair(TW_SWAP_SIZE, make_pair("32", 1))); + mValues.insert(make_pair(TW_SDEXT_SIZE, make_pair("0", 1))); + mValues.insert(make_pair(TW_SWAP_SIZE, make_pair("0", 1))); mValues.insert(make_pair(TW_SDPART_FILE_SYSTEM, make_pair("ext3", 1))); mValues.insert(make_pair(TW_TIME_ZONE_GUISEL, make_pair("CST6;CDT,M3.2.0,M11.1.0", 1))); mValues.insert(make_pair(TW_TIME_ZONE_GUIOFFSET, make_pair("0", 1))); diff --git a/gui/action.cpp b/gui/action.cpp index 656c687b..e13d15c6 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -792,25 +792,27 @@ int GUIAction::generatebackupname(std::string arg __unused) return 0; } -int GUIAction::checkpartitionlist(std::string arg __unused) +int GUIAction::checkpartitionlist(std::string arg) { - string Wipe_List, wipe_path; + string List, part_path; int count = 0; - DataManager::GetValue("tw_wipe_list", Wipe_List); - LOGINFO("checkpartitionlist list '%s'\n", Wipe_List.c_str()); - if (!Wipe_List.empty()) { - size_t start_pos = 0, end_pos = Wipe_List.find(";", start_pos); - while (end_pos != string::npos && start_pos < Wipe_List.size()) { - wipe_path = Wipe_List.substr(start_pos, end_pos - start_pos); - LOGINFO("checkpartitionlist wipe_path '%s'\n", wipe_path.c_str()); - if (wipe_path == "/and-sec" || wipe_path == "DALVIK" || wipe_path == "INTERNAL") { + if (arg.empty()) + arg = "tw_wipe_list"; + DataManager::GetValue(arg, List); + LOGINFO("checkpartitionlist list '%s'\n", List.c_str()); + if (!List.empty()) { + size_t start_pos = 0, end_pos = List.find(";", start_pos); + while (end_pos != string::npos && start_pos < List.size()) { + part_path = List.substr(start_pos, end_pos - start_pos); + LOGINFO("checkpartitionlist part_path '%s'\n", part_path.c_str()); + if (part_path == "/and-sec" || part_path == "DALVIK" || part_path == "INTERNAL") { // Do nothing } else { count++; } start_pos = end_pos + 1; - end_pos = Wipe_List.find(";", start_pos); + end_pos = List.find(";", start_pos); } DataManager::SetValue("tw_check_partition_list", count); } else { @@ -819,29 +821,32 @@ int GUIAction::checkpartitionlist(std::string arg __unused) return 0; } -int GUIAction::getpartitiondetails(std::string arg __unused) +int GUIAction::getpartitiondetails(std::string arg) { - string Wipe_List, wipe_path; + string List, part_path; int count = 0; - DataManager::GetValue("tw_wipe_list", Wipe_List); - LOGINFO("getpartitiondetails list '%s'\n", Wipe_List.c_str()); - if (!Wipe_List.empty()) { - size_t start_pos = 0, end_pos = Wipe_List.find(";", start_pos); - while (end_pos != string::npos && start_pos < Wipe_List.size()) { - wipe_path = Wipe_List.substr(start_pos, end_pos - start_pos); - LOGINFO("getpartitiondetails wipe_path '%s'\n", wipe_path.c_str()); - if (wipe_path == "/and-sec" || wipe_path == "DALVIK" || wipe_path == "INTERNAL") { + if (arg.empty()) + arg = "tw_wipe_list"; + DataManager::GetValue(arg, List); + LOGINFO("getpartitiondetails list '%s'\n", List.c_str()); + if (!List.empty()) { + size_t start_pos = 0, end_pos = List.find(";", start_pos); + part_path = List; + while (end_pos != string::npos && start_pos < List.size()) { + part_path = List.substr(start_pos, end_pos - start_pos); + LOGINFO("getpartitiondetails part_path '%s'\n", part_path.c_str()); + if (part_path == "/and-sec" || part_path == "DALVIK" || part_path == "INTERNAL") { // Do nothing } else { - DataManager::SetValue("tw_partition_path", wipe_path); + DataManager::SetValue("tw_partition_path", part_path); break; } start_pos = end_pos + 1; - end_pos = Wipe_List.find(";", start_pos); + end_pos = List.find(";", start_pos); } - if (!wipe_path.empty()) { - TWPartition* Part = PartitionManager.Find_Partition_By_Path(wipe_path); + if (!part_path.empty()) { + TWPartition* Part = PartitionManager.Find_Partition_By_Path(part_path); if (Part) { unsigned long long mb = 1048576; @@ -881,12 +886,14 @@ int GUIAction::getpartitiondetails(std::string arg __unused) DataManager::SetValue("tw_partition_ext", 0); return 0; } else { - LOGERR("Unable to locate partition: '%s'\n", wipe_path.c_str()); + LOGERR("Unable to locate partition: '%s'\n", part_path.c_str()); } } } DataManager::SetValue("tw_partition_name", ""); DataManager::SetValue("tw_partition_file_system", ""); + // Set this to 0 to prevent trying to partition this device, just in case + DataManager::SetValue("tw_partition_removable", 0); return 0; } diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml index 6c91d065..57fef404 100755 --- a/gui/theme/common/landscape.xml +++ b/gui/theme/common/landscape.xml @@ -1068,7 +1068,7 @@ {@repair_change_btn=Repair or Change File System} - + tw_wipe_list checkpartitionlist @@ -1179,7 +1179,7 @@ partitionlisterror=0 - + tw_wipe_list partitionoptions @@ -1188,7 +1188,6 @@ partitionlisterror=1 - tw_wipe_list= advancedwipe @@ -1271,6 +1270,7 @@ tw_action_param=%tw_partition_mount_point% tw_has_action2=1 tw_action2=getpartitiondetails + tw_action2_param=tw_wipe_list tw_text1={@resize_confirm=Resize %tw_partition_name%?} tw_text2= tw_action_text1={@resizing=Resizing...} @@ -1320,7 +1320,7 @@ partitionlisterror=0 - + tw_wipe_list selectfilesystem @@ -3091,7 +3091,10 @@ {@part_sd_btn=Partition SD Card} - partsdcard + + partitionlisterror=0 + partsdcardsel +