package android.security.extractor.logic;


import java.io.IOException;

import java.util.LinkedList;


import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.m2m.atl.core.ATLCoreException;
import android.security.execute.transformations.ICCModelExtractorForAbundleOFOneToTenApps;
import android.security.execute.transformations.ICCModelExtractorForAbundleOFOneToTwentyApps;
import android.security.execute.transformations.ICCModelExtractorForAbundleOFOneToThirtyApps;
import android.security.execute.transformations.ICCModelExtractorForAbundleOFOneToFortyApps;
import android.security.execute.transformations.ICCModelExtractorForAbundleOFOneToFiftyApps;
import android.security.execute.transformations.ICCModelExtractorForAbundleOFOneToSixtyApps;
import android.security.execute.transformations.AndroidSecurityExtractor;
import android.security.execute.transformations.IntraAppIntentSpoofing;
import android.security.execute.transformations.IntraAppUnauthorizedIntentReceipt;
import android.security.execute.transformations.IntraAppPassiveDataLeak;
import android.security.execute.transformations.IntraAppContentPollution;
import android.security.execute.transformations.IntraAppPrivilegeEscalation;
import android.security.execute.transformations.IntraAppCustomPermissionVulnerability;
import android.security.execute.transformations.InterAppIntentSpoofing;
import android.security.execute.transformations.InterAppIntentSpoofingExplicitCommunication;
import android.security.execute.transformations.InterAppUnauthorizedIntentReceipt;
import android.security.execute.transformations.InterAppPassiveDataLeak;
import android.security.execute.transformations.InterAppContentPollution;
import android.security.execute.transformations.InterAppPrivilegeEscalation;
import android.security.execute.transformations.InterAppCustomPermission;



public class AndroidModelExtractor {
	
	
	private String AndroidSecurityPath1;
	
	LinkedList<IJavaProject> projectList = new LinkedList<IJavaProject>();
	LinkedList<IFile> manifestList= new LinkedList<IFile>();
	LinkedList<IFile> javaModelList= new LinkedList<IFile>();
	IProject [] projectsOfApps;
	IProject projectsOfApp;
	private String XMLModel;
	private String JAVAModel;
	private String AndroidSecurityModel;
	private String AndroidModel;//input model for intent spoofing and UnauthorizedIntentReceipt in intra app
	private String IntentSpoofingModelIntraApp;//output model for intent spoofing in intra app
	private String UnauthorizedIntentReceiptIntraApp;//output model for UnauthorizedIntentReceipt in intra app
	private String PassiveDataLeakIntraApp;//output model for passive data leak  in intra app
	private String ContentPollutionIntraApp;//output model for content pollution in intra app
	private String PrivilegeEscalationIntraApp;//output model for privilege escalation in intra app
	private String CustomPermissionIntraApp;//output model for custom permission in intra app
	private String ICCModel;
	private String IntentSpoofingModelInterApp;//output model for intent spoofing in inter app
	private String IntentSpoofingModelInterAppExplicitCommunication;//output model for intent spoofing in inter app ExplicitCommunication
	private String UnauthorizedIntentReceiptInterApp;//output model for UnauthorizedIntentReceipt in inter app
	private String PassiveDataLeakInterApp;//output model for passive data leak in inter app
	private String ContentPollutionInterApp;//output model for Content Pollution in inter app
	private String PrivilegeEscalationInterApp;//output model for Privilege Escalation in inter app
	private String CustomPermissionInterApp;//output model for Privilege Escalation in inter app
	
	private String ICCModelForAnalysis;// input model for intent spoofing and UnauthorizedIntentReceipt in inter app
	
	LinkedList<IFile> androidModels= new LinkedList<IFile>();
	LinkedList<IFile> androidModelsList= new LinkedList<IFile>();
	IFile [] androidModelsList1;
	IFile emptyModel;
	IFile InterComponentCommunicationModel;// input model for intent spoofing and UnauthorizedIntentReceipt in inter app
	
	private Integer numberOfApps;

	
	public AndroidModelExtractor(LinkedList<IJavaProject> projectList, LinkedList<IFile> manifestList, LinkedList<IFile> javaModelList, Integer numberOfApps, IProject [] projects) {
		
		this.projectList=projectList;
		this.projectsOfApps=projects;
		this.manifestList=manifestList;
		this.javaModelList=javaModelList;
		this.numberOfApps=numberOfApps;
		
		System.out.print(" number of list apps----------------->>>>>>>>>>>   "+ this.projectList.size()+ "          " + "\n");
		
		System.out.print(" number of java model----------------->>>>>>>>>>>   "+ this.javaModelList.size()+ "          " + "\n");
		
	}
	
