本文整理了Java中soot.options.Options.output_format()
方法的一些代码示例,展示了Options.output_format()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Options.output_format()
方法的具体详情如下:
包路径:soot.options.Options
类名称:Options
方法名:output_format
暂无
代码示例来源:origin: Sable/soot
if (Options.v().whole_program() || Options.v().output_format() == Options.output_format_dava) {
代码示例来源:origin: Sable/soot
private void postProcessXML(Iterator<SootClass> classes) {
if (!Options.v().xml_attributes()) {
return;
}
if (Options.v().output_format() != Options.output_format_jimple) {
return;
}
while (classes.hasNext()) {
SootClass c = classes.next();
processXMLForClass(c);
}
}
代码示例来源:origin: Sable/soot
private void determineExcludedPackages() {
excludedPackages = new LinkedList<String>();
if (Options.v().exclude() != null) {
excludedPackages.addAll(Options.v().exclude());
}
// do not kill contents of the APK if we want a working new APK
// afterwards
if (!Options.v().include_all() && Options.v().output_format() != Options.output_format_dex
&& Options.v().output_format() != Options.output_format_force_dex) {
excludedPackages.add("java.*");
excludedPackages.add("sun.*");
excludedPackages.add("javax.*");
excludedPackages.add("com.sun.*");
excludedPackages.add("com.ibm.*");
excludedPackages.add("org.xml.*");
excludedPackages.add("org.w3c.*");
excludedPackages.add("apple.awt.*");
excludedPackages.add("com.apple.*");
}
}
代码示例来源:origin: Sable/soot
protected void writeOutput(Iterator<SootClass> classes) {
// If we're writing individual class files, we can write them
// concurrently. Otherwise, we need to synchronize for not destroying
// the shared output stream.
int threadNum = Options.v().output_format() == Options.output_format_class && jarFile == null
? Runtime.getRuntime().availableProcessors()
: 1;
CountingThreadPoolExecutor executor
= new CountingThreadPoolExecutor(threadNum, threadNum, 30, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
while (classes.hasNext()) {
final SootClass c = classes.next();
executor.execute(() -> writeClass(c));
}
// Wait till all classes have been written
try {
executor.awaitCompletion();
executor.shutdown();
} catch (InterruptedException e) {
// Something went horribly wrong
throw new RuntimeException("Could not wait for writer threads to " + "finish: " + e.getMessage(), e);
}
// If something went wrong, we tell the world
if (executor.getException() != null) {
if (executor.getException() instanceof RuntimeException) {
throw (RuntimeException) executor.getException();
} else {
throw new RuntimeException(executor.getException());
}
}
}
代码示例来源:origin: Sable/soot
String fileName = SourceLocator.v().getFileNameFor(s, Options.v().output_format());
decompiledClasses.add(fileName.substring(fileName.lastIndexOf('/') + 1));
if (pathForBuild == null) {
代码示例来源:origin: Sable/soot
public void print() {
try {
if (Options.v().output_jar()
|| (originalApk != null && Options.v().output_format() != Options.output_format_force_dex)) {
printZip();
} else {
final String outputDir = SourceLocator.v().getOutputDir();
LOGGER.info("Writing dex files to \"{}\" folder.", outputDir);
dexBuilder.writeTo(outputDir);
}
} catch (IOException e) {
throw new CompilationDeathException("I/O exception while printing dex", e);
}
}
代码示例来源:origin: Sable/soot
private void preProcessDAVA() {
if (Options.v().output_format() == Options.output_format_dava) {
Map<String, String> options = PhaseOptions.v().getPhaseOptions("db");
boolean isSourceJavac = PhaseOptions.getBoolean(options, "source-is-javac");
if (!isSourceJavac) {
/*
* It turns out that the exception attributes of a method i.e. those exceptions that a method can throw are only
* checked by the Java compiler and not the JVM
*
* Javac does place this information into the attributes but other compilers dont hence if the source is not javac
* then we have to do this fancy analysis to find all the potential exceptions that might get thrown
*
* BY DEFAULT the option javac of db is set to true so we assume that the source is javac
*
* See ThrowFinder for more details
*/
if (DEBUG) {
System.out.println("Source is not Javac hence invoking ThrowFinder");
}
ThrowFinder.v().find();
} else {
if (DEBUG) {
System.out.println("Source is javac hence we dont need to invoke ThrowFinder");
}
}
PackageNamer.v().fixNames();
}
}
代码示例来源:origin: Sable/soot
private void processXMLForClass(SootClass c, TagCollector tc) {
int ofmt = Options.v().output_format();
final int format = ofmt != Options.output_format_none ? ofmt : Options.output_format_jimple;
String fileName = SourceLocator.v().getFileNameFor(c, format);
XMLAttributesPrinter xap = new XMLAttributesPrinter(fileName, SourceLocator.v().getOutputDir());
xap.printAttrs(c, tc);
}
代码示例来源:origin: Sable/soot
/**
* assumption: only called when <code>Options.v().output_format() == Options.output_format_jimple</code>
*/
private void processXMLForClass(SootClass c) {
final int format = Options.v().output_format();
String fileName = SourceLocator.v().getFileNameFor(c, format);
XMLAttributesPrinter xap = new XMLAttributesPrinter(fileName, SourceLocator.v().getOutputDir());
xap.printAttrs(c);
}
代码示例来源:origin: Sable/soot
protected void writeClass(SootClass c) {
if (Options.v().output_format() == Options.output_format_jimple) {
if (!c.isPhantom) {
ConstantValueToInitializerTransformer.v().transformClass(c);
final int format = Options.v().output_format();
if (format == Options.output_format_none) {
return;
代码示例来源:origin: Sable/soot
/** Returns true if we are resolving all class refs recursively. */
protected boolean resolveEverything() {
if (Options.v().on_the_fly()) {
return false;
}
return (Options.v().whole_program() || Options.v().whole_shimple() || Options.v().full_resolver()
|| Options.v().output_format() == Options.output_format_dava);
}
代码示例来源:origin: Sable/soot
public void writeOutput() {
setupJAR();
if (Options.v().verbose()) {
PhaseDumper.v().dumpBefore("output");
}
if (Options.v().output_format() == Options.output_format_dava) {
postProcessDAVA();
outputDava();
} else if (Options.v().output_format() == Options.output_format_dex
|| Options.v().output_format() == Options.output_format_force_dex) {
writeDexOutput();
} else {
writeOutput(reachableClasses());
tearDownJAR();
}
postProcessXML(reachableClasses());
if (!Options.v().no_writeout_body_releasing()) {
releaseBodies(reachableClasses());
}
if (Options.v().verbose()) {
PhaseDumper.v().dumpAfter("output");
}
}
代码示例来源:origin: Sable/soot
String fileName = SourceLocator.v().getFileNameFor(s, Options.v().output_format());
代码示例来源:origin: Sable/soot
@SuppressWarnings("fallthrough")
private void runBodyPacks(SootClass c) {
final int format = Options.v().output_format();
if (format == Options.output_format_dava) {
logger.debug("Decompiling {}...", c.getName());
if (Options.v().xml_attributes() && Options.v().output_format() != Options.output_format_jimple) {
if (Options.v().xml_attributes() && Options.v().output_format() != Options.output_format_jimple) {
processXMLForClass(c, tc);
代码示例来源:origin: ibinti/bugvm
if(Options.v().whole_program() || Options.v().output_format()==Options.output_format_dava) {
代码示例来源:origin: com.bugvm/bugvm-soot
if(Options.v().whole_program() || Options.v().output_format()==Options.output_format_dava) {
代码示例来源:origin: ibinti/bugvm
/** Returns true if we are resolving all class refs recursively. */
private boolean resolveEverything() {
return( Options.v().whole_program() || Options.v().whole_shimple()
|| Options.v().full_resolver()
|| Options.v().output_format() == Options.output_format_dava );
}
代码示例来源:origin: com.bugvm/bugvm-soot
/** Returns true if we are resolving all class refs recursively. */
private boolean resolveEverything() {
return( Options.v().whole_program() || Options.v().whole_shimple()
|| Options.v().full_resolver()
|| Options.v().output_format() == Options.output_format_dava );
}
内容来源于网络,如有侵权,请联系作者删除!