I have made two basic (hello world) apps in android studio with different project names and hence different package names as well . say App A in package com.example.first.appA and App B in com.example.second.appB
Still I am getting same signature keys for my above two apps and I am completely clueless on what could be the reason for same key. Somebody please help!
Here is the code snippet I am using to get the signatures from my apps .
PackageInfo packageInfo = this.getPackageManager()
.getPackageInfo(this.getPackageName(),
PackageManager.GET_SIGNATURES);
for (Signature signature : packageInfo.signatures) {
byte[] signatureBytes = signature.toByteArray();
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
final String currentSignature = Base64.encodeToString(md.digest(), Base64.DEFAULT);
Log.d("Signature", "Here is the value for SIGNATURE:" + currentSignature);
So when I put this code snippet one by one in both of my apps A and B . I get same value of currentSignature say 478yYkKAQF+KST8y4ATKvHkYibo= in my Log
Note : I have not done any release/ debug mode signing explicitly for my app ,i.e. they should be something by default . (Using android studio)
EDIT After the answers from SO and googling I got the answer that any number of projects you have on your android studio would have same debug key (unless explicitly modified) and you can get different keys for different projects by signing your app.