Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
New Contributor
MuhammadRashid
Posts: 6
Registered: ‎02-26-2013
My Device: Blackberry 10
My Carrier: 923214917948

adding android.cfg by using online packager

Dear all,

 

Would you like to tell me how to add android.cfg file and push permission entry by using online packager.

 

Regards

Please use plain text.
Contributor
vmurarka
Posts: 18
Registered: ‎03-14-2013
My Device: Z10
My Carrier: NA

Re: adding android.cfg by using online packager

I also didn;t find how to do with online packager but was able to do it manually. Created bar file using apk2bar command and then used a zip utility to unzip, add cfg file and zip back to bar. Note: I had to also modify the manifest file in bar to add an entry as below and then I was able to deploy the bar file.

Archive-Asset-Name: android/android.cfg

Please use plain text.
Contributor
vmurarka
Posts: 18
Registered: ‎03-14-2013
My Device: Z10
My Carrier: NA

Re: adding android.cfg by using online packager

Issue: getting "android/android.cfg: unknown asset" when adding android.cfg manually via a zip uitility into the bar file

 

Solution:

Option 1: Add below manual entry to the bar manifest file. (probably not best option to do)

Archive-Asset-Name: android/android.cfg"

 

Option 2: If you have an APK named {something}.APK (e.g., ‘foo.APK’), then running apk2bar with the ‘-m -ma’ arguments will automatically look for ‘foo.MF’ and ‘foo.CFG’ in the same folder.  If they exist, they will be packaged as part of the BAR.  HOWEVER, apk2bar also automatically renames the CFG file in the process - instead of ‘foo.CFG’, it appears in the BAR as ‘android\android.cfg’. When the resulting BAR is signed, the android.cfg file will get signed automatically.

 

Option 3: Put the <projectName>.cfg file under the root of the Android project and then create apk and then repackage it as bar and you will find ‘android\android.cfg’ file present in bar file.

 

For me since I started with an existing apk file (so just support existing apk on the BB device without any code modification), I prefered option #2.

Please use plain text.