Tencent / tinker

Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.
Other
17.1k stars 3.33k forks source link

revert and fix parse cmdline bug #1669

Open waruqi opened 1 year ago

waruqi commented 1 year ago

cmdline 这块解析之前还能正常跑,新版本直接获取到一串非截断乱码。

while (len > 0 && (buf[len - 1] <= 0 || buf[len - 1] == 10 || buf[len - 1] == 13)) --len;

问题1: 为啥要改成尾遍历,如果 X 是无效字符,abd X edf XXXX 中间如果出现部分有效字符,这样获取的 len 就是有问题的,得从 0 开始遍历才对。

return new String(buf, StandardCharsets.US_ASCII);

问题2: 最后那个 len 算完,也没用进去哈。。。

tencent-adm commented 1 year ago

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.