MCPcopy Create free account
hub / github.com/baldurk/renderdoc / GetPathForPackage

Function GetPathForPackage

renderdoc/android/android_utils.cpp:150–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150rdcstr GetPathForPackage(const rdcstr &deviceID, const rdcstr &packageName)
151{
152 rdcstr pkgPath = adbExecCommand(deviceID, "shell pm path " + packageName).strStdout.trimmed();
153
154 // if there are multiple slices, the path will be returned on many lines. Take only the first
155 // line, assuming all of the apks are in the same directory
156 if(pkgPath.find("\n") >= 0)
157 {
158 rdcarray<rdcstr> lines;
159 split(pkgPath, lines, '\n');
160 pkgPath = lines[0].trimmed();
161 }
162
163 if(pkgPath.empty() || pkgPath.find("package:") != 0 || pkgPath.find("base.apk") == -1)
164 return pkgPath;
165
166 pkgPath.erase(0, strlen("package:"));
167 pkgPath.erase(pkgPath.size() - strlen("base.apk"), ~0U);
168
169 return pkgPath;
170}
171
172bool IsSupported(rdcstr deviceID)
173{

Callers 2

InjectLibrariesFunction · 0.85
ExecuteAndInjectMethod · 0.85

Calls 7

adbExecCommandFunction · 0.85
splitFunction · 0.85
trimmedMethod · 0.80
findMethod · 0.45
emptyMethod · 0.45
eraseMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected