[Question] - Possible false-positive on emulator detection #2066
Replies: 2 comments 1 reply
-
Thanks for your nice words @gabcarneiro , we're very happy to hear that |
Beta Was this translation helpful? Give feedback.
-
Hi @gabcarneiro I can share my experience of building emulator detection. I have access to several Android devices for testing. During development I've experienced false positives as well, including the case when I used build.props from the MSTG. My recent project with emulator detection is using the library to detect emulator and I'm satisfied with its approach. I've received no complaints about false positives when using it. Here is what it checks for: https://github.com/react-native-device-info/react-native-device-info/blob/e186394d1b1afc6af74703e52c99192dccc9b9d9/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java#L226 public boolean isEmulatorSync() {
return Build.FINGERPRINT.startsWith("generic")
|| Build.FINGERPRINT.startsWith("unknown")
|| Build.MODEL.contains("google_sdk")
|| Build.MODEL.toLowerCase(Locale.ROOT).contains("droid4x")
|| Build.MODEL.contains("Emulator")
|| Build.MODEL.contains("Android SDK built for x86")
|| Build.MANUFACTURER.contains("Genymotion")
|| Build.HARDWARE.contains("goldfish")
|| Build.HARDWARE.contains("ranchu")
|| Build.HARDWARE.contains("vbox86")
|| Build.PRODUCT.contains("sdk")
|| Build.PRODUCT.contains("google_sdk")
|| Build.PRODUCT.contains("sdk_google")
|| Build.PRODUCT.contains("sdk_x86")
|| Build.PRODUCT.contains("vbox86p")
|| Build.PRODUCT.contains("emulator")
|| Build.PRODUCT.contains("simulator")
|| Build.BOARD.toLowerCase(Locale.ROOT).contains("nox")
|| Build.BOOTLOADER.toLowerCase(Locale.ROOT).contains("nox")
|| Build.HARDWARE.toLowerCase(Locale.ROOT).contains("nox")
|| Build.PRODUCT.toLowerCase(Locale.ROOT).contains("nox")
|| Build.SERIAL.toLowerCase(Locale.ROOT).contains("nox")
|| (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic"));
} |
Beta Was this translation helpful? Give feedback.
-
Hello guys, first i wanna thank you for all the effort you have been putting on this project, im working on an app that requires resilience against reverse engineering and this project saved my life.
The issue is: im applying an emulator detection on an Android project based on these build.props here.
I noticed that running the app on a Pixel 3 (API 28) from Firebase Test Lab triggers the emulator detection due to value of the prop
Build.User
beeingandroid-build
.I get the same behaviour running the app on some devices from AWS Device Farm, tested with the following devices:
All of them have the value of the property
Build.USER
asandroid-build
.Unfortunately i couldnt get my hands on any "real physical device" from this list and test it.
Can we realy relly on this
build.prop
?Is there any chance that devices from Firebase Test Lab or AWS Device Farm would behave differenlty than a common physical device?
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions