Open l2m2 opened 3 years ago
使用aapt2时,若路径中有中文,可能回出现错误。 暂时的解决方案:将路径转换成短路径再处理。 可使用Win32 API GetShortPathNameW进行处理。
Python使用Win32 API转换成短路径的一个示例:
from ctypes import *
path = r"E:\workspace\中文\output\tmp\src\com.android.systemui\res"
buf = create_unicode_buffer(260)
GetLongPathName = windll.kernel32.GetShortPathNameW
rv = GetLongPathName(path, buf, 260)
print(buf.value)
https://l2m2.top/2021/06/17/2021-06-17-using-aapt2/