Revert "Revert "keymaster restore: warn when pin, password or pattern is enabled""

This reverts commit 59a8bd388e.
This commit is contained in:
Konsta
2022-01-12 16:55:18 +02:00
parent 59a8bd388e
commit 88d598c8c3
6 changed files with 436 additions and 1 deletions
+135
View File
@@ -2196,6 +2196,83 @@
<action function="overlay">select_storage</action>
</actions>
</button>
<action>
<condition var1="tw_crypto_pwtype" op="!=" var2="0"/>
<actions>
<action function="page">restore_pin</action>
</actions>
</action>
<action>
<condition var1="tw_restore" op="modified"/>
<actions>
<action function="readBackup"/>
<action function="page">restore_read</action>
</actions>
</action>
<action>
<touch key="home"/>
<action function="page">main</action>
</action>
<action>
<touch key="back"/>
<action function="page">main</action>
</action>
</page>
<page name="restore_force">
<template name="page"/>
<action>
<conditions>
<condition var1="tw_is_fbe" var2="1"/>
<condition var1="tw_all_users_decrypted" var2="0"/>
<condition var1="tw_multiuser_warning_accepted" op="!=" var2="1"/>
</conditions>
<actions>
<action function="set">tw_multiuser_warning_destination=restore</action>
<action function="page">multiuser_warning</action>
</actions>
</action>
<text style="text_l">
<placement x="%col1_x_header%" y="%row3_header_y%"/>
<text>{@restore_hdr=Restore}</text>
</text>
<text style="text_m">
<placement x="%col1_x_header%" y="%row4_header_y%"/>
<text>{@restore_sel_store_hdr=Select Backup from %tw_storage_display_name% (%tw_storage_free_size% MB)}</text>
</text>
<template name="sort_options"/>
<fileselector>
<placement x="%col1_x_left%" y="%row1a_y%" w="%content_quarter_width%" h="%fileselector_install_height%"/>
<text>{@restore_sel_pack_fs=Select Package to Restore:}</text>
<filter folders="1" files="1" nav="0" extn=".ab"/>
<path name="tw_backups_folder"/>
<data name="tw_restore" default=""/>
<selection name="tw_restore_name"/>
</fileselector>
<button style="main_button_half_width_low">
<placement x="%col_button_right%" y="%row16a_y%"/>
<text>{@select_storage_btn=Select Storage}</text>
<actions>
<action function="set">tw_back=restore</action>
<action function="overlay">select_storage</action>
</actions>
</button>
<action>
<condition var1="tw_crypto_pwtype" op="!=" var2="0"/>
<actions>
<action function="page">restore_pin</action>
</actions>
</action>
<action>
<condition var1="tw_restore" op="modified"/>
@@ -6031,5 +6108,63 @@ edi <conditions>
</actions>
</action>
</page>
<page name="restore_pin">
<template name="page"/>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="1"/>
<placement x="%col1_x_header%" y="%row3_header_y%"/>
<text>{@restore_with_pin1=PIN/Password is enabled}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="1"/>
<placement x="%col1_x_header%" y="%row4_header_y%"/>
<text>{@restore_with_pin2=PIN/Password should be disabled before restore}</text>
</text>
<text style="text_l">
<condition var1="tw_crypto_pwtype" var2="1"/>
<placement x="%center_x%" y="%row2_y%" placement="5"/>
<text>{@restore_pin=Restore While PIN/Password Enabled?}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="2"/>
<placement x="%col1_x_header%" y="%row3_header_y%"/>
<text>{@restore_with_pattern1=Pattern is enabled}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="2"/>
<placement x="%col1_x_header%" y="%row4_header_y%"/>
<text>{@restore_with_pattern2=Pattern should be disabled before restore}</text>
</text>
<text style="text_l">
<condition var1="tw_crypto_pwtype" var2="2"/>
<placement x="%center_x%" y="%row2_y%" placement="5"/>
<text>{@restore_pattern=Restore While Pattern Enabled?}</text>
</text>
<slider>
<text>{@continue_restore_encrypted=Continue Restore?}</text>
<actions>
<action function="page">restore_force</action>
</actions>
</slider>
<action>
<touch key="home"/>
<action function="page">main</action>
</action>
<action>
<touch key="back"/>
<actions>
<action function="page">main</action>
</actions>
</action>
</page>
</pages>
</recovery>
+11
View File
@@ -782,5 +782,16 @@
<string name="merge_snapshots_confirm">Merge Snapshots?</string>
<string name="merging_snapshots">Merging Snapshots...</string>
<string name="merging_snapshots_complete">Merged Snapshots</string>
<string name="restore_pin_password">Restore While PIN/Password Enabled?</string>
<string name="restore_pattern">Restore While Pattern Enabled?</string>
<string name="restore_pin">Restore While PIN Enabled?</string>
<string name="continue_restore_encrypted">Continue Restore?</string>
<string name="restore_with_pin_password1">PIN/Password is enabled</string>
<string name="restore_with_pin_password2">PIN/Password should be disabled before restore</string>
<string name="restore_with_pin1">PIN is enabled</string>
<string name="restore_with_pin2">PIN should be disabled before restore</string>
<string name="restore_with_pattern1">Pattern is enabled</string>
<string name="restore_with_pattern2">Pattern should be disabled before restore</string>
<string name="reboot_after_restore">It is recommended to reboot Android once after first boot.</string>
</resources>
</language>
+148
View File
@@ -2358,6 +2358,78 @@
</actions>
</button>
<action>
<condition var1="tw_crypto_pwtype" op="!=" var2="0"/>
<actions>
<action function="page">restore_keymaster</action>
</actions>
</action>
<action>
<condition var1="tw_restore" op="modified"/>
<actions>
<action function="readBackup"/>
<action function="page">restore_read</action>
</actions>
</action>
<action>
<touch key="home"/>
<action function="page">main</action>
</action>
<action>
<touch key="back"/>
<action function="page">main</action>
</action>
</page>
<page name="restore_force">
<template name="page"/>
<action>
<conditions>
<condition var1="tw_is_fbe" var2="1"/>
<condition var1="tw_all_users_decrypted" var2="0"/>
<condition var1="tw_multiuser_warning_accepted" op="!=" var2="1"/>
</conditions>
<actions>
<action function="set">tw_multiuser_warning_destination=restore</action>
<action function="page">multiuser_warning</action>
</actions>
</action>
<text style="text_l">
<placement x="%col1_x_header%" y="%row3_header_y%"/>
<text>{@restore_hdr=Restore}</text>
</text>
<text style="text_m">
<placement x="%col1_x_header%" y="%row4_header_y%"/>
<text>{@restore_sel_store_hdr=Select Backup from %tw_storage_display_name% (%tw_storage_free_size% MB)}</text>
</text>
<template name="sort_options"/>
<fileselector>
<placement x="%indent%" y="%row3_y%" w="%content_width%" h="%fileselector_install_height%"/>
<text>{@restore_sel_pack_fs=Select Package to Restore:}</text>
<filter folders="1" files="1" nav="0" extn=".ab"/>
<path name="tw_backups_folder"/>
<data name="tw_restore" default=""/>
<selection name="tw_restore_name"/>
</fileselector>
<button style="main_button_half_height">
<placement x="%indent%" y="%row21a_y%"/>
<text>{@select_storage_btn=Select Storage}</text>
<actions>
<action function="set">tw_back=restore</action>
<action function="overlay">select_storage</action>
</actions>
</button>
<action>
<condition var1="tw_restore" op="modified"/>
<actions>
@@ -5761,5 +5833,81 @@
</actions>
</action>
</page>
<page name="restore_keymaster">
<template name="page"/>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="1"/>
<placement x="%center_x%" y="%row2_y%" placement="5"/>
<text>{@restore_with_pin_password1=PIN/Password is enabled}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="1"/>
<placement x="%center_x%" y="%row3_y%" placement="5"/>
<text>{@restore_with_pin_password2=PIN/Password should be disabled before restore}</text>
</text>
<text style="text_l">
<condition var1="tw_crypto_pwtype" var2="1"/>
<placement x="%col1_x_header%" y="%row3_header_y%"/>
<text>{@restore_pin_password=Restore While PIN/Password Enabled?}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="2"/>
<placement x="%center_x%" y="%row2_y%" placement="5"/>
<text>{@restore_with_pattern1=Pattern is enabled}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="2"/>
<placement x="%center_x%" y="%row3_y%" placement="5"/>
<text>{@restore_with_pattern2=Pattern should be disabled before restore}</text>
</text>
<text style="text_l">
<condition var1="tw_crypto_pwtype" var2="2"/>
<placement x="%col1_x_header%" y="%row3_header_y%"/>
<text>{@restore_pattern=Restore While Pattern Enabled?}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="3"/>
<placement x="%center_x%" y="%row2_y%" placement="5"/>
<text>{@restore_with_pin1=PIN is enabled}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="3"/>
<placement x="%center_x%" y="%row3_y%" placement="5"/>
<text>{@restore_with_pin2=PIN should be disabled before restore}</text>
</text>
<text style="text_l">
<condition var1="tw_crypto_pwtype" var2="3"/>
<placement x="%col1_x_header%" y="%row3_header_y%"/>
<text>{@restore_pin=Restore While PIN Enabled?}</text>
</text>
<slider>
<text>{@continue_restore_encrypted=Continue Restore?}</text>
<actions>
<action function="page">restore_force</action>
</actions>
</slider>
<action>
<touch key="home"/>
<action function="page">main</action>
</action>
<action>
<touch key="back"/>
<actions>
<action function="page">main</action>
</actions>
</action>
</page>
</pages>
</recovery>
+138
View File
@@ -2709,6 +2709,75 @@
</actions>
</button>
<action>
<condition var1="tw_crypto_pwtype" op="!=" var2="0"/>
<actions>
<action function="page">restore_pin</action>
</actions>
</action>
<action>
<condition var1="tw_restore" op="modified"/>
<actions>
<action function="readBackup"/>
<action function="set">tw_back=restore</action>
<action function="page">restore_read</action>
</actions>
</action>
<action>
<touch key="home"/>
<action function="page">main</action>
</action>
<action>
<touch key="back"/>
<action function="page">main</action>
</action>
</page>
<page name="restore_force">
<template name="page"/>
<action>
<conditions>
<condition var1="tw_is_fbe" var2="1"/>
<condition var1="tw_all_users_decrypted" var2="0"/>
<condition var1="tw_multiuser_warning_accepted" op="!=" var2="1"/>
</conditions>
<actions>
<action function="set">tw_multiuser_warning_destination=restore</action>
<action function="page">multiuser_warning</action>
</actions>
</action>
<template name="statusbar"/>
<text style="text_m">
<placement x="%col1_x_left%" y="%row1_header_y%"/>
<text>{@restore_hdr=Restore} &gt; {@sel_backup_hdr=Select Backup}</text>
</text>
<fileselector>
<placement x="%indent%" y="%row2_header_y%" w="%content_width%" h="%fileselector_install_height%"/>
<text>%tw_storage_display_name%</text>
<filter folders="1" files="1" nav="0" extn=".ab"/>
<path name="tw_backups_folder"/>
<data name="tw_restore" default=""/>
<selection name="tw_restore_name"/>
</fileselector>
<button>
<placement x="%btn4_col4_x%" y="%row11_y%"/>
<highlight color="%highlight_color%"/>
<image resource="q_btn_storage"/>
<actions>
<action function="set">tw_storagetext={@restore_btn=Restore} &gt; {@select_storage_btn=Select Storage}</action>
<action function="set">tw_back=restore</action>
<action function="page">select_storage</action>
</actions>
</button>
<action>
<condition var1="tw_restore" op="modified"/>
<actions>
@@ -6137,5 +6206,74 @@
</actions>
</action>
</page>
<page name="restore_pin">
<template name="page"/>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="1"/>
<placement x="%center_x%" y="%row1_y%" placement="5"/>
<text>{@restore_with_pin1=PIN/Password is enabled}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="1"/>
<placement x="%center_x%" y="%row2_y%" placement="5"/>
<text>{@restore_with_pin2=PIN/Password should be disabled before restore}</text>
</text>
<text style="text_l">
<condition var1="tw_crypto_pwtype" var2="1"/>
<placement x="%center_x%" y="%row3_y%" placement="5"/>
<text>{@restore_pin=Restore While PIN/Password Enabled?}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="2"/>
<placement x="%center_x%" y="%row1_y%" placement="5"/>
<text>{@restore_with_pattern1=Pattern is enabled}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="2"/>
<placement x="%center_x%" y="%row2_y%" placement="5"/>
<text>{@restore_with_pattern2=Pattern should be disabled before restore}</text>
</text>
<text style="text_l">
<condition var1="tw_crypto_pwtype" var2="2"/>
<placement x="%center_x%" y="%row3_y%" placement="5"/>
<text>{@restore_pattern=Restore While Pattern Enabled?}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="2"/>
<placement x="%center_x%" y="%row2_y%" placement="5"/>
<text>{@restore_with_pin1=PIN is enabled}</text>
</text>
<text style="text_m_accent">
<condition var1="tw_crypto_pwtype" var2="3"/>
<placement x="%center_x%" y="%row2_y%" placement="5"/>
<text>{@restore_with_pin2=PIN should be disabled before restore}</text>
</text>
<text style="text_l">
<condition var1="tw_crypto_pwtype" var2="3"/>
<placement x="%center_x%" y="%row3_y%" placement="5"/>
<text>{@restore_pin=Restore While PIN Enabled?}</text>
</text>
<slider>
<text>{@continue_restore_encrypted=Continue Restore?}</text>
<actions>
<action function="page">restore_force</action>
</actions>
</slider>
<action>
<touch key="home"/>
<action function="page">main</action>
</action>
<action>
<touch key="back"/>
<actions>
<action function="page">main</action>
</actions>
</action>
</page>
</pages>
</recovery>
+1 -1
View File
@@ -7,7 +7,7 @@
<title>Backup Naowz</title>
<description>Default basic theme</description>
<preview>preview.png</preview>
<themeversion>3</themeversion>
<themeversion>4</themeversion>
</details>
<include>
+3
View File
@@ -1269,6 +1269,9 @@ int TWPartitionManager::Run_Restore(const string& Restore_Name) {
UnMount_Main_Partitions();
time(&rStop);
gui_msg(Msg(msg::kHighlight, "restore_completed=[RESTORE COMPLETED IN {1} SECONDS]")((int)difftime(rStop,rStart)));
TWPartition* Decrypt_Data = Find_Partition_By_Path("/data");
if (Decrypt_Data && Decrypt_Data->Is_Encrypted)
gui_msg(Msg(msg::kWarning, "reboot_after_restore=It is recommended to reboot Android once after first boot."));
DataManager::SetValue("tw_file_progress", "");
return true;