bigbiff | df8436b | 2020-08-30 16:22:34 -0400 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2012-2020 TeamWin |
| 3 | This file is part of TWRP/TeamWin Recovery Project. |
| 4 | |
| 5 | TWRP is free software: you can redistribute it and/or modify |
| 6 | it under the terms of the GNU General Public License as published by |
| 7 | the Free Software Foundation, either version 3 of the License, or |
| 8 | (at your option) any later version. |
| 9 | |
| 10 | TWRP is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | GNU General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public License |
| 16 | along with TWRP. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #ifndef STARTUPARGS_HPP |
| 20 | #define STARTUPARGS_HPP |
| 21 | #include <android-base/properties.h> |
| 22 | |
| 23 | #include "data.hpp" |
| 24 | #include "gui/gui.hpp" |
| 25 | #include "openrecoveryscript.hpp" |
| 26 | #include "partitions.hpp" |
| 27 | #include "twcommon.h" |
| 28 | #include "twrp-functions.hpp" |
| 29 | #include "variables.h" |
| 30 | #include "bootloader_message/include/bootloader_message/bootloader_message.h" |
bigbiff | 1f9e484 | 2020-10-31 11:33:15 -0400 | [diff] [blame] | 31 | #include "twinstall/get_args.h" |
bigbiff | df8436b | 2020-08-30 16:22:34 -0400 | [diff] [blame] | 32 | |
| 33 | class startupArgs { |
| 34 | public: |
| 35 | static inline std::string const UPDATE_PACKAGE = "--update_package"; |
Ctapchuk | bbd3bb3 | 2021-11-12 21:34:05 +0700 | [diff] [blame] | 36 | static inline std::string const SPECIAL_UPDATE_PACKAGE = "--special_update_package"; |
bigbiff | df8436b | 2020-08-30 16:22:34 -0400 | [diff] [blame] | 37 | static inline std::string const WIPE_CACHE = "--wipe_cache"; |
| 38 | static inline std::string const WIPE_DATA = "--wipe_data"; |
| 39 | static inline std::string const SEND_INTENT = "--send_intent"; |
| 40 | static inline std::string const SIDELOAD = "--sideload"; |
| 41 | static inline std::string const REASON = "--reason"; |
| 42 | static inline std::string const FASTBOOT = "--fastboot"; |
| 43 | static inline std::string const NANDROID = "--nandroid"; |
DarthJabba9 | 58d1e7a | 2020-10-23 14:44:08 +0100 | [diff] [blame] | 44 | static inline std::string const RESCUE_PARTY = "--prompt_and_wipe_data"; |
bigbiff | df8436b | 2020-08-30 16:22:34 -0400 | [diff] [blame] | 45 | void parse(int *argc, char ***argv); |
| 46 | bool Should_Skip_Decryption(); |
| 47 | std::string Get_Intent(); |
| 48 | bool Get_Fastboot_Mode(); |
bigbiff | aed1bdf | 2021-08-03 18:21:39 -0400 | [diff] [blame] | 49 | bool processRecoveryArgs(std::vector<std::string> args, int index); |
bigbiff | df8436b | 2020-08-30 16:22:34 -0400 | [diff] [blame] | 50 | |
| 51 | private: |
| 52 | bool SkipDecryption = false; |
| 53 | bool fastboot_mode = false; |
| 54 | std::string Send_Intent; |
| 55 | }; |
DarthJabba9 | 58d1e7a | 2020-10-23 14:44:08 +0100 | [diff] [blame] | 56 | #endif |