Friday, 13 May 2011

Playbook Signing Processes - creating and deploying a debug token

Recently I posted about my experience with signing a Playbook application for the Blackberry AppWorld. This posting is a continuation of the saga looking at the steps to create and deploy a debug token. This process was introduced with the latest Playbook SDK and Simulator version 1.0.1 which came along with the official launch of the Playbook, Flash Builder 4.5 and the Air SDK2.6.

Who thought that things might have gotten a bit easier...well, continue dreaming. It got worse :-(

First I tried using the Flash Builder 4.5 UI to create the debug token bar file, but I got an error message saying "Unable to parse issue date from debug token.". Research showed that there seems to be an issue with any environment with non en_US date time settings for either the OS, Flash Builder and or the JRE. Essentially you either setup your system to US date time settings and make sure to find all JRE and Flash Builder config files and change the respective settings (works I have tested it) or you are back to command line batch processing.

Being non US located, I prefer to keep my local settings, hence I'm back to command line…

1.      I copied the client-PBDT-xxx.csj file provided by RIM into the directory where I keep all my signature files and created a batch files to register the .csj file (one time only).

CD "\Program Files (x86)\Adobe\Adobe Flash Builder 4.5\sdks\blackberry-tablet-sdk-1.0.1\bin\"
blackberry-debugtokenrequest -register -cskpass xxx -csjpin xxx "D:\AppCertification\BBRegister\client-PBDT-xxx.csj"

Please refer to my previous posting where I explained a modification to blackberry-debugtokenrequest.bat and all other signing related batch files.

  1. I then created a D:\BlackberryApps\DebugToken directory in my in which I create and store the debug token bar files and from where deploy them to the Playbook Simulator.

    CD "\Program Files (x86)\Adobe\Adobe Flash Builder 4.5\sdks\blackberry-tablet-sdk-1.0.1\bin\"
    blackberry-debugtokenrequest -cskpass xxx -csjpin xxx  -keystore "D:\AppCertification\flexdominonet-dvl2.p12" -storepass xxx -deviceId 0xFFFFFF "D:\BlackberryApps\DebugToken\"

    Note: the device ID (PIN) reported in the Simulator is eventually incorrect. Please go through the process of generating the debug token through the Flash Builder UI. The “Auto Discover…” feature will give you the correct device ID (or PIN). Please refer to the online help of Blackberry for this procedure. Though it did not work out for me, it is explained well.

  2. Finally I created the batch file to deploy the debug token bar file.

    CD "\Program Files (x86)\Adobe\Adobe Flash Builder 4.5\sdks\blackberry-tablet-sdk-1.0.1\bin\"
    blackberry-deploy -installDebugToken "D:\BlackberryApps\DebugToken\" -device -password xxx

    Note: the device IP can received from the Simulator:

  3. Now I started the Simulator and made sure the date and time setting are in sync with my PC. I disabled the Set Date and Time Automatically and then set the date and time. The automatic date time feature sets the Simulator to a past date (at least in my case) and lets the deployment of the debug token fail.

  4. Under Security->Development Mode I enabled Use Development Mode and then clicked Upload Debug Token.

  5. As the last step I ran the 3 batch files (as said above, the first batch file to register the .csj file must only be executed ones).

    Note: from my experience the last batch file to deploy the token will succeed, but hang the waiting upload process in the Simulator. However, after resetting the VM, the token is eventually installed and shows the following:
Removing an existing token is also not straight forward. The Remove Debug Token button doesn’t seem to work. So this is what I came up with:

1.      Reset the VM
2.      Change the Simulator’s date to a future date (year) to render the token invalid
3.      Now the Remove Debug Token button works and you can successfully remove the token.

I have not yet managed to deploy an unsigned application. The Flash Builder UI failed on this one too. Reason being that I could not import the debug token bar file because of the same "Unable to parse issue date from debug token." error I already stumbled over. So now I’m trying to deploy the unsigned application bar file again through command line processing. I will post as soon as I have some results…so stay tuned.

1 comment:

  1. See my latest posting re correspondence with Blackberry Dev Support...