Better Android detection

This commit is contained in:
Mark Qvist 2022-01-12 11:50:03 +01:00
parent 25620415a0
commit bec8473695
1 changed files with 16 additions and 2 deletions

View File

@ -1,11 +1,25 @@
def get_platform():
from os import environ
if 'ANDROID_ARGUMENT' in environ:
return 'android'
if "ANDROID_ARGUMENT" in environ:
return "android"
elif "ANDROID_ROOT" in environ:
return "android"
else:
import sys
return sys.platform
def is_darwin():
if get_platform() == "darwin":
return True
else:
return False
def is_android():
if get_platform() == "android":
return True
else:
return False
def is_windows():
if str(get_platform()).startswith("win"):
return True