3

I have Android application (.apk bundle). Application name contains umlauts. I'm trying to convert .apk bundle to .bar (BlackBerry 10). I'm using BlackBerry Repackaging Tool Plug-in for Eclipse.

After repackaging and signing process application name in MANIFEST.MF file in .bar bundle contains '?' signs instead of umlauts. I can't upload the .bar bundle to BlackBerry World due to this. When I'm trying to upload it I'm getting the error:

Invalid signature file digest for Manifest main attributes System.exit calls not allowed!

Nate
  • 31,017
  • 13
  • 83
  • 207
Mikhail Grebionkin
  • 3,806
  • 2
  • 17
  • 18

2 Answers2

1

Michail, your own answer doesn't work properly. BAR file is signed and verified, but if I install final application to real Z10 device, there is "App f\u00FCr BlackBerry" as an application name (escaped sequence is printed directly).

I found easy solution here: Cyrillic app name incorrectly encoded during porting Android app to Blackberry

Problem is in encoding used by BlackBerry command tools. Only you need is to add

-Dfile.encoding=utf-8

parameter into apk2bar and blackberry-signer batch commands. For example:

java -Djava.awt.headless=true -Dfile.encoding=utf-8 -Xmx512M -cp "$LIB/BarPackager.jar:$LIB/Apk2Bar.jar"...

Then you can use signing for BlackBerry World directly from Eclipse.

Community
  • 1
  • 1
Peter Knut
  • 2,311
  • 20
  • 15
0

I guess I found the solution.

Let's say we have an Android application (.APK) with umlauts in its name, for example: "App für BlackBerry". If we want successfully convert it to BlackBerry application (.BAR), sign it and upload to BlackBerry World then we have to do next things:

  1. Replace umlauts in application name with unicode escape sequences in AndroidManifest.xml file of our Android project. So, we will have "App f\u00FCr BlackBerry". Build our application (this will create .APK file).

  2. Use apk2bar utility to convert .APK to .BAR (this will create .BAR file in same folder as our .APK file):

    apk2bar <path to our .APK file> <path to Android SDK>
    
  3. Change file extension of our .BAR file to .ZIP (or add .ZIP after .BAR). Unzip file with any archive manager. We should see next files in the archive folder:

    android/<application name>.APK
    META-INF/MANIFEST.MF
    

    We need to open META-INF/MANIFEST.MF file and check "Application-Name" and "Entry-Point-Name" lines. If they looks like:

    Application-Name: App für BlackBerry
    Entry-Point-Name: App für BlackBerry
    

    then we need to copy MANIFEST.MF file to the same folder as our .APK file and replace umlauts in those lines with unicode escape sequences:

    Application-Name: App f\u00FCr BlackBerry
    Entry-Point-Name: App f\u00FCr BlackBerry
    

    After this step we can remove .ZIP file and unziped folder.

  4. Use apk2bar utility again with additional option:

    apk2bar <path to our .APK file> <path to Android SDK> -m <path to our updated MANIFEST.MF file>
    

    After this step we will have .BAR file with unicode escape sequences instead of umlauts in inner MANIFEST.MF file.

    Caution: Don't update inner MANIFEST.MF file, zip unziped folder and change archive extensions from .ZIP back to .BAR. It may corrupt .BAR file. So it was for me.

  5. Sign our .BAR file with blackberry-signer utility.

    • If our p12 and CSK passwords are the same then we could use:

      blackberry-signer -storepass <our P12/CSK password> <path to our .BAR file>
      
    • If our p12 and CSK passwords aren't the same then we should use: blackberry-signer -keystore -storepass author and:

      blackberry-signer -verbose -cskpass <our CSK password> -keystore <path to our lP12 file> -storepass <our P12 password> <path to our .BAR file> RDK
      
  6. Verify our .BAR file:

    blackberry-signer -verify <path to our .BAR file>
    

If this command shows no error then we can upload .BAR file to BlackBerry World.

That's it.

Mikhail Grebionkin
  • 3,806
  • 2
  • 17
  • 18