DEV Community

Surhid Amatya
Surhid Amatya

Posted on

2 1

Signing apk with .p12

Can I release an android apk using .p12 file? I don't have keystore file?

Regarding this question, developing Android applications for more than 7+ years my answer was NO.

What is .p12 file?

A P12 file (a file with a .p12 extension) is a type of certificate file (a Personal Information Exchange file). The Packager for iPhone uses this type of certificate to build an iPhone application. You convert the developer certificate you receive from Apple into this form of the certificate. So, a .p12 file is for iOS development.

After answering this question in StackOverflow I got to know you can use .p12 file as well to sign an android apk.
Let's jump to procedure to convert your .p12 file to jks file.

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 -importkeystore -srckeystore xxxx.p12 -destkeystore xxxx.jks -srcstoretype pkcs12 -deststoretype jks -srcalias xxxx_alias_name -destalias xxxx_alias_name

In some cases you might need to define -destkeypass
otherwise jks file won't password on the key and studio may look for password generating an error.

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (1)

Collapse
 
chris_levis_d1e25f4e33755 profile image
Chris Levis

Signing an APK with a .p12 file is a straightforward process using Java's keytool and Android's apksigner. You can convert a .p12 file to a Java Keystore (.jks) if needed or use it directly with apksigner. When signing, ensure you have the correct alias and password, as mismatches can cause errors. Automating this with Fastlane or GitHub Actions can streamline the deployment process. If you're dealing with APK management and distribution, platforms like b9game.pureapk.io/ can be useful for exploring different app deployment strategies.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay