1
0
mirror of https://github.com/gryf/mc_adbfs.git synced 2025-12-18 12:00:19 +01:00

Added basic support for not rooted devices

This commit is contained in:
2017-03-06 17:10:15 +01:00
parent 210d7f2962
commit 7a6a8a499b

20
adbfs
View File

@@ -16,7 +16,7 @@ import re
import subprocess
import sys
__version__ = 0.8
__version__ = 0.9
XDG_CONFIG_HOME = os.getenv("XDG_CONFIG_HOME", os.path.expanduser("~/.config"))
@@ -298,8 +298,12 @@ class Adb(object):
def _retrieve_single_dir_list(self, dir_):
"""Retrieve file list using adb"""
command = ["adb", "shell", "su", "-c"]
command.append(self.conf.box['rls'].format(dir_))
if self._got_root:
command = ["adb", "shell", "su", "-c",
self.conf.box['rls'].format(dir_)]
else:
command = ["adb", "shell"]
command += self.conf.box['rls'].format(dir_).split(' ')
try:
if self.conf.debug:
@@ -352,12 +356,16 @@ class Adb(object):
def _retrieve_file_list(self, root=None):
"""Retrieve file list using adb"""
command = ["adb", "shell", "su", "-c"]
if not root:
command.append(self.conf.box['ls'])
lscmd = self.conf.box['ls']
else:
command.append(self.conf.box['rls'].format(root.filepath))
lscmd = self.conf.box['rls'].format(root.filepath)
if self._got_root:
command = ["adb", "shell", "su", "-c", lscmd]
else:
command = ["adb", "shell"] + lscmd.split()
try:
if self.conf.debug: