diff options
Diffstat (limited to 'twrp.cpp')
-rw-r--r-- | twrp.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -82,6 +82,8 @@ int main(int argc, char **argv) { crash_counter = atoi(crash_prop_val) + 1; snprintf(crash_prop_val, sizeof(crash_prop_val), "%d", crash_counter); property_set("twrp.crash_counter", crash_prop_val); + property_set("ro.twrp.boot", "1"); + property_set("ro.twrp.version", TW_VERSION_STR); time_t StartupTime = time(NULL); printf("Starting TWRP %s on %s", TW_VERSION_STR, ctime(&StartupTime)); @@ -279,6 +281,23 @@ int main(int argc, char **argv) { OpenRecoveryScript::Run_OpenRecoveryScript(); } + // Enable MTP? + if (DataManager::GetIntValue(TW_IS_ENCRYPTED) != 0) { + if (DataManager::GetIntValue(TW_IS_DECRYPTED) != 0 && DataManager::GetIntValue("tw_mtp_enabled") == 1) { + LOGINFO("Enabling MTP during startup\n"); + if (!PartitionManager.Enable_MTP()) + PartitionManager.Disable_MTP(); + else + gui_print("MTP Enabled\n"); + } + } else if (DataManager::GetIntValue("tw_mtp_enabled") == 1) { + LOGINFO("Enabling MTP during startup\n"); + if (!PartitionManager.Enable_MTP()) + PartitionManager.Disable_MTP(); + else + gui_print("MTP Enabled\n"); + } + // Launch the main GUI gui_start(); |