crypto.preanalysis.TransformerSetup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of CryptoAnalysis Show documentation
Show all versions of CryptoAnalysis Show documentation
CogniCrypt_SAST: CrySL-to-Static Analysis Compiler
The newest version!
package crypto.preanalysis;
import boomerang.scene.jimple.BoomerangPretransformer;
import crysl.rule.CrySLRule;
import java.util.Collection;
public class TransformerSetup {
private static TransformerSetup instance;
public void setupPreTransformer(Collection rules) {
// Transformer related to the analysis
setupEmptyStatementTransformer(rules);
setupExceptionAwareTransformer(rules);
// Transformer related to Boomerang
setupUpdatedBoomerangPreTransformer();
}
public void setupEmptyStatementTransformer(Collection rules) {
EmptyStatementTransformer transformer = new EmptyStatementTransformer(rules);
transformer.apply();
}
public void setupExceptionAwareTransformer(Collection rules) {
for (CrySLRule rule : rules) {
ExceptionAwareTransformer transformer = new ExceptionAwareTransformer(rule);
transformer.apply();
}
}
public void setupBoomerangTransformer() {
BoomerangPretransformer.v().reset();
BoomerangPretransformer.v().apply();
}
public void setupUpdatedBoomerangPreTransformer() {
UpdatedBoomerangPreTransformer.v().reset();
UpdatedBoomerangPreTransformer.v().apply();
}
public static TransformerSetup v() {
if (instance == null) {
instance = new TransformerSetup();
}
return instance;
}
public void reset() {
instance = null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy