android – Google play store app signing key issue with 105 char hex-ThrowExceptions

Exception or error:

I’m trying to add my keystore to google play app signing.

The guide mentions

java -jar pepk.jar --keystore = foo.keystore --alias = foo --output = output.zip --encryptionkey = The_Hex_Which_Is_105_Char

The_Hex_Which_Is_105_Char is a 105 char hex provided by google in the instructions.

which I had to remove the extra spaces to make it to work.

java -jar pepk.jar --keystore=my.keystore --alias=myAlias --output=output.zip --encryptionkey=The_Hex_Which_Is_105_Char

but running this I get an error:

Error: Unable to export or encrypt the private key
java.lang.IllegalArgumentException: Hex encoded byte array must have even length but instead has length: 105. Hex encoded string: The_Hex_Which_Is_105_Char
    at com.google.wireless.android.vending.developer.signing.tools.extern.export.ExportEncryptedPrivateKeyTool.fromHex(ExportEncryptedPrivateKeyTool.java:225)
    at com.google.wireless.android.vending.developer.signing.tools.extern.export.ExportEncryptedPrivateKeyTool.run(ExportEncryptedPrivateKeyTool.java:149)
    at com.google.wireless.android.vending.developer.signing.tools.extern.export.ExportEncryptedPrivateKeyTool.main(ExportEncryptedPrivateKeyTool.java:110)

How should the key be generated? Why does google give me a 105 char hex key and the pepk tool doesn’t work with?

How to solve:

There were 3 options

  • Have Google create and manage app signature keys (recommended)
  • Export and upload a key and a certificate from a Java Keystore
  • Export and upload a key and certificate (not from a Java keystore)

I was using option 2 as my keystore was already created.

I got it to work by using the encryptionkey provided in option 3 (136 characters)

  • Export and upload a key and certificate (not from a Java keystore)
 java -jar pepk.jar --keystore = foo.keystore --alias = foo --output =
 output.zip --encryptionkey = KeyFromOption3WorksHere136CharactersLong

Leave a Reply

Your email address will not be published. Required fields are marked *