summaryrefslogtreecommitdiffstats
path: root/twrp.cpp
diff options
context:
space:
mode:
authorbigbiff bigbiff <bigbiff@teamw.in>2014-09-03 00:59:01 +0200
committerbigbiff bigbiff <bigbiff@teamw.in>2014-09-03 03:44:49 +0200
commitc7eee6fef0263ed4eb5aa0d934a0a8c972d41b30 (patch)
treea994f2110aeeb58ef2bc1f23c31f695cd840ac46 /twrp.cpp
parentFix derp (diff)
downloadandroid_bootable_recovery-c7eee6fef0263ed4eb5aa0d934a0a8c972d41b30.tar
android_bootable_recovery-c7eee6fef0263ed4eb5aa0d934a0a8c972d41b30.tar.gz
android_bootable_recovery-c7eee6fef0263ed4eb5aa0d934a0a8c972d41b30.tar.bz2
android_bootable_recovery-c7eee6fef0263ed4eb5aa0d934a0a8c972d41b30.tar.lz
android_bootable_recovery-c7eee6fef0263ed4eb5aa0d934a0a8c972d41b30.tar.xz
android_bootable_recovery-c7eee6fef0263ed4eb5aa0d934a0a8c972d41b30.tar.zst
android_bootable_recovery-c7eee6fef0263ed4eb5aa0d934a0a8c972d41b30.zip
Diffstat (limited to '')
-rw-r--r--twrp.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/twrp.cpp b/twrp.cpp
index 8b60ee1db..5f58e41aa 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -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();