├── AndroidManifest.xml ├── README.md ├── bin ├── AndroidManifest.xml ├── classes.dex ├── classes │ └── com │ │ └── ouz │ │ └── evasion │ │ ├── BuildConfig.class │ │ ├── EvasionMainActivity.class │ │ ├── R$attr.class │ │ ├── R$dimen.class │ │ ├── R$drawable.class │ │ ├── R$id.class │ │ ├── R$layout.class │ │ ├── R$menu.class │ │ ├── R$string.class │ │ ├── R$style.class │ │ └── R.class ├── dexedLibs │ ├── android-support-v4-153e0412dd75dea280e93bd187b340c1.jar │ └── annotations-286d4cb1131c9ea24a6c0e4f61e0071a.jar ├── evasion.apk ├── jarlist.cache ├── res │ └── crunch │ │ ├── drawable-hdpi │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ │ └── drawable-xxhdpi │ │ └── ic_launcher.png └── resources.ap_ ├── gen └── com │ └── ouz │ └── evasion │ ├── BuildConfig.java │ └── R.java ├── ic_launcher-web.png ├── libs └── android-support-v4.jar ├── proguard-project.txt ├── project.properties ├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── drawable-xxhdpi │ └── ic_launcher.png ├── layout │ └── activity_evasion_main.xml ├── menu │ └── evasion_main.xml ├── values-v11 │ └── styles.xml ├── values-v14 │ └── styles.xml ├── values-w820dp │ └── dimens.xml └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml └── src └── com └── ouz └── evasion └── EvasionMainActivity.java /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Android-Emulator-Evasion 2 | ======================== 3 | 4 | Sample Android project that covers all the emulator detection techniques that are mentioned in the blog post: 5 | http://www.oguzhantopgul.com/2014/12/android-malware-evasion-techniques.html 6 | -------------------------------------------------------------------------------- /bin/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /bin/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes.dex -------------------------------------------------------------------------------- /bin/classes/com/ouz/evasion/BuildConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes/com/ouz/evasion/BuildConfig.class -------------------------------------------------------------------------------- /bin/classes/com/ouz/evasion/EvasionMainActivity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes/com/ouz/evasion/EvasionMainActivity.class -------------------------------------------------------------------------------- /bin/classes/com/ouz/evasion/R$attr.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes/com/ouz/evasion/R$attr.class -------------------------------------------------------------------------------- /bin/classes/com/ouz/evasion/R$dimen.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes/com/ouz/evasion/R$dimen.class -------------------------------------------------------------------------------- /bin/classes/com/ouz/evasion/R$drawable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes/com/ouz/evasion/R$drawable.class -------------------------------------------------------------------------------- /bin/classes/com/ouz/evasion/R$id.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes/com/ouz/evasion/R$id.class -------------------------------------------------------------------------------- /bin/classes/com/ouz/evasion/R$layout.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes/com/ouz/evasion/R$layout.class -------------------------------------------------------------------------------- /bin/classes/com/ouz/evasion/R$menu.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes/com/ouz/evasion/R$menu.class -------------------------------------------------------------------------------- /bin/classes/com/ouz/evasion/R$string.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes/com/ouz/evasion/R$string.class -------------------------------------------------------------------------------- /bin/classes/com/ouz/evasion/R$style.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes/com/ouz/evasion/R$style.class -------------------------------------------------------------------------------- /bin/classes/com/ouz/evasion/R.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/classes/com/ouz/evasion/R.class -------------------------------------------------------------------------------- /bin/dexedLibs/android-support-v4-153e0412dd75dea280e93bd187b340c1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/dexedLibs/android-support-v4-153e0412dd75dea280e93bd187b340c1.jar -------------------------------------------------------------------------------- /bin/dexedLibs/annotations-286d4cb1131c9ea24a6c0e4f61e0071a.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/dexedLibs/annotations-286d4cb1131c9ea24a6c0e4f61e0071a.jar -------------------------------------------------------------------------------- /bin/evasion.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/evasion.apk -------------------------------------------------------------------------------- /bin/jarlist.cache: -------------------------------------------------------------------------------- 1 | # cache for current jar dependency. DO NOT EDIT. 2 | # format is 3 | # Encoding is UTF-8 4 | -------------------------------------------------------------------------------- /bin/res/crunch/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/res/crunch/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/res/crunch/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/res/crunch/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/res/crunch/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/resources.ap_: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/bin/resources.ap_ -------------------------------------------------------------------------------- /gen/com/ouz/evasion/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package com.ouz.evasion; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /gen/com/ouz/evasion/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package com.ouz.evasion; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class dimen { 14 | /** Default screen margins, per the Android Design guidelines. 15 | 16 | Example customization of dimensions originally defined in res/values/dimens.xml 17 | (such as screen margins) for screens with more than 820dp of available width. This 18 | would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). 19 | 20 | */ 21 | public static final int activity_horizontal_margin=0x7f040000; 22 | public static final int activity_vertical_margin=0x7f040001; 23 | } 24 | public static final class drawable { 25 | public static final int ic_launcher=0x7f020000; 26 | } 27 | public static final class id { 28 | public static final int action_settings=0x7f080001; 29 | public static final int textView1=0x7f080000; 30 | } 31 | public static final class layout { 32 | public static final int activity_evasion_main=0x7f030000; 33 | } 34 | public static final class menu { 35 | public static final int evasion_main=0x7f070000; 36 | } 37 | public static final class string { 38 | public static final int action_settings=0x7f050002; 39 | public static final int app_name=0x7f050000; 40 | public static final int hello_world=0x7f050001; 41 | } 42 | public static final class style { 43 | /** 44 | Base application theme, dependent on API level. This theme is replaced 45 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices. 46 | 47 | 48 | Theme customizations available in newer API levels can go in 49 | res/values-vXX/styles.xml, while customizations related to 50 | backward-compatibility can go here. 51 | 52 | 53 | Base application theme for API 11+. This theme completely replaces 54 | AppBaseTheme from res/values/styles.xml on API 11+ devices. 55 | 56 | API 11 theme customizations can go here. 57 | 58 | Base application theme for API 14+. This theme completely replaces 59 | AppBaseTheme from BOTH res/values/styles.xml and 60 | res/values-v11/styles.xml on API 14+ devices. 61 | 62 | API 14 theme customizations can go here. 63 | */ 64 | public static final int AppBaseTheme=0x7f060000; 65 | /** Application theme. 66 | All customizations that are NOT specific to a particular API-level can go here. 67 | */ 68 | public static final int AppTheme=0x7f060001; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/ic_launcher-web.png -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/libs/android-support-v4.jar -------------------------------------------------------------------------------- /proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-14 15 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzhantopgul/Android-Emulator-Detection/321108ceac6edf8da9be20f8b28869716371430b/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/layout/activity_evasion_main.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 19 | 20 | -------------------------------------------------------------------------------- /res/menu/evasion_main.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 64dp 9 | 10 | 11 | -------------------------------------------------------------------------------- /res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | evasion 5 | Hello world! 6 | Settings 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/com/ouz/evasion/EvasionMainActivity.java: -------------------------------------------------------------------------------- 1 | package com.ouz.evasion; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.os.Build; 6 | import android.os.Bundle; 7 | import android.telephony.TelephonyManager; 8 | import android.widget.TextView; 9 | 10 | public class EvasionMainActivity extends Activity { 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.activity_evasion_main); 16 | 17 | TextView isEmulatorTextView = (TextView)findViewById(R.id.textView1); 18 | 19 | if (isEmulator(getApplicationContext())) 20 | isEmulatorTextView.setText("Emulator"); 21 | else 22 | isEmulatorTextView.setText("Device"); 23 | 24 | } 25 | 26 | public static Boolean isEmulator(Context paramContext) 27 | { 28 | Boolean isEmulator = false; 29 | 30 | try { 31 | Class SystemProperties = Class.forName("android.os.SystemProperties"); 32 | TelephonyManager localTelephonyManager = (TelephonyManager)paramContext.getSystemService("phone"); 33 | if (getProperty(SystemProperties, "ro.secure").equalsIgnoreCase("0")) 34 | isEmulator = Boolean.valueOf(true); 35 | else if (getProperty(SystemProperties, "ro.kernel.qemu").equalsIgnoreCase("1")) 36 | isEmulator = Boolean.valueOf(true); 37 | else if (Build.PRODUCT.contains("sdk")) 38 | isEmulator = Boolean.valueOf(true); 39 | else if (Build.MODEL.contains("sdk")) 40 | isEmulator = Boolean.valueOf(true); 41 | else if(localTelephonyManager.getSimOperatorName().equals("Android")) 42 | isEmulator = Boolean.valueOf(true); 43 | else if(localTelephonyManager.getNetworkOperatorName().equals("Android")) 44 | isEmulator = Boolean.valueOf(true); 45 | else 46 | isEmulator = Boolean.valueOf(false); 47 | 48 | } catch (Exception e) { 49 | e.printStackTrace(); 50 | } 51 | return isEmulator; 52 | } 53 | 54 | private static String getProperty(Class myClass, String propertyName) throws Exception { 55 | return (String) myClass.getMethod("get", String.class).invoke(myClass, propertyName); 56 | } 57 | 58 | 59 | } 60 | --------------------------------------------------------------------------------