summaryrefslogtreecommitdiff
path: root/adb/client/fastdeploy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'adb/client/fastdeploy.cpp')
-rw-r--r--adb/client/fastdeploy.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/adb/client/fastdeploy.cpp b/adb/client/fastdeploy.cpp
index e82f15a7d..f4e8664a8 100644
--- a/adb/client/fastdeploy.cpp
+++ b/adb/client/fastdeploy.cpp
@@ -16,6 +16,7 @@
#include "fastdeploy.h"
+#include <string.h>
#include <algorithm>
#include <array>
#include <memory>
@@ -31,7 +32,7 @@
#include "adb_utils.h"
-static constexpr long kRequiredAgentVersion = 0x00000001;
+static constexpr long kRequiredAgentVersion = 0x00000002;
static constexpr const char* kDeviceAgentPath = "/data/local/tmp/";
@@ -313,9 +314,16 @@ void install_patch(const char* apkPath, const char* patchPath, int argc, const c
std::vector<unsigned char> applyErrorBuffer;
std::string argsString;
+ bool rSwitchPresent = false;
for (int i = 0; i < argc; i++) {
argsString.append(argv[i]);
argsString.append(" ");
+ if (!strcmp(argv[i], "-r")) {
+ rSwitchPresent = true;
+ }
+ }
+ if (!rSwitchPresent) {
+ argsString.append("-r");
}
std::string applyPatchCommand =
@@ -326,3 +334,9 @@ void install_patch(const char* apkPath, const char* patchPath, int argc, const c
error_exit("Executing %s returned %d", applyPatchCommand.c_str(), returnCode);
}
}
+
+bool find_package(const char* apkPath) {
+ const std::string findCommand =
+ "/data/local/tmp/deployagent find " + get_packagename_from_apk(apkPath);
+ return !send_shell_command(findCommand);
+}