From bec847369577242307de8e44e8d43250ed90a80b Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 12 Jan 2022 11:50:03 +0100 Subject: [PATCH] Better Android detection --- RNS/vendor/platformutils.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/RNS/vendor/platformutils.py b/RNS/vendor/platformutils.py index e22ee0c..cb322d0 100644 --- a/RNS/vendor/platformutils.py +++ b/RNS/vendor/platformutils.py @@ -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