Wednesday, December 28, 2011
Update: you can find a simpler way to archive this goal at Easy method to convert APK (Android) to BAR (Playbook)
This post shows you 8 steps to convert an Android app (.apk) to Playbook app (.bar).
Step 0 : download file apk2bar-HaTaX.zip hereUnzip this file into apk2bar folder. This folder will contain:
+ apk2bar-HaTaX.bat –> convert .apk file to .bar file
+ signbar-HaTaX.bat –> used to sign .bar file
+ bin folder –> tools to get *.p12
Step 1: (download Android SDK)Download Android SDK at http://developer.android.com/sdk/index.html
Step 2: ( Install Android SDK)Setup Android SDK and remember its path. Run SDK Manager. Click SDK platform in Android 2.3.3 (API10) as follows
Step 3: ( Edit path in apk2bar-HaTaX.bat)Using notepad to edit file apk2bar-HaTaX.bat to change the path "ANDROIDSDK=" to Android SDK installed in step 2.
Note: remove “\” after android-sdk
Step 4 : (Testing) convert APK –> BARThis step tests above steps. If you drag file *.APK into file apk2bar-HaTaX.bat and obtain file *.bar without errors, you have done correctly.
Step 5 : (Register to receive file *.csj (not *.p12))Go to website :https://www.blackberry.com/SignedKeys/ to register to receive file and go to https://www.blackberry.com/SignedKeys/ to register another file.
Note: in the input PIN part, you can input any characters but you must remember it.
After registering, you may need to wait about 2 hours to receive 2 files *.csj.
- First file client-PBDT-xxxxxxxx.csj (x: client number)
- Second file client-RDK-xxxxxxxx.csj (x: client number)
Step 6 : get file *.p12Step 6.1 : Open cmd.exe and change to \apk2bar\bin (in step 0) and copy files *.csj into this folder
Step 6.2 : In cmd, type:
blackberry-signer -csksetup -cskpass <create_a_password>
If you already had key, an error will occur.
CSK file already exists. Use -cskdelete to delete first
Don’t use command cskdelete to delete unless you forgot pass. If you forgot pass, you can delete CSK file and request new CSJ file from RIM.
Step 6.3 : Next, input
blackberry-signer -register -csjpin <PIN>-cskpass <csk password from step 6.2><CSJ_file>
Note: PIN is the PIN number in Step 5.
In Step 5, we register 2 keys because we will get errors if using only one key.
Step 6.4: Input
blackberry-keytool -genkeypair -keystore -storepass –dname "cn=" -alias author
Step 7: Config file signbar-HaTax.bat
Using notepad to edit file signbar-HaTaX.bat. Only edit the first part of this file.
SET DEVCERTFILE : the path to *.p12 file created in Step 6.4.
SET DEVCertPASS : pass to protect file *.p12 created in Step 6.4
SET CSKPASS : pass CSK created in step 6.4.
Step 8 : sign file barStep 8.1 : Drag file *.apk into file apk2bar-HaTaX.bat to create file *.BAR
Step 8.2 : Drag *.bar created in Step 8.1 to file signbar-HaTaX.bat to sign file *.bar.