private void findClasses(String packageName,Set<String> classNames,Set<String> subpackageNames){
  String packagePrefix=packageName + '.';
  String pathPrefix=packagePrefix.replace('.','/');
  for (  String entryName : classPath) {
    File classPathEntry=new File(entryName);
    if (classPathEntry.exists()) {
      try {
        if (entryName.endsWith(".apk")) {
          findClassesInApk(entryName,packageName,classNames,subpackageNames);
        }
 else {
          for (          String apkPath : apkPaths) {
            File file=new File(apkPath);
            scanForApkFiles(file,packageName,classNames,subpackageNames);
          }
        }
      }
 catch (      IOException e) {
        throw new AssertionError("Can't read classpath entry " + entryName + ": "+ e.getMessage());
      }
    }
  }
}

private void findClasses ( String packageName , Set < String > classNames , Set < String > subpackageNames ) { String packagePrefix = packageName + '.' ; String pathPrefix = packagePrefix . replace ( '.' , '/' ) ; for ( String entryName : classPath ) { File classPathEntry = new File ( entryName ) ; if ( classPathEntry . exists ( ) ) { try { if ( entryName . endsWith ( ".apk" ) ) { findClassesInApk ( entryName , packageName , classNames , subpackageNames ) ; } else { for ( String apkPath : apkPaths ) { File file = new File ( apkPath ) ; scanForApkFiles ( file , packageName , classNames , subpackageNames ) ; } } } catch ( IOException e ) { throw new AssertionError ( "Can't read classpath entry " + entryName + ": " + e . getMessage ( ) ) ; } } } }
finds all classes and sub packages that are below the packagename and add them to the respective sets . searches the package on the whole class path .
