当前位置: 首页>>代码示例>>Java>>正文


Java MultiMap类代码示例

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


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

示例1: collectCallbackMethodsIncremental

import soot.util.MultiMap; //导入依赖的package包/类
/**
 * Incrementally collects the callback methods for all Android default
 * handlers implemented in the source code. This just processes the contents
 * of the worklist.
 * Note that this operation runs inside Soot, so this method only registers
 * a new phase that will be executed when Soot is next run
 */
public void collectCallbackMethodsIncremental() {
	Transform transform = new Transform("wjtp.ajc", new SceneTransformer() {
		protected void internalTransform(String phaseName, @SuppressWarnings("rawtypes") Map options) {
			// Process the worklist from last time
			System.out.println("Running incremental callback analysis for " + callbackWorklist.size()
					+ " components...");
			MultiMap<String, SootMethodAndClass> workListCopy =
					new HashMultiMap<String, SootMethodAndClass>(callbackWorklist);
			for (String className : workListCopy.keySet()) {
				List<MethodOrMethodContext> entryClasses = new LinkedList<MethodOrMethodContext>();
				for (SootMethodAndClass am : workListCopy.get(className))
					entryClasses.add(Scene.v().getMethod(am.getSignature()));
				analyzeRechableMethods(Scene.v().getSootClass(className), entryClasses);
				callbackWorklist.remove(className);
			}
			System.out.println("Incremental callback analysis done.");
		}
	});
	PackManager.v().getPack("wjtp").add(transform);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:28,代码来源:AnalyzeJimpleClass.java

示例2: onResultsAvailable

import soot.util.MultiMap; //导入依赖的package包/类
@Override
public void onResultsAvailable(IInfoflowCFG cfg, InfoflowResults results) {
	log.info("FlowDroid has finished. Duration: " + (System.currentTimeMillis() - Main.startTime) +" ms.");
	Main.startTime = System.currentTimeMillis();
	Settings.instance.setDummyMainToLibraryClass();
	this.results = results;
	
	if (log.isDebugEnabled()) {
		log.debug("");
		log.debug("InfoFlow Results");
		MultiMap<ResultSinkInfo, ResultSourceInfo> r = results.getResults();
		for (ResultSinkInfo k : r.keySet()) {
			log.debug("ResultSinkInfo: "+ k);

			for (ResultSourceInfo rsi: r.get(k)) {
				log.debug("  source: "+ rsi);
			}
		}
		log.debug("");
	}


	log.info("Starting bytecode instrumentation.");
	
	log.info("Adding code to initialize PEPs.");
	Util.initializePePInAllPossibleClasses(Settings.instance.getApkPath());
	
	log.info("Build code for new 'WaitPDPActivity"); // building the code has to be done here (not in the Main class, otherwise Jimple validation will fail
	String mainActivityClass = UpdateManifestAndCodeForWaitPDP.getMainActivityName(Settings.instance.getApkPath());
	String packageName = UpdateManifestAndCodeForWaitPDP.getApplicationPackageName(Settings.instance.getApkPath());
	UpdateManifestAndCodeForWaitPDP.updateWaitPDPActivity(packageName, mainActivityClass);
	
	// update packagename in field of WaitPDP class
	SootClass sc = Scene.v().getSootClass(Settings.INSTRUMENTATION_HELPER_JAVA);
	SootField sf1 = sc.getFieldByName("applicationPackageName");
	Util.changeConstantStringInField(sf1, packageName);
	
	log.info("Adding Policy Enforcement Points (PEPs).");
	doAccessControlChecks(cfg);
	
	log.info("Instrumentation is done.");
	
	if (Settings.mustOutputJimple()) {
		log.info("-------- Dumping Jimple bodies.");
		Main.dumpJimple();
		log.info("--------");
	}
}
 
开发者ID:secure-software-engineering,项目名称:DroidForce,代码行数:49,代码来源:PolicyEnforcementPoint.java


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