public JarStatus addResourcesFromJar ( File jarFile ) throws ApkCreationException , SealedApkException , DuplicateFileException { if ( mIsSealed ) { throw new SealedApkException ( "APK is already sealed" ) ; } try { verbosePrintln ( "%s:" , jarFile ) ; // reset the filter with this input. mFilter . reset ( jarFile ) ; // ask the builder to add the content of the file, filtered to only let through // the java resources. FileInputStream fis = new FileInputStream ( jarFile ) ; mBuilder . writeZip ( fis , mFilter ) ; fis . close ( ) ; // check if native libraries were found in the external library. This should // constitutes an error or warning depending on if they are in lib/ return new JarStatusImpl ( mFilter . getNativeLibs ( ) , mFilter . getNativeLibsConflict ( ) ) ; } catch ( DuplicateFileException e ) { mBuilder . cleanUp ( ) ; throw e ; } catch ( Exception e ) { mBuilder . cleanUp ( ) ; throw new ApkCreationException ( e , "Failed to add %s" , jarFile ) ; } }
Adds the resources from a jar file .