如何获取任何已安装 Android 应用程序的清单权限

发布于 2024-10-06 23:10:00 字数 38 浏览 1 评论 0原文

是否可以获得任何已安装的 Android 应用程序的清单权限?

Is it possible to get the manifest permissions of any installed Android application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

给我一枪 2024-10-13 23:10:00

感谢您的提示,让它运行:

final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = getPackageManager().queryIntentActivities(mainIntent, 0);

for (Object obj : pkgAppsList) {
  ResolveInfo resolveInfo = (ResolveInfo) obj;
  PackageInfo packageInfo = null;
  try {
    packageInfo = getPackageManager().getPackageInfo(resolveInfo.activityInfo.packageName, PackageManager.GET_PERMISSIONS);
  } catch (NameNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }

  String[] requestedPermissions = packageInfo.requestedPermissions;
}

Thanks for the hint,got it running with:

final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = getPackageManager().queryIntentActivities(mainIntent, 0);

for (Object obj : pkgAppsList) {
  ResolveInfo resolveInfo = (ResolveInfo) obj;
  PackageInfo packageInfo = null;
  try {
    packageInfo = getPackageManager().getPackageInfo(resolveInfo.activityInfo.packageName, PackageManager.GET_PERMISSIONS);
  } catch (NameNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }

  String[] requestedPermissions = packageInfo.requestedPermissions;
}
煞人兵器 2024-10-13 23:10:00

使用此获取已安装的软件包。

final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);

并使用包名称来获取信息。

http://developer.android.com/reference/android/content/pm /PackageInfo.html

Get installed packages using this.

final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);

And use the package name to get the info.

http://developer.android.com/reference/android/content/pm/PackageInfo.html

只怪假的太真实 2024-10-13 23:10:00

如果您有 apk 文件,则非常简单,只需从开始菜单打开 cmd 并编写此命令行:

aapt d permissions D:\dina\app-debug.apk 

注意您编写的路径,然后您可以从该应用程序中的所有权限中获取列表,包名称也如下所示:

package: com.example.dinasaif.facebookintegration
uses-permission: android.permission.INTERNET

If you have apk file it is very simple just open cmd from start menu and write this command line:

aapt d permissions D:\dina\app-debug.apk 

take care for the path you write then you can get list from all permissions in this application and package name also like this:

package: com.example.dinasaif.facebookintegration
uses-permission: android.permission.INTERNET
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文