0
votes

I try to prepare bat file to sign apk file with signapk.jar The syntax of this program is:

java -jar signapk.jar testkey.x509.pem testkey.pk8 <update.apk> <update_signed.apk>

My script looks like this:

java -jar "%~dp0%\SignApk\signapk.jar" "%~dp0%\SignApk\testkey.x509.pem" "%~dp0%\SignApk\testkey.pk8" "%~dp0%\SignApk\%ApkName%.apk" "%~dp0%\SignApk\%ApkName%_sign.apk"

When I execute the script I receive a message "Unable to access jarfile {update_signed.apk}", java "thinks" that is also a jar file and tries to run it..

Someone can help me how to pass arguments to jar file ?

Thanks.

1

1 Answers

1
votes

The -jar variant of the Java command line does only process a single JAR file, so your error message is not related to that.

Your error message is most likely created by the signapk application: You should try the direct command (with no batch wrapper, without the argument variables and especially without special characters or space in the path or the arguments or relative naming - do a cd into the SignApk dir first).

If that works, you can work backwards to find where the escaping has failed you.

BTW: if this is the tool, you need to specify a sign command as well:

java -jar signapk.jar -c sign.pem -k sign.p8 sign your.apk