I'm getting the output:
Error: null
from the command (executed at the command line):
java -jar pepk.jar --keystore=my.keystore --alias=x --output=my.output --encryptionkey=1243
Anyone any idea why or how to resolve it?
The "my.keystore" file exists and is a keystore. The alias is correct and the "my.output" file doesn't exist. I have changed the encryptionkey value in the example above but no matter what values I use I always get the same output.
I've tried double quoting the keystore and output values and providing (with quotes) full paths to the keystore file and the output file. Still the same error output. The jar is being executed because I get the usage help displayed if something is missing. I've also tried running the command in different directories and ensured that the permissions in the output directory is correct.
I'm using java version:
java version "9" Java(TM) SE Runtime Environment (build 9+181) Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
on Windows 10. (I've tried paths with both / and ). The pepk.jar was downloaded on the same day this question was posted from the App Signing page on the Play Store for my app.
After downloading the new version of pepk.jar as suggested by Pierre the output is now:
Error: Unable to export or encrypt the private key
java.lang.NullPointerException
at com.google.wireless.android.vending.developer.signing.tools.extern.export.KeystoreHelper.loadKeystore(KeystoreHelper.java:45)
at com.google.wireless.android.vending.developer.signing.tools.extern.export.KeystoreHelper.getPrivateKey(KeystoreHelper.java:38)
at com.google.wireless.android.vending.developer.signing.tools.extern.export.ExportEncryptedPrivateKeyTool.run(ExportEncryptedPrivateKeyTool.java:114)
at com.google.wireless.android.vending.developer.signing.tools.extern.export.ExportEncryptedPrivateKeyTool.main(ExportEncryptedPrivateKeyTool.java:79)
I've double checked the keystore and it contains a private key, via the use of keytool -list -v -keystore.
You have atleast Java Version 8(JDK 1.8) to run the syntax:
java -jar PATH_TO_PEPK --keystore=PATH_TO_KEYSTORE --alias=ALIAS_YOU_USE_TO_SIGN_APK --output=PATH_TO_OUTPUT_FILE --encryptionkey=GOOGLE_ENCRYPTION_KEY
Legend:
*.keystore
or *.jks
or without extension. Something like C:\Android\mykeystore or C:\Android\mykeystore.keystore..pem
extension, something like C:\Android\private_key.pemExample:
java -jar "C:\Users\YourName\Downloads\pepk.jar"
--keystore="C:\Android\mykeystore" --alias=myalias --output="C:\Android\private_key.pem" --encryptionkey=eb10fe8f7c7c9df715022017b00c6471f8ba8170b13049a11e6c09ffe3056a104a3bbe4ac5a955f4ba4fe93fc8cef27558a3eb9d2a529a2092761fb833b656cd48b9de6a
After entering the command in the terminal, you will need to provide the following:
If everything has gone OK, you now will have a file in PATH_TO_OUTPUT_FILE
folder called private_key.pem.
More resources: