Skip to content

Commit

Permalink
added Emulator Detection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dineshshetty committed Jul 14, 2018
1 parent ef0735c commit 335b384
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
Binary file modified InsecureBankv2.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public void onClick(View v) {
protected void createUser() {
Toasteroid.show(this, "Create User functionality is still Work-In-Progress!!", Toasteroid.STYLES.WARNING, Toasteroid.LENGTH_LONG);


}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
Expand All @@ -17,6 +18,8 @@
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import com.marcohc.toasteroid.Toasteroid;


/*
The page that allows gives the user below functionalities
Expand Down Expand Up @@ -44,10 +47,10 @@ protected void onCreate(Bundle savedInstanceState) {
uname = intent.getStringExtra("uname");

root_status =(TextView) findViewById(R.id.rootStatus);
// Display root status
// Display root status
showRootStatus();


// Display emulator status
checkEmulatorStatus();

transfer_button = (Button) findViewById(R.id.trf_button);
transfer_button.setOnClickListener(new View.OnClickListener() {
Expand Down Expand Up @@ -82,7 +85,36 @@ public void onClick(View v) {
});
}

void showRootStatus() {
private void checkEmulatorStatus() {
Boolean isEmulator = checkIfDeviceIsEmulator();
if(isEmulator==true)
{
Toasteroid.show(this, "Application running on Emulator", Toasteroid.STYLES.ERROR, Toasteroid.LENGTH_LONG);
}
else
{
Toasteroid.show(this, "Application running on Real device", Toasteroid.STYLES.SUCCESS, Toasteroid.LENGTH_LONG);
}
}

private Boolean checkIfDeviceIsEmulator() {

if(Build.FINGERPRINT.startsWith("generic")
|| Build.FINGERPRINT.startsWith("unknown")
|| Build.MODEL.contains("google_sdk")
|| Build.MODEL.contains("Emulator")
|| Build.MODEL.contains("Android SDK built for x86")
|| Build.MANUFACTURER.contains("Genymotion")
|| (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic"))
|| "google_sdk".equals(Build.PRODUCT))
{
return true;
}
return false;
}


void showRootStatus() {
boolean isrooted = doesSuperuserApkExist("/system/app/Superuser.apk")||
doesSUexist();
if(isrooted==true)
Expand Down
1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This is a major update to one of my previous projects - "InsecureBank". This vul
* Local Encryption issues
* Vulnerable Activity Components
* Root Detection and Bypass
* Emulator Detection and Bypass
* Insecure Content Provider access
* Insecure Webview implementation
* Weak Cryptography implementation
Expand Down

0 comments on commit 335b384

Please sign in to comment.