Adding Edl button in reboot menu

Edl mode is available only on qualcomm devices and it used to fully
restore the bricked devices. I made the button available only if
TW_HAS_EDL_MODE := true like the download button. I set the edl
button to the right of the download button, so devices can support
edl button and download button. I also added the translation for
all languages.

Change-Id: I69d1058b8c050b722395c7b3da6dce1ccfbe7a91
This commit is contained in:
mauronofrio
2019-03-20 10:57:07 -05:00
committed by Ethan Yonker
parent 08f91e84e0
commit e9a49efe75
31 changed files with 97 additions and 0 deletions
+3
View File
@@ -281,6 +281,9 @@ endif
ifeq ($(TW_HAS_DOWNLOAD_MODE), true)
LOCAL_CFLAGS += -DTW_HAS_DOWNLOAD_MODE
endif
ifeq ($(TW_HAS_EDL_MODE), true)
LOCAL_CFLAGS += -DTW_HAS_EDL_MODE
endif
ifeq ($(TW_NO_SCREEN_BLANK), true)
LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
endif
+4
View File
@@ -722,6 +722,10 @@ void DataManager::SetDefaultValues()
printf("TW_HAS_DOWNLOAD_MODE := true\n");
mConst.SetValue(TW_DOWNLOAD_MODE, "1");
#endif
#ifdef TW_HAS_EDL_MODE
printf("TW_HAS_EDL_MODE := true\n");
mConst.SetValue(TW_EDL_MODE, "1");
#endif
#ifdef TW_INCLUDE_CRYPTO
mConst.SetValue(TW_HAS_CRYPTO, "1");
printf("TW_INCLUDE_CRYPTO := true\n");
+19
View File
@@ -2705,6 +2705,25 @@
</actions>
</button>
<button style="main_button">
<condition var1="tw_edl_mode" var2="1"/>
<placement x="%center_x%" y="%row11_y%"/>
<text>{@rb_edl_btn=Edl}</text>
<actions>
<action function="set">tw_back=reboot</action>
<action function="set">tw_action=reboot</action>
<action function="set">tw_action_param=edl</action>
<action function="set">tw_reboot_param=edl</action>
<action function="set">tw_has_action2=0</action>
<action function="set">tw_text1={@no_os1=No OS Installed! Are you}</action>
<action function="set">tw_text2={@no_osrb=sure you wish to reboot?}</action>
<action function="set">tw_action_text1={@rebooting=Rebooting...}</action>
<action function="set">tw_complete_text1={@rebooting=Rebooting...}</action>
<action function="set">tw_slider_text={@swipe_reboot=Swipe to Reboot}</action>
<action function="page">rebootcheck</action>
</actions>
</button>
<action>
<touch key="home"/>
<action function="page">main</action>
+1
View File
@@ -262,6 +262,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Stáhnout</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Vypínání...</string>
<string name="swipe_power_off">Potáhnout pro vypnutí</string>
<string name="swipe_power_off_s">Vypnout</string>
+1
View File
@@ -283,6 +283,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Download</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Ausschalten...</string>
<string name="swipe_power_off">Gerät ausschalten</string>
<string name="swipe_power_off_s">Ausschalten</string>
+1
View File
@@ -273,6 +273,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Λήψη</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Απενεργοποίηση...</string>
<string name="swipe_power_off">Σύρετε για Απενεργοποίηση</string>
<string name="swipe_power_off_s">Απενεργοποίηση</string>
+1
View File
@@ -288,6 +288,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Download</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Turning Off...</string>
<string name="swipe_power_off">Swipe to Power Off</string>
<string name="swipe_power_off_s">Power Off</string>
+1
View File
@@ -263,6 +263,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Descarga</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Apagando...</string>
<string name="swipe_power_off">Deslice para Apagar</string>
<string name="swipe_power_off_s">Apagar</string>
+1
View File
@@ -260,6 +260,7 @@
<string name="rb_recovery_btn">Récupération</string>
<string name="rb_bootloader_btn">Amorçage</string>
<string name="rb_download_btn">Télécharger</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Arrêt en cours...</string>
<string name="swipe_power_off">Glisser pour éteindre</string>
<string name="swipe_power_off_s">Éteindre</string>
+1
View File
@@ -283,6 +283,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Download mód</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Kikapcsolás...</string>
<string name="swipe_power_off">Csúsztasson a kikapcsoláshoz</string>
<string name="swipe_power_off_s">Kikapcsolás</string>
+1
View File
@@ -283,6 +283,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Download</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Spegnimento in corso...</string>
<string name="swipe_power_off">Scorri per spegnere</string>
<string name="swipe_power_off_s">Spegni</string>
+1
View File
@@ -270,6 +270,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Download</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Uitschakelen...</string>
<string name="swipe_power_off">Veeg om uit te schakelen</string>
<string name="swipe_power_off_s">Uitschakelen</string>
+1
View File
@@ -270,6 +270,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Download</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Wyłączanie...</string>
<string name="swipe_power_off">Przesuń, aby wyłączyć</string>
<string name="swipe_power_off_s">Wyłącz</string>
+1
View File
@@ -262,6 +262,7 @@
<string name="rb_recovery_btn">Recuperação</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Baixar</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Desligar...</string>
<string name="swipe_power_off">Deslize para desligar</string>
<string name="swipe_power_off_s">Desligar</string>
+1
View File
@@ -284,6 +284,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Descarregar</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">A desligar...</string>
<string name="swipe_power_off"> Deslize para desligar</string>
<string name="swipe_power_off_s">Desligar</string>
+1
View File
@@ -280,6 +280,7 @@
<string name="rb_recovery_btn">Рекавери</string>
<string name="rb_bootloader_btn">Загрузчик</string>
<string name="rb_download_btn">Режим загрузки</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Выключение...</string>
<string name="swipe_power_off">Свайп для выключения</string>
<string name="swipe_power_off_s">Выключение</string>
+1
View File
@@ -262,6 +262,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Stiahnuť</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Vypínanie...</string>
<string name="swipe_power_off">Potiahnite pre vypnutie</string>
<string name="swipe_power_off_s">Vypnúť</string>
+1
View File
@@ -262,6 +262,7 @@
<string name="rb_recovery_btn">Obnovitev</string>
<string name="rb_bootloader_btn">Zagonski nalagalnik</string>
<string name="rb_download_btn">Prejmi</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Izklapljanje …</string>
<string name="swipe_power_off">Povlecite za izklop</string>
<string name="swipe_power_off_s">Izklopi</string>
+1
View File
@@ -101,6 +101,7 @@
<string name="rb_system_btn">System</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Ladda ner</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Stänger av...</string>
<string name="settings_hdr">Inställningar</string>
<string name="settings_gen_s_hdr">Allmänt</string>
+1
View File
@@ -284,6 +284,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Download</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Kapatılıyor...</string>
<string name="swipe_power_off">Kapatmak için Kaydır</string>
<string name="swipe_power_off_s">Kapat</string>
+1
View File
@@ -266,6 +266,7 @@
<string name="rb_recovery_btn">Рекавері</string>
<string name="rb_bootloader_btn">Завантажувач</string>
<string name="rb_download_btn">Режим завантаження</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">Вимкнення...</string>
<string name="swipe_power_off">Вимкнути</string>
<string name="swipe_power_off_s">Вимкнення</string>
+19
View File
@@ -2862,6 +2862,25 @@
</actions>
</button>
<button style="main_button">
<condition var1="tw_edl_mode" var2="1"/>
<placement x="%center_x%" y="%row13a_y%"/>
<text>{@rb_edl_btn=Edl}</text>
<actions>
<action function="set">tw_back=reboot</action>
<action function="set">tw_action=reboot</action>
<action function="set">tw_action_param=edl</action>
<action function="set">tw_reboot_param=edl</action>
<action function="set">tw_has_action2=0</action>
<action function="set">tw_text1={@no_os1=No OS Installed! Are you}</action>
<action function="set">tw_text2={@no_osrb=sure you wish to reboot?}</action>
<action function="set">tw_action_text1={@rebooting=Rebooting...}</action>
<action function="set">tw_complete_text1={@rebooting=Rebooting...}</action>
<action function="set">tw_slider_text={@swipe_reboot=Swipe to Reboot}</action>
<action function="page">rebootcheck</action>
</actions>
</button>
<text style="text_m">
<condition var1="tw_has_boot_slots" var2="1"/>
<placement x="%center_x%" y="%row17_y%" placement="5"/>
+18
View File
@@ -3359,6 +3359,24 @@
<action function="page">rebootcheck</action>
</actions>
</button>
<button style="main_button">
<condition var1="tw_edl_mode" var2="1"/>
<placement x="%col1_x_right%" y="%row11_y%"/>
<text>{@rb_edl_btn=Edl}</text>
<actions>
<action function="set">tw_back=reboot</action>
<action function="set">tw_action=reboot</action>
<action function="set">tw_action_param=edl</action>
<action function="set">tw_reboot_param=edl</action>
<action function="set">tw_has_action2=0</action>
<action function="set">tw_text1={@no_os1=No OS Installed! Are you}</action>
<action function="set">tw_text2={@no_osrb=sure you wish to reboot?}</action>
<action function="set">tw_action_text1={@rebooting=Rebooting...}</action>
<action function="set">tw_complete_text1={@rebooting=Rebooting...}</action>
<action function="set">tw_slider_text={@swipe_reboot_s= Reboot}</action>
<action function="page">rebootcheck</action>
</actions>
</button>
<action>
<touch key="home"/>
@@ -265,6 +265,7 @@
<string name="rb_recovery_btn">リカバリ</string>
<string name="rb_bootloader_btn">ブートローダー</string>
<string name="rb_download_btn">ダウンロード</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">電源を切っています...</string>
<string name="swipe_power_off">スワイプで電源を切る</string>
<string name="swipe_power_off_s">電源を切る</string>
@@ -283,6 +283,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Download</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">正在关机…</string>
<string name="swipe_power_off">滑动按钮确认关机</string>
<string name="swipe_power_off_s">关机</string>
@@ -283,6 +283,7 @@
<string name="rb_recovery_btn">Recovery</string>
<string name="rb_bootloader_btn">Bootloader</string>
<string name="rb_download_btn">Download</string>
<string name="rb_edl_btn">Edl</string>
<string name="turning_off">正在關機…</string>
<string name="swipe_power_off">滑動按鈕確認關機</string>
<string name="swipe_power_off_s">關機</string>
+2
View File
@@ -343,6 +343,8 @@ int OpenRecoveryScript::run_script_file(void) {
TWFunc::tw_reboot(rb_bootloader);
else if (strlen(value) && strcmp(value, "download") == 0)
TWFunc::tw_reboot(rb_download);
else if (strlen(value) && strcmp(value, "edl") == 0)
TWFunc::tw_reboot(rb_edl);
else
TWFunc::tw_reboot(rb_system);
} else if (strcmp(command, "cmd") == 0) {
+7
View File
@@ -625,6 +625,13 @@ int TWFunc::tw_reboot(RebootCommand command)
return property_set(ANDROID_RB_PROPERTY, "reboot,download");
#else
return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "download");
#endif
case rb_edl:
check_and_run_script("/sbin/rebootedl.sh", "reboot edl");
#ifdef ANDROID_RB_PROPERTY
return property_set(ANDROID_RB_PROPERTY, "reboot,edl");
#else
return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "edl");
#endif
default:
return -1;
+1
View File
@@ -37,6 +37,7 @@ typedef enum
rb_poweroff,
rb_bootloader, // May also be fastboot
rb_download,
rb_edl,
} RebootCommand;
enum Archive_Type {
+2
View File
@@ -345,6 +345,8 @@ int main(int argc, char **argv) {
TWFunc::tw_reboot(rb_bootloader);
else if (Reboot_Arg == "download")
TWFunc::tw_reboot(rb_download);
else if (Reboot_Arg == "edl")
TWFunc::tw_reboot(rb_edl);
else
TWFunc::tw_reboot(rb_system);
+1
View File
@@ -129,6 +129,7 @@
#define TW_MIN_SYSTEM_SIZE "50" // minimum system size to allow a reboot
#define TW_MIN_SYSTEM_VAR "tw_min_system"
#define TW_DOWNLOAD_MODE "tw_download_mode"
#define TW_EDL_MODE "tw_edl_mode"
#define TW_IS_ENCRYPTED "tw_is_encrypted"
#define TW_IS_DECRYPTED "tw_is_decrypted"
#define TW_CRYPTO_PWTYPE "tw_crypto_pwtype"