I'm checking package signatures against each other to determine if they are incompatible (compiled against different keystores). I noticed that PackageInfo.signatures
is almost always a collection containing a single entry, which makes sense to me. I build my app with either a debug or production keystore, and that determines the signature of the package (that is my simplistic understanding of the apk signing process at this point). I know that this will be null if I don't specifically ask for this information (by passing the PackageManager.GET_SIGNATURES
flag), but I don't quite understand the case in which there would be more than one.
I wrote some debug code and ran it on my personal Android phone. Of the 300+ packages installed on my phone, everything had exactly one signature except for a few packages that seemed to be from my service provider (com.verizon.* namespaces).
I feel like it's acceptable for my use case (package management) to consider that app packages will have a single signature, but I want to make sure that I'm not missing something that could introduce an edge case bug.