• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Options类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中soot.options.Options的典型用法代码示例。如果您正苦于以下问题:Java Options类的具体用法?Java Options怎么用?Java Options使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Options类属于soot.options包,在下文中一共展示了Options类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initialiseSoot

import soot.options.Options; //导入依赖的package包/类
/**
 * Provides all needed information to soot.
 */
public static void initialiseSoot() {

	// prefer Android APK files// -src-prec apk
	Options.v().set_src_prec(Options.src_prec_apk);
	Options.v().set_force_overwrite(true);

	// output as APK, too//-f J
	Options.v().set_output_format(Options.output_format_dex);

	Options.v().set_force_android_jar(androidJAR);
	Options.v().set_android_jars(androidJAR);
	Options.v().set_allow_phantom_refs(true);
	List<String> procDir = new ArrayList<String>();
	procDir.add(apk);
	Options.v().set_process_dir(procDir);
	Options.v().set_soot_classpath(classpath);

	Scene.v().addBasicClass("android.util.Log", SootClass.SIGNATURES);
	Scene.v().addBasicClass("call.LogCaller", SootClass.BODIES);

	Scene.v().loadNecessaryClasses();

	Scene.v().getSootClass("call.LogCaller").setApplicationClass();
	
}
 
开发者ID:bjrnmath,项目名称:mutaflow,代码行数:29,代码来源:PrivacyAPK.java


示例2: generateCSV

import soot.options.Options; //导入依赖的package包/类
/**
 * Generate file representing the graph as comma separated edges.
 * @param outputName
 * @throws IOException 
 */
public void generateCSV(String outputName) throws IOException {
  // create directory to write graphs
  File graphDir = new File(Options.v().output_dir() +"/"+ "graphs/");
  if (!graphDir.exists())
    graphDir.mkdir();
  for (int i=0; i < ConfigCHA.v().getGraphOutMaxDepth(); i++) {
    String name =  graphDir.getAbsolutePath() +"/"+ i + outputName;
    out.add(new PrintWriter(new BufferedWriter(new FileWriter(name))));
    log.info("Output CSV graph to '"+ name);
  }
  Set<SootMethod> alreadyVisited = new HashSet<SootMethod>();
  SootMethod main = Scene.v().getMainMethod();
  alreadyVisited.add(main);
  visit(alreadyVisited, main, 0);
  
  for (int i=0; i < ConfigCHA.v().getGraphOutMaxDepth(); i++)
    out.get(i).close();
  
}
 
开发者ID:Alexandre-Bartel,项目名称:permission-map,代码行数:25,代码来源:OutputGraph.java


示例3: TrapUnitGraph

import soot.options.Options; //导入依赖的package包/类
/**
    *  Constructs the graph from a given Body instance.
    *  @param the Body instance from which the graph is built.
    */
   public TrapUnitGraph(Body body)
   {
       super(body);
int size = unitChain.size();

       if(Options.v().time())
           Timers.v().graphTimer.start();

unitToSuccs = new HashMap<Unit, List<Unit>>(size * 2 + 1, 0.7f);
unitToPreds = new HashMap<Unit, List<Unit>>(size * 2 + 1, 0.7f);
buildUnexceptionalEdges(unitToSuccs, unitToPreds);
buildExceptionalEdges(unitToSuccs, unitToPreds);
makeMappedListsUnmodifiable(unitToSuccs);
makeMappedListsUnmodifiable(unitToPreds);

buildHeadsAndTails();

       if(Options.v().time())
           Timers.v().graphTimer.end();

soot.util.PhaseDumper.v().dumpGraph(this, body);
   }
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:27,代码来源:TrapUnitGraph.java


示例4: setSootOptions

import soot.options.Options; //导入依赖的package包/类
@Override
	public void setSootOptions(Options options) {
		// explicitly include packages for shorter runtime:
		List<String> includeList = new LinkedList<String>();
		includeList.add("java.lang.*");
		includeList.add("java.util.*");
		includeList.add("java.io.*");
		includeList.add("sun.misc.*");
		includeList.add("java.net.*");
		includeList.add("org.apache.http.*");
		includeList.add("de.test.*");
		includeList.add("soot.*");
		includeList.add("securibench.*");
		includeList.add("javax.servlet.*");
		includeList.add("com.oreilly.servlet.*");
//		includeList.add("java.security.");
//		includeList.add("javax.crypto.");
		options.set_include(includeList);
		options.set_output_format(Options.output_format_none);
	}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:21,代码来源:ConfigSecuriBench.java


示例5: stringBuilderTest2_NoJDK