	public String getFullPath(String path) {
		String output = "";
		if (path.startsWith("platform:/resource/")) {
			String workspacePath = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile().getPath();
			String filePath = path.replaceAll("platform:/resource/", "");
			output = workspacePath + "\\" + filePath.replaceAll("/", "\\\\");
		}
		else if (path.startsWith("file:/")) {
			output = path.replaceAll("file:/", "");
		}
		
		return output;
	}
	
public void execute() throws IOException, ATLCoreException, CoreException {
		
		//create Android security model:
		System.out.print(" running for each app  "+ "          "+"\n");
		for(int i = 0; i < numberOfApps; i++) 
		{
			long startTimeForCreateAndroidSecurityModelForCurrentApp = System.currentTimeMillis();//for create Android Model for each app
			System.out.print("Android Security Extractor   "+ "          " +"\n");
			this.extractSecurityFromAndroid(projectList.get(i), javaModelList.get(i), manifestList.get(i));
			long endTimeForCreateAndroidSecurityModelForCurrentApp = System.currentTimeMillis();//for end of create Android Model for each app
			long totalTimeAndroidSecurityExt = endTimeForCreateAndroidSecurityModelForCurrentApp - startTimeForCreateAndroidSecurityModelForCurrentApp;
			System.out.println("--------------TimeForCreateAndroidModelFor---------------->>>:"+"   "+ projectList.get(i).getElementName()+ "==" + "  "+ totalTimeAndroidSecurityExt + "\n");
		
		}
		
		System.out.print(" end running for each app  "+ "          "+"\n");
		//TODO:
		
		//Intent Spoofing Analysis in intra app level
       for(int i = 0; i < projectsOfApps.length; i++) 	
		{
			if(projectsOfApps [i].hasNature(JavaCore.NATURE_ID) && projectsOfApps [i].isOpen()  && projectsOfApps [i].getName() !="RemoteSystemsTempFiles" && projectsOfApps [i].getName() !="RequiredMetaModel")
			{
				if (projectsOfApps [i].getFile("IntentSpoofing.xmi").exists())
				{System.out.println("intra app analysis is done before for this app (IntentSpoofing)"+"                   "+"\n");
					continue;
				}
		      this.checkingIntentspoofingInIntraApp(projectsOfApps [i], projectsOfApps [i].getFile(projectsOfApps [i].getName().toString() + "_" + "AndroidApplicationSecurityAspects.xmi"));
			}
		}

        // Unauthorized Intent Receipt in intra app level
       for(int i = 0; i < projectsOfApps.length; i++) 	
		{
			if(projectsOfApps [i].hasNature(JavaCore.NATURE_ID) && projectsOfApps [i].isOpen()  && projectsOfApps [i].getName() !="RemoteSystemsTempFiles" && projectsOfApps [i].getName() !="RequiredMetaModel")
			{
				if (projectsOfApps [i].getFile("UnauthorizedIntentReceipt.xmi").exists())
				{System.out.println("intra app analysis is done before for this app (UnauthorizedIntentReceipt)"+"                   " + "\n");
					continue;
				}
		     this.checkingUnauthorizedIntentReceiptInIntraApp(projectsOfApps [i], projectsOfApps [i].getFile(projectsOfApps [i].getName().toString() + "_" + "AndroidApplicationSecurityAspects.xmi"));
			}
		}
      
		//Passive Data Leak in intra app level
	       for(int i = 0; i < projectsOfApps.length; i++) 	
			{
				if(projectsOfApps [i].hasNature(JavaCore.NATURE_ID) && projectsOfApps [i].isOpen()  && projectsOfApps [i].getName() !="RemoteSystemsTempFiles" && projectsOfApps [i].getName() !="RequiredMetaModel")
				{
					if (projectsOfApps [i].getFile("PassiveDataLeak.xmi").exists())
					{System.out.println("intra app analysis is done before for this app (PassiveDataLeak)"+"                   "+"\n");
						continue;
					}
			      this.checkingPassiveDataLeakInIntraApp(projectsOfApps [i], projectsOfApps [i].getFile(projectsOfApps [i].getName().toString() + "_" + "AndroidApplicationSecurityAspects.xmi"));
				}
			}
		
	     //Content Pollution in intra app level
	       for(int i = 0; i < projectsOfApps.length; i++) 	
			{
				if(projectsOfApps [i].hasNature(JavaCore.NATURE_ID) && projectsOfApps [i].isOpen()  && projectsOfApps [i].getName() !="RemoteSystemsTempFiles" && projectsOfApps [i].getName() !="RequiredMetaModel")
				{
					long startTimeForContentPollutionAnalysisForCurrentApp = System.currentTimeMillis();//for Content Pollution Analysis for each app
					if (projectsOfApps [i].getFile("ContentPollution.xmi").exists())
					{System.out.println("intra app analysis is done before for this app (ContentPollution)"+"                   "+"\n");
						continue;
					}
			      this.checkingContentPollutionInIntraApp(projectsOfApps [i], projectsOfApps [i].getFile(projectsOfApps [i].getName().toString() + "_" + "AndroidApplicationSecurityAspects.xmi"));
			      long endTimeForContentPollutionAnalysisForCurrentApp = System.currentTimeMillis();//for end of PassiveDataLeak Analysis for each app
				}
			}
	       
	     //Privilege escalation in intra app level
	       for(int i = 0; i < projectsOfApps.length; i++) 	
			{
				if(projectsOfApps [i].hasNature(JavaCore.NATURE_ID) && projectsOfApps [i].isOpen()  && projectsOfApps [i].getName() !="RemoteSystemsTempFiles" && projectsOfApps [i].getName() !="RequiredMetaModel")
				{
					if (projectsOfApps [i].getFile("PrivilegeEscalation.xmi").exists())
					{System.out.println("intra app analysis is done before for this app (PrivilegeEscalation)"+"                   "+"\n");
						continue;
					}
			      this.checkingPrivilegeEscalationInIntraApp(projectsOfApps [i], projectsOfApps [i].getFile(projectsOfApps [i].getName().toString() + "_" + "AndroidApplicationSecurityAspects.xmi"));
				}
			}
	       
	     //Custom permission in intra app level
	       for(int i = 0; i < projectsOfApps.length; i++) 	
			{
				if(projectsOfApps [i].hasNature(JavaCore.NATURE_ID) && projectsOfApps [i].isOpen()  && projectsOfApps [i].getName() !="RemoteSystemsTempFiles" && projectsOfApps [i].getName() !="RequiredMetaModel")
				{
					if (projectsOfApps [i].getFile("CustomPermissionVulnerability.xmi").exists())
					{System.out.println("intra app analysis is done before for this app (CustomPermissionVulnerability)"+"                   "+"\n");
						continue;
					}
			      this.checkingCustomPermissionInIntraApp(projectsOfApps [i], projectsOfApps [i].getFile(projectsOfApps [i].getName().toString() + "_" + "AndroidApplicationSecurityAspects.xmi"));
				}
			}
	       
	  	 
		//collect android security models in a list:
		for(int i = 0; i < projectsOfApps.length; i++) 	
		{
			if(projectsOfApps [i].hasNature(JavaCore.NATURE_ID) && projectsOfApps [i].isOpen()  && projectsOfApps [i].getName() !="RemoteSystemsTempFiles" && projectsOfApps [i].getName() !="RequiredMetaModel")
			{
		   androidModels.add(projectsOfApps [i].getFile(projectsOfApps [i].getName() + "_" + "AndroidApplicationSecurityAspects.xmi"));
			}
		}
		System.out.println("intra app analysis is done before for this app (UnauthorizedIntentReceipt)"+"                   "+ androidModels.getFirst().getLocation()+ "\n");
		for(int i = 0; i < projectsOfApps.length; i++) 
		{
			 if(projectsOfApps [i].getName().endsWith("RequiredMetaModel"))
			 {
				 emptyModel= projectsOfApps [i].getFile("EmpityAndroidSecurityModel.xmi");
				 ICCModel="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+projectsOfApps [i].getName()+ "/"+ "ICCModel.xmi";
				 System.out.print(" put models in list " + "            " + "\n");
			 }
			
		}
		
		System.out.print(" number of android security models ----->>>>>  "+  androidModels.size()+"          "+ "\n");
		System.out.print(" empty  models ----->>>>>  "+  this.emptyModel.getLocation().toString()+"          "+ "\n");
		
	
		System.out.print("Call ICC Model extractor"+ "   "+ "\n");
		this.ICCModelExtractorForAbundleOFApps(androidModels, emptyModel, ICCModel);
		 
		
		
		
		for(int i = 0; i < projectsOfApps.length; i++) 
		{
			 if(projectsOfApps [i].getName().endsWith("RequiredMetaModel"))
			 {
				 InterComponentCommunicationModel=projectsOfApps [i].getFile("ICCModel.xmi");
				 IntentSpoofingModelInterApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+projectsOfApps [i].getName()+ "/"+ "IntentSpoofing.xmi";
				 IntentSpoofingModelInterAppExplicitCommunication="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+projectsOfApps [i].getName()+ "/"+ "IntentSpoofingExplicitCommunication.xmi";
				 UnauthorizedIntentReceiptInterApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+projectsOfApps [i].getName()+ "/"+ "UnauthorizedIntentReceipt.xmi";
				 
				 PassiveDataLeakInterApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+projectsOfApps [i].getName()+ "/"+ "PassiveDataLeak.xmi";
				 ContentPollutionInterApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+projectsOfApps [i].getName()+ "/"+ "ContentPollution.xmi";
				 PrivilegeEscalationInterApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+projectsOfApps [i].getName()+ "/"+ "PrivilegeEscalation.xmi";
				 CustomPermissionInterApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+projectsOfApps [i].getName()+ "/"+ "CustomPermission.xmi";
				 
				 System.out.print(" put models in list for inter app analysis " + "            " + "\n");
			 }
		}
		
		long startTimeForInterAppAnalysisForCurrentBundle = System.currentTimeMillis();//for Inter App Analysis for each app
		
		
		System.out.print("Call Inter App Analysis Module"+ "   " + "\n");
		this.checkingIntentspoofingInInterApp(InterComponentCommunicationModel, IntentSpoofingModelInterApp);
		this.checkingIntentspoofingInInterAppExplicitCommunication(InterComponentCommunicationModel, IntentSpoofingModelInterAppExplicitCommunication);
		this.checkingUnauthorizedIntentReceiptInInterApp(InterComponentCommunicationModel, UnauthorizedIntentReceiptInterApp);
		this.checkingPassiveDataLeakInInterApp(InterComponentCommunicationModel, PassiveDataLeakInterApp);
		this.checkingContentPollutionInInterApp(InterComponentCommunicationModel, ContentPollutionInterApp);
		this.checkingPrivilegeEscalationInInterApp(InterComponentCommunicationModel, PrivilegeEscalationInterApp);
		this.checkingCustomPermissionInInterApp(InterComponentCommunicationModel, CustomPermissionInterApp);			
	
		
        //refresh all projects:
		for(int i = 0; i < projectsOfApps.length; i++) 
		{
		   cleanProject(projectsOfApps [i]);	
		}
		
	}
	
