@Override
    public boolean accept(String fullPath) {
      if (fullPath.endsWith(".class")) {
        String path = fixPath(fullPath);
        return classesInMainDex.contains(path);
      } else {
        return true;
      }
    }
A quick and accurate filter for when file path can be trusted.
android/android_framework/dex-maker/src/main/java/com/android/dx/command/dexer/Main.java