import soot.options.Options; //导入依赖的package包/类
@Test(timeout=600000)
  public void stringBuilderTest2_NoJDK(){
  	Infoflow infoflow = initInfoflow(true);
  	infoflow.setSootConfig(new IInfoflowConfig() {
	
	@Override
	public void setSootOptions(Options options) {
		List<String> excludeList = new ArrayList<String>();
		excludeList.add("java.");
		excludeList.add("javax.");
		options.set_exclude(excludeList);
		options.set_prepend_classpath(false);
	}
	
});
  	List<String> epoints = new ArrayList<String>();
  	epoints.add("<soot.jimple.infoflow.test.StringTestCode: void methodStringBuilder2()>");
infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
checkInfoflow(infoflow, 1);		
  }
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:21,代码来源:StringTests.java


示例6: exceptionControlFlowTestNoJDK1

import soot.options.Options; //导入依赖的package包/类
@Test
public void exceptionControlFlowTestNoJDK1() throws IOException {
	Infoflow infoflow = initInfoflow();
	infoflow.setTaintWrapper(new EasyTaintWrapper(new File("EasyTaintWrapperSource.txt")));
   	infoflow.setSootConfig(new IInfoflowConfig() {
		
		@Override
		public void setSootOptions(Options options) {
			List<String> excludeList = new ArrayList<String>();
			excludeList.add("java.");
			excludeList.add("javax.");
			options.set_exclude(excludeList);
			options.set_prepend_classpath(false);
		}
		
	});
	
	List<String> epoints = new ArrayList<String>();
	epoints.add("<soot.jimple.infoflow.test.ExceptionTestCode: void exceptionControlFlowTest1()>");
	infoflow.computeInfoflow(appPath, null, epoints, sources, sinks);
	checkInfoflow(infoflow, 1);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:23,代码来源:ExceptionTests.java


示例7: doPrivilegedTest3_NoJDK

import soot.options.Options; //导入依赖的package包/类
@Test(timeout=300000)
public void doPrivilegedTest3_NoJDK() {
   	Infoflow infoflow = initInfoflow();
   	infoflow.setSootConfig(new IInfoflowConfig() {
		
		@Override
		public void setSootOptions(Options options) {
			List<String> excludeList = new ArrayList<String>();
			excludeList.add("java.");
			excludeList.add("javax.");
			options.set_exclude(excludeList);
			options.set_prepend_classpath(false);
		}
		
	});
   	List<String> epoints = new ArrayList<String>();
   	epoints.add("<soot.jimple.infoflow.test.OtherTestCode: void doPrivilegedTest3()>");
	infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
	checkInfoflow(infoflow, 1);
	Assert.assertTrue(infoflow.getResults().isPathBetweenMethods(sink, sourceDeviceId));		
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:22,代码来源:OtherTests.java


示例8: callToReturnTest

import soot.options.Options; //导入依赖的package包/类
@Test(timeout=300000)
public void callToReturnTest() throws IOException{
	// not yet supported
	Infoflow infoflow = initInfoflow();
	infoflow.setInspectSinks(false);
	infoflow.setEnableImplicitFlows(true);
	infoflow.setTaintWrapper(new EasyTaintWrapper("EasyTaintWrapperSource.txt"));
   	infoflow.setSootConfig(new IInfoflowConfig() {
		
		@Override
		public void setSootOptions(Options options) {
			options.set_include(Collections.<String>emptyList());
			List<String> excludeList = new ArrayList<String>();
			excludeList.add("java.");
			excludeList.add("javax.");
			options.set_exclude(excludeList);
			options.set_prepend_classpath(false);
		}
		
	});

	List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.ImplicitFlowTestCode: void callToReturnTest()>");
	infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
	checkInfoflow(infoflow, 1);	
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:27,代码来源:ImplicitFlowTests.java


示例9: implicitFlowTaintWrapperTest

import soot.options.Options; //导入依赖的package包/类
@Test(timeout=300000)
public void implicitFlowTaintWrapperTest() throws IOException{
	Infoflow infoflow = initInfoflow();
	infoflow.setInspectSinks(false);
	infoflow.setEnableImplicitFlows(true);
	infoflow.setTaintWrapper(new EasyTaintWrapper("EasyTaintWrapperSource.txt"));
   	infoflow.setSootConfig(new IInfoflowConfig() {
		
		@Override
		public void setSootOptions(Options options) {
			options.set_include(Collections.<String>emptyList());
			List<String> excludeList = new ArrayList<String>();
			excludeList.add("java.");
			excludeList.add("javax.");
			options.set_exclude(excludeList);
			options.set_prepend_classpath(false);
		}
		
	});

	List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.ImplicitFlowTestCode: void implicitFlowTaintWrapperTest()>");
	infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
	checkInfoflow(infoflow, 1);	
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:26,代码来源:ImplicitFlowTests.java


示例10: implicitFlowTaintWrapperNegativeTest

import soot.options.Options; //导入依赖的package包/类
@Test(timeout=300000)
public void implicitFlowTaintWrapperNegativeTest() throws IOException{
	Infoflow infoflow = initInfoflow();
	infoflow.setInspectSinks(false);
	infoflow.setEnableImplicitFlows(true);
	infoflow.setTaintWrapper(new EasyTaintWrapper(Collections.<String, Set<String>>emptyMap()));
   	infoflow.setSootConfig(new IInfoflowConfig() {
		
		@Override
		public void setSootOptions(Options options) {
			options.set_include(Collections.<String>emptyList());
			List<String> excludeList = new ArrayList<String>();
			excludeList.add("java.");
			excludeList.add("javax.");
			options.set_exclude(excludeList);
			options.set_prepend_classpath(false);
		}
		
	});

	List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.ImplicitFlowTestCode: void implicitFlowTaintWrapperTest()>");
	infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
	negativeCheckInfoflow(infoflow);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:26,代码来源:ImplicitFlowTests.java


示例11: determineExcludedPackages

import soot.options.Options; //导入依赖的package包/类
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.*");
       }
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:21,代码来源:Scene.java


示例12: getDefaultThrowAnalysis

import soot.options.Options; //导入依赖的package包/类
/**
    * Returns the {@link ThrowAnalysis} to be used by default when
    * constructing CFGs which include exceptional control flow.
    *
    * @return the default {@link ThrowAnalysis}
    */
   public ThrowAnalysis getDefaultThrowAnalysis() 
   {
if( defaultThrowAnalysis == null ) {
    int optionsThrowAnalysis = Options.v().throw_analysis();
    switch (optionsThrowAnalysis) {
    case Options.throw_analysis_pedantic:
	defaultThrowAnalysis = PedanticThrowAnalysis.v();
	break;
    case Options.throw_analysis_unit:
	defaultThrowAnalysis = UnitThrowAnalysis.v();
	break;
    default:
	throw new IllegalStateException("Options.v().throw_analysi() == " +
					Options.v().throw_analysis());
    }
}
return defaultThrowAnalysis;
   }
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:25,代码来源:Scene.java


示例13: loadNecessaryClasses

import soot.options.Options; //导入依赖的package包/类
/** Load the set of classes that soot needs, including those specified on the
 *  command-line. This is the standard way of initialising the list of
 *  classes soot should use.
 */
public void loadNecessaryClasses() {
	loadBasicClasses();
    
	for (String name : Options.v().classes()) {
        loadNecessaryClass(name);
    }

    loadDynamicClasses();

    if(Options.v().oaat()) {
    	if(Options.v().process_dir().isEmpty()) {
    		throw new IllegalArgumentException("If switch -oaat is used, then also -process-dir must be given.");
    	}
    } else {
     for( final String path : Options.v().process_dir() ) {
         for (String cl : SourceLocator.v().getClassesUnder(path)) {
         	SootClass theClass = loadClassAndSupport(cl);
         	theClass.setApplicationClass();
         }
     }
    }

    prepareClasses();
    setDoneResolving();
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:30,代码来源:Scene.java


示例14: getMinJavaVersion

import soot.options.Options; //导入依赖的package包/类
@Override
protected int getMinJavaVersion(SootMethod method) {
	final BafBody body = getBafBody(method);		
	int minVersion = Options.java_version_1_1;

	for (Unit u : body.getUnits()) {
		if (u instanceof DynamicInvokeInst) {
			return Options.java_version_1_7;
		}
		if (u instanceof PushInst) {
			if (((PushInst) u).getConstant() instanceof ClassConstant) {
				minVersion = Options.java_version_1_5;
			}
		}
	}

	return minVersion;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:19,代码来源:BafASMBackend.java


示例15: printProfilingInformation

import soot.options.Options; //导入依赖的package包/类
public void printProfilingInformation() {
  long totalTime = totalTimer.getTime();

  G.v().out.println("Time measurements");
  G.v().out.println();

  G.v().out.println("    Main generation: " + toTimeString(mainGeneration, totalTime));

  G.v().out.println();

  G.v().out.println("    Entry points: " + entryPoints);
  G.v().out.println("     Class count: " + classes);

  // Print out time stats.
  G.v().out.println("totalTime:" + toTimeString(totalTimer, totalTime));

  if (Options.v().subtract_gc()) {
    G.v().out.println("Garbage collection was subtracted from these numbers.");
    G.v().out.println(
        "       forcedGC:" + toTimeString(G.v().Timer_forcedGarbageCollectionTimer, totalTime));
  }
}
 
开发者ID:dialdroid-android,项目名称:ic3-dialdroid,代码行数:23,代码来源:Timers.java


示例16: TypeResolver

import soot.options.Options; //导入依赖的package包/类
private TypeResolver(JimpleBody stmtBody, Scene scene)
{
  this.stmtBody = stmtBody;
  hierarchy = ClassHierarchy.classHierarchy(scene);

  OBJECT = hierarchy.OBJECT;
  NULL = hierarchy.NULL;
  typeVariable(OBJECT);
  typeVariable(NULL);
  
  // hack for J2ME library, reported by Stephen Cheng 
  if (!Options.v().j2me()) {
    typeVariable(hierarchy.CLONEABLE);
    typeVariable(hierarchy.SERIALIZABLE);
  }
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:17,代码来源:TypeResolver.java


示例17: ClassHierarchy

import soot.options.Options; //导入依赖的package包/类
private ClassHierarchy(Scene scene)
 {
   if(scene == null)
     {
throw new InternalTypingException();
     }

   G.v().ClassHierarchy_classHierarchyMap.put(scene, this);

   NULL = typeNode(NullType.v());
   OBJECT = typeNode(RefType.v("java.lang.Object"));

   // hack for J2ME library which does not have Cloneable and Serializable
   // reported by Stephen Chen
   if (!Options.v().j2me()) {
     CLONEABLE = typeNode(RefType.v("java.lang.Cloneable"));
     SERIALIZABLE = typeNode(RefType.v("java.io.Serializable"));
   } else {
     CLONEABLE = null;
     SERIALIZABLE = null;
   }

   INT = typeNode(IntType.v());
 }
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:25,代码来源:ClassHierarchy.java


示例18: TypeResolverBV

import soot.options.Options; //导入依赖的package包/类
private TypeResolverBV(JimpleBody stmtBody, Scene scene)
{
  this.stmtBody = stmtBody;
  hierarchy = ClassHierarchy.classHierarchy(scene);

  OBJECT = hierarchy.OBJECT;
  NULL = hierarchy.NULL;
  typeVariable(OBJECT);
  typeVariable(NULL);
  
  // hack for J2ME library, reported by Stephen Cheng 
  if (!Options.v().j2me()) {
    typeVariable(hierarchy.CLONEABLE);
    typeVariable(hierarchy.SERIALIZABLE);
  }
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:17,代码来源:TypeResolverBV.java


示例19: autoSetOptions

import soot.options.Options; //导入依赖的package包/类
public void autoSetOptions() {
	//when no-bodies-for-excluded is enabled, also enable phantom refs	
       if(Options.v().no_bodies_for_excluded())
       	Options.v().set_allow_phantom_refs(true);
	
	//when reflection log is enabled, also enable phantom refs	
    CGOptions cgOptions = new CGOptions( PhaseOptions.v().getPhaseOptions("cg") );
    String log = cgOptions.reflection_log();
    if(log!=null && log.length()>0) {
    	Options.v().set_allow_phantom_refs(true);
    }
    
    //if phantom refs enabled,  ignore wrong staticness in type assigner
    if(Options.v().allow_phantom_refs()) {
    	PhaseOptions.v().setPhaseOption("jb.tr", "ignore-wrong-staticness:true");
    }
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:18,代码来源:Main.java


示例20: generateInnerClassReferences

import soot.options.Options; //导入依赖的package包/类
/**
 * Emits the bytecode for all references to inner classes if present
 */
protected void generateInnerClassReferences() {
	if (sc.hasTag("InnerClassAttribute")
			&& !Options.v().no_output_inner_classes_attribute()) {
		InnerClassAttribute ica = (InnerClassAttribute) sc
				.getTag("InnerClassAttribute");
		List<InnerClassTag> sortedTags = new ArrayList<InnerClassTag>(ica.getSpecs());
		Collections.sort(sortedTags, new SootInnerClassComparator());
		for (InnerClassTag ict : sortedTags) {
			String name = slashify(ict.getInnerClass());
			String outerClassName = slashify(ict.getOuterClass());
			String innerName = slashify(ict.getShortName());
			int access = ict.getAccessFlags();
			cv.visitInnerClass(name, outerClassName, innerName, access);
		}
	}
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:20,代码来源:AbstractASMBackend.java



注:本文中的soot.options.Options类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ChunkWatchEvent类代码示例发布时间:2022-05-21
下一篇:
Java AbstractConnector类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap