blob: 006a5fb79cf5d6f490be1cbe78b4ff868db039d0 [file] [log] [blame]
bigbiffdf8436b2020-08-30 16:22:34 -04001/*
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"
bigbiff1f9e4842020-10-31 11:33:15 -040031#include "twinstall/get_args.h"
bigbiffdf8436b2020-08-30 16:22:34 -040032
33class startupArgs {
34public:
35 static inline std::string const UPDATE_PACKAGE = "--update_package";
Ctapchuk452489e2021-11-12 21:34:05 +070036 static inline std::string const SPECIAL_UPDATE_PACKAGE = "--special_update_package";
bigbiffdf8436b2020-08-30 16:22:34 -040037 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";
DarthJabba958d1e7a2020-10-23 14:44:08 +010044 static inline std::string const RESCUE_PARTY = "--prompt_and_wipe_data";
bigbiffdf8436b2020-08-30 16:22:34 -040045 void parse(int *argc, char ***argv);
46 bool Should_Skip_Decryption();
47 std::string Get_Intent();
48 bool Get_Fastboot_Mode();
bigbiffaed1bdf2021-08-03 18:21:39 -040049 bool processRecoveryArgs(std::vector<std::string> args, int index);
bigbiffdf8436b2020-08-30 16:22:34 -040050
51private:
52 bool SkipDecryption = false;
53 bool fastboot_mode = false;
54 std::string Send_Intent;
55};
DarthJabba958d1e7a2020-10-23 14:44:08 +010056#endif