verify-permissions: Fix checking of permission mask

* Currently this passes if the permission is either
  signature OR privileged, not both. Fix it.
This commit is contained in:
Paul Keith 2021-10-12 23:12:10 -05:00
parent 99ffe4e102
commit a8b1bba0c8

View File

@ -50,7 +50,7 @@ for perm in root.findall('permission'):
levels = set(perm.get('{}protectionLevel'.format(ANDROID_XML_NS)).split('|'))
# Check if the protections include signature and privileged
levels_masked = levels & privileged_permission_mask
if len(levels_masked) > 0:
if len(levels_masked) >= len(privileged_permission_mask):
privileged_permissions.add(name)
# Definitions for privapp-permissions