Support application/vnd.android.package-archive mime type for APKs#470
Merged
rbs-jacob merged 2 commits intoJun 4, 2024
Merged
Conversation
rbs-jacob
approved these changes
Jun 4, 2024
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One sentence summary of this PR (This should go in the CHANGELOG!)
Support
application/vnd.android.package-archivemime type for APKs, which is returned by newer versions of libmagicLink 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.pycurrently fails, as theApkIdentifierdoes not recognize the test apk file as such. The issue is that currentlyApkIdentifierexpects apks to be recognized by libmime asapplication/java-archiveorapplication/zipbut in fact it is recognized asapplication/vnd.android.package-archive. This change addsapplication/vnd.android.package-archivetoApkIdentifier- for that mime type, theApktag 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.