mirror of
https://github.com/gryf/mc_adbfs.git
synced 2025-12-18 20:10:21 +01:00
Added basic support for not rooted devices
This commit is contained in:
20
adbfs
20
adbfs
@@ -16,7 +16,7 @@ import re
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
__version__ = 0.8
|
__version__ = 0.9
|
||||||
|
|
||||||
XDG_CONFIG_HOME = os.getenv("XDG_CONFIG_HOME", os.path.expanduser("~/.config"))
|
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_):
|
def _retrieve_single_dir_list(self, dir_):
|
||||||
"""Retrieve file list using adb"""
|
"""Retrieve file list using adb"""
|
||||||
command = ["adb", "shell", "su", "-c"]
|
if self._got_root:
|
||||||
command.append(self.conf.box['rls'].format(dir_))
|
command = ["adb", "shell", "su", "-c",
|
||||||
|
self.conf.box['rls'].format(dir_)]
|
||||||
|
else:
|
||||||
|
command = ["adb", "shell"]
|
||||||
|
command += self.conf.box['rls'].format(dir_).split(' ')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.conf.debug:
|
if self.conf.debug:
|
||||||
@@ -352,12 +356,16 @@ class Adb(object):
|
|||||||
|
|
||||||
def _retrieve_file_list(self, root=None):
|
def _retrieve_file_list(self, root=None):
|
||||||
"""Retrieve file list using adb"""
|
"""Retrieve file list using adb"""
|
||||||
command = ["adb", "shell", "su", "-c"]
|
|
||||||
|
|
||||||
if not root:
|
if not root:
|
||||||
command.append(self.conf.box['ls'])
|
lscmd = self.conf.box['ls']
|
||||||
else:
|
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:
|
try:
|
||||||
if self.conf.debug:
|
if self.conf.debug:
|
||||||
|
|||||||
Reference in New Issue
Block a user