Revert "Add support for multi-user decryption"

This reverts commit 0b25b1d79b79bc4d45dfff2aaf575e10bd24ef2d.

Reason for revert: Changes need to be made to libtwrpfscrypt to include this patchset. Will cherry-pick this patch later and make necessary modifications.

Change-Id: I7601d7b820129709b05d9b4368573b6f1048de02
diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml
index 7fc9980..3af174e 100755
--- a/gui/theme/common/landscape.xml
+++ b/gui/theme/common/landscape.xml
@@ -759,7 +759,6 @@
 				<action function="set">tw_cancel_param=</action>
 				<action function="set">tw_show_exclamation=0</action>
 				<action function="set">tw_show_reboot=0</action>
-				<action function="set">tw_crypto_user_id=</action>
 				<action function="page">%tw_clear_destination%</action>
 			</action>
 		</page>
@@ -1063,13 +1062,8 @@
 			</text>
 
 			<text style="text_m_accent">
-				<placement x="%center_x%" y="%row3_y%" placement="5"/>
-				<text>{@factory_reset5=(not including users/lockscreen)}</text>
-			</text>
-
-			<text style="text_m_accent">
 				<condition var1="tw_has_data_media" var2="1"/>
-				<placement x="%center_x%" y="%row4_y%" placement="5"/>
+				<placement x="%center_x%" y="%row3_y%" placement="5"/>
 				<text>{@factory_reset2=(not including internal storage)}</text>
 			</text>
 
@@ -2523,10 +2517,6 @@
 				</conditions>
 				<placement x="%col2_x_left%" y="%row15a_y%"/>
 				<text>{@decrypt_data_btn=Decrypt Data}</text>
-				<action function="set">tw_crypto_user_id=0</action>
-				<action function="set">tw_crypto_password=</action>
-				<action function="set">tw_password_fail=0</action>
-				<action function="set">tw_crypto_pwtype=%tw_crypto_pwtype_0%</action>
 				<action function="page">decrypt</action>
 			</button>
 
@@ -3393,16 +3383,6 @@
 
 			<listbox style="advanced_listbox">
 				<placement x="%center_x%" y="%row2_y%" w="%content_half_width%" h="%fileselector_install_height%"/>
-				<listitem name="{@decrypt_users=Decrypt Users}">
-					<conditions>
-						<condition var1="tw_is_fbe" var2="1"/>
-						<condition var1="tw_all_users_decrypted" var2="0"/>
-					</conditions>
-					<actions>
-						<action function="set">tw_crypto_user_id=</action>
-						<action function="page">decrypt_users</action>
-					</actions>
-				</listitem>
 				<listitem name="{@reload_theme_btn=Reload Theme}">
 					<action function="reload"/>
 				</listitem>
@@ -4416,17 +4396,10 @@
 			</text>
 
 			<text style="text_m_accent">
-				<condition var1="tw_is_fbe" op="!=" var2="1"/>
 				<placement x="%center_x%" y="%row2_y%" placement="5"/>
 				<text>{@decrypt_data_enter_pass=Enter Password:}</text>
 			</text>
 
-			<text style="text_m_accent">
-				<condition var1="tw_is_fbe" var2="1"/>
-				<placement x="%center_x%" y="%row2_y%" placement="5"/>
-				<text>{@decrypt_data_enter_pass_fbe=Enter Password for User [%tw_crypto_user_id%]}</text>
-			</text>
-
 			<input>
 				<placement x="%col1_x_left%" y="%row3_input_y%" w="%content_width%" h="%input_height%"/>
 				<text>%tw_crypto_display%</text>
@@ -5406,44 +5379,5 @@
 				<action function="screenshot"/>
 			</action>
 		</page>
-
-		<page name="decrypt_users">
-			<template name="page"/>
-
-			<text style="text_l">
-				<placement x="%col1_x_header%" y="%row3_header_y%"/>
-				<text>{@decrypt_users=Decrypt Users}</text>
-			</text>
-
-			<text style="text_m_accent">
-				<placement x="%center_x%" y="%row2_y%" placement="5"/>
-				<text>{@decrypt_users_selection=Select a user ID to decrypt}</text>
-			</text>
-
-			<listbox>
-				<placement x="%col1_x_left%" y="%row1a_y%" w="%content_width%" h="%partitionlist_mount_height%"/>
-				<text>{@select_user=Select User}</text>
-				<icon selected="radio_true" unselected="radio_false" />
-				<data name="tw_crypto_user_id" />
-			</listbox>
-
-			<button style="main_button_half_width">
-				<placement x="%col2_x_right%" y="%row15a_y%"/>
-				<text>{@decrypt_users=Decrypt Users}</text>
-				<action function="set">tw_crypto_password=</action>
-				<action function="set">tw_password_fail=0</action>
-				<action function="page">decrypt</action>
-			</button>
-
-			<action>
-				<touch key="home"/>
-				<action function="page">main</action>
-			</action>
-
-			<action>
-				<touch key="back"/>
-				<action function="page">advanced</action>
-			</action>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/theme/common/languages/en.xml b/gui/theme/common/languages/en.xml
index 07d8e78..ac9472e 100755
--- a/gui/theme/common/languages/en.xml
+++ b/gui/theme/common/languages/en.xml
@@ -141,7 +141,6 @@
 		<string name="factory_reset2">(not including internal storage)</string>
 		<string name="factory_reset3">Most of the time this is</string>
 		<string name="factory_reset4">the only wipe that you need.</string>
