From dd1d7bd2bacc369e41a0848485f2d041d70dc3d2 Mon Sep 17 00:00:00 2001 From: Baldur Karlsson Date: Mon, 12 Mar 2018 13:05:56 +0000 Subject: [PATCH] Handle 'slice' apks with many apks in the shell pm path. --- renderdoc/android/android_utils.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/renderdoc/android/android_utils.cpp b/renderdoc/android/android_utils.cpp index ff9d716ea..12bae9d7a 100644 --- a/renderdoc/android/android_utils.cpp +++ b/renderdoc/android/android_utils.cpp @@ -110,6 +110,15 @@ std::string GetPathForPackage(const std::string &deviceID, const std::string &pa { std::string pkgPath = trim(adbExecCommand(deviceID, "shell pm path " + packageName).strStdout); + // if there are multiple slices, the path will be returned on many lines. Take only the first + // line, assuming all of the apks are in the same directory + if(pkgPath.find("\n") != std::string::npos) + { + std::vector lines; + split(pkgPath, lines, '\n'); + pkgPath = lines[0]; + } + if(pkgPath.empty() || pkgPath.find("package:") != 0 || pkgPath.find("base.apk") == std::string::npos) return pkgPath;