All Downloads are FREE. Search and download functionalities are using the official Maven repository.

soot.jimple.infoflow.android.iccta.MessageHandler Maven / Gradle / Ivy

There is a newer version: 2.14.1
Show newest version
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