-		<string name="factory_reset5">(not including users/lockscreen)</string>
 		<string name="factory_resetting">Factory Reset...</string>
 		<string name="advanced_wipe_hdr">Advanced Wipe</string>
 		<string name="advanced_wipe_btn">Advanced Wipe</string>
@@ -512,15 +511,6 @@
 		<string name="fix_recovery_loop_complete">Fix Recovery Bootloop Complete</string>
 		<string name="fixing_recovery_loop_patch">Patching kernel...</string>
 		<string name="fix_recovery_loop_patch_error">Error patching kernel.</string>
-		<string name="decrypt_users">Decrypt Users</string>
-		<string name="decrypt_users_selection">Select a user ID to decrypt</string>
-		<string name="select_user">Select User</string>
-		<string name="backup_storage_undecrypt_warning">Backup not include some files of user {1}, because the user is not decrypted.</string>
-		<string name="decrypting_user_fbe">Attempting to decrypt FBE for user {1}...</string>
-		<string name="decrypt_user_success_fbe">User {1} Decrypted Successfully</string>
-		<string name="decrypt_user_fail_fbe">Failed to decrypt user {1}</string>
-		<string name="decrypt_data_enter_pass_fbe">Enter Password for User [%tw_crypto_user_id%]</string>
-		<string name="decrypt_data_enter_pattern_fbe">Enter Pattern for User [%tw_crypto_user_id%]</string>
 
 		<!-- Various console messages - these consist of user displayed messages, oftentimes errors -->
 		<string name="no_kernel_selinux">Kernel does not have support for reading SELinux contexts.</string>
@@ -697,7 +687,7 @@
 		<!-- These 2 items are saved in the data manager instead of resource manager, so %llu, etc is correct instead of {1} -->
 		<string name="file_progress">%llu of %llu files, %i%%</string>
 		<string name="size_progress">%lluMB of %lluMB, %i%%</string>
-		<string name="decrypt_cmd" version="2">Attempting to decrypt data partition or user data via command line.</string>
+		<string name="decrypt_cmd">Attempting to decrypt data partition via command line.</string>
 		<string name="base_pkg_err">Failed to load base packages.</string>
 		<string name="simulating">Simulating actions...</string>
 		<string name="backup_cancel">Backup Cancelled</string>
diff --git a/gui/theme/common/portrait.xml b/gui/theme/common/portrait.xml
index a14fc43..64b8776 100755
--- a/gui/theme/common/portrait.xml
+++ b/gui/theme/common/portrait.xml
@@ -710,7 +710,6 @@
 				<action function="set">tw_cancel_param=</action>
 				<action function="set">tw_show_exclamation=0</action>
 				<action function="set">tw_show_reboot=0</action>
-				<action function="set">tw_crypto_user_id=</action>
 				<action function="page">%tw_clear_destination%</action>
 			</action>
 		</page>
@@ -1014,13 +1013,8 @@
 			</text>
 
 			<text style="text_m_accent">
-				<placement x="%center_x%" y="%row3_y%" placement="5"/>
-				<text>{@factory_reset5=(not including users/lockscreen)}</text>
-			</text>
-
-			<text style="text_m_accent">
 				<condition var1="tw_has_data_media" var2="1"/>
-				<placement x="%center_x%" y="%row4_y%" placement="5"/>
+				<placement x="%center_x%" y="%row3_y%" placement="5"/>
 				<text>{@factory_reset2=(not including internal storage)}</text>
 			</text>
 
@@ -2679,10 +2673,6 @@
 				</conditions>
 				<placement x="%center_x%" y="%row18a_y%"/>
 				<text>{@decrypt_data_btn=Decrypt Data}</text>
-				<action function="set">tw_crypto_user_id=0</action>
-				<action function="set">tw_crypto_password=</action>
-				<action function="set">tw_password_fail=0</action>
-				<action function="set">tw_crypto_pwtype=%tw_crypto_pwtype_0%</action>
 				<action function="page">decrypt</action>
 			</button>
 
