I have following situation. Another application is calling mine (using startActivityForResult). Since I have to be sure that the calling activity comes from developer I trust I'd like to read the developer public key and compare it with value that is hardcoded in my app. I tried following:
String packageName = callingActivity.getPackageName();
String signature = null;
try {
PackageInfo pi = manager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES);
// assumption: get the first available signature
// actually according to Google for applications there will be always one element
signature = pi.signatures[0]. toCharsString();
}
But this gives me application (not developer) signature.