Skip to content

Commit

Permalink
Hooking up detection methods
Browse files Browse the repository at this point in the history
  • Loading branch information
strazzere committed Jul 30, 2013
1 parent 1232a64 commit bca1676
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions AntiEmulator/src/diff/strazzere/anti/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package diff.strazzere.anti;

import diff.strazzere.anti.emulator.FindEmulator;
import diff.strazzere.anti.taint.FindTaint;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;

public class MainActivity extends Activity {
Expand All @@ -10,6 +13,10 @@ public class MainActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

isQEmuEnvDetected();

isTaintTrackingDetected();
}

@Override
Expand All @@ -19,4 +26,45 @@ public boolean onCreateOptionsMenu(Menu menu) {
return true;
}

public boolean isQEmuEnvDetected() {
log("Checking for QEmu env...");
log("hasKnownDeviceId : " + FindEmulator.hasKnownDeviceId());
log("hasKnownImei : " + FindEmulator.hasKnownImei());
log("hasKnownPhoneNumber : " + FindEmulator.hasKnownPhoneNumber());
log("hasPipes : " + FindEmulator.hasPipes());
log("hasQEmuDriver : " + FindEmulator.hasQEmuDriver());
log("hasQEmuFiles : " + FindEmulator.hasQEmuFiles());
if(FindEmulator.hasKnownDeviceId() ||
FindEmulator.hasKnownImei() ||
FindEmulator.hasKnownPhoneNumber() ||
FindEmulator.hasPipes() ||
FindEmulator.hasQEmuDriver() ||
FindEmulator.hasQEmuFiles()) {
log("QEmu environment detected.");
return true;
} else {
log("QEmu environment not detected.");
return false;
}
}

public boolean isTaintTrackingDetected() {
log("Checking for Taint tracking...");
log("hasAppAnalysisPackage : " + FindTaint.hasAppAnalysisPackage(getApplicationContext()));
log("hasTaintClass : " + FindTaint.hasTaintClass());
log("hasTaintMemberVariables : " + FindTaint.hasTaintMemberVariables());
if(FindTaint.hasAppAnalysisPackage(getApplicationContext()) ||
FindTaint.hasTaintClass() ||
FindTaint.hasTaintMemberVariables()) {
log("Taint tracking was detected.");
return true;
} else {
log("Taint tracking was not detected.");
return false;
}
}

public void log(String msg) {
Log.v("AntiEmulator", msg);
}
}

0 comments on commit bca1676

Please sign in to comment.