#include "adb_utils.h"
#include "client/file_sync_client.h"
#include "commandline.h"
-#include "fastdeploy.h"
static constexpr int kFastDeployMinApi = 24;
}
if (use_fastdeploy) {
- auto metadata = extract_metadata(file);
- if (metadata.has_value()) {
- // pass all but 1st (command) and last (apk path) parameters through to pm for
- // session creation
- std::vector<const char*> pm_args{argv + 1, argv + argc - 1};
- auto patchFd = install_patch(pm_args.size(), pm_args.data());
- return stream_patch(file, std::move(metadata.value()), std::move(patchFd));
- }
}
struct stat sb;
argv[last_apk] = apk_dest.c_str(); /* destination name, not source location */
if (use_fastdeploy) {
- auto metadata = extract_metadata(apk_file[0]);
- if (metadata.has_value()) {
- auto patchFd = apply_patch_on_device(apk_dest.c_str());
- int status = stream_patch(apk_file[0], std::move(metadata.value()), std::move(patchFd));
-
- result = pm_command(argc, argv);
- delete_device_file(apk_dest);
-
- return status;
- }
}
if (do_sync_push(apk_file, apk_dest.c_str(), false)) {
InstallMode installMode = INSTALL_DEFAULT;
bool use_fastdeploy = false;
bool is_reinstall = false;
- FastDeploy_AgentUpdateStrategy agent_update_strategy = FastDeploy_AgentUpdateDifferentVersion;
for (int i = 1; i < argc; i++) {
if (!strcmp(argv[i], "--streaming")) {
use_fastdeploy = false;
} else if (!strcmp(argv[i], "--force-agent")) {
processedArgIndicies.push_back(i);
- agent_update_strategy = FastDeploy_AgentUpdateAlways;
} else if (!strcmp(argv[i], "--date-check-agent")) {
processedArgIndicies.push_back(i);
- agent_update_strategy = FastDeploy_AgentUpdateNewerTimeStamp;
} else if (!strcmp(argv[i], "--version-check-agent")) {
processedArgIndicies.push_back(i);
- agent_update_strategy = FastDeploy_AgentUpdateDifferentVersion;
}
}
error_exit("Attempting to use streaming install on unsupported device");
}
- if (use_fastdeploy && get_device_api_level() < kFastDeployMinApi) {
- printf("Fast Deploy is only compatible with devices of API version %d or higher, "
- "ignoring.\n",
- kFastDeployMinApi);
+ if (use_fastdeploy) {
+ printf("Fast Deploy is unavailable in this build of adb, "
+ "ignoring.\n");
use_fastdeploy = false;
}
- fastdeploy_set_agent_update_strategy(agent_update_strategy);
std::vector<const char*> passthrough_argv;
for (int i = 0; i < argc; i++) {