How to Get Apk Signing Signature

How to get APK signing signature?

You can access the APK's signing signature like this using the PackageManager class
http://developer.android.com/reference/android/content/pm/PackageManager.html

Signature[] sigs = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES).signatures;
for (Signature sig : sigs)
{
Trace.i("MyApp", "Signature hashcode : " + sig.hashCode());
}

I've used this to compare with the hashcode for my debug key, as a way to identify whether the APK is a debug APK or a release APK.

How can I sign my app with APK Signature Scheme v3 and v4 ?

As of today, Android Studio supprot v3 and v 4 with Android Gradle Plugin 4.2
To enable one or both of these formats in your build, add the following properties to your module-level build.gradle or build.gradle.kts file:

android {
...
signingConfigs {
config {
...
enableV3Signing = true
enableV4Signing = true
}
}
}


Related Topics



Leave a reply



Submit