package android.security.extractor;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.Platform;


public class Utility {
	private static final String metamodelsFolder = "metamodels/";
	private static final String resourcesFolder = "res/";
	private static final String TransFolder = "Transformations/";
	private static final String EmptyModel = "Models/";
	IFile emptyModel1;
	private static final String APIMapping = "APIMapping/";
	private static final String ModelsFolder = "Models/";
	
	public static final String JAVA_METAMODEL_PATH = "http://www.eclipse.org/MoDisco/Java/0.2.incubation/java";
	public static final String XML_METAMODEL_PATH = "http://www.eclipse.org/MoDisco/Xml/0.1.incubation/XML";
    public static final String ANOMALY_METAMODEL_PATH = getLocation() + metamodelsFolder + "ANO.ecore";
    public static final String ICC_METAMODEL_PATH = getLocation() + metamodelsFolder + "ICCMM.ecore";
	public static final String ANDROID_SECURITY_METAMODEL_PATH = getLocation() + metamodelsFolder + "ASAMM.ecore";
	
	public static final String API_MAPPING_FILE_PATH = getLocation() + APIMapping + "sdk_map_permissions-final_xml.xmi";
	
	public static final String Empty_Android_Security_Model_Path = getLocation() + EmptyModel + "EmpityAndroidSecurityModel.xmi";
	
	
	
	public static final String xml_MODELS = getLocation() + ModelsFolder + "AndroidManifest_xml.xmi";
	public static final String java_MODELS = getLocation() + ModelsFolder + "android app for Smart Keyboard PRO_java.xmi";
	public static final String ANDROID_MODELS = getLocation() + ModelsFolder + "android.xmi";
	public static final String ANomaly_MODELS = getLocation() + ModelsFolder + "androidanomalyy.xmi";
	public static final String EXTRACT_ANDROID_MODELS = getLocation() + ModelsFolder + "androidDDD.xmi";
	public static final String ANomaly2_MODELS = getLocation() + ModelsFolder + "androidanomalyy2222.xmi";
	

	public static final String EMPTY_XMI_XML_PATH = getLocation().replaceFirst("file:/", "") + resourcesFolder + "empty_xml.xmi";
	public static final String EMPTY_XMI_JAVA_PATH = getLocation().replaceFirst("file:/", "") + resourcesFolder + "empty_java_project.xmi";
	
	public static final String XMI_XML_PATH = getLocation().replaceFirst("file:/", "") + resourcesFolder + "AndroidManifest_xml.xmi";
	public static final String XMI_JAVA_PATH = getLocation().replaceFirst("file:/", "") + resourcesFolder + "android app for Smart Keyboard PRO.xmi";
	
	
	
	public static final String EXTRACTING_ANDROID_SECURITY =getLocation() + TransFolder + "AndroidSecurityAspectsModeling.asm";
	public static final String EXTRACTING_ANDROID_SECURITY1 =EXTRACTING_ANDROID_SECURITY.replace("file:/", "");
	
	public static final String CHECKING_INTENT_SPOOFING_INTRA_APP =getLocation() + TransFolder + "IntentSpoofingInIntraAppCommunication.asm";
	public static final String CHECKING_INTENT_SPOOFING_INTRA_APP_PATH =CHECKING_INTENT_SPOOFING_INTRA_APP.replace("file:/", "");
	
	public static final String CHECKING_Unauthorized_IntentReceipt_INTRA_APP =getLocation() + TransFolder + "UnauthorizedIntentReceiptIntraAppCommunication.asm";
	public static final String CHECKING_Unauthorized_IntentReceipt_INTRA_APP_PATH =CHECKING_Unauthorized_IntentReceipt_INTRA_APP.replace("file:/", "");
	
	public static final String CHECKING_PASSIVE_DATA_LEAK_INTRA_APP =getLocation() + TransFolder + "PassiveDataLeakVulnerabilityDetectionIntraApp.asm";
	public static final String CHECKING_PASSIVE_DATA_LEAK_INTRA_APP_PATH =CHECKING_PASSIVE_DATA_LEAK_INTRA_APP.replace("file:/", "");
	
	public static final String CHECKING_CONTENT_POLLUTION_INTRA_APP =getLocation() + TransFolder + "ContentPollutionVulnerabilityDetectionIntraApp.asm";
	public static final String CHECKING_CONTENT_POLLUTION_INTRA_APP_PATH =CHECKING_CONTENT_POLLUTION_INTRA_APP.replace("file:/", "");
	
	public static final String CHECKING_PRIVILEGE_ESCALATION_INTRA_APP =getLocation() + TransFolder + "PrivilegeEscalationIntraApp.asm";
	public static final String CHECKING_PRIVILEGE_ESCALATION_INTRA_APP_PATH =CHECKING_PRIVILEGE_ESCALATION_INTRA_APP.replace("file:/", "");
	
	public static final String CHECKING_CUSTOM_PERMISSION_INTRA_APP =getLocation() + TransFolder + "CustomPermissionVulnerabilityIntraApp.asm";
	public static final String CHECKING_CUSTOM_PERMISSION_INTRA_APP_PATH =CHECKING_CUSTOM_PERMISSION_INTRA_APP.replace("file:/", "");
	
	
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Ten =getLocation() + TransFolder + "ICCModelExtractorForOneToTenApps.asm";
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Ten_Path =ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Ten.replace("file:/", "");
	
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Twenty =getLocation() + TransFolder + "ICCModelExtractorForOneToTwentyApps.asm";
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Twenty_Path =ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Twenty.replace("file:/", "");
	
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Thirty =getLocation() + TransFolder + "ICCModelExtractorForOneToThirtyApps.asm";
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Thirty_Path =ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Thirty.replace("file:/", "");
	
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Forty =getLocation() + TransFolder + "ICCModelExtractorForOneToFortyApps.asm";
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Forty_Path =ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Forty.replace("file:/", "");
	
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Fifty =getLocation() + TransFolder + "ICCModelExtractorForOneToFiftyApps.asm";
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Fifty_Path =ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Fifty.replace("file:/", "");
	
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Sixty =getLocation() + TransFolder + "ICCModelExtractorForOneToSixtyApps.asm";
	public static final String ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Sixty_Path =ICC_MODEL_EXTRACTOR_For_A_Bundle_With_One_To_Sixty.replace("file:/", "");
	
	public static final String CHECKING_INTENT_SPOOFING_INTER_APP =getLocation() + TransFolder + "IntentSpoofingInInterAppCommunication.asm";
	public static final String CHECKING_INTENT_SPOOFING_INTER_APP_Path =CHECKING_INTENT_SPOOFING_INTER_APP.replace("file:/", "");
	
	public static final String CHECKING_INTENT_SPOOFING_INTER_APP_Explicit_Communication =getLocation() + TransFolder + "IntentSpoofingInInterAppLevelForExplicitCommunications.asm";
	public static final String CHECKING_INTENT_SPOOFING_INTER_APP_Explicit_Communication_Path =CHECKING_INTENT_SPOOFING_INTER_APP_Explicit_Communication.replace("file:/", "");
	
	public static final String CHECKING_Unauthorized_IntentReceipt_INTER_APP =getLocation() + TransFolder + "UnauthorizedIntentReceiptInterAppCommunication.asm";
	public static final String CHECKING_Unauthorized_IntentReceipt_INTER_APP_PATH =CHECKING_Unauthorized_IntentReceipt_INTER_APP.replace("file:/", "");
	
	public static final String CHECKING_PASSIVE_DATA_LEAK_INTER_APP =getLocation() + TransFolder + "PassiveDataLeakVulnerabilityDetectionInterApp.asm";
	public static final String CHECKING_PASSIVE_DATA_LEAK_INTER_APP_PATH =CHECKING_PASSIVE_DATA_LEAK_INTER_APP.replace("file:/", "");
	
	public static final String CHECKING_CONTENT_POLLUTION_INTER_APP =getLocation() + TransFolder + "ContentPollutionVulnerabilityDetectionInterApp.asm";
	public static final String CHECKING_CONTENT_POLLUTION_INTER_APP_PATH =CHECKING_CONTENT_POLLUTION_INTER_APP.replace("file:/", "");
	
	public static final String CHECKING_PRIVILEGE_ESCALATION_INTER_APP =getLocation() + TransFolder + "PrivilegeEscalationInterApp.asm";
	public static final String CHECKING_PRIVILEGE_ESCALATION_INTER_APP_PATH =CHECKING_PRIVILEGE_ESCALATION_INTER_APP.replace("file:/", "");
	
	public static final String CHECKING_CUSTOM_PERMISSION_INTER_APP =getLocation() + TransFolder + "CustomPermissionVulnerabilityInterApp.asm";
	public static final String CHECKING_CUSTOM_PERMISSION_INTER_APP_PATH =CHECKING_CUSTOM_PERMISSION_INTER_APP.replace("file:/", "");
	
	
	public static final String getLocation() {	
		
		String t = Platform.getBundle(Activator.PLUGIN_ID).getLocation().replaceFirst("reference:", ""); 
		return t ;
	}

}
