MCPcopy Create free account
hub / github.com/afkT/DevUtils / getAppMessage

Method getAppMessage

lib/DevApp/src/main/java/dev/utils/app/ADBUtils.java:212–222  ·  view source on GitHub ↗

查看应用详细信息 输出中包含很多信息, 包括 Activity Resolver Table、Registered ContentProviders、 包名、userId、安装后的文件资源代码等路径、版本信息、权限信息和授予状态、签名版本信息等 @param packageName 应用包名 @return 应用详细信息

(final String packageName)

Source from the content-addressed store, hash-verified

210 * @return 应用详细信息
211 */
212 public static String getAppMessage(final String packageName) {
213 if (TextUtils.isEmpty(packageName)) return null;
214 // 执行 shell
215 ShellUtils.CommandResult result = ShellUtils.execCmd(
216 "dumpsys package " + packageName, true
217 );
218 if (result.isSuccessWithSuccessOutput()) {
219 return result.successMsg;
220 }
221 return null;
222 }
223
224 /**
225 * 获取 APP versionCode

Callers

nothing calls this directly

Calls 3

execCmdMethod · 0.95
isEmptyMethod · 0.45

Tested by

no test coverage detected