1. HaTaX's Avatar
    Well guys, I made some batch files to simplify the loading of BAR files before and now I'm back with some more batch files to streamline the APK to BAR conversion process, and the signing process.

    Grab this ZIP file and extract it to the root of your C drive. You should end up with a folder structure like so "C:\apk2bar" that has my "apk2bar-HaTaX.bat" and "signbar-HaTaX.bat" in there.(apk2bar-HaTaX.zip)

    If this is your first time dipping your toes into this, all you need besides this file is the Android SDK to get started. And if you plan on sharing these BAR files with others, you should go get yourself some signing keys pronto, they take a few days to get sometimes. That means yes, the Blackberry command line converter and signing tools are in this ZIP file and you don't need to go grab those again.

    I don't need to go into detail twice for this, I included a "README" file in the zip that outlines the steps you need to take, so I'll just post the contents of it here:
    Code:
    Hello fellow BlackBerry lovers!!!
    
    I've made a few batch files before to make things easier, and here
    is the latest installment to simplify the two step process to porting
    Android APKs over to the Android Player on the BlackBerry Playbook.
    
    apk2bar-HaTaX.bat -
    
        This batch file processes the APK and converts it to a loadable BAR file.
        It will place the BAR file in the same directory the APK file was in.
    
        First things first, go get your Android SDK downloaded from here:
    
            http://developer.android.com/sdk/index.html
    
            When running the installer, remember where you installed the SDK!
            You're going to need that path in a future step, I installed to
            "C:\android-sdk" to keep things simple and clean.
    
    
        Second, get that SDK installed and download the "SDK Platform" from the
            "Android 2.3.3 (API10)" list in the Android SDK Manager tree.
    
        Third,  setup the apk2bar-HaTaX.bat file by opening it up in notepad and make
            sure the "ANDROIDSDK=" line has the correct path to the installed SDK.
    
        You're set at this point!  Just drag an APK onto the batch file in windows
            explorer and it should start working it's magic.  If the file isn't
            compatible you'll see that listed in the output at the end.
    
    
    signbar-HaTaX.bat -
    
        This batch file signs the BAR file created by apk2bar-HaTaX.bat.
    
        First,  make sure you've gone through the steps to get your signing keys from RIM.
            Start that process at this URL:
    
            https://www.blackberry.com/SignedKeys/    
    
        Second, get those keys activated and create a working p12 certificate file.
            Follow the steps at this URL if you need help:
    
            http://docs.blackberry.com/en/developers/deliverables/27280/Configure_app_signing_from_cmd_line_1463563_11.jsp
    
        Third,  setup the signbar-HaTaX.bat file by opening it up in notepad and make
            sure the 3 lines are properly filled out.  You should know where your
            .p12 file is, and the passwords for both the .p12 and the CSK password.
            (You created these passwords when you went through step 2 above)
    
        You're set again!  Just drag a BAR file made with apk2bar-HaTaX.bat onto the
            batch file in windows explorer and you will get a signed BAR file
            ready to be loaded on any Playbook running OS 2.0 with developer mode on.
    
    
    
    Good luck!
    So basically just follow those steps to get setup and you'll be on your way to converting and signing your very own Android app.

    Let me know what you think and how it works for you! I'll consider putting together OSX / Linux shell scripts for this if there's enough demand as well.

    EDITS:
    New version 1.2 posted on 12-17-2011
    This version supports multiple files at once, now you can select multiple files to have converted or signed and it will process them one by one. I know, something that would have been more useful a while ago, but better late then never!!
    New version 1.1 posted on 11-1-2011
    This version now supports long file names in paths and APK names.
    Problems with APKs in a root folder of a drive fixed (C:\ for example).
    Some additional tweaks to ensure the correct file is passed.
    Default output of APK left up to apk2bar application now, they WILL be placed where the original APK was located


    Previous versions available:
    1.1 - Download apk2bar-HaTaX-1.1.zip
    1.0 - Download apk2bar-HaTaX-1.0.zip
    Last edited by HaTaX; 12-17-11 at 03:46 AM.
    10-20-11 01:37 AM
  2. papped's Avatar
    Awesome.... let the mass apk conversions commence

    Sent from Tapatalk on my Playbook
    10-20-11 01:38 AM
  3. HaTaX's Avatar
    D@mn, you is fast papped...

    Hopefully this will help the people out that aren't so familiar with the whole process. Only ugly part is getting the signing keys and following the registration instructions to get a working .p12 file. Not much I can do to work around that...

    Other then that, it should make the process a lot faster for those that are just testing and dumping these APKs like candy.
    Blaby likes this.
    10-20-11 01:41 AM
  4. snakeshea's Avatar
    Amazing!! thank you very much and trying on it now~
    10-20-11 01:51 AM
  5. papped's Avatar
    Was just luck actually, lol. Just happened to look at the post right after you made it.

    Sent from Tapatalk on my Playbook
    10-20-11 01:52 AM
  6. snakeshea's Avatar
    jut try it and seem like not working on my computer. it took 5sec and show me "exiting" but nothing come out to the folder. did i make something wrong?
    10-20-11 03:43 AM
  7. HaTaX's Avatar
    I did notice one small thing, don't have your APKs in the root folder of a drive. It chops the last "\" off and it doesn't have a proper output path then. I'll fix this soon and post up a new link, but for now just put it in "C:\Temp" or something before dragging it over.
    10-20-11 04:03 AM
  8. snakeshea's Avatar
    I put the apk file to some folder and drag it again still nothing happen, may be i should wait for your new link and check it out again. Thank you very much~
    10-20-11 04:19 AM
  9. T-Joker's Avatar
    I cant find my DEVCERTPASS or CSKPASS password anywhere. Anyway I can retrieve it from my current environment?! I use Flash Builder.

    Very stupid question, do you have to sign the file after the conversion, or is it suppose to work without signing?
    10-20-11 06:57 AM
  10. Gossieur's Avatar
    jut try it and seem like not working on my computer. it took 5sec and show me "exiting" but nothing come out to the folder. did i make something wrong?
    Same here ...
    10-20-11 07:57 AM
  11. tofo17's Avatar
    Same here ...
    Same with me HataX, I get the "Starting to Convert", "Using Android SDK located at", and "Created BAR file will be placed in" messages followed by "Exiting" but nothing is created.

    Tried a few APKs to be sure.
    10-20-11 08:04 AM
  12. DangerMouseUK's Avatar
    Same here as well, exiting with nothing created, nothing in log either.
    10-20-11 09:01 AM
  13. nimrodity's Avatar
    me too,no file was created
    10-20-11 09:45 AM
  14. compgen25's Avatar
    For those of you having issues with this, if you are using Windows Vista or Windows 7 Microsoft changed the behavior of allowing drag and drop on batch files. Dropping the apk file on the .bat file will not work. You will have to open a command prompt and run it from there with the path to the apk file as an argument to the apk2bar-HaTax.bat file. I just confirmed that this does work.
    erhan8 likes this.
    10-20-11 09:58 AM
  15. Gossieur's Avatar
    For those of you having issues with this, if you are using Windows Vista or Windows 7 Microsoft changed the behavior of allowing drag and drop on batch files. Dropping the apk file on the .bat file will not work. You will have to open a command prompt and run it from there with the path to the apk file as an argument to the apk2bar-HaTax.bat file. I just confirmed that this does work.
    I'm not sure this is the issue, since I have it on Windows XP aswell ...
    john1210 likes this.
    10-20-11 10:05 AM
  16. Gossieur's Avatar
    I'm not sure this is the issue, since I have it on Windows XP aswell ...
    Could you please give me an example of the syntax ??
    I have tried your suggestion but keep getting an error
    10-20-11 10:24 AM
  17. nimrodity's Avatar
    trie with command prompt,nothing happened
    10-20-11 10:28 AM
  18. compgen25's Avatar
    I have not tested on Windows XP. Howerver I am on Windows 7 and dragging the file on top of the bat file was giving me the same issues. I just opened a command prompt and changed directory to where the apk2bar-HaTax.bat file was and ran apk2bar-HaTax.bat {path to apk file} and it worked just fine. Same with the signapk bat file as well. All worked just fine so it is definately not something in the batch file that is not working just how windows is handling the drop.
    10-20-11 10:34 AM
  19. Gossieur's Avatar
    I'm not sure this is the issue, since I have it on Windows XP aswell ...
    This is the error I get ...
    10-20-11 10:36 AM
  20. Gossieur's Avatar
    I have not tested on Windows XP. Howerver I am on Windows 7 and dragging the file on top of the bat file was giving me the same issues. I just opened a command prompt and changed directory to where the apk2bar-HaTax.bat file was and ran apk2bar-HaTax.bat {path to apk file} and it worked just fine. Same with the signapk bat file as well. All worked just fine so it is definately not something in the batch file that is not working just how windows is handling the drop.
    You are a genius !! Got it working ! Thx a lot !!!
    compgen25 likes this.
    10-20-11 10:44 AM
  21. compgen25's Avatar
    Based on that error it appears you are using the full tools from Blackberry and not the tools that HaTax provided. If that is the case I am not sure as I was using HaTax's attached zip file and instructions on the repackage.
    10-20-11 10:46 AM
  22. nimrodity's Avatar
    ok the converting worked now,but can i test the bar without signing.
    I dont have the signing keys,does it work without?
    10-20-11 11:11 AM
  23. Gossieur's Avatar
    ok the converting worked now,but can i test the bar without signing.
    I dont have the signing keys,does it work without?
    Well, in my case it didn't ... waiting for a follu up on your question
    10-20-11 11:37 AM
  24. nimrodity's Avatar
    i just signed up for the keys,hope it be soon so i can try signing my bars
    10-20-11 11:39 AM
  25. compgen25's Avatar
    ok the converting worked now,but can i test the bar without signing.
    I dont have the signing keys,does it work without?

    I do believe you must sign the app to make it work on the OS. You can get free signing keys from RIM to do this. The only way to use unsigned apps is with a debug token which you would get from RIM when you get your signing keys. So either way you will have to get signing keys.
    10-20-11 11:42 AM
450 123 ...
LINK TO POST COPIED TO CLIPBOARD