summaryrefslogtreecommitdiff
path: root/findjava.py
diff options
context:
space:
mode:
Diffstat (limited to 'findjava.py')
-rwxr-xr-xfindjava.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/findjava.py b/findjava.py
new file mode 100755
index 0000000..09f65ac
--- /dev/null
+++ b/findjava.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+
+import avfs
+import os, sys
+
+def is_jvm_class(fname):
+ return b'\xca\xfe\xba\xbe' == avfs.open(fname, 'rb').read(4)
+
+if __name__ == "__main__":
+ for fname in avfs.find(os.fsencode(sys.argv[1]), {b'.git'}):
+ try:
+ if is_jvm_class(fname):
+ print(fname.decode('utf-8', 'replace'))
+ except:
+ pass