Better Android detection

This commit is contained in:
Mark Qvist 2022-01-12 11:50:03 +01:00
parent 25620415a0
commit bec8473695

View File

@ -1,11 +1,25 @@
def get_platform(): def get_platform():
from os import environ from os import environ
if 'ANDROID_ARGUMENT' in environ: if "ANDROID_ARGUMENT" in environ:
return 'android' return "android"
elif "ANDROID_ROOT" in environ:
return "android"
else: else:
import sys import sys
return sys.platform 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(): def is_windows():
if str(get_platform()).startswith("win"): if str(get_platform()).startswith("win"):
return True return True