I am going to update my client's app which is available on Google PlayStore. And I have only a .p12 file with password, not .keystore file.
I am wondering if it's possible to publish the updated version to Google PlayStore.
Sorry for basic question. I am so confused with that. Thank you in advance for your assistance.
In Android Studio, you can configure your project to sign the release version of your app automatically during the build process by creating a signing configuration and assigning it to your release build type. A signing configuration consists of a keystore location, keystore password, key alias, and key password.
Here's where to find the certificate: Open Play Console and go to the Play App Signing page (Release > Setup > App integrity). Scroll to the “App signing key certificate” section and copy the fingerprints (MD5, SHA-1, and SHA-256) of your app signing certificate.
As a security measure, Android requires that apps be signed in order to be installed. Signing an app first requires creating keystores. A keystore is a storage mechanism for security certificates. A public key certificate is used to sign an APK before deployment to services like the Google Play Store.
You can just convert your p12 file to jks:
Create an empty JKS store
keytool -genkey -alias anyname -keystore yourcertificate.jks
keytool -delete -alias anyname -keystore yourcertificate.jks
Import yourcertificate.p12 into yourcertificate.jks
keytool -v -importkeystore -srckeystore yourcertificate.p12 -srcstoretype PKCS12 -destkeystore yourcertificate.jks -deststoretype JKS
You can also check this link: http://shib.kuleuven.be/docs/ssl_commands.shtml#keytool
These commands worked for me:
keytool -importkeystore -srckeystore yourp12file.p12 -destkeystore keystorefile.keystore -srcstoretype pkcs12
You gonna use the flag -storetype PKCS12
First, create your keystore with its alias [ on this ex. mykeystore and myalias ]
keytool -genkey -alias myalias -keystore mykeystore -storetype PKCS12 -keyalg RSA -validity 3650 -keysize 2048
And just sign your APK
jarsigner -keystore mykeystore my.apk myalias
In case you need to align the app, use zipalign command before and do the signing with the aligned one, like so:
zipalign -f -p 4 my.apk myapk-aligned.apk
jarsigner -keystore mykeystore myapk-aligned.apk myalias
Flags used on zipalign
-f overwrite existing outfile
-p page align stored shared object files
-v if you want to see the verbose log, use that
The -validity 3650 was used to expire the signing in 10 years
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With