@Override
    public MediaType detect(ZipFile zip, TikaInputStream tis) throws IOException {
        if (zip.getEntry("META-INF/MANIFEST.MF") != null) {
            // It's a Jar file, or something based on Jar

            // Is it an Android APK?
            if (zip.getEntry("AndroidManifest.xml") != null) {
                return MediaType.application("vnd.android.package-archive");
            }

            // Check for WAR and EAR
            if (zip.getEntry("WEB-INF/") != null) {
                return MediaType.application("x-tika-java-web-archive");
            }
            if (zip.getEntry("META-INF/application.xml") != null) {
                return MediaType.application("x-tika-java-enterprise-archive");
            }
            // AAB archive
            if (zip.getEntry("base/manifest/AndroidManifest.xml") != null) {
                return MediaType.application("x-authorware-bin");
            }

            // Looks like a regular Jar Archive
            return MediaType.application("java-archive");
        } else {
            // Some Android APKs miss the default Manifest
            if (zip.getEntry("AndroidManifest.xml") != null) {
                return MediaType.application("vnd.android.package-archive");
            }

            return null;
        }
    }
This detector detects JAR files and file type variants of zip subtypes
that may contain a MANIFEST.MF
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-zip-commons/src/main/java/org/apache/tika/detect/zip/JarDetector.java