private static InputStream getInputStream ( String libPath ) throws IOException { Preconditions . checkArgument ( ( libPath . endsWith ( ".jar" ) || libPath . endsWith ( ".aar" ) ) && Files . exists ( Paths . get ( libPath ) ) , "invalid library path! " + libPath ) ; LOG ( VERBOSE , "Info" , "opening library: " + libPath + "..." ) ; InputStream jarIS = null ; if ( libPath . endsWith ( ".jar" ) ) { jarIS = new FileInputStream ( libPath ) ; } else if ( libPath . endsWith ( ".aar" ) ) { ZipFile aar = new ZipFile ( libPath ) ; ZipEntry jarEntry = aar . getEntry ( "classes.jar" ) ; jarIS = ( jarEntry == null ? null : aar . getInputStream ( jarEntry ) ) ; } return jarIS ; }
Get InputStream of the jar of class files to be analyzed .