V
V
Vladimir Korotenko2020-02-27 13:21:26
iPhone
Vladimir Korotenko, 2020-02-27 13:21:26

How to detect IPhone, Android emulator?

Actually, the question arose of how to determine that the application is running in the emulator, a related issue is detecting work through VPN and geolocation substitution.

Help with links and works on similar topics.
From the Xamarin side, everything is more or less standard, in the case of Android, it is apparently necessary to look towards the NDK and its module for detection.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2020-03-07
@firedragon

1. As an option, you can try to request the version of the device model using the Build class (from the android.os package), which returns various string resources (and not just string ones). We need a MODEL string .
on android emulators in this line most often lies something like this: Android SDK Build for x86 , etc.

import android.os.Build;
...
String s = Build.MODEL;
...

2. Detection of work through VPN.
The old ways of checking, listening to network interfaces are no longer relevant in the latest versions of the OS.
Here you can check the user's IP address, but this is not a 100% option either. It was also noticed that the Google search engine somehow understands that they came to it to search through a VPN connection and asks to enter a captcha. But I don’t know how true this thing is - if you knock on Google and get the content of the page in response from Google, look at the captcha there or not .. then repeat this operation a couple more times.
3. Substitution of geolocation.
In theory, how does substitution work? If the user turns on in the developer options "location simulation" + an application that will simulate the "left" gps coordinates (there are tons of them in the market that do this). I don’t know how this scheme differs in the simulation of coordinates on old devices. Try to somehow pull the flag responsible for the simulation of locations, which is located in the developer options. If it is at all realistic at the moment. PS: for most of some operations on new devices, getting system data and other things, you may need the appropriate permission in the manifest.
---
I will look for more details about this at my leisure ..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question