问题
I would like to block my app from running in emulators such as bluestacks/youwave etc. Is there anyway I can block or even identify if the user is running in bluestacks/youwave? My app has logging in features. So it users the server as well, so I dont mind blocking the user at clientside/serverside as long as he's blocked. Any help would be greatly appreciated.
回答1:
1: Check for SIM Number and deny access to whoever has none. This includes tablets since you stated that you wanted to block them.
Java:
TelephonyManager telemamanger = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String getSimSerialNumber = telemamanger.getSimSerialNumber();
String getSimNumber = telemamanger.getLine1Number();
Manifest.xml:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
2. Emulator kernel check.
If #1 fails because of user modifications to their emulator, check if (ro.kernel.qemu == 1). This property is read-only and will always return 1 for emulators.
来源:https://stackoverflow.com/questions/13464517/blocking-app-from-running-in-bluestacks-youwave-and-other-emulators