You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SecurityPolicies class provides several factory methods for creating SecurityPolicy instances that support common use cases, such as checking that two apps have matching signatures.
One (somewhat) common case it does not support yet is a security policy for interacting a system app (one that is embedded in the operating system). These are usually part of AOSP or provided by OEMs and commonly signed with the same certificate as the whole platform so that they can access privileged permissions.
Describe the solution you'd like
SecurityPolicies could provide another factory method that specifically checks that the given app has the same signature as the platform:
The platform's signature can be retrieved by using PackageManager to query for the package named "android", which is present on all devices.
Describe alternatives you've considered
Users may call PackageManager directly to obtain the platform signature and then invoke SecurityPolicies.hasSignature. But given that this pattern is becoming more frequent in Google, we can make the process less error-prone and repetitive.