GithubHelp home page GithubHelp logo

Comments (6)

ipcjs avatar ipcjs commented on July 28, 2024 1

modify

        b'(', b'(;  #`ls`$PATH\'"(\\\\\\\\){};!\xc0\xaf\xff\xc2\xbf'

to

        b'(', '(;  #`ls`$PATH\'"(\\\\\\\\){};!\xc0\xaf\xff\xc2\xbf'

can fix the problem : )

from adb-sync.

sonicer105 avatar sonicer105 commented on July 28, 2024

I also have this issue

D:\Sources\adb-sync>C:\Users\redacted\AppData\Local\Programs\Python\Python38\python.exe adb-sync -R /storage/emulated/0/Music C:\Users\redacted\Desktop\Backup\Music
INFO:root:Sync: local b'C:\\Users\\redacted\\Desktop\\Backup\\Music/Music', remote b'/storage/emulated/0/Music'
Traceback (most recent call last):
  File "adb-sync", line 883, in <module>
    main()
  File "adb-sync", line 870, in main
    if not syncer.IsWorking():
  File "adb-sync", line 507, in IsWorking
    return self.adb.IsWorking()
  File "adb-sync", line 219, in IsWorking
    with Stdout(self.adb +
  File "adb-sync", line 76, in __init__
    self.popen = subprocess.Popen(args, stdout=subprocess.PIPE)
  File "C:\Users\redacted\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\redacted\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1247, in _execute_child
    args = list2cmdline(args)
  File "C:\Users\redacted\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 549, in list2cmdline
    for arg in map(os.fsdecode, seq):
  File "C:\Users\redacted\AppData\Local\Programs\Python\Python38\lib\os.py", line 818, in fsdecode
    return filename.decode(encoding, errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 41: invalid start byte```

from adb-sync.

PiN73 avatar PiN73 commented on July 28, 2024

Same problem no Windows

C:\Users\Pavel\Phone>python adb-sync\adb-sync --reverse /sdcard/DCIM .
INFO:root:Sync: local b'./DCIM', remote b'/sdcard/DCIM'
Traceback (most recent call last):
  File "adb-sync\adb-sync", line 883, in <module>
    main()
  File "adb-sync\adb-sync", line 870, in main
    if not syncer.IsWorking():
  File "adb-sync\adb-sync", line 507, in IsWorking
    return self.adb.IsWorking()
  File "adb-sync\adb-sync", line 219, in IsWorking
    with Stdout(self.adb +
  File "adb-sync\adb-sync", line 76, in __init__
    self.popen = subprocess.Popen(args, stdout=subprocess.PIPE)
  File "C:\Users\Pavel\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\Pavel\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1247, in _execute_child
    args = list2cmdline(args)
  File "C:\Users\Pavel\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 549, in list2cmdline
    for arg in map(os.fsdecode, seq):
  File "C:\Users\Pavel\AppData\Local\Programs\Python\Python38\lib\os.py", line 818, in fsdecode
    return filename.decode(encoding, errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 41: invalid start byte

Sync seems working after I disable checks in IsWorking function e.g. made it just return True, but I think it should be a better way to fix it

from adb-sync.

watson96 avatar watson96 commented on July 28, 2024

modify

        b'(', b'(;  #`ls`$PATH\'"(\\\\\\\\){};!\xc0\xaf\xff\xc2\xbf'

to

        b'(', '(;  #`ls`$PATH\'"(\\\\\\\\){};!\xc0\xaf\xff\xc2\xbf'

can fix the problem : )

Now returns with error:

C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools>python adb-sync -R /sdcard/Movies/ "C:\Users\sriva\Desktop"
INFO:root:Sync: local b'C:\Users\sriva\Desktop"', remote b'/sdcard/Movies/'
Traceback (most recent call last):
File "C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools\adb-sync", line 883, in
main()
File "C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools\adb-sync", line 870, in main
if not syncer.IsWorking():
File "C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools\adb-sync", line 507, in IsWorking
return self.adb.IsWorking()
File "C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools\adb-sync", line 221, in IsWorking
b'date +%s' % (self.QuoteArgument(test_string),)]) as stdout:
File "C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools\adb-sync", line 201, in QuoteArgument
arg = arg.replace(b'\', b'\\')
TypeError: replace() argument 1 must be str, not bytes

from adb-sync.

Khaja786431 avatar Khaja786431 commented on July 28, 2024

Can anyone help to resolve the issue.
Traceback (most recent call last):
File "C:\Baymax_v0.3\install.py", line 112, in
if res.decode().count("Android Debug Bridge version") > 0:
^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 92: invalid start byte

from adb-sync.

freemedom avatar freemedom commented on July 28, 2024
    test_strings = [
        b'(', b'(;  #`ls`$PATH\'"(\\\\\\\\){};!'
    ]

Remove \xc0\xaf\xff\xc2\xbf and it will work. I actually don't think the IsWorking function here is very necessary. This paragraph is presumably to test whether some special characters that may be present in the file name can interact properly.

I guess this is probably due to the different decode mechanism of python3 and python2.

Reference:
https://stackoverflow.com/questions/23772144/python-unicodedecodeerror-utf8-codec-cant-decode-byte-0xc0-in-position-0-i
https://security.stackexchange.com/questions/48879/why-does-directory-traversal-attack-c0af-work

image

from adb-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.