Flutter技术实现:如何检测应用运行于LD Player模拟器
Detecting LD Player Simulator in Flutter Apps
I’ve faced similar headaches with hyper-realistic emulators like LD Player slipping past standard detection libraries. Let’s break down how to flag it using the device info you shared—there are several red flags we can leverage to spot it.
Key Detection Signals from Your Device Info
Looking at the device_info_plus output, here are the inconsistencies unique to LD Player:
- Mismatched Hardware/Brand/Model Fields: The device claims to be an
ASUS_Z01QDbut uses a Samsung board (SM-G975N) and product name (SM-G975N). Real physical devices never have conflicting brand/model/board values like this. - x86 Architecture with ARM Emulation: The
supportedAbislistsx86first, followed by ARM ABIs (armeabi-v7a,armeabi), andsupported64BitAbisis empty. The real ASUS_Z01QD uses an ARM64 chip, so this is a dead giveaway for an x86 emulator mimicking ARM. - Suspicious Fingerprint: The
fingerprintstarts withgoogle/android_x86/x86—real ASUS devices have fingerprints starting withasus/[device-name]/[device-name]. - Missing Critical Values:
bootloader: "unknown"andandroidId: nullare extremely rare on real devices, which almost always have valid entries here. - Unusual System Features: The
systemFeaturesincludesandroid.hardware.ethernet(rare on consumer phones) and Pixel-exclusive features likecom.google.android.feature.PIXEL_EXPERIENCEon an ASUS-branded device—this combination doesn’t exist in genuine hardware.
Flutter Implementation
Here’s a custom function to combine these checks using device_info_plus:
import 'package:device_info_plus/device_info_plus.dart'; Future<bool> isLDPlayer() async { final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); final AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; // Check for mismatched brand/model/board/product bool hasMismatchedHardware = androidInfo.brand == "asus" && androidInfo.model == "ASUS_Z01QD" && (androidInfo.board == "SM-G975N" || androidInfo.product == "SM-G975N"); // Check x86 architecture with empty 64-bit ABIs bool isX86Emulator = androidInfo.supportedAbis.isNotEmpty && androidInfo.supportedAbis.first == "x86" && androidInfo.supported64BitAbis.isEmpty; // Check suspicious android_x86 fingerprint bool hasAndroidX86Fingerprint = androidInfo.fingerprint.startsWith("google/android_x86/x86"); // Check missing bootloader or androidId bool hasMissingCriticalValues = androidInfo.bootloader == "unknown" && androidInfo.androidId == null; // Combine checks (use logical OR to cover all possible red flags) return hasMismatchedHardware || isX86Emulator || hasAndroidX86Fingerprint || hasMissingCriticalValues; }
Notes for Long-Term Maintenance
- Emulators like LD Player often update to patch these inconsistencies, so you’ll need to periodically test your detection logic on the latest LD Player version and adjust rules as needed.
- To reduce false positives, rely on multiple checks instead of a single signal. For example, a rare real x86 device might trigger the architecture check, but won’t have the mismatched brand/model fields.
- Validate this logic against real ASUS devices to ensure you don’t block legitimate users.
内容的提问来源于stack exchange,提问作者Moaz El-sawaf
相关产品推荐
相关产品推荐