	private void cleanProject(IProject project) throws CoreException {
		
		this.refreshProjet(project);
	}
	
	
	
	private void refreshProjet(IProject project) throws CoreException {
		//((File) project).refreshLocal(IResource.DEPTH_INFINITE, null);
		project.refreshLocal(IResource.DEPTH_INFINITE, null);
	}
	

	public void checkingIntentspoofingInIntraApp(IProject project, IFile AndroidModel) throws IOException, ATLCoreException {
		System.out.print("Intent Spoofing Intra App"+ "\n");
		IntraAppIntentSpoofing transformation=new IntraAppIntentSpoofing();
		
		this.AndroidModel="file:/"+ AndroidModel.getLocation().toString();
		this.IntentSpoofingModelIntraApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+project.getName().toString()+ "/"+ "IntentSpoofing.xmi";
		try {
			transformation.runATL(this.AndroidModel, this.IntentSpoofingModelIntraApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end Intent Spoofing Intra App" + "\n");
		

	}
	
	public void checkingUnauthorizedIntentReceiptInIntraApp(IProject project, IFile AndroidModel) throws IOException, ATLCoreException {
		System.out.print("Unauthorized Intent Receipt Intra App"+ "\n");
		IntraAppUnauthorizedIntentReceipt transformation=new IntraAppUnauthorizedIntentReceipt();
		
		this.AndroidModel="file:/"+ AndroidModel.getLocation().toString();
		this.UnauthorizedIntentReceiptIntraApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+project.getName().toString()+ "/"+ "UnauthorizedIntentReceipt.xmi";
		try {
			transformation.runATL(this.AndroidModel, this.UnauthorizedIntentReceiptIntraApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end Unauthorized Intent Receipt Intra App" + "\n");
	}
	
	public void checkingPassiveDataLeakInIntraApp(IProject project, IFile AndroidModel) throws IOException, ATLCoreException {
		System.out.print("Passive Data Leak Intra App" + "\n");
		IntraAppPassiveDataLeak transformation=new IntraAppPassiveDataLeak();
		
		this.AndroidModel="file:/"+ AndroidModel.getLocation().toString();
		this.PassiveDataLeakIntraApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+project.getName().toString()+ "/"+ "PassiveDataLeak.xmi";
		try {
			transformation.runATL(this.AndroidModel, this.PassiveDataLeakIntraApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end Passive Data Leak Intra App"+ "\n");
	}
	
	public void checkingContentPollutionInIntraApp(IProject project, IFile AndroidModel) throws IOException, ATLCoreException {
		System.out.print("Content Pollution Intra App"+ "\n");
		IntraAppContentPollution transformation=new IntraAppContentPollution();
		
		this.AndroidModel="file:/"+ AndroidModel.getLocation().toString();
		this.ContentPollutionIntraApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+project.getName().toString()+ "/"+ "ContentPollution.xmi";
		try {
			transformation.runATL(this.AndroidModel, this.ContentPollutionIntraApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end Content Pollution Intra App"+ "\n");
	}
	
	public void checkingPrivilegeEscalationInIntraApp(IProject project, IFile AndroidModel) throws IOException, ATLCoreException {
		System.out.print("Privilege Escalation Intra App"+ "\n");
		IntraAppPrivilegeEscalation transformation=new IntraAppPrivilegeEscalation();
		
		this.AndroidModel="file:/"+ AndroidModel.getLocation().toString();
		this.PrivilegeEscalationIntraApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+project.getName().toString()+ "/"+ "PrivilegeEscalation.xmi";
		try {
			transformation.runATL(this.AndroidModel, this.PrivilegeEscalationIntraApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end Privilege Escalation Intra App"+ "\n");
	}
	
	public void checkingCustomPermissionInIntraApp(IProject project, IFile AndroidModel) throws IOException, ATLCoreException {
		System.out.print("CustomPermission Intra App"+"\n");
		IntraAppCustomPermissionVulnerability transformation=new IntraAppCustomPermissionVulnerability();
		
		this.AndroidModel="file:/"+ AndroidModel.getLocation().toString();
		this.CustomPermissionIntraApp="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+project.getName().toString()+ "/"+ "CustomPermissionVulnerability.xmi";
		try {
			transformation.runATL(this.AndroidModel, this.CustomPermissionIntraApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end CustomPermission Intra App"+"\n");
	}
	
	public void checkingIntentspoofingInInterApp(IFile ICCModel, String IntentSpoofing) throws IOException, ATLCoreException {
		System.out.print("Intent Spoofing Inter App"+"\n");
		this.ICCModelForAnalysis="file:/"+ICCModel.getLocation().toString();
		this.IntentSpoofingModelInterApp=IntentSpoofing;
		InterAppIntentSpoofing transformation=new InterAppIntentSpoofing();
		
		try {
			transformation.runATL(this.ICCModelForAnalysis, this.IntentSpoofingModelInterApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end Intent Spoofing Intra App"+"\n");
		
		
	}
	
	public void checkingIntentspoofingInInterAppExplicitCommunication(IFile ICCModel, String IntentSpoofing) throws IOException, ATLCoreException {
		System.out.print("Intent Spoofing Inter App ExplicitCommunication"+"\n");
		this.ICCModelForAnalysis="file:/"+ICCModel.getLocation().toString();
		this.IntentSpoofingModelInterAppExplicitCommunication=IntentSpoofing;
		InterAppIntentSpoofingExplicitCommunication transformation=new InterAppIntentSpoofingExplicitCommunication();
		
		try {
			transformation.runATL(this.ICCModelForAnalysis, this.IntentSpoofingModelInterAppExplicitCommunication);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("Intent Spoofing Inter App ExplicitCommunication"+"\n");
		
		
	}
	
	public void checkingUnauthorizedIntentReceiptInInterApp(IFile ICCModel, String UnauthorizedIntentReceipt) throws IOException, ATLCoreException {
		System.out.print("Unauthorized Intent Receipt Inter App"+"\n");
		this.ICCModelForAnalysis="file:/"+ICCModel.getLocation().toString();
		this.UnauthorizedIntentReceiptInterApp=UnauthorizedIntentReceipt;
		InterAppUnauthorizedIntentReceipt transformation=new InterAppUnauthorizedIntentReceipt();
		
		try {
			transformation.runATL(this.ICCModelForAnalysis, this.UnauthorizedIntentReceiptInterApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end Unauthorized Intent Receipt Inter App"+"\n");
		

	}
	
	public void checkingPassiveDataLeakInInterApp(IFile ICCModel, String PassiveDataLeak) throws IOException, ATLCoreException {
		System.out.print("Passive Data Leak Inter App"+"\n");
		this.ICCModelForAnalysis="file:/"+ICCModel.getLocation().toString();
		this.PassiveDataLeakInterApp=PassiveDataLeak;
		InterAppPassiveDataLeak transformation=new InterAppPassiveDataLeak();
		
		try {
			transformation.runATL(this.ICCModelForAnalysis, this.PassiveDataLeakInterApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end Passive Data Leak Inter App"+"\n");
		
		
	}
	
	public void checkingContentPollutionInInterApp(IFile ICCModel, String ContentPollution) throws IOException, ATLCoreException {
		System.out.print("Content Pollution Inter App"+"\n");
		this.ICCModelForAnalysis="file:/"+ICCModel.getLocation().toString();
		this.ContentPollutionInterApp=ContentPollution;
		InterAppContentPollution transformation=new InterAppContentPollution();
		
		try {
			transformation.runATL(this.ICCModelForAnalysis, this.ContentPollutionInterApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end Content Pollution Inter App"+"\n");	
	}
	
	public void checkingPrivilegeEscalationInInterApp(IFile ICCModel, String PrivilegeEscalation) throws IOException, ATLCoreException {
		System.out.print("Privilege Escalation Inter App"+"\n");
		this.ICCModelForAnalysis="file:/"+ICCModel.getLocation().toString();
		this.PrivilegeEscalationInterApp=PrivilegeEscalation;
		InterAppPrivilegeEscalation transformation=new InterAppPrivilegeEscalation();
		
		try {
			transformation.runATL(this.ICCModelForAnalysis, this.PrivilegeEscalationInterApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end Privilege Escalation Inter App"+"\n");	
	}
	
	public void checkingCustomPermissionInInterApp(IFile ICCModel, String CustomPermission) throws IOException, ATLCoreException {
		System.out.print("Custom Permission Inter App"+"\n");
		this.ICCModelForAnalysis="file:/"+ICCModel.getLocation().toString();
		this.CustomPermissionInterApp=CustomPermission;
		InterAppCustomPermission transformation=new InterAppCustomPermission();
		
		try {
			transformation.runATL(this.ICCModelForAnalysis, this.CustomPermissionInterApp);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("end Custom Permission Inter App"+"\n");	
	}
	
	
	public void ICCModelExtractorForAbundleOFApps(LinkedList<IFile> androidModels, IFile emptyModel, String ICCModel) throws IOException, ATLCoreException {
		System.out.print("ICC Communication Extractor For A Bundle OF One To Ten Apps"+"\n");
		this.androidModels=androidModels;
		System.out.print("Actual Number Of Android Models" + androidModels.size()+ "    "+"\n");
		this.emptyModel=emptyModel;
		this.ICCModel=ICCModel;
		//for bundle with one to ten Apps
		if (androidModels.size()<11)
		{
			for(int i = 0; i < 10; i++)
		  {
			if (i< androidModels.size())
			{
				androidModelsList.add(androidModels.get(i));
			}
			else
			{
				androidModelsList.add(emptyModel);
			}
		  }
			System.out.print("bundle with one to ten Apps: " + androidModels.size()+" &&&&  " + androidModelsList.size()+ "    "+"\n");
		}
		
		//for bundle with one to twenty Apps
				if (androidModels.size()>10 && androidModels.size()<21)
				{
					for(int i = 0; i < 20; i++)
				  {
					if (i< androidModels.size())
					{
						androidModelsList.add(androidModels.get(i));
					}
					else
					{
						androidModelsList.add(emptyModel);
					}
				  }
					System.out.print("bundle with one to twenty Apps: " + androidModels.size()+" &&&&  " + androidModelsList.size()+ "    "+"\n");
				}
				
				//for bundle with one to thirty Apps
				if (androidModels.size()>20 && androidModels.size()<31)
				{
					for(int i = 0; i < 30; i++)
				  {
					if (i< androidModels.size())
					{
						androidModelsList.add(androidModels.get(i));
					}
					else
					{
						androidModelsList.add(emptyModel);
					}
				  }
					System.out.print("bundle with one to thirty Apps: " + androidModels.size()+" &&&&  " + androidModelsList.size()+ "    ");
				}
				
				//for bundle with one to Forty Apps
				if (androidModels.size()>30 && androidModels.size()<41)
				{
					for(int i = 0; i < 40; i++)
				  {
					if (i< androidModels.size())
					{
						androidModelsList.add(androidModels.get(i));
					}
					else
					{
						androidModelsList.add(emptyModel);
					}
				  }
					System.out.print("bundle with one to Forty Apps: " + androidModels.size()+" &&&&  " + androidModelsList.size()+ "    "+"\n");
				}
		
				//for bundle with one to fifty Apps
				if (androidModels.size()>40 && androidModels.size()<51)
				{
					for(int i = 0; i < 50; i++)
				  {
					if (i< androidModels.size())
					{
						androidModelsList.add(androidModels.get(i));
					}
					else
					{
						androidModelsList.add(emptyModel);
					}
				  }
					System.out.print("bundle with one to fifty Apps: " + androidModels.size()+" &&&&  " + androidModelsList.size()+ "    "+"\n");
				}
				
				//for bundle with one to sixty Apps
				if (androidModels.size()>50 && androidModels.size()<61)
				{
					for(int i = 0; i < 60; i++)
				  {
					if (i< androidModels.size())
					{
						androidModelsList.add(androidModels.get(i));
					}
					else
					{
						androidModelsList.add(emptyModel);
					}
				  }
					System.out.print("bundle with one to Sixty Apps: " + androidModels.size()+" &&&&  " + androidModelsList.size()+ "    "+"\n");
				}
		
		
		System.out.print("location of empty model" + emptyModel.getLocation().toString()+ "    "+"\n");
		

		ICCModelExtractorForAbundleOFOneToTenApps transformation1=new ICCModelExtractorForAbundleOFOneToTenApps();
		ICCModelExtractorForAbundleOFOneToTwentyApps transformation2=new ICCModelExtractorForAbundleOFOneToTwentyApps();
		ICCModelExtractorForAbundleOFOneToThirtyApps transformation3=new ICCModelExtractorForAbundleOFOneToThirtyApps();
		ICCModelExtractorForAbundleOFOneToFortyApps transformation4=new ICCModelExtractorForAbundleOFOneToFortyApps();
		ICCModelExtractorForAbundleOFOneToFiftyApps transformation5=new ICCModelExtractorForAbundleOFOneToFiftyApps();
		ICCModelExtractorForAbundleOFOneToSixtyApps transformation6=new ICCModelExtractorForAbundleOFOneToSixtyApps();
		System.out.print("android model 1" +  "file:/"+ androidModelsList.get(0).getLocation().toString() +"    "+"\n");
		 ////////////////continue here
		if (androidModels.size()<11)
		{	System.out.print("run icc extractor for a bundle with one to ten Apps: " + "    "+"\n");
		 try {
			transformation1.runATL("file:/"+ androidModelsList.get(0).getLocation().toString(),"file:/"+ androidModelsList.get(1).getLocation().toString(), "file:/"+ androidModelsList.get(2).getLocation().toString(), "file:/"+ androidModelsList.get(3).getLocation().toString(),"file:/"+ androidModelsList.get(4).getLocation().toString()
					              , "file:/"+ androidModelsList.get(5).getLocation().toString()
					              , "file:/"+ androidModelsList.get(6).getLocation().toString()
				                  , "file:/"+ androidModelsList.get(7).getLocation().toString()
					              , "file:/"+ androidModelsList.get(8).getLocation().toString()
					              , "file:/"+ androidModelsList.get(9).getLocation().toString()
					              , this.ICCModel);
		     } 
		 
		 catch (Exception e) 
		 {
			// TODO Auto-generated catch block
			e.printStackTrace();
		 }
		}
		
		if (androidModels.size()> 10 && androidModels.size() < 21)
		{   System.out.print("run icc extractor for a bundle with one to twenty Apps: " + "    "+"\n");
			try {
				transformation2.runATL("file:/"+ androidModelsList.get(0).getLocation().toString(), 
					              "file:/"+ androidModelsList.get(1).getLocation().toString()
					              , "file:/"+ androidModelsList.get(2).getLocation().toString(), 
					               "file:/"+ androidModelsList.get(3).getLocation().toString(), 
					               "file:/"+ androidModelsList.get(4).getLocation().toString()
					              , "file:/"+ androidModelsList.get(5).getLocation().toString()
					              , "file:/"+ androidModelsList.get(6).getLocation().toString()
				                  , "file:/"+ androidModelsList.get(7).getLocation().toString()
					              , "file:/"+ androidModelsList.get(8).getLocation().toString()
					              , "file:/"+ androidModelsList.get(9).getLocation().toString(), 
					              "file:/"+ androidModelsList.get(10).getLocation().toString(), 
					              "file:/"+ androidModelsList.get(11).getLocation().toString()
					              , "file:/"+ androidModelsList.get(12).getLocation().toString(), 
					               "file:/"+ androidModelsList.get(13).getLocation().toString(), 
					               "file:/"+ androidModelsList.get(14).getLocation().toString()
					              , "file:/"+ androidModelsList.get(15).getLocation().toString()
					              , "file:/"+ androidModelsList.get(16).getLocation().toString()
				                  , "file:/"+ androidModelsList.get(17).getLocation().toString()
					              , "file:/"+ androidModelsList.get(18).getLocation().toString()
					              , "file:/"+ androidModelsList.get(19).getLocation().toString(), this.ICCModel);
			     } 
			 
			 catch (Exception e) 
			 {
				// TODO Auto-generated catch block
				e.printStackTrace();
			 }
		}
		
		if (androidModels.size()> 20 && androidModels.size() < 31)
		{   System.out.print("run icc extractor for a bundle with one to thirty Apps: " + "    "+"\n");
			try {
				transformation3.runATL("file:/"+ androidModelsList.get(0).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(1).getLocation().toString()
			              , "file:/"+ androidModelsList.get(2).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(3).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(4).getLocation().toString()
			              , "file:/"+ androidModelsList.get(5).getLocation().toString()
			              , "file:/"+ androidModelsList.get(6).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(7).getLocation().toString()
			              , "file:/"+ androidModelsList.get(8).getLocation().toString()
			              , "file:/"+ androidModelsList.get(9).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(10).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(11).getLocation().toString()
			              , "file:/"+ androidModelsList.get(12).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(13).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(14).getLocation().toString()
			              , "file:/"+ androidModelsList.get(15).getLocation().toString()
			              , "file:/"+ androidModelsList.get(16).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(17).getLocation().toString()
			              , "file:/"+ androidModelsList.get(18).getLocation().toString()
			              , "file:/"+ androidModelsList.get(19).getLocation().toString(),
			              "file:/"+ androidModelsList.get(20).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(21).getLocation().toString()
			              , "file:/"+ androidModelsList.get(22).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(23).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(24).getLocation().toString()
			              , "file:/"+ androidModelsList.get(25).getLocation().toString()
			              , "file:/"+ androidModelsList.get(26).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(27).getLocation().toString()
			              , "file:/"+ androidModelsList.get(28).getLocation().toString()
			              , "file:/"+ androidModelsList.get(29).getLocation().toString(),this.ICCModel);
			}
			 
			 catch (Exception e) 
			 {
				// TODO Auto-generated catch block
				e.printStackTrace();
			 }
		}
	    
		if (androidModels.size()> 30 && androidModels.size() < 41)
		{   System.out.print("run icc extractor for a bundle with one to forty Apps: " + "    "+"\n");
			try {
				transformation4.runATL("file:/"+ androidModelsList.get(0).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(1).getLocation().toString()
			              , "file:/"+ androidModelsList.get(2).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(3).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(4).getLocation().toString()
			              , "file:/"+ androidModelsList.get(5).getLocation().toString()
			              , "file:/"+ androidModelsList.get(6).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(7).getLocation().toString()
			              , "file:/"+ androidModelsList.get(8).getLocation().toString()
			              , "file:/"+ androidModelsList.get(9).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(10).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(11).getLocation().toString()
			              , "file:/"+ androidModelsList.get(12).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(13).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(14).getLocation().toString()
			              , "file:/"+ androidModelsList.get(15).getLocation().toString()
			              , "file:/"+ androidModelsList.get(16).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(17).getLocation().toString()
			              , "file:/"+ androidModelsList.get(18).getLocation().toString()
			              , "file:/"+ androidModelsList.get(19).getLocation().toString(),
			              "file:/"+ androidModelsList.get(20).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(21).getLocation().toString()
			              , "file:/"+ androidModelsList.get(22).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(23).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(24).getLocation().toString()
			              , "file:/"+ androidModelsList.get(25).getLocation().toString()
			              , "file:/"+ androidModelsList.get(26).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(27).getLocation().toString()
			              , "file:/"+ androidModelsList.get(28).getLocation().toString()
			              , "file:/"+ androidModelsList.get(29).getLocation().toString(),
			              "file:/"+ androidModelsList.get(30).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(31).getLocation().toString()
			              , "file:/"+ androidModelsList.get(32).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(33).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(34).getLocation().toString()
			              , "file:/"+ androidModelsList.get(35).getLocation().toString()
			              , "file:/"+ androidModelsList.get(36).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(37).getLocation().toString()
			              , "file:/"+ androidModelsList.get(38).getLocation().toString()
			              , "file:/"+ androidModelsList.get(39).getLocation().toString(),
			              this.ICCModel);
			}
			 
			 catch (Exception e) 
			 {
				// TODO Auto-generated catch block
				e.printStackTrace();
			 }
		}
		
		if (androidModels.size()> 40 && androidModels.size() < 51)
		{   System.out.print("run icc extractor for a bundle with one to fifty Apps: " + "    "+"\n");
			try {
				transformation5.runATL("file:/"+ androidModelsList.get(0).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(1).getLocation().toString()
			              , "file:/"+ androidModelsList.get(2).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(3).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(4).getLocation().toString()
			              , "file:/"+ androidModelsList.get(5).getLocation().toString()
			              , "file:/"+ androidModelsList.get(6).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(7).getLocation().toString()
			              , "file:/"+ androidModelsList.get(8).getLocation().toString()
			              , "file:/"+ androidModelsList.get(9).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(10).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(11).getLocation().toString()
			              , "file:/"+ androidModelsList.get(12).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(13).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(14).getLocation().toString()
			              , "file:/"+ androidModelsList.get(15).getLocation().toString()
			              , "file:/"+ androidModelsList.get(16).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(17).getLocation().toString()
			              , "file:/"+ androidModelsList.get(18).getLocation().toString()
			              , "file:/"+ androidModelsList.get(19).getLocation().toString(),
			              "file:/"+ androidModelsList.get(20).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(21).getLocation().toString()
			              , "file:/"+ androidModelsList.get(22).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(23).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(24).getLocation().toString()
			              , "file:/"+ androidModelsList.get(25).getLocation().toString()
			              , "file:/"+ androidModelsList.get(26).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(27).getLocation().toString()
			              , "file:/"+ androidModelsList.get(28).getLocation().toString()
			              , "file:/"+ androidModelsList.get(29).getLocation().toString(),
			              "file:/"+ androidModelsList.get(30).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(31).getLocation().toString()
			              , "file:/"+ androidModelsList.get(32).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(33).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(34).getLocation().toString()
			              , "file:/"+ androidModelsList.get(35).getLocation().toString()
			              , "file:/"+ androidModelsList.get(36).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(37).getLocation().toString()
			              , "file:/"+ androidModelsList.get(38).getLocation().toString()
			              , "file:/"+ androidModelsList.get(39).getLocation().toString(),
			              "file:/"+ androidModelsList.get(40).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(41).getLocation().toString()
			              , "file:/"+ androidModelsList.get(42).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(43).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(44).getLocation().toString()
			              , "file:/"+ androidModelsList.get(45).getLocation().toString()
			              , "file:/"+ androidModelsList.get(46).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(47).getLocation().toString()
			              , "file:/"+ androidModelsList.get(48).getLocation().toString()
			              , "file:/"+ androidModelsList.get(49).getLocation().toString(),
			              this.ICCModel);
			}
			 
			 catch (Exception e) 
			 {
				// TODO Auto-generated catch block
				e.printStackTrace();
			 }
		}
		
		if (androidModels.size()> 50 && androidModels.size() < 61)
		{   System.out.print("run icc extractor for a bundle with one to Sixty Apps: " + "    "+"\n");
			try {
				transformation6.runATL("file:/"+ androidModelsList.get(0).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(1).getLocation().toString()
			              , "file:/"+ androidModelsList.get(2).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(3).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(4).getLocation().toString()
			              , "file:/"+ androidModelsList.get(5).getLocation().toString()
			              , "file:/"+ androidModelsList.get(6).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(7).getLocation().toString()
			              , "file:/"+ androidModelsList.get(8).getLocation().toString()
			              , "file:/"+ androidModelsList.get(9).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(10).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(11).getLocation().toString()
			              , "file:/"+ androidModelsList.get(12).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(13).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(14).getLocation().toString()
			              , "file:/"+ androidModelsList.get(15).getLocation().toString()
			              , "file:/"+ androidModelsList.get(16).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(17).getLocation().toString()
			              , "file:/"+ androidModelsList.get(18).getLocation().toString()
			              , "file:/"+ androidModelsList.get(19).getLocation().toString(),
			              "file:/"+ androidModelsList.get(20).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(21).getLocation().toString()
			              , "file:/"+ androidModelsList.get(22).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(23).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(24).getLocation().toString()
			              , "file:/"+ androidModelsList.get(25).getLocation().toString()
			              , "file:/"+ androidModelsList.get(26).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(27).getLocation().toString()
			              , "file:/"+ androidModelsList.get(28).getLocation().toString()
			              , "file:/"+ androidModelsList.get(29).getLocation().toString(),
			              "file:/"+ androidModelsList.get(30).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(31).getLocation().toString()
			              , "file:/"+ androidModelsList.get(32).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(33).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(34).getLocation().toString()
			              , "file:/"+ androidModelsList.get(35).getLocation().toString()
			              , "file:/"+ androidModelsList.get(36).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(37).getLocation().toString()
			              , "file:/"+ androidModelsList.get(38).getLocation().toString()
			              , "file:/"+ androidModelsList.get(39).getLocation().toString(),
			              "file:/"+ androidModelsList.get(40).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(41).getLocation().toString()
			              , "file:/"+ androidModelsList.get(42).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(43).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(44).getLocation().toString()
			              , "file:/"+ androidModelsList.get(45).getLocation().toString()
			              , "file:/"+ androidModelsList.get(46).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(47).getLocation().toString()
			              , "file:/"+ androidModelsList.get(48).getLocation().toString()
			              , "file:/"+ androidModelsList.get(49).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(50).getLocation().toString()
			              , "file:/"+ androidModelsList.get(51).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(52).getLocation().toString(), 
			               "file:/"+ androidModelsList.get(53).getLocation().toString()
			              , "file:/"+ androidModelsList.get(54).getLocation().toString()
			              , "file:/"+ androidModelsList.get(55).getLocation().toString()
		                  , "file:/"+ androidModelsList.get(56).getLocation().toString()
			              , "file:/"+ androidModelsList.get(57).getLocation().toString()
			              , "file:/"+ androidModelsList.get(58).getLocation().toString(), 
			              "file:/"+ androidModelsList.get(59).getLocation().toString(),
			              this.ICCModel);
			}
			 
			 catch (Exception e) 
			 {
				// TODO Auto-generated catch block
				e.printStackTrace();
			 }
		}

	}

	public void extractSecurityFromAndroid(IJavaProject project, IFile javaModel,IFile manifestFile) throws IOException, ATLCoreException {
		
		System.out.print("Extract android model" +"\n");
		AndroidSecurityExtractor transformation=new AndroidSecurityExtractor();
		

		this.XMLModel="file:/"+ manifestFile.getLocation().toString();
		this.JAVAModel="file:/"+ javaModel.getLocation().toString();
		this.AndroidSecurityModel="file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+project.getElementName().toString()+ "/"+project.getElementName().toString() + "_" + "AndroidApplicationSecurityAspects.xmi";
		
		System.out.print("manifest of app"+ this.XMLModel + "    "+"\n");
		System.out.print("java of app"+ this.JAVAModel+"   "+"\n");
		System.out.print("result model of app "+ "file:/" +ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ "/"+project.getElementName().toString()+ "/"+ "AndroidSecurity.xmi"+ "   "+"\n");
		
		try {
		transformation.runATL(this.XMLModel, this.JAVAModel, this.AndroidSecurityModel);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.print("********" + this.AndroidSecurityPath1+"\n");
		System.out.print("end Extract android model"+"\n");
		
		
	}	
	
}
