1

I've been stumped on this for a few hours now and was wondering if anyone would be able to shed some light.

I am using Blackberry's APK repackaging command line tools for repackaging an apk to a bar file. https://developer.blackberry.com/android/documentation/preparing_android_apps_for_bbtos_1729415_11.html

I've created .bat file to perform the repackaging and code-signing all on in one shot. I created and ran it on a machine running Windows server 2008 R2 standard edition. Everytime I run it, it works perfectly. Gives me a nice, signed, Playbook App World ready bar file. Here is the script:

echo %USERDOMAIN%\%USERNAME%
call apk2bar <apk_location> <android sdk location>
call batchbar-signer <bar_location> <developer_certificate> <keystore_password> <csk_password> 

The problem comes into play when I run this script remotely via PHP with the PHP exec command. It creates the bar, but dies at the code signing portion. Here is the error:

 Error: Certificate chain not found for: RDK.  RDK must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.

I find this strange because it is suggesting that my keystore (the .p12 file i'm guessing?) doesn't exist or is invalid. But then why it would it constantly work when I run the .bat file locally from command line?

I thought this may have been because I don't specify the <-a author_name> argument for the apk2bar portion of the script, but it still does not work even after I have filled it in.

Extra information that may be useful:

-This PHP file resides on the same Windows machine that the bat script is on. I call it from via a web browser from a remote machine.

  • Windows Machine is running IIS 6.0

  • When echo-ing the %USERNAME% while running the PHP script, it shows the machine name with a dollar sign ($) at the end. When I call the script from command line, %USERNAME% is the user I'm currently logged in as.

  • When running from command line, the account that I am logged in with is an admin account.

Any help would be greatly appreciated!

0 Answers0