/** * Returns the SHA1 digest of the AAR by computing it on the fly. * @return the SHA1 digest of the AAR */ @Override public synchronized String getSHA1() { return this.aarWriter.getSHA1(); }
/** * Returns the SHA1 digest of the JAR. Either taken from the manifest (entry VULAS-originalSHA1, in case the original JAR has been instrumented * offline), or by computing it on the fly. * @return the SHA1 digest of the JAR */ public synchronized String getSHA1() { return this.jarWriter.getSHA1(); }
/** * @return */ private Manifest createModifiedManifest() { final Manifest m = new Manifest(); final Attributes atts = m.getMainAttributes(); // Put all the main attributes of the original JAR if(this.originalManifest!=null) { for(Object key: this.originalManifest.getMainAttributes().keySet()) { // Unless it is one to be skipped if(!this.mfEntriesToSkip.contains(key.toString())) atts.putValue(key.toString(), this.originalManifest.getMainAttributes().getValue(key.toString())); } } // Put all the new entries for(String key: this.mfEntriesToAdd.keySet()) { atts.putValue(key, this.mfEntriesToAdd.get(key)); } // Add vulas-specific ones atts.putValue(JarWriter.MANIFEST_ENTRY_VULAS_MODIF, JarWriter.DATE_FORMAT.format(new Date(System.currentTimeMillis()))); atts.putValue(JarWriter.MANIFEST_ENTRY_ORIG_SHA1, this.getSHA1()); return m; }
jw.setClassifier(jw.getSHA1()); appended_path = jw.rewrite(VulasConfiguration.getGlobal().getTmpDir()); _classpath.add(appended_path);