PinNaCode / magiskboot_build

unofficial magiskboot build system (and port) targeting multi-platform (does not require NDK)
Apache License 2.0
150 stars 23 forks source link

Non-ASCII file paths doesn't work on Windows #26

Closed ghost closed 6 months ago

ghost commented 6 months ago

i came across this while debugging #25 ...

❯ ~/magiskboot_build/build/magiskboot_debug.exe unpack -h ./中国語テスト/boot.img
The system cannot find the path specified. (os error 3)
ghost commented 6 months ago

i wonder if it was caused by this line in libmagiskbase-rs ...

we are currently using system default code page (locale specific) on windows, which is not utf-8, so this is a problem when a file path contains non-ASCII character, bcs it will not be able to be decoded as UTF-8

ghost commented 6 months ago

removing this check seems to help

❯ ~/magiskboot_build/build/magiskboot_debug.exe unpack -h ./中国語テスト/boot.img
Parsing boot image: [./中国語テスト/boot.img]
HEADER_VER      [4]
KERNEL_SZ       [46771916]
RAMDISK_SZ      [1380092]
OS_VERSION      [12.0.0]
OS_PATCH_LEVEL  [2023-08]
PAGESIZE        [4096]
CMDLINE         []
KERNEL_FMT      [raw]
RAMDISK_FMT     [lz4_legacy]
[boot\sign.rs:261] unexpected ASN.1 DER tag: expected SEQUENCE, got APPLICATION [1] (primitive)
VBMETA
ghost commented 6 months ago

landed in latest releases