From 2da4960dbb76f60ef72e5aaffd52f3520dd9fcd0 Mon Sep 17 00:00:00 2001 From: Ctapchuk Date: Fri, 12 Nov 2021 21:34:05 +0700 Subject: [PATCH] Add support for installation realme/OPPO OTA Support for '--special_update_package' command from boot message For example realmeUI 2.0 using this command for boot message to install OTA packages --special_update_package=/data/ota_package/OTA/.otaPackage/system_vendor_19720.1.3.202108120000042554318_patch Change-Id: I7d1a49a3e05a439d4c96717c1700dd063f4e55c4 --- startupArgs.cpp | 2 +- startupArgs.hpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/startupArgs.cpp b/startupArgs.cpp index f385e27fd..bf74f871f 100755 --- a/startupArgs.cpp +++ b/startupArgs.cpp @@ -51,7 +51,7 @@ bool startupArgs::processRecoveryArgs(std::vector 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) { diff --git a/startupArgs.hpp b/startupArgs.hpp index d388f55d2..006a5fb79 100755 --- a/startupArgs.hpp +++ b/startupArgs.hpp @@ -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";