1

一些 Android 应用程序使用其权限向电话号码发送短信以从用户那里提取资金。

如何检测哪些 Android 应用程序使用其权限发送短信?

4

1 回答 1

0

这可能会有所帮助

final PackageManager pm = getPackageManager();
final List<ApplicationInfo> Apps = pm.getInstalledApplications(PackageManager.GET_META_DATA);

for ( ApplicationInfo app : Apps ) {
    // Info we can fetch app.packageName,app.uid, app.sourceDir

    // for Permissions:
    StringBuffer permissions = new StringBuffer();

    try {
        PackageInfo packageInfo = pm.getPackageInfo(app.packageName, PackageManager.GET_PERMISSIONS);

        String[] requestedPermissions = packageInfo.requestedPermissions;
        if ( requestedPermissions != null ) {
            for (int i = 0; i < requestedPermissions.length; i++) {
                permissions.append(requestedPermissions[i] + "\n");
            }

            // fetch  permissions
        }
    }
    catch ( PackageManager.NameNotFoundException e ) {
        e.printStackTrace();
    }
}
于 2013-09-03T18:42:48.153 回答