3 ms·
I'm extremely confused about the claim that other tools have a worse precision or recall for APK or JAR files which are very much regular. Like, they should be
by lifthrasiir 3y ago
I'm extremely confused about the claim that other tools have a worse precision or recall for APK or JAR files which are very much regular. Like, they should be a valid ZIP file with `META-INF/MANIFEST.MF` present (at least), and APK would need `classes.dex` as well, but at this point there is no other format that can be confused with APK or JAR I believe. I'd like to see which file was causing unexpected drop on precision or recall.
- charcircuit 3y agoapks are also zipaligned so it's not like random users are going to be making them either
- HtmlProgrammer 3y agoMinecraft mods 14 years ago used to tell you to open the JAR and delete the META-INF when installing them so can’t rely on that one…
- supriyo-biswas 3y agoThe `file` command checks only the first few bytes, and doesn’t parse the structure of the file. APK files are indeed reported as Zip archives by the latest version of `file`.
- m0shen 3y agoThis is false in every sense for https://www.darwinsys.com/file/ https://www.darwinsys.com/file/ (probably the most used file version). It depends on the magic for a specific file, but it can check any part of your file. Many Linux distros are years out of date, you might be using a very old version. FILE_45: ./src/file -m magic/magic.mgc ../../OpenCalc.v2.3.1.apk ../../OpenCalc.v2.3.1.apk: Android package (APK), with zipflinger virtual entry, with APK Signing Block
- supriyo-biswas 3y agoInteresting! I checked with file 5.44 from Ubuntu 23.10 and 5.45 on macOS using homebrew, and in both cases, I got “Zip archive data, at least v2.0 to extract” for the file here[1]. I don’t have an Android phone to check and I’m also not familiar with Android tooling, so is this a corrupt APK? [1] https://download.apkpure.net/custom/com.apkpure.aegon-3197817.apk?_fn=QVBLUHVyZV92My4xOS43OF9hcGtwdXJlLmNvbS5hcGs&as=952379a4c2cf139483a198906d30724d65cef794&ai=-711161207&at=1708062492&_sa=ai%2Cat&k=af2a27ab4a6fcef520110d64b356610d65d19a1c&r=https%3A%2F%2Fapkpure.net%2Famp&_p=Y29tLmFwa3B1cmUuYWVnb24&c=1%7CTOOLS%7CZGV2PUFQS1B1cmUmdD1hcGsmcz0xMDQzMzgyNiZ2bj0zLjE5Ljc4JnZjPTMxOTc4MTc&hot=1&arg=apkpure%3A%2F%2Fcampaign%2F%3Futm_medium%3Dapkpure%26utm_source%3Dpre-register%26report_context%3D%7B%22channel_id%22%3A2007%2C%22source_package_name%22%3A%22com.levelinfinite.sgameGlobal%22%7D&arg=apkpure%3A%2F%2Fcustom%3Ftype%3Dopen_detail%26package_name%3Dcom.levelinfinite.sgameGlobal%26auto_pre_register%3D1 https://download.apkpure.net/custom/com.apkpure.aegon-319781...
- m0shen 3y agoThat doesn't appear to be a valid link. Try building `file` from source and using the provided default magic database.
- supriyo-biswas 3y agoI also tried this with the sources of file from the homepage you linked above, and I still get the same results. You could try this for yourself using the same APKPure file which I uploaded at the following alternative link[1]. Further, while this could be a corrupt APK, I can’t see any signs of that from a cursory inspection as both the `classes.dex` and `META-INF` directory are present, and this is APKPure’s own APK, instead of an APK contributed for an app contributed by a third-party. [1] https://wormhole.app/Mebmy#CDv86juV9H4aRCL2DSJeDw https://wormhole.app/Mebmy#CDv86juV9H4aRCL2DSJeDw
- Someone 3y agoPeople do create JAR files without a META-INF/MANIFEST.MF entry. The tooling even supports it. https://docs.oracle.com/en/java/javase/21/docs/specs/man/jar.html#operation-modifiers-valid-only-in-create-and-update-modes https://docs.oracle.com/en/java/javase/21/docs/specs/man/jar...: -M or --no-manifest Doesn't create a manifest file for the entries