Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef _VARIABLES_HEADER_ |
| 18 | #define _VARIABLES_HEADER_ |
| 19 | |
bigbiff | d07fdb3 | 2022-10-01 12:56:44 -0400 | [diff] [blame] | 20 | #define TW_MAIN_VERSION_STR "3.7.0_12" |
bigbiff bigbiff | 584b977 | 2016-12-08 21:21:17 -0500 | [diff] [blame] | 21 | #define TW_VERSION_STR TW_MAIN_VERSION_STR TW_DEVICE_VERSION |
epicX | a721f95 | 2021-01-04 13:01:31 +0530 | [diff] [blame] | 22 | #define TW_SETTINGS_FILE ".twrps" |
| 23 | #define TW_RECOVERY_NAME "TWRP" |
| 24 | #define TW_DEFAULT_RECOVERY_FOLDER "/" TW_RECOVERY_NAME |
Mohd Faraz | f923110 | 2022-06-18 22:51:55 +0200 | [diff] [blame] | 25 | #define TW_STORAGE_PATH "/data/recovery/" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 26 | #define TW_USE_COMPRESSION_VAR "tw_use_compression" |
| 27 | #define TW_FILENAME "tw_filename" |
| 28 | #define TW_ZIP_INDEX "tw_zip_index" |
bigbiff | ee7b7ff | 2020-03-23 15:08:27 -0400 | [diff] [blame] | 29 | #define TW_ZIP_QUEUE_COUNT "tw_zip_queue_count" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 30 | |
| 31 | #define MAX_BACKUP_NAME_LEN 64 |
| 32 | #define TW_BACKUP_TEXT "tw_backup_text" |
| 33 | #define TW_BACKUP_NAME "tw_backup_name" |
| 34 | #define TW_BACKUP_SYSTEM_VAR "tw_backup_system" |
| 35 | #define TW_BACKUP_DATA_VAR "tw_backup_data" |
| 36 | #define TW_BACKUP_BOOT_VAR "tw_backup_boot" |
| 37 | #define TW_BACKUP_RECOVERY_VAR "tw_backup_recovery" |
| 38 | #define TW_BACKUP_CACHE_VAR "tw_backup_cache" |
| 39 | #define TW_BACKUP_ANDSEC_VAR "tw_backup_andsec" |
| 40 | #define TW_BACKUP_SDEXT_VAR "tw_backup_sdext" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 41 | #define TW_BACKUP_AVG_IMG_RATE "tw_backup_avg_img_rate" |
| 42 | #define TW_BACKUP_AVG_FILE_RATE "tw_backup_avg_file_rate" |
| 43 | #define TW_BACKUP_AVG_FILE_COMP_RATE "tw_backup_avg_file_comp_rate" |
| 44 | #define TW_BACKUP_SYSTEM_SIZE "tw_backup_system_size" |
| 45 | #define TW_BACKUP_DATA_SIZE "tw_backup_data_size" |
| 46 | #define TW_BACKUP_BOOT_SIZE "tw_backup_boot_size" |
| 47 | #define TW_BACKUP_RECOVERY_SIZE "tw_backup_recovery_size" |
| 48 | #define TW_BACKUP_CACHE_SIZE "tw_backup_cache_size" |
| 49 | #define TW_BACKUP_ANDSEC_SIZE "tw_backup_andsec_size" |
| 50 | #define TW_BACKUP_SDEXT_SIZE "tw_backup_sdext_size" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 51 | #define TW_STORAGE_FREE_SIZE "tw_storage_free_size" |
bigbiff bigbiff | 56cf564 | 2016-08-19 17:43:45 -0400 | [diff] [blame] | 52 | #define TW_GENERATE_DIGEST_TEXT "tw_generate_digest_text" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 53 | |
| 54 | #define TW_RESTORE_TEXT "tw_restore_text" |
| 55 | #define TW_RESTORE_SYSTEM_VAR "tw_restore_system" |
| 56 | #define TW_RESTORE_DATA_VAR "tw_restore_data" |
| 57 | #define TW_RESTORE_BOOT_VAR "tw_restore_boot" |
| 58 | #define TW_RESTORE_RECOVERY_VAR "tw_restore_recovery" |
| 59 | #define TW_RESTORE_CACHE_VAR "tw_restore_cache" |
| 60 | #define TW_RESTORE_ANDSEC_VAR "tw_restore_andsec" |
| 61 | #define TW_RESTORE_SDEXT_VAR "tw_restore_sdext" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 62 | #define TW_RESTORE_AVG_IMG_RATE "tw_restore_avg_img_rate" |
| 63 | #define TW_RESTORE_AVG_FILE_RATE "tw_restore_avg_file_rate" |
| 64 | #define TW_RESTORE_AVG_FILE_COMP_RATE "tw_restore_avg_file_comp_rate" |
| 65 | #define TW_RESTORE_FILE_DATE "tw_restore_file_date" |
bigbiff bigbiff | 56cf564 | 2016-08-19 17:43:45 -0400 | [diff] [blame] | 66 | #define TW_VERIFY_DIGEST_TEXT "tw_verify_digest_text" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 67 | #define TW_UPDATE_SYSTEM_DETAILS_TEXT "tw_update_system_details_text" |
| 68 | |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 69 | #define TW_VERSION_VAR "tw_version" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 70 | #define TW_GUI_SORT_ORDER "tw_gui_sort_order" |
| 71 | #define TW_ZIP_LOCATION_VAR "tw_zip_location" |
| 72 | #define TW_ZIP_INTERNAL_VAR "tw_zip_internal" |
| 73 | #define TW_ZIP_EXTERNAL_VAR "tw_zip_external" |
Matt Mower | bfccfb8 | 2016-04-25 23:22:31 -0500 | [diff] [blame] | 74 | #define TW_DISABLE_FREE_SPACE_VAR "tw_disable_free_space" |
bigbiff bigbiff | 56cf564 | 2016-08-19 17:43:45 -0400 | [diff] [blame] | 75 | #define TW_FORCE_DIGEST_CHECK_VAR "tw_force_digest_check" |
| 76 | #define TW_SKIP_DIGEST_CHECK_VAR "tw_skip_digest_check" |
| 77 | #define TW_SKIP_DIGEST_GENERATE_VAR "tw_skip_digest_generate" |
epicX | 9597b84 | 2021-03-20 21:58:17 +0530 | [diff] [blame] | 78 | #define TW_SKIP_DIGEST_CHECK_ZIP_VAR "tw_skip_digest_check_zip" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 79 | #define TW_SIGNED_ZIP_VERIFY_VAR "tw_signed_zip_verify" |
Matt Mower | 8dc25b7 | 2016-04-25 23:06:53 -0500 | [diff] [blame] | 80 | #define TW_INSTALL_REBOOT_VAR "tw_install_reboot" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 81 | #define TW_TIME_ZONE_VAR "tw_time_zone" |
| 82 | #define TW_RM_RF_VAR "tw_rm_rf" |
| 83 | |
| 84 | #define TW_BACKUPS_FOLDER_VAR "tw_backups_folder" |
epicX | a721f95 | 2021-01-04 13:01:31 +0530 | [diff] [blame] | 85 | #define TW_RECOVERY_FOLDER_VAR "tw_recovery_folder" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 86 | |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 87 | #define TW_SDEXT_SIZE "tw_sdext_size" |
| 88 | #define TW_SWAP_SIZE "tw_swap_size" |
| 89 | #define TW_SDPART_FILE_SYSTEM "tw_sdpart_file_system" |
| 90 | #define TW_TIME_ZONE_GUISEL "tw_time_zone_guisel" |
| 91 | #define TW_TIME_ZONE_GUIOFFSET "tw_time_zone_guioffset" |
| 92 | #define TW_TIME_ZONE_GUIDST "tw_time_zone_guidst" |
| 93 | |
| 94 | #define TW_ACTION_BUSY "tw_busy" |
| 95 | |
| 96 | #define TW_ALLOW_PARTITION_SDCARD "tw_allow_partition_sdcard" |
| 97 | |
| 98 | #define TW_SCREEN_OFF "tw_screen_off" |
| 99 | |
| 100 | #define TW_REBOOT_SYSTEM "tw_reboot_system" |
| 101 | #define TW_REBOOT_RECOVERY "tw_reboot_recovery" |
| 102 | #define TW_REBOOT_POWEROFF "tw_reboot_poweroff" |
| 103 | #define TW_REBOOT_BOOTLOADER "tw_reboot_bootloader" |
| 104 | |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 105 | #define TW_USE_EXTERNAL_STORAGE "tw_use_external_storage" |
| 106 | #define TW_HAS_INTERNAL "tw_has_internal" |
| 107 | #define TW_INTERNAL_PATH "tw_internal_path" // /data/media or /internal |
| 108 | #define TW_INTERNAL_MOUNT "tw_internal_mount" // /data or /internal |
| 109 | #define TW_INTERNAL_LABEL "tw_internal_label" // data or internal |
| 110 | #define TW_HAS_EXTERNAL "tw_has_external" |
| 111 | #define TW_EXTERNAL_PATH "tw_external_path" // /sdcard or /external/sdcard2 |
| 112 | #define TW_EXTERNAL_MOUNT "tw_external_mount" // /sdcard or /external |
| 113 | #define TW_EXTERNAL_LABEL "tw_external_label" // sdcard or external |
| 114 | |
| 115 | #define TW_HAS_DATA_MEDIA "tw_has_data_media" |
| 116 | |
| 117 | #define TW_HAS_BOOT_PARTITION "tw_has_boot_partition" |
| 118 | #define TW_HAS_RECOVERY_PARTITION "tw_has_recovery_partition" |
| 119 | #define TW_HAS_ANDROID_SECURE "tw_has_android_secure" |
| 120 | #define TW_HAS_SDEXT_PARTITION "tw_has_sdext_partition" |
| 121 | #define TW_HAS_USB_STORAGE "tw_has_usb_storage" |
| 122 | #define TW_NO_BATTERY_PERCENT "tw_no_battery_percent" |
| 123 | #define TW_POWER_BUTTON "tw_power_button" |
| 124 | #define TW_SIMULATE_ACTIONS "tw_simulate_actions" |
| 125 | #define TW_SIMULATE_FAIL "tw_simulate_fail" |
| 126 | #define TW_DONT_UNMOUNT_SYSTEM "tw_dont_unmount_system" |
| 127 | // #define TW_ALWAYS_RMRF "tw_always_rmrf" |
| 128 | |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 129 | #define TW_HAS_INJECTTWRP "tw_has_injecttwrp" |
| 130 | #define TW_INJECT_AFTER_ZIP "tw_inject_after_zip" |
| 131 | #define TW_HAS_DATADATA "tw_has_datadata" |
| 132 | #define TW_FLASH_ZIP_IN_PLACE "tw_flash_zip_in_place" |
| 133 | #define TW_MIN_SYSTEM_SIZE "50" // minimum system size to allow a reboot |
| 134 | #define TW_MIN_SYSTEM_VAR "tw_min_system" |
| 135 | #define TW_DOWNLOAD_MODE "tw_download_mode" |
mauronofrio | e9a49ef | 2018-10-03 13:38:16 +0200 | [diff] [blame] | 136 | #define TW_EDL_MODE "tw_edl_mode" |
bigbiff | df8436b | 2020-08-30 16:22:34 -0400 | [diff] [blame] | 137 | #define TW_FASTBOOT_MODE "tw_fastboot_mode" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 138 | #define TW_IS_ENCRYPTED "tw_is_encrypted" |
| 139 | #define TW_IS_DECRYPTED "tw_is_decrypted" |
Vojtech Bocek | 7e11ac5 | 2015-03-05 23:21:49 +0100 | [diff] [blame] | 140 | #define TW_CRYPTO_PWTYPE "tw_crypto_pwtype" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 141 | #define TW_HAS_CRYPTO "tw_has_crypto" |
Ethan Yonker | bd7492d | 2016-12-07 13:55:01 -0600 | [diff] [blame] | 142 | #define TW_IS_FBE "tw_is_fbe" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 143 | #define TW_CRYPTO_PASSWORD "tw_crypto_password" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 144 | #define TW_SDEXT_DISABLE_EXT4 "tw_sdext_disable_ext4" |
| 145 | #define TW_MILITARY_TIME "tw_military_time" |
bigbiff bigbiff | 56cf564 | 2016-08-19 17:43:45 -0400 | [diff] [blame] | 146 | #define TW_USE_SHA2 "tw_use_sha2" |
| 147 | #define TW_NO_SHA2 "tw_no_sha2" |
Chaosmaster | ff4f958 | 2020-01-26 15:38:11 +0100 | [diff] [blame] | 148 | #define TW_UNMOUNT_SYSTEM "tw_unmount_system" |
bigbiff | ee7b7ff | 2020-03-23 15:08:27 -0400 | [diff] [blame] | 149 | #define TW_IS_SUPER "tw_is_super" |
me-cafebabe | 2136fc5 | 2022-07-20 06:42:18 +0800 | [diff] [blame] | 150 | #define TW_VIRTUAL_AB_ENABLED "tw_virtual_ab.enabled" |
nebrassy | ac29e69 | 2021-05-20 13:03:30 +0200 | [diff] [blame] | 151 | #define TW_AUTO_REFLASHTWRP_VAR "tw_auto_reflashtwrp" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 152 | |
Mohd Faraz | fe8bcd4 | 2023-08-26 20:50:26 +0530 | [diff] [blame] | 153 | // BUILD PROPS |
| 154 | #define TW_FASTBOOT_MODE_PROP "ro.twrp.fastbootd" |
| 155 | #define TW_MODULES_MOUNTED_PROP "twrp.modules.loaded" // property for successfully mounted modules |
Mohd Faraz | a57874b | 2023-09-30 00:57:58 +0530 | [diff] [blame] | 156 | #define TW_KEYMASTER_VERSION_PROP "keymaster_ver" |
Mohd Faraz | fe8bcd4 | 2023-08-26 20:50:26 +0530 | [diff] [blame] | 157 | |
Captain Throwback | 33dbec0 | 2022-01-29 12:45:35 -0500 | [diff] [blame] | 158 | // Theme versioning |
| 159 | // version 2 requires theme to handle power button as action togglebacklight |
| 160 | // version 4 adds listbox support to reboot page |
| 161 | // version 5 adds File Manager options, nano & Flash Current TWRP |
| 162 | #define TW_THEME_VERSION 5 |
| 163 | |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 164 | // Also used: |
| 165 | // tw_boot_is_mountable |
| 166 | // tw_system_is_mountable |
| 167 | // tw_data_is_mountable |
| 168 | // tw_cache_is_mountable |
| 169 | // tw_sdcext_is_mountable |
| 170 | // tw_sdcint_is_mountable |
| 171 | // tw_sd-ext_is_mountable |
| 172 | // tw_sp1_is_mountable |
| 173 | // tw_sp2_is_mountable |
| 174 | // tw_sp3_is_mountable |
| 175 | |
Dees_Troy | 54f6875 | 2013-02-25 03:58:41 +0000 | [diff] [blame] | 176 | // Max archive size for tar backups before we split (1.5GB) |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 177 | #define MAX_ARCHIVE_SIZE 1610612736LLU |
Dees_Troy | 83bd483 | 2013-05-04 12:39:56 +0000 | [diff] [blame] | 178 | //#define MAX_ARCHIVE_SIZE 52428800LLU // 50MB split for testing |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 179 | |
| 180 | #ifndef CUSTOM_LUN_FILE |
Darth9 | 29a789e | 2023-04-11 10:22:41 +0100 | [diff] [blame] | 181 | #define CUSTOM_LUN_FILE "/config/usb_gadget/g1/functions/mass_storage.0/lun.%d/file" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 182 | #endif |
| 183 | |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 184 | #define SCRIPT_FILE_TMP "/tmp/openrecoveryscript" |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 185 | #define TMP_LOG_FILE "/tmp/recovery.log" |
Dees_Troy | 8211102 | 2013-02-21 21:13:09 +0000 | [diff] [blame] | 186 | |
| 187 | #endif // _VARIABLES_HEADER_ |