Fix invalid entries within a manifest file of a BAR file
Occasionally, the apk2bar tool fails to repackage an APK because it mapped one or more invalid attributes to the BAR manifest file.
Typically, the problem is the result of attribute values that are too long. For example, the BlackBerry 10 OS only accepts BAR package names that are 29 characters or fewer. If the Package-Name attribute mapped from the AndroidManifest.xml file exceeds the maximum length, the repackaging fails. When the repackaging of an app fails as a result of invalid attributes in the manifest file, the apk2bar tool generates a manifest file for that app, with the name <APK_filename>.mf, and saves it in the same folder as the APK file. The tool displays an error message that indicates which attribute caused the repackaging to fail.
To correct this issue, modify the generated manifest file for the app and package this custom manifest file with the BAR file.
- Using an archiving tool, locate and open <APK_filename>.bar that apk2bar tool generated.
- Extract the meta-inf/manifest.mf file to the folder that contains your APK files.
- Rename the file as <APK_filename>.mf.
- Iin any text editor that preserves UNIX line terminators, open the <APK_filename>.mf file.
- Modify the problematic attribute value(s) as necessary. Note that manifest file attributes are subject to restrictive syntax and length constraints.
- Save the file.