diff options
author | Calin Juravle <calin@google.com> | 2017-12-14 15:48:15 -0800 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2018-08-03 11:21:06 -0700 |
commit | f03eebdd59c063ab0c27a44ec4ae402006064c29 (patch) | |
tree | 33645aa5337d2ad72e7d44be3c0fa4b3e30f6f83 /adb/client/commandline.cpp | |
parent | ddcee93c0138fc68dbc6320962a53cd4761ab94b (diff) | |
download | system_core-f03eebdd59c063ab0c27a44ec4ae402006064c29.tar.gz system_core-f03eebdd59c063ab0c27a44ec4ae402006064c29.tar.bz2 system_core-f03eebdd59c063ab0c27a44ec4ae402006064c29.zip |
Accept DexMetadata files (.dm) for install-multiple
Allow .dm files (DexMetadata) to be passed to adb install-multiple.
Do not rename the input files based on their indices as the naming matters
for associating an .dm file to an .apk file.
Test: adb install-multiple -p com.android.cts.classloadersplitapp base.apk
split.apk split.dm
Bug: 30934496
Change-Id: I2ac39e00d64eae938124250033f79e02f3c3f9c0
(cherry picked from commit aa7753871e0519b628b78c2defa38c71e8c3879a)
Diffstat (limited to 'adb/client/commandline.cpp')
-rw-r--r-- | adb/client/commandline.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/adb/client/commandline.cpp b/adb/client/commandline.cpp index 3fb14f351..da273fd3f 100644 --- a/adb/client/commandline.cpp +++ b/adb/client/commandline.cpp @@ -1925,7 +1925,8 @@ static int install_multiple_app(int argc, const char** argv) { for (int i = argc - 1; i >= 0; i--) { const char* file = argv[i]; - if (android::base::EndsWithIgnoreCase(file, ".apk")) { + if (android::base::EndsWithIgnoreCase(file, ".apk") || + android::base::EndsWithIgnoreCase(file, ".dm")) { struct stat sb; if (stat(file, &sb) != -1) total_size += sb.st_size; first_apk = i; @@ -1986,9 +1987,8 @@ static int install_multiple_app(int argc, const char** argv) { } std::string cmd = android::base::StringPrintf( - "%s install-write -S %" PRIu64 " %d %d_%s -", - install_cmd.c_str(), static_cast<uint64_t>(sb.st_size), session_id, i, - android::base::Basename(file).c_str()); + "%s install-write -S %" PRIu64 " %d %s -", install_cmd.c_str(), + static_cast<uint64_t>(sb.st_size), session_id, android::base::Basename(file).c_str()); int localFd = adb_open(file, O_RDONLY); if (localFd < 0) { |