From 53796e73334ac9d87d4cb5a355fc8c1d205104f6 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Fri, 11 Jan 2019 22:49:52 -0600 Subject: Use magiskboot to repack the boot partition Set TW_INCLUDE_REPACKTOOLS := true Must also have: AB_OTA_UPDATER := true Use magiskboot and provide GUI options to allow users to repack their existing boot image to install TWRP (or kernels) so we can stop having to provide installation zips for AB devices. There is also an option to try to fix a recovery bootloop if the kernel has been patched to always boot the ramdisk for root, etc. You will need to pull the below repo into external/magisk-prebuilt https://github.com/TeamWin/external_magisk-prebuilt Change-Id: I74196cc6f095a7576d61886dc96cbc18deba9b04 --- twrp-functions.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'twrp-functions.cpp') diff --git a/twrp-functions.cpp b/twrp-functions.cpp index 28a0f0cc7..5b618e2ac 100755 --- a/twrp-functions.cpp +++ b/twrp-functions.cpp @@ -879,10 +879,11 @@ void TWFunc::Auto_Generate_Backup_Name() { space_check = Backup_Name.substr(Backup_Name.size() - 1, 1); } replace(Backup_Name.begin(), Backup_Name.end(), ' ', '_'); - DataManager::SetValue(TW_BACKUP_NAME, Backup_Name); - if (PartitionManager.Check_Backup_Name(false) != 0) { - LOGINFO("Auto generated backup name '%s' contains invalid characters, using date instead.\n", Backup_Name.c_str()); + if (PartitionManager.Check_Backup_Name(Backup_Name, false, true) != 0) { + LOGINFO("Auto generated backup name '%s' is not valid, using date instead.\n", Backup_Name.c_str()); DataManager::SetValue(TW_BACKUP_NAME, Get_Current_Date()); + } else { + DataManager::SetValue(TW_BACKUP_NAME, Backup_Name); } } -- cgit v1.2.3