@@ -3553,16 +3543,6 @@
 
 			<listbox style="advanced_listbox">
 				<placement x="%indent%" y="%row13a_y%" w="%content_width%" h="%listbox_advanced_height%"/>
-				<listitem name="{@decrypt_users=Decrypt Users}">
-					<conditions>
-						<condition var1="tw_is_fbe" var2="1"/>
-						<condition var1="tw_all_users_decrypted" var2="0"/>
-					</conditions>
-					<actions>
-						<action function="set">tw_crypto_user_id=</action>
-						<action function="page">decrypt_users</action>
-					</actions>
-				</listitem>
 				<listitem name="{@reload_theme_btn=Reload Theme}">
 					<action function="reload"/>
 				</listitem>
@@ -4577,17 +4557,10 @@
 			</text>
 
 			<text style="text_m_accent">
-				<condition var1="tw_is_fbe" op="!=" var2="1"/>
 				<placement x="%center_x%" y="%row2_y%" placement="5"/>
 				<text>{@decrypt_data_enter_pass=Enter Password:}</text>
 			</text>
 
-			<text style="text_m_accent">
-				<condition var1="tw_is_fbe" var2="1"/>
-				<placement x="%center_x%" y="%row2_y%" placement="5"/>
-				<text>{@decrypt_data_enter_pass_fbe=Enter Password for User [%tw_crypto_user_id%]}</text>
-			</text>
-
 			<input>
 				<placement x="%indent%" y="%row3_input_y%" w="%content_width%" h="%input_height%"/>
 				<text>%tw_crypto_display%</text>
@@ -4643,17 +4616,10 @@
 			</text>
 
 			<text style="text_m_accent">
-				<condition var1="tw_is_fbe" op="!=" var2="1"/>
 				<placement x="%center_x%" y="%row2_y%" placement="5"/>
 				<text>{@decrypt_data_enter_pattern=Enter Pattern.}</text>
 			</text>
 
-			<text style="text_m_accent">
-				<condition var1="tw_is_fbe" var2="1"/>
-				<placement x="%center_x%" y="%row2_y%" placement="5"/>
-				<text>{@decrypt_data_enter_pattern_fbe=Enter Pattern for User [%tw_crypto_user_id%]}</text>
-			</text>
-
 			<text style="text_m_fail">
 				<condition var1="tw_password_fail" var2="1"/>
 				<placement x="%center_x%" y="%row3_y%" placement="5"/>
@@ -5173,44 +5139,5 @@
 				<action function="screenshot"/>
 			</action>
 		</page>
-
-		<page name="decrypt_users">
-			<template name="page"/>
-
-			<text style="text_l">
-				<placement x="%col1_x_header%" y="%row3_header_y%"/>
-				<text>{@decrypt_users=Decrypt Users}</text>
-			</text>
-
-			<text style="text_m_accent">
-				<placement x="%center_x%" y="%row2_y%" placement="5"/>
-				<text>{@decrypt_users_selection=Select a user ID to decrypt}</text>
-			</text>
-
-			<listbox>
-				<placement x="%indent%" y="%row3_y%" w="%content_width%" h="%listbox_advanced_height%"/>
-				<text>{@select_user=Select User}</text>
-				<icon selected="radio_true" unselected="radio_false" />
-				<data name="tw_crypto_user_id" />
-			</listbox>
-
-			<button style="main_button_half_height">
-				<placement x="%center_x%" y="%row21a_y%"/>
-				<text>{@decrypt_users=Decrypt Users}</text>
-				<action function="set">tw_crypto_password=</action>
-				<action function="set">tw_password_fail=0</action>
-				<action function="page">decrypt</action>
-			</button>
-
-			<action>
-				<touch key="home"/>
-				<action function="page">main</action>
-			</action>
-
-			<action>
-				<touch key="back"/>
-				<action function="page">advanced</action>
-			</action>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/theme/common/watch.xml b/gui/theme/common/watch.xml
index af6a643..70ccf38 100755
--- a/gui/theme/common/watch.xml
+++ b/gui/theme/common/watch.xml
@@ -975,7 +975,6 @@
 				<action function="set">tw_cancel_param=</action>
 				<action function="set">tw_show_exclamation=0</action>
 				<action function="set">tw_show_reboot=0</action>
-				<action function="set">tw_crypto_user_id=</action>
 				<action function="page">%tw_clear_destination%</action>
 			</action>
 		</page>
@@ -1386,13 +1385,8 @@
 			</text>
 
 			<text style="text_m_accent">
-				<placement x="%center_x%" y="%row2_y%" placement="5"/>
-				<text>{@factory_reset5=(not including users/lockscreen)}</text>
-			</text>
-
-			<text style="text_m_accent">
 				<condition var1="tw_has_data_media" var2="1"/>
