Skip to content

Commit

Permalink
Fix apk classification (#72)
Browse files Browse the repository at this point in the history
* Fix apk classification
  • Loading branch information
nazywam authored Oct 2, 2023
1 parent 62faee9 commit ab285aa
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions karton/classifier/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,13 @@ def zip_has_file(path: str) -> bool:
except Exception:
return False

if magic.startswith("Zip archive data") or magic.startswith(
"Java archive data (JAR)"
):
JAVA_ARCHIVES = [
"Zip archive data",
"Java archive data (JAR)",
"Android package (APK)",
]

if any(magic.startswith(x) for x in JAVA_ARCHIVES):
if extension == "apk" or zip_has_file("AndroidManifest.xml"):
sample_class.update(
{"kind": "runnable", "platform": "android", "extension": "apk"}
Expand Down

0 comments on commit ab285aa

Please sign in to comment.