Android模拟器检测

时间:2019-06-23 10:21:20

标签: android android-emulator

我需要更改检测android仿真。可能有人知道方法吗?我知道这个变量,但是如何在不同的模拟器上进行更改?

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);
}

0 个答案:

没有答案