how to use below commands in Android Studio? java -jar signapk.jar certificate.pem key.pk8 file.apk file-signed.apk
My reply comes probably too late for the question itself, but could be useful to someone else.
In order to sign an apk with Android studio you need to provide a .keystore file. Now, following this tutorial I found this tool that allows you to create a keystore file starting from your .pk8 and .pem files. All you have to do is:
keytool-importkeypair -k ~/.android/key.keystore -p android -pk8 platform.pk8 -cert platform.x509.pem -alias platform
signingConfigs {
config {
storeFile file("key.keystore")
storePassword 'password'
keyAlias 'alias'
keyPassword 'password'
}
}
buildTypes {
release {
signingConfig signingConfigs.config
}
}
Copy APK and Key Files to the following folder: C:\Users%USERNAME%\AppData\Local\Android\Sdk\build-tools* (Any of the subfolders will do; for example: 27.0.3)
Sign the APK with the following command: apksigner.bat sign --key .pk8 --cert .x509.pem APKFILE.apk
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