5

Recently, I came across this Stackoverflow post describing how to check if the device running an app is an emulator. The solution described checking the device fingerprint, model, and brand:

public static boolean isEmulator() {
    return 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);
}

Now I was wondering if there is a way to get around this. If I have a standard Genymotion device, how can I want to mask my emulation's fingerprint, model, and brand?

enter image description here

Now if you're wondering why I want to do this, it's simply to try to achieve a genuine device experience on an emulator, especially on apps that refuse to work on emulators.

Ruchir Baronia
  • 7,406
  • 5
  • 48
  • 83
  • 1
    I know only a few things about VM, but I have a friend that works in a malware detection company and it deals with them on a daily basis. In a discussion we had, he told me that some malware can check to see if it runs in a VM or not, and not execute its code to make it look safe. Starting from here, I guess that there is no way to trick some code that it runs on a real pc when it really runs on a VM (if it would really be possible, I guess that somebody who would work from this industry would have a way to do it). – Iulian Popescu Jul 16 '18 at 08:15
  • The functions to check for emulator are hard-coded in the emulator itself so you won't be able to bypass that, unless you compile your own emulators and system images, which I don't think it's even possible. – andreszs Jul 22 '18 at 00:15

1 Answers1

7

In general there are three ways to bypass an emulator check:

  1. Modify the app and remove the emulator check.
  2. Modify the emulator so that it pretends to be a real device.
  3. Modify the system calls the app does for detecting it is running on an emulator

None of the ways are that simple; however, the third way may be the easiest as there are some tools that can help you.

Back to option 1 - it requires a lot of development skills to decompile the app (e.g. using apktool to decompile it to Smali code), identify the emulator checks, and then bypass app integrity checks that may exist.

Option 2 is even harder as it requires you to patch and recompile the Android emulator (which is available as source code).

Therefore from my point of view only option 3 is realistic for you. However, it still may require some Java development.

You can install the XPosed framework onto your emulator. It allows to modify system calls the app uses for identifying that it is running on an emulator. There are a some existing XPosed modules for hiding that a device is rooted or that it is running on an emulator. If you are lucky there is an existing module working out-of-the box, letting you run your app on an emulator.

Das_Geek
  • 2,775
  • 7
  • 20
  • 26
Crafty_FoXx
  • 71
  • 1
  • 2