[X] I have reviewed the OFRAK contributor guide and attest that this pull request is in accordance with it.
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.
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 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.py
currently fails, as theApkIdentifier
does not recognize the test apk file as such. The issue is that currentlyApkIdentifier
expects apks to be recognized by libmime asapplication/java-archive
orapplication/zip
but in fact it is recognized asapplication/vnd.android.package-archive
. This change addsapplication/vnd.android.package-archive
toApkIdentifier
- for that mime type, theApk
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.