This repository contains an Android Studio Plugin for CogniCrypt.
Launch Requirements:
- Android Studio (tested with version 2018.3.6)
 
- IntelliJ 2019.1.3
 - Java Development Kit 8 (either Oracle or OpenJDK will do)
 
Using JDK 8 currently is a hard requirement. Any version lower or higher will cause a build error. There are two places to make sure the project is built with a specific JDK version:
- Open the module settings for icognicrypt (F4) and check if the Project SDK under 
Project Settings -> Projectrefers to a JDK 8 version. - Gradle settings:
a) Gradle utilized in the IDE's terminal gets its JDK reference through the 
JAVA_HOMEenvironment variable of the operating system. Change the value of that variable if required and reboot the system for the changes to take effect. You can check the used JDK/JVM by typinggradlew -v. b) When using the IDE's built-in run and debug commands (the buttons in the top toolbar), Gradle uses a JDK version that is specified in the settings of IntelliJ. Open the settings and go toBuild, Execution, Deployment -> Build Tools -> Gradle. Edit theGradle JVMsetting as required (suggestion: choose the option: Use Project JDK). 
Run gradlew assemble  or gradlew build in root directory.
To enable the debug functionality you need to add a run configuration in IntelliJ.
- Click 
Add Configurationin the top toolbar. - Press the 
+symbol and add a Gradle build. - As Gradle Project choose icognicrypt from the drop down menu.
 - Enter 
:runIdeas Task and optionally--infoas Argument. - Press Apply and OK
 
- Open Android Studio installation and go to 
File > Settings > Pluginsand Select the gear icon andInstall Plugin from Disk... - Select file 
build\distributions\icognicrypt-<VERSION>.zip - Restart Android Studio
 - Download https://github.com/CROSSINGTUD/CryptoAnalysis/releases/download/2.3/CrySL-rulesets.zip and extract it to some folder
 - Go to 
File > Settings > Other Settings > CogniCryptand set the CrySL Rules Directory to /JavaCryptographicArchitecture - To assure you don't recieve any Stackoverflow exceptions while the analysis is processing make sure the available stack size and allocated memory for Android Studio is sufficent.
Go toHelp > Edit custom VM options...and enter the lines-Xmx4g -Xss100m. 
- Build your 
.apkand make sure it successfully produces an.apkfile within your project folder. - Go to 
Analyze > Run CogniCrypt - Wait till analysis process terminates.
 
This work is part of the research project "AppSecure.nrw - Security-by-Design of Java-based Applications". The project is funded by the European Regional Development Fund (ERDF-0801379).


