Merge remote-tracking branch 'TeamWin/android-11' into android-11

Change-Id: Ifd35e85f6e2e18b4cdf77006138b60a6ede82e3e

Conflicts:
	gui/theme/common/landscape.xml
	gui/theme/common/portrait.xml
This commit is contained in:
Konsta
2021-11-19 15:55:34 +02:00
46 changed files with 950 additions and 343 deletions
+13 -7
View File
@@ -1080,15 +1080,21 @@ int Get_Password_Type(const userid_t user_id, std::string& filename) {
printf("Failed to Get_Password_Data\n");
return 0;
}
if (pwd.password_type == 1) { // In Android this means pattern
// In Android type 1 is pattern
// In Android <11 type 2 is PIN or password
// In Android 11+ type 3 is PIN and type 4 is password
if (pwd.password_type == 2) {
printf("password type: password/PIN\n");
return 1; // In TWRP this means password or PIN (Android <11)
} else if (pwd.password_type == 4) {
printf("password type: password\n");
return 1; // In TWRP this means password
} else if (pwd.password_type == 1) {
printf("password type: pattern\n");
return 2; // In TWRP this means pattern
}
// In Android <11 type 2 is PIN or password
// In Android 11 type 3 is PIN and type 4 is password
else if (pwd.password_type > 1) {
printf("password type: pin\n");
return 1; // In TWRP this means PIN or password
} else if (pwd.password_type == 3) {
printf("password type: PIN\n");
return 3; // In TWRP this means PIN
}
printf("using default password\n");
return 0; // We'll try the default password
+10
View File
@@ -62,6 +62,8 @@ static constexpr size_t STRETCHED_BYTES = 1 << 6;
static constexpr uint32_t AUTH_TIMEOUT = 30; // Seconds
static const std::string kPkmBlob("pKMblob\x00", 8);
static const char* kCurrentVersion = "1";
static const char* kRmPath = "/system/bin/rm";
static const char* kSecdiscardPath = "/system/bin/secdiscard";
@@ -247,6 +249,10 @@ static KeymasterOperation begin(Keymaster& keymaster, const std::string& dir,
auto kmKeyPath = dir + "/" + kFn_keymaster_key_blob;
std::string kmKey;
if (!readFileToString(kmKeyPath, &kmKey)) return KeymasterOperation();
// In A12 keymaster_key_blob format changed:
// it have useless for us bytes in beginning, so remove them to correctly handle key
if (!kmKey.compare(0, kPkmBlob.size(), kPkmBlob))
kmKey.erase(0, kPkmBlob.size());
km::AuthorizationSet inParams(keyParams);
inParams.append(opParams.begin(), opParams.end());
for (;;) {
@@ -590,6 +596,10 @@ bool retrieveKey(const std::string& dir, const KeyAuthentication& auth, KeyBuffe
static bool deleteKey(const std::string& dir) {
std::string kmKey;
if (!readFileToString(dir + "/" + kFn_keymaster_key_blob, &kmKey)) return false;
// In A12 keymaster_key_blob format changed:
// it have useless for us bytes in beginning, so remove them to correctly handle key
if (!kmKey.compare(0, kPkmBlob.size(), kPkmBlob))
kmKey.erase(0, kPkmBlob.size());
Keymaster keymaster;
if (!keymaster) return false;
if (!keymaster.deleteKey(kmKey)) return false;
+1 -1
View File
@@ -174,7 +174,7 @@ static bool read_key(const std::string& metadata_key_dir, const KeyGeneration& g
unlink(newKeyPath.c_str());
}
bool needs_cp = cp_needsCheckpoint();
if (!retrieveOrGenerateKey(dir, temp, kEmptyAuthentication, gen, key, needs_cp)) return false;
if (!retrieveOrGenerateKey(dir, temp, kEmptyAuthentication, gen, key, true)) return false;
if (needs_cp && pathExists(newKeyPath)) std::thread(commit_key, dir).detach();
return true;
}
+8 -8
View File
@@ -1942,15 +1942,15 @@ int GUIAction::setbootslot(std::string arg)
{
operation_start("Set Boot Slot");
if (!simulate) {
if (!PartitionManager.UnMount_By_Path("/vendor", false)) {
// PartitionManager failed to unmount /vendor, this should not happen,
// but in case it does, do a lazy unmount
LOGINFO("WARNING: vendor partition could not be unmounted normally!\n");
umount2("/vendor", MNT_DETACH);
PartitionManager.Set_Active_Slot(arg);
} else {
PartitionManager.Set_Active_Slot(arg);
if (PartitionManager.Find_Partition_By_Path("/vendor")) {
if (!PartitionManager.UnMount_By_Path("/vendor", false)) {
// PartitionManager failed to unmount /vendor, this should not happen,
// but in case it does, do a lazy unmount
LOGINFO("WARNING: vendor partition could not be unmounted normally!\n");
umount2("/vendor", MNT_DETACH);
}
}
PartitionManager.Set_Active_Slot(arg);
} else {
simulate_progress_bar();
}
+205 -21
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"/>
@@ -2840,7 +2917,7 @@
</actions>
</listitem>
<listitem name="{@rb_edl_btn=Edl}">
<listitem name="{@rb_edl_btn=EDL}">
<condition var1="tw_edl_mode" var2="1"/>
<actions>
<action function="set">tw_back=fastbootreboot</action>
@@ -2867,13 +2944,6 @@
</page>
<page name="reboot">
<action>
<action function="checkforapp"></action>
<action function="page">reboot2</action>
</action>
</page>
<page name="reboot2">
<template name="page"/>
<text style="text_l">
@@ -2978,7 +3048,7 @@
</actions>
</listitem>
<listitem name="{@rb_edl_btn=Edl}">
<listitem name="{@rb_edl_btn=EDL}">
<condition var1="tw_edl_mode" var2="1"/>
<actions>
<action function="set">tw_back=reboot</action>
@@ -2996,18 +3066,6 @@
</listitem>
</listbox>
<button style="main_button">
<condition var1="tw_app_prompt" op="!=" var2="-1"/>
<condition var1="tw_app_install_status" var2="1"/>
<placement x="%center_x%" y="%row12_y%"/>
<text>{@reboot_install_app_hdr=Install TWRP App}</text>
<actions>
<action function="set">tw_back=reboot</action>
<action function="set">tw_appinstall_title={@reboot_hdr=Reboot}</action>
<action function="page">installapp</action>
</actions>
</button>
<text style="text_m">
<condition var1="tw_has_boot_slots" var2="1"/>
<placement x="%col1_x_header%" y="%row14_y%"/>
@@ -4773,6 +4831,11 @@ edi <conditions>
<action function="page">decrypt_pattern</action>
</action>
<action>
<condition var1="tw_crypto_pwtype" var2="3"/>
<action function="page">decrypt_pin</action>
</action>
<text style="text_l">
<placement x="%col1_x_header%" y="%row3_header_y%"/>
<text>{@mount_hdr=Mount}</text>
@@ -4902,6 +4965,69 @@ edi <conditions>
</button>
</page>
<page name="decrypt_pin">
<template name="page"/>
<text style="text_l">
<placement x="%col1_x_header%" y="%row3_header_y%"/>
<text>{@mount_hdr=Mount}</text>
</text>
<text style="text_m">
<placement x="%col1_x_header%" y="%row4_header_y%"/>
<text>{@decrypt_data_hdr=Decrypt Data}</text>
</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 PIN:}</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 PIN 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>
<data name="tw_crypto_password" mask="*" maskvariable="tw_crypto_display"/>
<restrict minlen="1" maxlen="254"/>
<action function="page">trydecrypt</action>
</input>
<fill color="%accent_color%">
<placement x="%col1_x_left%" y="row5_y" w="%content_width%" h="input_line_width" placement="1"/>
</fill>
<fill color="%text_fail_color%">
<condition var1="tw_password_fail" var2="1"/>
<placement x="%col1_x_left%" y="row5_y" w="%content_width%" h="input_line_width" placement="1"/>
</fill>
<text style="text_m_fail">
<condition var1="tw_password_fail" var2="1"/>
<placement x="%col1_x_left%" y="%row5_y%"/>
<text>{@decrypt_data_failed=PIN failed, please try again!}</text>
</text>
<button style="main_button_half_width_low">
<placement x="%indent%" y="%row6_y%"/>
<text>{@cancel_btn=Cancel}</text>
<action function="page">canceldecrypt</action>
</button>
<button style="main_button_half_width_low">
<placement x="%indent_right%" y="%row6_y%" placement="1"/>
<text>{@sel_lang_btn=Select Language}</text>
<action function="overlay">select_language</action>
</button>
<template name="keyboardnum"/>
</page>
<page name="trydecrypt">
<template name="page"/>
@@ -5982,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>
+1 -1
View File
@@ -262,7 +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="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 -1
View File
@@ -292,7 +292,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="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 -1
View File
@@ -273,7 +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="rb_edl_btn">EDL</string>
<string name="turning_off">Απενεργοποίηση...</string>
<string name="swipe_power_off">Σύρετε για Απενεργοποίηση</string>
<string name="swipe_power_off_s">Απενεργοποίηση</string>
+12 -1
View File
@@ -293,7 +293,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="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>
@@ -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>
+1 -1
View File
@@ -263,7 +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="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 -1
View File
@@ -260,7 +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="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 -1
View File
@@ -283,7 +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="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 -1
View File
@@ -293,7 +293,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="rb_edl_btn">EDL</string>
<string name="turning_off">Mematikan...</string>
<string name="swipe_power_off">Geser untuk Matikan</string>
<string name="swipe_power_off_s">Matikan Perangkat</string>
+1 -1
View File
@@ -283,7 +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="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 -1
View File
@@ -287,7 +287,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="rb_edl_btn">EDL</string>
<string name="turning_off">Wordt uitgeschakeld...</string>
<string name="swipe_power_off">Veeg om uit te schakelen</string>
<string name="swipe_power_off_s">Uitschakelen</string>
+1 -1
View File
@@ -270,7 +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="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 -1
View File
@@ -262,7 +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="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 -1
View File
@@ -291,7 +291,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="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>
+40 -7
View File
@@ -317,6 +317,7 @@
<string name="settings_gen_s_hdr">Основные</string>
<string name="settings_gen_btn">Основные</string>
<string name="use_rmrf_chk">Использовать rm -rf вместо форматирования</string>
<string name="auto_reflashtwrp_chk">Автоматически перепрошивать TWRP после установки прошивки</string>
<string name="use24clock_chk">Использовать 24-часовой формат времени</string>
<string name="rev_navbar_chk">Инвертировать порядок навигационных кнопок</string>
<string name="simact_chk">Имитация действий для тестирования темы</string>
@@ -334,7 +335,7 @@
<string name="time_zone_hdr">Часовой пояс</string>
<string name="sel_tz_list">Выбор часового пояса:</string>
<!-- Translator note: if it does not make sense to translate the locations or if it makes more sense,
feel free to change the location listed or drop the location entirely and just call it UTC -6 -->
feel free to change the location listed or drop the location entirely and just call it UTC -6 -->
<string name="utcm11">(UTC-11, SST) о.Мидуэй, Самоа</string>
<string name="utcm10">(UTC-10, HAST) Гавайи</string>
<string name="utcm9">(UTC-9, AKST) Аляска</string>
@@ -506,9 +507,16 @@
<string name="install_complete">Установка завершена</string>
<string name="unpack_error">Ошибка распаковки образа.</string>
<string name="repack_error">Ошибка перепаковки образа.</string>
<string name="modified_ramdisk_error">файлы рамдиска были изменены, неудалось создать рамдиск для установки, используйте fastboot boot twrp и попробуйте эту функцию снова или воспользуйтесь Установка рекавери в ramdisk.</string>
<string name="create_ramdisk_error">неудалось создать рамдиск для установки.</string>
<string name="unpacking_image">Распаковка {1}...</string>
<string name="repacking_image">Перепаковка {1}...</string>
<string name="repack_image_hdr">Выбор образа</string>
<string name="repack_overwrite_warning">Если устройство ранее было рутовано, тогда рут перезапишется и нужно будет переустановить его.</string>
<string name="reflash_twrp">Установить текущее TWRP</string>
<string name="reflash_twrp_confirm">Установить текущее TWRP?</string>
<string name="reflashing_twrp">Установка TWRP...</string>
<string name="reflash_twrp_complete">TWRP успешно установлено</string>
<string name="fix_recovery_loop">Исправить циклическую перезагрузку рекавери</string>
<string name="fix_recovery_loop_confirm">Исправить циклическую перезагрузку рекавери?</string>
<string name="fixing_recovery_loop">Исправление циклической перезагрузки рекавери...</string>
@@ -518,16 +526,16 @@
<string name="decrypt_users">Расшифровка пользователей</string>
<string name="decrypt_users_selection">Выберите ID пользователя для расшифровки</string>
<string name="select_user">Выбор пользователя</string>
<string name="backup_storage_undecrypt_warning">В резервную копию не включены некоторые файлы пользователя {1}, потому что пользователь не расшифрован.</string>
<string name="decrypting_user_fbe">Попытка расшифровать FBE пользователя {1}...</string>
<string name="backup_storage_undecrypt_warning">В резервную копию не включены некоторые файлы пользователя {1}, потому что пользователь не расшифрован.</string>
<string name="decrypting_user_fbe">Попытка расшифровать FBE пользователя {1}...</string>
<string name="decrypt_user_success_fbe">Пользователь {1} расшифрован успешно</string>
<string name="decrypt_user_fail_fbe">Ошибка расшифровки пользователя {1}</string>
<string name="decrypt_data_enter_pass_fbe">Введите пароль пользователя [%tw_crypto_user_id%]</string>
<string name="decrypt_data_enter_pattern_fbe">Введите шаблон пользователя [%tw_crypto_user_id%]</string>
<string name="multiuser_warning1">Не все пользователи расшифрованы!</string>
<string name="multiuser_warning2">Резервное копирование или восстановление могут завершиться неудачно!</string>
<string name="multiuser_warning2">Резервное копирование или восстановление могут завершиться неудачно!</string>
<string name="multiuser_warning_accept">Всё равно продолжить</string>
<string name="multiuser_warning_hdr">Предупреждение о нескольких пользователях</string>
<string name="multiuser_warning_hdr">Предупреждение о нескольких пользователях</string>
<!-- Various console messages - these consist of user displayed messages, oftentimes errors -->
<string name="no_kernel_selinux">Чтение SELinux-контекста не поддерживается ядром.</string>
@@ -628,7 +636,7 @@
<string name="cannot_resize">Невозможно изменить размер {1}.</string>
<string name="repair_resize">Восстановление {1} перед изменением размера.</string>
<string name="unable_resize">Не удаётся изменить размер {1}.</string>
<string name="no_digest_found" version="2">Отсутствует файл контрольной суммы для '{1}'. Пожалуйста отмените выбор проверки контрольных сумм при восстановлении.</string>
<string name="no_digest_found" version="2">Отсутствует файл контрольной суммы для '{1}'. Пожалуйста, отмените выбор проверки контрольных сумм при восстановлении.</string>
<string name="digest_fail_match" version="2">Контрольная сумма не соответствует '{1}'.</string>
<string name="digest_matched" version="2">Контрольная сумма соответствует '{1}'.</string>
<string name="fail_decrypt_tar">Не удаётся расшифровать tar-файл '{1}'</string>
@@ -733,7 +741,9 @@
<string name="twrp_adbbu_option">-- эта опция позволяет делать резервное копирование по ADB</string>
<string name="partition_not_found">путь: {1} отсутствует в списке разделов.</string>
<string name="copy_kernel_log">Kernel Log скопирован в {1}</string>
<string name="copy_logcat">Logcat скопирован в {1}</string>
<string name="include_kernel_log">Добавить Kernel Log</string>
<string name="include_logcat">Добавить Logcat</string>
<string name="sha2_chk">Использовать SHA2 для контрольных сумм (иначе - MD5)</string>
<string name="unable_set_boot_slot">Ошибка смены слота загрузки bootloader на {1}</string>
<string name="unmount_sys_install">Размонтировать System перед установкой ZIP</string>
@@ -744,11 +754,11 @@
<string name="flash_ab_both_slots">Прошить в оба слота</string>
<string name="ozip_decrypt_decryption">Начало расшифровки Ozip...</string>
<string name="ozip_decrypt_finish">Расшифровка Ozip завершена!</string>
<string name="fbe_wipe_msg">ВНИМАНИЕ: {1} очищен. Устройство необходимо перезагрузить в ОС (не в рекавери) для установки начальной политики FBE после очистки.</string>
<string name="fastboot_button">Fastboot</string>
<string name="enable_adb">Включить ADB</string>
<string name="enable_fastboot">Включить Fastboot</string>
<string name="fastboot_console_msg">Переход в режим Fastboot...</string>
<string name="data_media_fbe_msg">TWRP не пересоздаёт /data/media на FBE устройствах. Пожалуйста, перезагрузитесь в систему чтобы создать /data/media</string>
<!-- Android Rescue Party trigger -->
<string name="rescue_party0">Обнаружен сбой Android Rescue Party! Возможные решения:</string>
<string name="rescue_party1"> 1. Очистить Cache и/или</string>
@@ -760,5 +770,28 @@
<string name="change_twrp_folder_on_process">Смена папки TWRP</string>
<string name="change_twrp_folder_after_process">Папка TWRP изменена на</string>
<string name="tw_folder_exists">Папка с таким именем уже существует!</string>
<string name="unmap_super_devices">Отключить Super разделы</string>
<string name="unmap_super_devices_confirm">Отключить все Super разделы?</string>
<string name="unmapping_super_devices">Отключение всех Super разделов...</string>
<string name="unmap_super_devices_complete">Отлючены все Super разделы</string>
<string name="remove_dynamic_groups_confirm">Отлючить все Super разделы?</string>
<string name="remove_dynamic_groups">Отключение Super разделов...</string>
<string name="remove_dynamic_groups_complete">Отлючены все Super разделы</string>
<string name="mount_vab_partitions">Super-разделы могут не монтироваться до перезагрузки рекавери.</string>
<string name="merges_snapshots">Слияние Снапшотов</string>
<string name="merge_snapshots_confirm">Слить Снапшоты?</string>
<string name="merging_snapshots">Слияние Снапшотов...</string>
<string name="merging_snapshots_complete">Снапшоты слиты</string>
<string name="restore_pin_password">Восстановить при включенном PIN-коде/Пароле?</string>
<string name="restore_pattern">Восстановить при включенном графическом пароле?</string>
<string name="restore_pin">Восстановить при включенном PIN-коде?</string>
<string name="continue_restore_encrypted">Продолжить восстановление?</string>
<string name="restore_with_pin_password1">PIN-код/Пароль включен</string>
<string name="restore_with_pin_password2">PIN-код/Пароль должен быть отключён перед восстановлением</string>
<string name="restore_with_pin1">PIN-код включен</string>
<string name="restore_with_pin2">PIN-код должен быть отключён перед восстановлением</string>
<string name="restore_with_pattern1">Графический пароль включен</string>
<string name="restore_with_pattern2">Графический пароль должен быть отключён перед восстановлением</string>
<string name="reboot_after_restore">Рекомендуется перезагрузить Android один раз после первой загрузки.</string>
</resources>
</language>
+1 -1
View File
@@ -262,7 +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="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 -1
View File
@@ -262,7 +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="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 -1
View File
@@ -101,7 +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="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 -1
View File
@@ -284,7 +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="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 -1
View File
@@ -266,7 +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="rb_edl_btn">EDL</string>
<string name="turning_off">Вимкнення...</string>
<string name="swipe_power_off">Вимкнути</string>
<string name="swipe_power_off_s">Вимкнення</string>
+221 -24
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>
@@ -2996,7 +3068,7 @@
</actions>
</listitem>
<listitem name="{@rb_edl_btn=Edl}">
<listitem name="{@rb_edl_btn=EDL}">
<condition var1="tw_edl_mode" var2="1"/>
<actions>
<action function="set">tw_back=fastbootreboot</action>
@@ -3024,13 +3096,6 @@
</page>
<page name="reboot">
<action>
<action function="checkforapp"></action>
<action function="page">reboot2</action>
</action>
</page>
<page name="reboot2">
<template name="page"/>
<text style="text_l">
@@ -3134,7 +3199,7 @@
</actions>
</listitem>
<listitem name="{@rb_edl_btn=Edl}">
<listitem name="{@rb_edl_btn=EDL}">
<condition var1="tw_edl_mode" var2="1"/>
<actions>
<action function="set">tw_back=reboot</action>
@@ -3154,11 +3219,11 @@
<text style="text_m">
<condition var1="tw_has_boot_slots" var2="1"/>
<placement x="%center_x%" y="%row15_y%" placement="5"/>
<placement x="%center_x%" y="%row17_y%" placement="5"/>
<text>{@current_boot_slot=Current Slot: %tw_active_slot%}</text>
</text>
<button style="main_button_half_height">
<button style="main_button">
<condition var1="tw_has_boot_slots" var2="1"/>
<placement x="%indent%" y="%row19_y%"/>
<text>{@boot_slot_a=Slot A}</text>
@@ -3174,7 +3239,7 @@
</actions>
</button>
<button style="main_button_half_height">
<button style="main_button">
<condition var1="tw_has_boot_slots" var2="1"/>
<placement x="%center_x%" y="%row19_y%"/>
<text>{@boot_slot_b=Slot B}</text>
@@ -3190,18 +3255,6 @@
</actions>
</button>
<button style="main_button_half_height">
<condition var1="tw_app_prompt" op="!=" var2="-1"/>
<condition var1="tw_app_install_status" var2="1"/>
<placement x="%indent%" y="%row22_y%"/>
<text>{@reboot_install_app_hdr=Install TWRP App}</text>
<actions>
<action function="set">tw_back=reboot</action>
<action function="set">tw_appinstall_title={@reboot_hdr=Reboot}</action>
<action function="page">installapp</action>
</actions>
</button>
<action>
<touch key="home"/>
<action function="page">main</action>
@@ -4896,6 +4949,11 @@
<action function="page">decrypt_pattern</action>
</action>
<action>
<condition var1="tw_crypto_pwtype" var2="3"/>
<action function="page">decrypt_pin</action>
</action>
<text style="text_l">
<placement x="%col1_x_header%" y="%row3_header_y%"/>
<text>{@mount_hdr=Mount}</text>
@@ -5032,6 +5090,69 @@
</button>
</page>
<page name="decrypt_pin">
<template name="page"/>
<text style="text_l">
<placement x="%col1_x_header%" y="%row3_header_y%"/>
<text>{@mount_hdr=Mount}</text>
</text>
<text style="text_m">
<placement x="%col1_x_header%" y="%row4_header_y%"/>
<text>{@decrypt_data_hdr=Decrypt Data}</text>
</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 PIN:}</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 PIN 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>
<data name="tw_crypto_password" mask="*" maskvariable="tw_crypto_display"/>
<restrict minlen="1" maxlen="254"/>
<action function="page">trydecrypt</action>
</input>
<fill color="%accent_color%">
<placement x="%indent%" y="row4a_y" w="%content_width%" h="input_line_width" placement="1"/>
</fill>
<fill color="%text_fail_color%">
<condition var1="tw_password_fail" var2="1"/>
<placement x="%indent%" y="row4a_y" w="%content_width%" h="input_line_width" placement="1"/>
</fill>
<text style="text_m_fail">
<condition var1="tw_password_fail" var2="1"/>
<placement x="%indent%" y="%row5_y%"/>
<text>{@decrypt_data_failed=PIN failed, please try again!}</text>
</text>
<button style="main_button_half_height">
<placement x="%indent%" y="%row10_y%"/>
<text>{@cancel_btn=Cancel}</text>
<action function="page">canceldecrypt</action>
</button>
<button style="main_button_half_height">
<placement x="%center_x%" y="%row10_y%"/>
<text>{@sel_lang_btn=Select Language}</text>
<action function="overlay">select_language</action>
</button>
<template name="keyboardnum"/>
</page>
<page name="trydecrypt">
<template name="page"/>
@@ -5712,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>
+204 -8
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>
@@ -3399,13 +3468,6 @@
</page>
<page name="reboot">
<action>
<action function="checkforapp"></action>
<action function="page">reboot2</action>
</action>
</page>
<page name="reboot2">
<template name="page"/>
<template name="statusbar"/>
@@ -3504,7 +3566,7 @@
<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>
<text>{@rb_edl_btn=EDL}</text>
<actions>
<action function="set">tw_back=reboot</action>
<action function="set">tw_action=reboot</action>
@@ -5447,6 +5509,11 @@
<action function="page">decrypt_pattern</action>
</action>
<action>
<condition var1="tw_crypto_pwtype" var2="3"/>
<action function="page">decrypt_pin</action>
</action>
<text style="text_m">
<placement x="%col1_x_left%" y="%row1_header_y%"/>
<text>{@mount_hdr=Mount} &gt; {@decrypt_data_hdr=Decrypt Data}</text>
@@ -5617,6 +5684,66 @@
</button>
</page>
<page name="decrypt_pin">
<template name="page"/>
<template name="statusbar"/>
<text style="text_m">
<placement x="%col1_x_left%" y="%row1_header_y%"/>
<text>{@mount_hdr=Mount} &gt; {@decrypt_data_hdr=Decrypt Data}</text>
</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 PIN:}</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 PIN 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>
<data name="tw_crypto_password" mask="*" maskvariable="tw_crypto_display"/>
<restrict minlen="1" maxlen="254"/>
<action function="page">trydecrypt</action>
</input>
<fill color="%accent_color%">
<placement x="%col1_x_left%" y="row3_input_y" w="%content_width%" h="input_line_width" placement="1"/>
</fill>
<fill color="%text_fail_color%">
<condition var1="tw_password_fail" var2="1"/>
<placement x="%col1_x_left%" y="row3_input_y" w="%content_width%" h="input_line_width" placement="1"/>
</fill>
<text style="text_m_fail">
<condition var1="tw_password_fail" var2="1"/>
<placement x="%col1_x_left%" y="%row3_input_y%"/>
<text>{@decrypt_data_failed=PIN failed, please try again!}</text>
</text>
<button style="main_button_half_height">
<placement x="%col1_x_left%" y="%row4_y%"/>
<text>{@sel_lang_btn=Select Language}</text>
<action function="page">settings_language</action>
</button>
<button style="main_button_half_height">
<placement x="%col1_x_right%" y="%row4_y%"/>
<text>{@cancel_btn=Cancel}</text>
<action function="page">canceldecrypt</action>
</button>
<template name="keyboardnum"/>
</page>
<page name="trydecrypt">
<template name="page"/>
@@ -6079,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
@@ -265,7 +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="rb_edl_btn">EDL</string>
<string name="turning_off">電源を切っています...</string>
<string name="swipe_power_off">スワイプで電源を切る</string>
<string name="swipe_power_off_s">電源を切る</string>
@@ -292,7 +292,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="rb_edl_btn">EDL</string>
<string name="turning_off">正在关机…</string>
<string name="swipe_power_off">滑动滑块确认关机</string>
<string name="swipe_power_off_s">关机</string>
@@ -292,7 +292,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="rb_edl_btn">EDL</string>
<string name="turning_off">正在關機…</string>
<string name="swipe_power_off">滑動滑塊確認關機</string>
<string name="swipe_power_off_s">關機</string>
+23
View File
@@ -720,5 +720,28 @@
</layout4>
</keyboard>
</template>
<template name="keyboardnum">
<keyboard>
<placement x="0" y="%keyboard_y%" w="1920" h="512"/>
<keymargin x="6" y="6"/>
<background color="#111111"/>
<key-alphanumeric color="#111111" font="keylabel" textcolor="#EEEEEE"/>
<key-other color="#111111" font="keylabel-small" textcolor="#5b5b5bff"/>
<longpress font="keylabel-longpress" textcolor="#5b5b5bff" x="40" y="4"/>
<keylabel key="0:c:8" text="Bksp" resource="backspace"/>
<keylabel key="0:action" text="Enter" resource="enter"/>
<keylabel key=" " text="Space" resource="space"/>
<highlight color="%highlight_color%"/>
<capshighlight color="%highlight_color%"/>
<layout1>
<keysize height="127" width="376"/>
<row1 key01="396:" key02="1" key03="2" key04="3" key05="396:"/>
<row2 key01="396:" key02="4" key03="5" key04="6" key05="396:"/>
<row3 key01="396:" key02="7" key03="8" key04="9" key05="396:"/>
<row4 key01="396:" key02="376:c:8" key03="0" key04="378:action" key05="396:"/>
</layout1>
</keyboard>
</template>
</templates>
</recovery>
+23
View File
@@ -720,5 +720,28 @@
</layout4>
</keyboard>
</template>
<template name="keyboardnum">
<keyboard>
<placement x="0" y="%keyboard_y%" w="800" h="192"/>
<keymargin x="4" y="4"/>
<background color="#111111"/>
<key-alphanumeric color="#111111" font="keylabel" textcolor="#EEEEEE"/>
<key-other color="#111111" font="keylabel-small" textcolor="#5b5b5bff"/>
<longpress font="keylabel-longpress" textcolor="#5b5b5bff" x="14" y="2"/>
<keylabel key="0:c:8" text="Bksp" resource="backspace"/>
<keylabel key="0:action" text="Enter" resource="enter"/>
<keylabel key=" " text="Space" resource="space"/>
<highlight color="%highlight_color%"/>
<capshighlight color="%highlight_color%"/>
<layout1>
<keysize height="47" width="158"/>
<row1 key01="164:" key02="1" key03="2" key04="3" key05="164:"/>
<row2 key01="164:" key02="4" key03="5" key04="6" key05="164:"/>
<row3 key01="164:" key02="7" key03="8" key04="9" key05="164:"/>
<row4 key01="164:" key02="158:c:8" key03="0" key04="159:action" key05="164:"/>
</layout1>
</keyboard>
</template>
</templates>
</recovery>
+24
View File
@@ -638,5 +638,29 @@
</layout4>
</keyboard>
</template>
<template name="keyboardnum">
<keyboard>
<condition var1="tw_hide_kb" var2="0"/>
<placement x="0" y="%keyboard_y%" w="1080" h="644"/>
<keymargin x="8" y="8"/>
<background color="#111111"/>
<key-alphanumeric color="#111111" font="keylabel" textcolor="#EEEEEE"/>
<key-other color="#111111" font="keylabel-small" textcolor="#5b5b5bff"/>
<longpress font="keylabel-longpress" textcolor="#5b5b5bff" x="12" y="0"/>
<keylabel key="0:c:8" text="Bksp" resource="backspace"/>
<keylabel key="0:action" text="Enter" resource="enter"/>
<keylabel key=" " text="Space" resource="space"/>
<highlight color="%highlight_color%"/>
<capshighlight color="%highlight_color%"/>
<layout1>
<keysize height="160" width="212"/>
<row1 key01="225:" key02="1" key03="2" key04="3" key05="225:"/>
<row2 key01="225:" key02="4" key03="5" key04="6" key05="225:"/>
<row3 key01="225:" key02="7" key03="8" key04="9" key05="225:"/>
<row4 key01="225:" key02="212:c:8" key03="0" key04="214:action" key05="225:"/>
</layout1>
</keyboard>
</template>
</templates>
</recovery>
+24
View File
@@ -638,5 +638,29 @@
</layout4>
</keyboard>
</template>
<template name="keyboardnum">
<keyboard>
<condition var1="tw_hide_kb" var2="0"/>
<placement x="0" y="%keyboard_y%" w="480" h="284"/>
<keymargin x="4" y="4"/>
<background color="#111111"/>
<key-alphanumeric color="#111111" font="keylabel" textcolor="#EEEEEE"/>
<key-other color="#111111" font="keylabel-small" textcolor="#5b5b5bff"/>
<longpress font="keylabel-longpress" textcolor="#5b5b5bff" x="6" y="0"/>
<keylabel key="0:c:8" text="Bksp" resource="backspace"/>
<keylabel key="0:action" text="Enter" resource="enter"/>
<keylabel key=" " text="Space" resource="space"/>
<highlight color="%highlight_color%"/>
<capshighlight color="%highlight_color%"/>
<layout1>
<keysize height="70" width="94"/>
<row1 key01="100:" key02="1" key03="2" key04="3" key05="100:"/>
<row2 key01="100:" key02="4" key03="5" key04="6" key05="100:"/>
<row3 key01="100:" key02="7" key03="8" key04="9" key05="100:"/>
<row4 key01="100:" key02="94:c:8" key03="0" key04="95:action" key05="100:"/>
</layout1>
</keyboard>
</template>
</templates>
</recovery>
+25 -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>
@@ -388,5 +388,29 @@
</layout4>
</keyboard>
</template>
<template name="keyboardnum">
<keyboard>
<condition var1="tw_hide_kb" var2="0"/>
<placement x="0" y="%keyboard_y%" w="320" h="144"/>
<keymargin x="2" y="2"/>
<background color="#111111"/>
<key-alphanumeric color="#111111" font="keylabel" textcolor="#EEEEEE"/>
<key-other color="#111111" font="keylabel-small" textcolor="#5b5b5bff"/>
<longpress font="keylabel-longpress" textcolor="#5b5b5bff" x="0" y="0"/>
<keylabel key="0:c:8" text="Bksp" resource="backspace"/>
<keylabel key="0:action" text="Enter" resource="enter"/>
<keylabel key=" " text="Space" resource="space"/>
<highlight color="%highlight_color%"/>
<capshighlight color="%highlight_color%"/>
<layout1>
<keysize height="35" width="62"/>
<row1 key01="67:" key02="1" key03="2" key04="3" key05="67:"/>
<row2 key01="67:" key02="4" key03="5" key04="6" key05="67:"/>
<row3 key01="67:" key02="7" key03="8" key04="9" key05="67:"/>
<row4 key01="67:" key02="62:c:8" key03="0" key04="63:action" key05="67:"/>
</layout1>
</keyboard>
</template>
</templates>
</recovery>
-218
View File
@@ -1,218 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
graphics.cpp \
graphics_fbdev.cpp \
resources.cpp \
truetype.cpp \
graphics_utils.cpp \
events.cpp
ifeq ($(TW_SUPPORT_INPUT_1_2_HAPTICS),true)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
LOCAL_SHARED_LIBRARIES += android.hardware.vibrator@1.2 libhidlbase
LOCAL_CFLAGS += -DUSE_QTI_HAPTICS
endif
endif
ifneq ($(TW_BOARD_CUSTOM_GRAPHICS),)
$(warning ****************************************************************************)
$(warning * TW_BOARD_CUSTOM_GRAPHICS support has been deprecated in TWRP. *)
$(warning ****************************************************************************)
$(error stopping)
endif
ifeq ($(TW_TARGET_USES_QCOM_BSP), true)
LOCAL_CFLAGS += -DMSM_BSP
LOCAL_SRC_FILES += graphics_overlay.cpp
ifeq ($(TARGET_PREBUILT_KERNEL),)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
LOCAL_REQUIRED_MODULES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
else
LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
endif
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
else
ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),)
LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include
else
LOCAL_C_INCLUDES += $(TARGET_CUSTOM_KERNEL_HEADERS)
endif
endif
else
LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include
# The header files required for adf graphics can cause compile errors
# with adf graphics.
ifneq ($(wildcard system/core/adf/Android.*),)
LOCAL_CFLAGS += -DHAS_ADF
LOCAL_SRC_FILES += graphics_adf.cpp
LOCAL_WHOLE_STATIC_LIBRARIES += libadf
endif
endif
ifeq ($(TW_NEW_ION_HEAP), true)
LOCAL_CFLAGS += -DNEW_ION_HEAP
endif
ifneq ($(wildcard external/libdrm/Android.*),)
LOCAL_CFLAGS += -DHAS_DRM
LOCAL_SRC_FILES += graphics_drm.cpp
ifneq ($(wildcard external/libdrm/Android.common.mk),)
LOCAL_WHOLE_STATIC_LIBRARIES += libdrm_platform
else
LOCAL_WHOLE_STATIC_LIBRARIES += libdrm
endif
endif
LOCAL_C_INCLUDES += \
external/libpng \
external/zlib \
system/core/include \
external/freetype/include \
external/libcxx/include \
$(LOCAL_PATH)/../twrpinstall/include
ifneq ($(TW_INCLUDE_JPEG),)
LOCAL_C_INCLUDES += \
external/jpeg
LOCAL_CFLAGS += -DTW_INCLUDE_JPEG
endif
ifeq ($(RECOVERY_TOUCHSCREEN_SWAP_XY), true)
LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_SWAP_XY
endif
ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_X), true)
LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_X
endif
ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_Y), true)
LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_Y
endif
ifeq ($(RECOVERY_GRAPHICS_FORCE_USE_LINELENGTH), true)
LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_USE_LINELENGTH
endif
ifeq ($(RECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER), true)
LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER
endif
#Remove the # from the line below to enable event logging
#TWRP_EVENT_LOGGING := true
ifeq ($(TWRP_EVENT_LOGGING), true)
LOCAL_CFLAGS += -D_EVENT_LOGGING
endif
ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBA_8888)
$(warning ****************************************************************************)
$(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBA_8888 not implemented yet *)
$(warning ****************************************************************************)
$(error stopping)
LOCAL_CFLAGS += -DRECOVERY_RGBA
endif
ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBX_8888)
$(warning ****************************************************************************)
$(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBX_8888 not implemented yet *)
$(warning ****************************************************************************)
$(error stopping)
LOCAL_CFLAGS += -DRECOVERY_RGBX
endif
ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),BGRA_8888)
$(warning ****************************************************************************)
$(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := BGRA_8888 not implemented yet *)
$(warning ****************************************************************************)
$(error stopping)
LOCAL_CFLAGS += -DRECOVERY_BGRA
endif
ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGB_565)
LOCAL_CFLAGS += -DRECOVERY_FORCE_RGB_565
endif
# This used to compare against values in double-quotes (which are just
# ordinary characters in this context). Strip double-quotes from the
# value so that either will work.
ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),ABGR_8888)
LOCAL_CFLAGS += -DRECOVERY_ABGR
endif
ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888)
LOCAL_CFLAGS += -DRECOVERY_RGBX
endif
ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),BGRA_8888)
LOCAL_CFLAGS += -DRECOVERY_BGRA
endif
ifneq ($(TARGET_RECOVERY_OVERSCAN_PERCENT),)
LOCAL_CFLAGS += -DOVERSCAN_PERCENT=$(TARGET_RECOVERY_OVERSCAN_PERCENT)
else
LOCAL_CFLAGS += -DOVERSCAN_PERCENT=0
endif
ifeq ($(TW_FBIOPAN), true)
LOCAL_CFLAGS += -DTW_FBIOPAN
endif
ifneq ($(TW_ROTATION),)
ifeq (,$(filter 0 90 180 270, $(TW_ROTATION)))
$(error TW_ROTATION must be set to 0, 90, 180 or 270. Currently set to $(TW_ROTATION))
endif
LOCAL_CFLAGS += -DTW_ROTATION=$(TW_ROTATION)
else
# Support for old flag
ifeq ($(BOARD_HAS_FLIPPED_SCREEN), true)
LOCAL_CFLAGS += -DTW_ROTATION=180
else
LOCAL_CFLAGS += -DTW_ROTATION=0
endif
endif
ifeq ($(TW_IGNORE_MAJOR_AXIS_0), true)
LOCAL_CFLAGS += -DTW_IGNORE_MAJOR_AXIS_0
endif
ifeq ($(TW_IGNORE_MT_POSITION_0), true)
LOCAL_CFLAGS += -DTW_IGNORE_MT_POSITION_0
endif
ifeq ($(TW_IGNORE_ABS_MT_TRACKING_ID), true)
LOCAL_CFLAGS += -DTW_IGNORE_ABS_MT_TRACKING_ID
endif
ifneq ($(TW_INPUT_BLACKLIST),)
LOCAL_CFLAGS += -DTW_INPUT_BLACKLIST=$(TW_INPUT_BLACKLIST)
endif
ifneq ($(TW_WHITELIST_INPUT),)
LOCAL_CFLAGS += -DWHITELIST_INPUT=$(TW_WHITELIST_INPUT)
endif
ifeq ($(TW_HAPTICS_TSPDRV), true)
LOCAL_SRC_FILES += tspdrv.cpp
LOCAL_CFLAGS += -DTW_HAPTICS_TSPDRV
endif
ifeq ($(TW_DISABLE_TTF), true)
$(warning ****************************************************************************)
$(warning * TW_DISABLE_TTF support has been deprecated in TWRP. *)
$(warning ****************************************************************************)
$(error stopping)
endif
LOCAL_CLANG := true
LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libpng libutils libc++
ifneq ($(TW_INCLUDE_JPEG),)
LOCAL_SHARED_LIBRARIES += libjpeg
endif
LOCAL_STATIC_LIBRARIES += libpixelflinger_twrp
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
LOCAL_SHARED_LIBRARIES += libcutils liblog libutils
endif
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libminuitwrp
include $(BUILD_SHARED_LIBRARY)
+3
View File
@@ -132,8 +132,11 @@ func globalFlags(ctx android.BaseContext) []string {
var tw_rotation = getMakeVars(ctx, "TW_ROTATION")
switch tw_rotation {
case "0":
fallthrough
case "90":
fallthrough
case "180":
fallthrough
case "270":
cflags = append(cflags, "-DTW_ROTATION="+tw_rotation)
default:
+31 -8
View File
@@ -754,10 +754,9 @@ bool TWPartition::Decrypt_FBE_DE() {
ExcludeAll(Mount_Point + "/misc/keystore");
ExcludeAll(Mount_Point + "/drm/kek.dat");
ExcludeAll(Mount_Point + "/system_de/0/spblob"); // contains data needed to decrypt synthetic password
// ExcludeAll(Mount_Point + "/system/users/0/gatekeeper.password.key");
// ExcludeAll(Mount_Point + "/system/users/0/gatekeeper.pattern.key");
ExcludeAll(Mount_Point + "/system/users/0/gatekeeper.password.key");
ExcludeAll(Mount_Point + "/system/users/0/gatekeeper.pattern.key");
ExcludeAll(Mount_Point + "/cache");
ExcludeAll(Mount_Point + "/system/users/0");
ExcludeAll(Mount_Point + "/per_boot"); // removed each boot by init
ExcludeAll(Mount_Point + "/gsi"); // cow devices
@@ -1210,6 +1209,17 @@ void TWPartition::Setup_Data_Media() {
wipe_exclusions.add_absolute_dir(Mount_Point + "/misc/vold"); // adopted storage keys
ExcludeAll(Mount_Point + "/system/storage.xml");
} else {
int i;
string path;
for (i = 2; i <= 9; i++) {
path = "/sdcard" + TWFunc::to_string(i);
if (!TWFunc::Path_Exists(path)) {
Make_Dir(path, false);
Symlink_Mount_Point = path;
LOGINFO("'%s' data/media emulated storage symlinked to %s.\n", Mount_Point.c_str(), Symlink_Mount_Point.c_str());
break;
}
}
if (Mount(true) && TWFunc::Path_Exists(Mount_Point + "/media/0")) {
Storage_Path = Mount_Point + "/media/0";
Symlink_Path = Storage_Path;
@@ -3296,7 +3306,14 @@ int TWPartition::Decrypt_Adopted() {
char type_guid[80];
char part_guid[80];
if (gpt_disk_get_partition_info(fd, 2, type_guid, part_guid) == 0) {
uint32_t p_num;
size_t last_digit = Primary_Block_Device.find_last_not_of("0123456789");
if ((last_digit != string::npos) && (last_digit != Primary_Block_Device.length()-1))
p_num = atoi(Primary_Block_Device.substr(last_digit + 1).c_str()) + 1;
else
p_num = 2;
if (gpt_disk_get_partition_info(fd, p_num, type_guid, part_guid) == 0) {
LOGINFO("type: '%s'\n", type_guid);
LOGINFO("part: '%s'\n", part_guid);
Adopted_GUID = part_guid;
@@ -3312,16 +3329,22 @@ int TWPartition::Decrypt_Adopted() {
* to disable USB Mass Storage whenever adopted storage
* is present.
*/
LOGINFO("Detected adopted storage, disabling USB mass storage mode\n");
DataManager::SetValue("tw_has_usb_storage", 0);
if (p_num == 2) {
// TODO: Properly detect mixed vs fully adopted storage. Maybe this
// should be moved to partitionmanager instead, and disable after
// checking all partitions. Also the presence of adopted storage does
// not necessarily mean it's being used as Internal Storage
LOGINFO("Detected adopted storage, disabling USB mass storage mode\n");
DataManager::SetValue("tw_has_usb_storage", 0);
}
}
}
}
if (Is_Adopted_Storage) {
string Adopted_Block_Device = Alternate_Block_Device + "p2";
string Adopted_Block_Device = Alternate_Block_Device + "p" + TWFunc::to_string(p_num);
if (!TWFunc::Path_Exists(Adopted_Block_Device)) {
Adopted_Block_Device = Alternate_Block_Device + "2";
Adopted_Block_Device = Alternate_Block_Device + TWFunc::to_string(p_num);
if (!TWFunc::Path_Exists(Adopted_Block_Device)) {
LOGINFO("Adopted block device does not exist\n");
goto exit;
+39 -15
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;
@@ -1834,23 +1837,30 @@ void TWPartitionManager::Parse_Users() {
user.userId = to_string(userId);
// Attempt to get name of user. Fallback to user ID if this fails.
char* userFile = PageManager::LoadFileToBuffer("/data/system/users/" + to_string(userId) + ".xml", NULL);
if (userFile == NULL) {
user.userName = to_string(userId);
std::string path = "/data/system/users/" + to_string(userId) + ".xml";
if ((atoi(TWFunc::System_Property_Get("ro.build.version.sdk").c_str()) > 30) && TWFunc::Path_Exists(path)) {
if(!TWFunc::Check_Xml_Format(path))
user.userName = to_string(userId);
}
else {
xml_document<> *userXml = new xml_document<>();
userXml->parse<0>(userFile);
xml_node<>* userNode = userXml->first_node("user");
if (userNode == nullptr) {
char* userFile = PageManager::LoadFileToBuffer(path, NULL);
if (userFile == NULL) {
user.userName = to_string(userId);
} else {
xml_node<>* nameNode = userNode->first_node("name");
if (nameNode == nullptr)
}
else {
xml_document<> *userXml = new xml_document<>();
userXml->parse<0>(userFile);
xml_node<>* userNode = userXml->first_node("user");
if (userNode == nullptr) {
user.userName = to_string(userId);
else {
string userName = nameNode->value();
user.userName = userName + " (" + to_string(userId) + ")";
} else {
xml_node<>* nameNode = userNode->first_node("name");
if (nameNode == nullptr)
user.userName = to_string(userId);
else {
string userName = nameNode->value();
user.userName = userName + " (" + to_string(userId) + ")";
}
}
}
}
@@ -2147,8 +2157,12 @@ int TWPartitionManager::usb_storage_enable(void) {
Mount2 = Find_Next_Storage(Mount1->Mount_Point, true);
if (Mount2 && Mount2->Mount_Point != Mount1->Mount_Point) {
Open_Lun_File(Mount2->Mount_Point, lun_file);
// Mimic single lun code: Mount CurrentStoragePath if it's not /data
} else if (TWFunc::Get_Root_Path(DataManager::GetCurrentStoragePath()) != "/data") {
Open_Lun_File(DataManager::GetCurrentStoragePath(), lun_file);
}
} else {
// Mimic single lun code: Mount CurrentStoragePath if it's not /data
} else if (TWFunc::Get_Root_Path(DataManager::GetCurrentStoragePath()) != "/data" && !Open_Lun_File(DataManager::GetCurrentStoragePath(), lun_file)) {
gui_err("unable_locate_storage=Unable to locate storage device.");
goto error_handle;
}
@@ -2982,6 +2996,16 @@ bool TWPartitionManager::Decrypt_Adopted() {
LOGERR("Cannot decrypt adopted storage because /data will not mount\n");
return false;
}
// In Android 12 xml format changed. Previously it was human-readable format with xml tags
// now it's ABX (Android Binary Xml). Sadly, rapidxml can't parse it, so check xml format firstly
std::string path = "/data/system/storage.xml";
if ((atoi(TWFunc::System_Property_Get("ro.build.version.sdk").c_str()) > 30) && TWFunc::Path_Exists(path))
if(!TWFunc::Check_Xml_Format(path)) {
LOGINFO("Android 12+: storage.xml is in ABX format. Skipping adopted storage decryption\n");
return false;
}
LOGINFO("Decrypt adopted storage starting\n");
char* xmlFile = PageManager::LoadFileToBuffer("/data/system/storage.xml", NULL);
xml_document<> *doc = NULL;
@@ -3592,4 +3616,4 @@ bool TWPartitionManager::Check_Pending_Merges() {
return false;
}
return true;
}
}
+1 -1
View File
@@ -4,10 +4,10 @@ recovery_only(`
permissive logd;
permissive adbd;
permissive fastbootd;
permissive postinstall;
allow kernel unlabeled:file rw_file_perms;
allow kernel tmpfs:file { read };
allow kernel recovery:fd { use };
allow unlabeled unlabeled:filesystem associate;
allow vendor_init rootfs:dir read;
allow postinstall tmpfs:file { getattr read execute };
')
+1 -1
View File
@@ -51,7 +51,7 @@ bool startupArgs::processRecoveryArgs(std::vector<std::string> args, int index)
android::base::SetProperty("sys.usb.config", "fastboot");
DataManager::SetValue("tw_enable_adb", 0);
DataManager::SetValue("tw_enable_fastboot", 1);
} else if (args[index].find(UPDATE_PACKAGE) != std::string::npos) {
} else if (args[index].find(UPDATE_PACKAGE) != std::string::npos || args[index].find(SPECIAL_UPDATE_PACKAGE) != std::string::npos) {
std::string::size_type eq_pos = args[index].find("=");
std::string arg = args[index].substr(eq_pos + 1, args[index].size());
if (arg.size() == 0) {
+1
View File
@@ -33,6 +33,7 @@
class startupArgs {
public:
static inline std::string const UPDATE_PACKAGE = "--update_package";
static inline std::string const SPECIAL_UPDATE_PACKAGE = "--special_update_package";
static inline std::string const WIPE_CACHE = "--wipe_cache";
static inline std::string const WIPE_DATA = "--wipe_data";
static inline std::string const SEND_INTENT = "--send_intent";
+16
View File
@@ -1499,4 +1499,20 @@ string TWFunc::Check_For_TwrpFolder() {
exit:
return TW_DEFAULT_RECOVERY_FOLDER;
}
bool TWFunc::Check_Xml_Format(const std::string filename) {
std::string buffer(' ', 4);
std::string abx_hdr("ABX\x00", 4);
std::ifstream File;
File.open(filename);
if (File.is_open()) {
File.get(&buffer[0], buffer.size());
File.close();
// Android Binary Xml start from these bytes
if(!buffer.compare(0, abx_hdr.size(), abx_hdr))
return false; // bad format, not possible to parse
}
return true; // good format, possible to parse
}
#endif // ndef BUILD_TWRPTAR_MAIN
+1
View File
@@ -129,6 +129,7 @@ public:
static void List_Mounts(); // List current mounts by the kernel
static void Clear_Bootloader_Message(); // Removes the bootloader message from misc for next boot
static string Check_For_TwrpFolder(); // Gets user defined path on storage where backups should be stored
static bool Check_Xml_Format(const std::string filename); // Return whether a xml is in plain xml or ABX format
private:
static void Copy_Log(string Source, string Destination);
+2 -1
View File
@@ -99,6 +99,8 @@ static void Decrypt_Page(bool SkipDecryption, bool datamedia) {
static void process_fastbootd_mode() {
LOGINFO("starting fastboot\n");
#ifdef TW_LOAD_VENDOR_MODULES
printf("=> Linking mtab\n");
symlink("/proc/mounts", "/etc/mtab");
std::string fstab_filename = "/etc/twrp.fstab";
@@ -113,7 +115,6 @@ static void process_fastbootd_mode() {
TWPartition* ven = PartitionManager.Find_Partition_By_Path("/vendor");
PartitionManager.Setup_Super_Devices();
PartitionManager.Prepare_Super_Volume(ven);
#ifdef TW_LOAD_VENDOR_MODULES
KernelModuleLoader::Load_Vendor_Modules();
if (android::base::GetBoolProperty("ro.virtual_ab.enabled", false)) {
PartitionManager.Unmap_Super_Devices();
+1
View File
@@ -216,6 +216,7 @@ bool twrpRepacker::Repack_Image_And_Flash(const std::string& Target_Image, const
else
PartitionManager.Override_Active_Slot("A");
DataManager::SetProgress(.25);
PartitionManager.Update_System_Details();
if (!Backup_Image_For_Repack(part, REPACK_ORIG_DIR, Repack_Options.Backup_First, gui_lookup("repack", "Repack")))
return false;
if (TWFunc::copy_file(REPACK_NEW_DIR "ramdisk.cpio", REPACK_ORIG_DIR "ramdisk.cpio", 0644)) {
+1 -1
View File
@@ -17,7 +17,7 @@
#ifndef _VARIABLES_HEADER_
#define _VARIABLES_HEADER_
#define TW_MAIN_VERSION_STR "3.5.2_11"
#define TW_MAIN_VERSION_STR "3.6.0_11"
#define TW_VERSION_STR TW_MAIN_VERSION_STR TW_DEVICE_VERSION
#define TW_SETTINGS_FILE ".twrps"
#define TW_RECOVERY_NAME "TWRP"