// Path: analysis/src/main/java/uk/ac/cam/gpe21/droidssl/analysis/Vulnerability.java
// public final class Vulnerability {
// 	private final SootClass clazz;
// 	private final SootMethod method;
// 	private final VulnerabilityType type;
// 	private final VulnerabilityState state;
// 
// 	public Vulnerability(SootClass clazz, VulnerabilityType type, VulnerabilityState state) {
// 		this.clazz = clazz;
// 		this.method = null;
// 		this.type = type;
// 		this.state = state;
// 	}
// 
// 	public Vulnerability(SootMethod method, VulnerabilityType type, VulnerabilityState state) {
// 		this.clazz = method.getDeclaringClass();
// 		this.method = method;
// 		this.type = type;
// 		this.state = state;
// 	}
// 
// 	public SootClass getClazz() {
// 		return clazz;
// 	}
// 
// 	public SootMethod getMethod() {
// 		return method;
// 	}
// 
// 	public VulnerabilityType getType() {
// 		return type;
// 	}
// 
// 	public VulnerabilityState getState() {
// 		return state;
// 	}
// 
// 	@Override
// 	public boolean equals(Object o) {
// 		if (this == o) return true;
// 		if (o == null || getClass() != o.getClass()) return false;
// 
// 		Vulnerability that = (Vulnerability) o;
// 
// 		if (!clazz.equals(that.clazz)) return false;
// 		if (method != null ? !method.equals(that.method) : that.method != null) return false;
// 		if (state != that.state) return false;
// 		if (type != that.type) return false;
// 
// 		return true;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		int result = clazz.hashCode();
// 		result = 31 * result + (method != null ? method.hashCode() : 0);
// 		result = 31 * result + type.hashCode();
// 		result = 31 * result + state.hashCode();
// 		return result;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		if (method == null) {
// 			return clazz.getName() + "\t" + type + "\t" + state;
// 		} else {
// 			return clazz.getName() + "::" + method.getName() + "\t" + type + "\t" + state;
// 		}
// 	}
// }


import soot.SceneTransformer;
import uk.ac.cam.gpe21.droidssl.analysis.Vulnerability;
import java.util.Map;
import java.util.Set;
/*
 * Copyright 2013-2014 Graham Edgecombe
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package uk.ac.cam.gpe21.droidssl.analysis.trans;



public final class AnalysisTransformer extends SceneTransformer {
	private final Set<Vulnerability> vulnerabilities;
	private final Analyser[] analysers;

	public AnalysisTransformer(Set<Vulnerability> vulnerabilities, Analyser... analysers) {
		this.vulnerabilities = vulnerabilities;
		this.analysers = analysers;
	}

	@Override
	protected void internalTransform(String phase, Map<String, String> options) {
		int size;
		do {
			size = vulnerabilities.size();
			for (Analyser analyser : analysers) {
// Path: analysis/src/main/java/uk/ac/cam/gpe21/droidssl/analysis/Vulnerability.java
// public final class Vulnerability {
// 	private final SootClass clazz;
// 	private final SootMethod method;
// 	private final VulnerabilityType type;
// 	private final VulnerabilityState state;
// 
// 	public Vulnerability(SootClass clazz, VulnerabilityType type, VulnerabilityState state) {
// 		this.clazz = clazz;
// 		this.method = null;
// 		this.type = type;
// 		this.state = state;
// 	}
// 
// 	public Vulnerability(SootMethod method, VulnerabilityType type, VulnerabilityState state) {
// 		this.clazz = method.getDeclaringClass();
// 		this.method = method;
// 		this.type = type;
// 		this.state = state;
// 	}
// 
// 	public SootClass getClazz() {
// 		return clazz;
// 	}
// 
// 	public SootMethod getMethod() {
// 		return method;
// 	}
// 
// 	public VulnerabilityType getType() {
// 		return type;
// 	}
// 
// 	public VulnerabilityState getState() {
// 		return state;
// 	}
// 
// 	@Override
// 	public boolean equals(Object o) {
// 		if (this == o) return true;
// 		if (o == null || getClass() != o.getClass()) return false;
// 
// 		Vulnerability that = (Vulnerability) o;
// 
// 		if (!clazz.equals(that.clazz)) return false;
// 		if (method != null ? !method.equals(that.method) : that.method != null) return false;
// 		if (state != that.state) return false;
// 		if (type != that.type) return false;
// 
// 		return true;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		int result = clazz.hashCode();
// 		result = 31 * result + (method != null ? method.hashCode() : 0);
// 		result = 31 * result + type.hashCode();
// 		result = 31 * result + state.hashCode();
// 		return result;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		if (method == null) {
// 			return clazz.getName() + "\t" + type + "\t" + state;
// 		} else {
// 			return clazz.getName() + "::" + method.getName() + "\t" + type + "\t" + state;
// 		}
// 	}
// }


// Path: analysis/src/main/java/uk/ac/cam/gpe21/droidssl/analysis/trans/AnalysisTransformer.java
import soot.SceneTransformer;
import uk.ac.cam.gpe21.droidssl.analysis.Vulnerability;
import java.util.Map;
import java.util.Set;

/*
 * Copyright 2013-2014 Graham Edgecombe
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package uk.ac.cam.gpe21.droidssl.analysis.trans;



public final class AnalysisTransformer extends SceneTransformer {
	private final Set<Vulnerability> vulnerabilities;
	private final Analyser[] analysers;

	public AnalysisTransformer(Set<Vulnerability> vulnerabilities, Analyser... analysers) {
		this.vulnerabilities = vulnerabilities;
		this.analysers = analysers;
	}

	@Override
	protected void internalTransform(String phase, Map<String, String> options) {
		int size;
		do {
			size = vulnerabilities.size();
			for (Analyser analyser : analysers) {
				analyser.analyse();