From f5236878b05dd12a441f2a4938b91a588c76c25f Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 1 Dec 2021 11:40:44 +0100 Subject: [PATCH] Added Android platform detection --- RNS/Reticulum.py | 10 ++++++++-- RNS/__init__.py | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/RNS/Reticulum.py b/RNS/Reticulum.py index 2d03d3e..47770a0 100755 --- a/RNS/Reticulum.py +++ b/RNS/Reticulum.py @@ -1,8 +1,14 @@ -from .Interfaces import * +from .vendor.platformutils import get_platform + +if get_platform() == "android": + # TODO: Selectively import Android-relevant interfaces + pass +else: + from .Interfaces import * + from .vendor.configobj import ConfigObj import configparser import multiprocessing.connection -import RNS import signal import threading import atexit diff --git a/RNS/__init__.py b/RNS/__init__.py index e54ef3a..33084da 100755 --- a/RNS/__init__.py +++ b/RNS/__init__.py @@ -67,6 +67,10 @@ def loglevelname(level): def version(): return __version__ +def host_os(): + from .vendor.platformutils import get_platform + return get_platform() + def log(msg, level=3, _override_destination = False): global _always_override_destination