-
-
Save 5l/eefbbca00bbb1b4740ca to your computer and use it in GitHub Desktop.
Idolm@ster CG Starlight Stage, Emulator Check Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool isEmulator() | |
{ | |
Process[] processes = Process.GetProcesses(); | |
Process[] array = processes; | |
for (int i = 0; i < array.Length; i++) | |
{ | |
Process process = array[i]; | |
if (process.ProcessName.Contains("com.bluestacks")) | |
{ | |
return true; | |
} | |
} | |
using (AndroidJavaClass androidJavaClass = new AndroidJavaClass("android.os.Build")) | |
{ | |
if (androidJavaClass.GetStatic<string>("TYPE") == "userdebug") | |
{ | |
bool result = true; | |
return result; | |
} | |
if (androidJavaClass.GetStatic<string>("SERIAL") == "unknown" && androidJavaClass.GetStatic<string>("BOARD") == "unknown") | |
{ | |
bool result = true; | |
return result; | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment