mirror of
https://github.com/gryf/mc_adbfs.git
synced 2025-12-18 20:10:21 +01:00
Added toybox support
This commit is contained in:
@@ -11,7 +11,8 @@ Rquirements
|
||||
* Python 2.7
|
||||
* ``adb`` installed and in ``$PATH`` or provided via the config file
|
||||
* An Android device or emulator preferably rooted
|
||||
* Busybox installed and available in the path on the device
|
||||
* ``busybox`` (``toolbox``, ``toybox``) installed and available in the path on
|
||||
the device
|
||||
|
||||
Make sure, that issuing from command line:
|
||||
|
||||
@@ -82,14 +83,14 @@ where:
|
||||
everything (slow!)
|
||||
* ``suppress_colors`` this option will make ``busybox`` not to display colors,
|
||||
helpful, if ``busybox ls`` is configured to display colors by default. Does
|
||||
not affect ``toolbox``.
|
||||
not affect ``toolbox`` or ``toybox``.
|
||||
* ``root`` root directory to read. Everything outside of that directory will be
|
||||
omitted. That would be the fastest way to access certain location on the
|
||||
device. Note, that ``dirs_to_skip`` still apply inside this directory.
|
||||
* ``adb_command`` absolute or relative path to ``adb`` command. `~/` or
|
||||
environment variables are allowed.
|
||||
* ``adb_connect`` specifies if connection to specific device needs to be
|
||||
performed before accessing shell. It is usefull for *adb over network*
|
||||
performed before accessing shell. It is useful for *adb over network*
|
||||
feature. Typical value here is a device IP address with optional port, which
|
||||
defaults to 5555.
|
||||
|
||||
|
||||
24
adbfs
24
adbfs
@@ -48,7 +48,17 @@ class Conf(object):
|
||||
r'(?P<size>\d+)?\s'
|
||||
r'(?P<date>\d{4}-\d{2}-\d{2}\s'
|
||||
r'\d{2}:\d{2})\s'
|
||||
r'(?P<name>.*)'}}
|
||||
r'(?P<name>.*)'},
|
||||
'toybox': {'ls': 'toybox ls -anl',
|
||||
'rls': 'toybox ls -Ranl {}',
|
||||
'file_re': r'^(?P<perms>[-bcdlps][-rwxsStT]{9})\s+'
|
||||
r'(?P<links>\d+)\s+'
|
||||
r'(?P<uid>\d+)\s+'
|
||||
r'(?P<gid>\d+)\s+'
|
||||
r'(?P<size>\d+)?\s'
|
||||
r'(?P<date>\d{4}-\d{2}-\d{2}\s'
|
||||
r'\d{2}:\d{2})\s'
|
||||
r'(?P<name>.*)'}}
|
||||
|
||||
def __init__(self):
|
||||
self.box = None
|
||||
@@ -81,6 +91,18 @@ class Conf(object):
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
try:
|
||||
with open(os.devnull, 'w') as fnull:
|
||||
result = subprocess.check_output(cmd + ['toybox'],
|
||||
stderr=fnull)
|
||||
|
||||
if 'toybox' in result:
|
||||
self.box = Conf.boxes['toybox']
|
||||
Adb.file_re = re.compile(self.box['file_re'])
|
||||
return
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
try:
|
||||
with open(os.devnull, 'w') as fnull:
|
||||
result = subprocess.check_output(cmd + ['toolbox'],
|
||||
|
||||
Reference in New Issue
Block a user