The documentation of PackageManager.GET_SIGNATURES says "This constant was deprecated in API level 28. Use GET_SIGNING_CERTIFICATES instead".
Unfortunately it was not secure and was easily hacked.
How can you use the new "GET_SIGNING_CERTIFICATES" introduced with Android P?