Skip to content

Commit

Permalink
initial commit of DSN'21 version from Bitbucket
Browse files Browse the repository at this point in the history
  • Loading branch information
daoyuan14 committed May 29, 2021
1 parent 6d2b7ea commit eea06cb
Showing 117 changed files with 17,341 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.class
*.swp
*.dot
*.log
*.pdf
*_apktool
*_src
*.pyc
test
dex2jarerr
temptest
cryptotest
ssltest
bountyApps
NDSS15_EdgeMiner_dataset
10 changes: 10 additions & 0 deletions BackDroid/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="../lib/soot-trunk.jar"/>
<classpathentry kind="lib" path="../lib/commons-cli-1.2.jar"/>
<classpathentry kind="lib" path="../lib/soot-infoflow.jar"/>
<classpathentry kind="lib" path="../lib/soot-infoflow-android.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions BackDroid/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
17 changes: 17 additions & 0 deletions BackDroid/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>BackDroid</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
79 changes: 79 additions & 0 deletions BackDroid/src/edu/smu/backdroid/DumpAPIClass.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package edu.smu.backdroid;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.HashSet;
import java.util.Set;

/**
* Read android-classes.txt and generate android-classes.ser
*
* @author Daoyuan
* @see borrow some code from my VSinkDumper
*/
public class DumpAPIClass {

public static String rootDirPath =
"../lib/";

public static String textFilePath =
rootDirPath + "android-classes.txt";

public static String dumpFilePath =
rootDirPath + "android-classes.ser";

/**
* @param args
* @throws IOException
* @throws ClassNotFoundException
*/
public static void main(String[] args) throws IOException, ClassNotFoundException {
Set<String> apiClassSet = new HashSet<String>();

/*
* Read file
*/
BufferedReader filein = new BufferedReader(new FileReader(textFilePath));

while (true) {
String nextline = filein.readLine();
if (nextline == null) //end of file
break;

apiClassSet.add(nextline);
}

if (filein != null)
filein.close();

/*
* Dump to Serialize
*/
FileOutputStream fileOut = new FileOutputStream(dumpFilePath);
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(apiClassSet);
System.out.println("Has dumped apiClassSet object into: "+dumpFilePath);
out.close();
fileOut.close();

/*
* test Deserialization and output logs
*/
FileInputStream fileIn = new FileInputStream(dumpFilePath);
ObjectInputStream in = new ObjectInputStream(fileIn);
Set<String> outApiClass = (Set<String>) in.readObject();
if (outApiClass.contains("org.apache.http.conn.ssl.SSLSocketFactory")
&& outApiClass.contains("android.graphics.Xfermode")
&& outApiClass.contains("javax.net.ssl.SSLContextSpi")) {
System.out.println("outApiClass contains all tested classes.");
}
in.close();
fileIn.close();
}

}
Loading

0 comments on commit eea06cb

Please sign in to comment.