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
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 28a0f0c..5b618e2 100755
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -879,10 +879,11 @@
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);
}
}