Java Code Examples for soot.options.Options#src_prec_class()

The following examples show how to use soot.options.Options#src_prec_class() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PackManager.java    From JAADAS with GNU General Public License v3.0 5 votes vote down vote up
private void runPacksNormally() {
	if (Options.v().src_prec() == Options.src_prec_class && Options.v().keep_line_number()){
           LineNumberAdder lineNumAdder = LineNumberAdder.v();
           lineNumAdder.internalTransform("", null);
       }
	
       if (Options.v().whole_program() || Options.v().whole_shimple()) {
           runWholeProgramPacks();
       }
       retrieveAllBodies();
       
   	// Create tags from all values we only have in code assignments now
       for (SootClass sc : Scene.v().getApplicationClasses()) {
           if( Options.v().validate() )
           	sc.validate();
       	if (!sc.isPhantom)
       		ConstantInitializerToTagTransformer.v().transformClass(sc, true);
       }
       
       // if running coffi cfg metrics, print out results and exit
       if (soot.jbco.Main.metrics) {
         coffiMetrics();
         System.exit(0);
       }

       preProcessDAVA();
       if (Options.v().interactive_mode()){
           if (InteractionHandler.v().getInteractionListener() == null){
               G.v().out.println("Cannot run in interactive mode. No listeners available. Continuing in regular mode.");
               Options.v().set_interactive_mode(false);
           }
           else {
               G.v().out.println("Running in interactive mode.");
           }
       }
       runBodyPacks();
       handleInnerClasses();
}
 
Example 2
Source File: SourceLocator.java    From JAADAS with GNU General Public License v3.0 5 votes vote down vote up
private void setupClassProviders() {
      classProviders = new LinkedList<ClassProvider>();
      ClassProvider classFileClassProvider = Options.v().coffi() ? new CoffiClassProvider() : new AsmClassProvider();
switch( Options.v().src_prec() ) {
          case Options.src_prec_class:
              classProviders.add(classFileClassProvider);
              classProviders.add(new JimpleClassProvider());
              classProviders.add(new JavaClassProvider());
              break;
          case Options.src_prec_only_class:
              classProviders.add(classFileClassProvider);
              break;
          case Options.src_prec_java:
              classProviders.add(new JavaClassProvider());
              classProviders.add(classFileClassProvider);
              classProviders.add(new JimpleClassProvider());
              break;
          case Options.src_prec_jimple:
              classProviders.add(new JimpleClassProvider());
              classProviders.add(classFileClassProvider);
              classProviders.add(new JavaClassProvider());
              break;
          case Options.src_prec_apk:
              classProviders.add(new DexClassProvider());
		classProviders.add(classFileClassProvider);
		classProviders.add(new JavaClassProvider());
		classProviders.add(new JimpleClassProvider());
              break;
          default:
              throw new RuntimeException("Other source precedences are not currently supported.");
      }
  }
 
Example 3
Source File: SootResolver.java    From JAADAS with GNU General Public License v3.0 5 votes vote down vote up
public SootResolver(Singletons.Global g) {
	worklist[SootClass.HIERARCHY] = new ArrayDeque<SootClass>();
	worklist[SootClass.SIGNATURES] = new ArrayDeque<SootClass>();
	worklist[SootClass.BODIES] = new ArrayDeque<SootClass>();

	program = new Program();
	program.state().reset();

	program.initBytecodeReader(new BytecodeParser());
	program.initJavaParser(new JavaParser() {
		public CompilationUnit parse(InputStream is, String fileName)
				throws IOException, beaver.Parser.Exception {
			return new JastAddJavaParser().parse(is, fileName);
		}
	});

	program.options().initOptions();
	program.options().addKeyValueOption("-classpath");
	program.options().setValueForOption(Scene.v().getSootClassPath(),
			"-classpath");
	if (Options.v().src_prec() == Options.src_prec_java)
		program.setSrcPrec(Program.SRC_PREC_JAVA);
	else if (Options.v().src_prec() == Options.src_prec_class)
		program.setSrcPrec(Program.SRC_PREC_CLASS);
	else if (Options.v().src_prec() == Options.src_prec_only_class)
		program.setSrcPrec(Program.SRC_PREC_CLASS);
	program.initPaths();
}