Skip to content

Support application/vnd.android.package-archive mime type for APKs#470

Merged
rbs-jacob merged 2 commits into
redballoonsecurity:masterfrom
ANogin:feature/apk_mime_type
Jun 4, 2024
Merged

Support application/vnd.android.package-archive mime type for APKs#470
rbs-jacob merged 2 commits into
redballoonsecurity:masterfrom
ANogin:feature/apk_mime_type

Conversation

@ANogin
Copy link
Copy Markdown
Contributor

@ANogin ANogin commented Jun 1, 2024

One sentence summary of this PR (This should go in the CHANGELOG!)
Support application/vnd.android.package-archive mime type for APKs, which is returned by newer versions of libmagic

Link to Related Issue(s)
N/A

Please describe the changes in your request.
In Debian 12 Bookworm with libmagic 5.44-3, ofrak_core/test_ofrak/components/test_apk.py currently fails, as the ApkIdentifier does not recognize the test apk file as such. The issue is that currently ApkIdentifier expects apks to be recognized by libmime as application/java-archive or application/zip but in fact it is recognized as application/vnd.android.package-archive. This change adds application/vnd.android.package-archive to ApkIdentifier - for that mime type, the Apk tag is immediately added without checking the archive contents.

Note that for newer libmagic the old code is not actually needed (and would only cause the identifier to take too long to reject the non-APK zip archives), but I kept it as we obviously want to support older versions of libmagic as well for time being.

Anyone you think should look at this, specifically?
Not sure.

@rbs-jacob rbs-jacob merged commit 336dacb into redballoonsecurity:master Jun 4, 2024
@ANogin ANogin deleted the feature/apk_mime_type branch June 6, 2024 14:59
ANogin pushed a commit to ANogin/ofrak that referenced this pull request Aug 20, 2024
…edballoonsecurity#470)

* Support `application/vnd.android.package-archive` mime type for APKs

* Add a CHANGELOG entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants