Skip to content

UnicodeDecodeError when copy android 14 system apk #51

@imianz

Description

@imianz
Traceback (most recent call last):
  File "/home/user/.local/bin/adbsync", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/user/.local/share/pipx/venvs/betteradbsync/lib/python3.12/site-packages/BetterADBSync/__init__.py", line 374, in main
    files_tree_source = fs_source.get_files_tree(path_source, follow_links = args.copy_links)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/share/pipx/venvs/betteradbsync/lib/python3.12/site-packages/BetterADBSync/FileSystems/Base.py", line 45, in get_files_tree
    return self._get_files_tree(tree_path, statObject, follow_links = follow_links)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/share/pipx/venvs/betteradbsync/lib/python3.12/site-packages/BetterADBSync/FileSystems/Base.py", line 33, in _get_files_tree
    tree[filename] = self._get_files_tree(
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/share/pipx/venvs/betteradbsync/lib/python3.12/site-packages/BetterADBSync/FileSystems/Base.py", line 33, in _get_files_tree
    tree[filename] = self._get_files_tree(
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/share/pipx/venvs/betteradbsync/lib/python3.12/site-packages/BetterADBSync/FileSystems/Base.py", line 30, in _get_files_tree
    for filename, stat_object_child, in self.lstat_in_dir(tree_path):
  File "/home/user/.local/share/pipx/venvs/betteradbsync/lib/python3.12/site-packages/BetterADBSync/FileSystems/Android.py", line 176, in lstat_in_dir
    for line in self.adb_shell(["ls", "-la", path]):
  File "/home/user/.local/share/pipx/venvs/betteradbsync/lib/python3.12/site-packages/BetterADBSync/FileSystems/Android.py", line 87, in adb_shell
    adb_line = adb_line.decode(self.adb_encoding).rstrip("\r\n")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 65: invalid start byte

Hi,
this error occurs during backup my data using "adbsync --show-progress pull".
The file responsible for the error is named "Connessione salute 14.apk" and is part of android system, the english version should be "Health Connect 14.apk".

Here the first 112 bytes of this file:

Connessione Salute 14.apk                                                      
00000 0000:  50 4B 03 04 0A 00 00 08  00 00 00 00 21 3A E9 9A  PK...... ....!:..
00000 0010:  A5 A9 0E 00 00 00 0E 00  00 00 2F 00 0B 00 4D 45  ........ ../...ME
00000 0020:  54 41 2D 49 4E 46 2F 61  6E 64 72 6F 69 64 78 2E  TA-INF/a ndroidx.
00000 0030:  61 63 74 69 76 69 74 79  5F 61 63 74 69 76 69 74  activity _activit
00000 0040:  79 2D 6B 74 78 2E 76 65  72 73 69 6F 6E FE CA 00  y-ktx.ve rsion...
00000 0050:  00 35 D9 03 00 04 00 00  31 2E 39 2E 30 2D 61 6C  .5...... 1.9.0-al
00000 0060:  70 68 61 30 33 0A 50 4B  03 04 0A 00 00 08 00 00  pha03.PK ........
                            ^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions