soot.jimple.infoflow.android.iccta.MessageHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of soot-infoflow-android Show documentation
Show all versions of soot-infoflow-android Show documentation
Android-specific components of FlowDroid
package soot.jimple.infoflow.android.iccta;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import soot.Scene;
import soot.SootClass;
public class MessageHandler {
private static MessageHandler instance = new MessageHandler();
private MessageHandler() {
};
public static MessageHandler v() {
return instance;
}
private Set handlerImpls = null;
public Set getAllHandlers() {
if (null == handlerImpls) {
handlerImpls = new HashSet();
SootClass handler = Scene.v().getSootClass("android.os.Handler");
for (Iterator iter = Scene.v().getApplicationClasses().snapshotIterator(); iter.hasNext();) {
SootClass sootClass = iter.next();
SootClass tmpClass = sootClass;
while (sootClass != null) {
if (sootClass.getName().equals(handler.getName())) {
handlerImpls.add(tmpClass);
break;
}
sootClass = sootClass.getSuperclassUnsafe();
}
}
}
return handlerImpls;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy