查看应用详细信息 输出中包含很多信息, 包括 Activity Resolver Table、Registered ContentProviders、 包名、userId、安装后的文件资源代码等路径、版本信息、权限信息和授予状态、签名版本信息等 @param packageName 应用包名 @return 应用详细信息
(final String packageName)
| 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 |
nothing calls this directly
no test coverage detected