add this to your manifest:
AddPermission(android.permission.QUERY_ALL_PACKAGES)
and plug this code in:
Dim packagemanager As JavaObject
Dim packageinfo As JavaObject
Dim jo As JavaObject
jo.InitializeContext
packagemanager = jo.RunMethod("getPackageManager",Null)
Dim packages As List = packagemanager.RunMethod("getInstalledPackages",Array(4096)) ' constant for permissions
Log(packages.Size & " packages")
For Each packageinfo As JavaObject In packages
Dim permissions() As String = packageinfo.GetField("requestedPermissions")
If permissions = Null Then
Log("no perms for " & packageinfo.GetField("packageName"))
Else
Log("perms for " & packageinfo.GetField("packageName") & ":")
Dim i As Int
For i = 0 To permissions.Length - 1
Log( permissions(i) ) ' <--- you can choose to list only permissions matching some criterion of yours
Next
End If
Log("------------------------------------------------------")
Next
output to log will give you a list of all installed packages, their name and permissions. you can pick and choose
perms for com.google.android.apps.restore:
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_WIFI_STATE
android.permission.BACKUP
android.permission.CHANGE_WIFI_STATE
android.permission.FOREGROUND_SERVICE
android.permission.FOREGROUND_SERVICE_DATA_SYNC
android.permission.GET_PACKAGE_SIZE
android.permission.INTERNET
android.permission.MANAGE_EXTERNAL_STORAGE
android.permission.MANAGE_USB
android.permission.MANAGE_USERS
android.permission.MANAGE_WIFI_NETWORK_SELECTION
android.permission.NEARBY_WIFI_DEVICES
android.permission.POST_NOTIFICATIONS
android.permission.NFC
android.permission.QUERY_ALL_PACKAGES
android.permission.READ_CALL_LOG
android.permission.READ_CONTACTS
android.permission.READ_EXTERNAL_STORAGE
android.permission.READ_PRIVILEGED_PHONE_STATE
android.permission.RECEIVE_BOOT_COMPLETED
you can do some of this with the phone library (dim pm as packagemanger, pm.getinstalledpackages), but i think you'll have to use javaobject for the real work, so i just did the whole thing that way.