private AndroidEntryPointCreator createEntryPointCreator() { AndroidEntryPointCreator entryPointCreator = new AndroidEntryPointCreator(new ArrayList<String>( this.entrypoints)); Map<String, List<String>> callbackMethodSigs = new HashMap<String, List<String>>(); for (String className : this.callbackMethods.keySet()) { List<String> methodSigs = new ArrayList<String>(); callbackMethodSigs.put(className, methodSigs); for (SootMethodAndClass am : this.callbackMethods.get(className)) methodSigs.add(am.getSignature()); } entryPointCreator.setCallbackFunctions(callbackMethodSigs); return entryPointCreator; }
public AndroidEntryPointCreator createEntryPointCreator() { AndroidEntryPointCreator entryPointCreator = new AndroidEntryPointCreator(new ArrayList<String>(this.entrypoints)); Map<String, List<String>> callbackMethodSigs = new HashMap<String, List<String>>(); for (String className : this.callbackMethods.keySet()) { List<String> methodSigs = new ArrayList<String>(); callbackMethodSigs.put(className, methodSigs); for (SootMethodAndClass am : this.callbackMethods.get(className)) { methodSigs.add(am.getSignature()); } } entryPointCreator.setCallbackFunctions(callbackMethodSigs); return entryPointCreator; }
public SootMethod generateDummyMainMethod(List<String> entryPoints, String sootClassName) { List<String> androidClasses = new ArrayList<String>(); androidClasses.add(sootClassName); SootMethod mainMethod = new SootMethod(DUMMY_MAIN_METHOD, new ArrayList<Type>(), VoidType.v(), Modifier.PUBLIC);// | Modifier.STATIC); //no need be static JimpleBody body = Jimple.v().newBody(mainMethod); mainMethod.setActiveBody(body); SootClass compSootClass = Scene.v().getSootClass(sootClassName); compSootClass.addMethod(mainMethod); //this is mandatory, the default dummyMainMethod is static, so they //do not deal thisIdentity. since we don't need static dummyMainMethod, //we should define it explicit body.insertIdentityStmts(); Map<String, List<String>> callbackFunctions = new HashMap<String, List<String>>(); callbackFunctions.put(sootClassName, getCallbackFunctions(compSootClass)); AndroidEntryPointCreator androidEPCreator = new AndroidEntryPointCreator(androidClasses); androidEPCreator.setCallbackFunctions(callbackFunctions); return androidEPCreator.createDummyMain(mainMethod); }
public PolicyEnforcementPoint(Map<String, EventInformation> eventInformation, Set<SourceSinkDefinition> sources, Set<SourceSinkDefinition> sinks, AndroidEntryPointCreator entryPointCreator){ this.allEventInformation = eventInformation; this.sources = sources; this.sinks = sinks; this.entryPointCreator = entryPointCreator; }
/** * Gets the entry point creator used for generating the dummy main method emulating the Android lifecycle and the * callbacks. Make sure to call calculateSourcesSinksEntryPoints() first, or you will get a null result. * * @return The entry point creator */ public AndroidEntryPointCreator getEntryPointCreator() { return entryPointCreator; }
/** * Gets the entry point creator used for generating the dummy main method emulating the Android * lifecycle and the callbacks. Make sure to call calculateSourcesSinksEntryPoints() first, or you * will get a null result. * * @return The entry point creator */ public AndroidEntryPointCreator getEntryPointCreator() { return entryPointCreator; }