openatx / adbutils

pure python adb library for google adb service.
MIT License
736 stars 173 forks source link

是否可以实现类似“adb root”这种命令 #48

Closed firmianay closed 2 years ago

firmianay commented 2 years ago

想要pull /system,但是需要root权限

firmianay commented 2 years ago

以及是否可以sync.pull一个目录

nblog commented 2 years ago

参考 adb root

codeskyblue commented 2 years ago

supported in 0.15.5

yinkh commented 2 years ago

use device.root() get this error on window10 paltform in adbutils==1.0.3

  File "D:\python_workspace\TestKit\adb\views.py", line 54, in save_dropbox
    a = device.root()
  File "D:\python_workspace\TestKit\venv\lib\site-packages\adbutils\_device.py", line 324, in root
    return c.read_string_block()
  File "D:\python_workspace\TestKit\venv\lib\site-packages\adbutils\_adb.py", line 118, in read_string_block
    size = int(length, 16)
ValueError: invalid literal for int() with base 16: 'rest'
yinkh commented 2 years ago

change return c.read_string_block() to return c.read_until_close() inside root will fix this bug,need pr?

codeskyblue commented 2 years ago

fix in 1.0.5

yinkh commented 2 years ago

confirm fixed! image