-				<placement x="%center_x%" y="%row3_y%" placement="5"/>
+				<placement x="%center_x%" y="%row2_y%" placement="5"/>
 				<text>{@factory_reset2=(not including internal storage)}</text>
 			</text>
 
@@ -3200,10 +3194,6 @@
 				</conditions>
 				<placement x="%col1_x_left%" y="%row6_y%"/>
 				<text>{@decrypt_data_btn=Decrypt Data}</text>
-				<action function="set">tw_crypto_user_id=0</action>
-				<action function="set">tw_crypto_password=</action>
-				<action function="set">tw_password_fail=0</action>
-				<action function="set">tw_crypto_pwtype=%tw_crypto_pwtype_0%</action>
 				<action function="page">decrypt</action>
 			</button>
 
@@ -4168,16 +4158,6 @@
 
 			<listbox style="advanced_listbox">
 				<placement x="%indent%" y="%row2_header_y%" w="%content_width%" h="%fileselector_install_height%"/>
-				<listitem name="{@decrypt_users=Decrypt Users}">
-					<conditions>
-						<condition var1="tw_is_fbe" var2="1"/>
-						<condition var1="tw_all_users_decrypted" var2="0"/>
-					</conditions>
-					<actions>
-						<action function="set">tw_crypto_user_id=</action>
-						<action function="page">decrypt_users</action>
-					</actions>
-				</listitem>
 				<listitem name="{@reload_theme_btn=Reload Theme}">
 					<action function="reload"/>
 				</listitem>
@@ -5276,17 +5256,10 @@
 			</text>
 
 			<text style="text_m_accent">
-				<condition var1="tw_is_fbe" op="!=" var2="1"/>
 				<placement x="%col1_x_left%" y="%row1_y%"/>
 				<text>{@decrypt_data_enter_pass=Enter Password:}</text>
 			</text>
 
-			<text style="text_m_accent">
-				<condition var1="tw_is_fbe" var2="1"/>
-				<placement x="%col1_x_left%" y="%row1_y%"/>
-				<text>{@decrypt_data_enter_pass_fbe=Enter Password for User [%tw_crypto_user_id%]}</text>
-			</text>
-
 			<input>
 				<placement x="%col1_x_left%" y="%row2_y%" w="%content_width%" h="%input_height%"/>
 				<text>%tw_crypto_display%</text>
@@ -5343,19 +5316,11 @@
 			</text>
 
 			<text style="text_m_accent">
-				<condition var1="tw_is_fbe" op="!=" var2="1"/>
 				<condition var1="tw_password_fail" op="!=" var2="1"/>
 				<placement x="%center_x%" y="%row5_y%" placement="5"/>
 				<text>{@decrypt_data_enter_pattern=Enter Pattern.}</text>
 			</text>
 
-			<text style="text_m_accent">
-				<condition var1="tw_is_fbe" var2="1"/>
-				<condition var1="tw_password_fail" op="!=" var2="1"/>
-				<placement x="%center_x%" y="%row5_y%" placement="5"/>
-				<text>{@decrypt_data_enter_pattern_fbe=Enter Pattern for User [%tw_crypto_user_id%]}</text>
-			</text>
-
 			<text style="text_m_fail">
 				<condition var1="tw_password_fail" var2="1"/>
 				<placement x="%center_x%" y="%row5_y%" placement="5"/>
@@ -5746,44 +5711,5 @@
 				<action function="screenshot"/>
 			</action>
 		</page>
-
-		<page name="decrypt_users">
-			<template name="page"/>
-
-			<text style="text_l">
-				<placement x="%col1_x_header%" y="%row3_header_y%"/>
-				<text>{@decrypt_users=Decrypt Users}</text>
-			</text>
-
-			<text style="text_m_accent">
-				<placement x="%center_x%" y="%row2_y%" placement="5"/>
-				<text>{@decrypt_users_selection=Select a user ID to decrypt}</text>
-			</text>
-
-			<listbox>
-				<placement x="%indent%" y="%row2_header_y%" w="%content_width%" h="%fileselector_install_height%"/>
-				<text>{@select_user=Select User}</text>
-				<icon selected="radio_true" unselected="radio_false" />
-				<data name="tw_crypto_user_id" />
-			</listbox>
-
-			<button style="main_button_half_height">
-				<placement x="%col1_x_left%" y="%row13_y%" textplacement="6"/>
-				<text>{@decrypt_users=Decrypt Users}</text>
-				<action function="set">tw_crypto_password=</action>
-				<action function="set">tw_password_fail=0</action>
-				<action function="page">decrypt</action>
-			</button>
-
-			<action>
-				<touch key="home"/>
-				<action function="page">main</action>
-			</action>
-
-			<action>
-				<touch key="back"/>
-				<action function="page">advanced</action>
-			</action>
-		</page>
 	</pages>
 </recovery>