Repository navigation
fix(arsc): 支持 FLAG_COMPACT 资源条目并修正边界校验 - #158
Open
trungduc22 wants to merge 1 commit into
Open
trungduc22 wants to merge 1 commit into
trungduc22 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
FLAG_COMPACT(0x0008) 紧凑资源条目:现代 AGP 8+ /aapt2 --enable-compact-entries会生成 8 字节紧凑ResTable_entry,其前 2 字节为key索引而非entrySize,高 8 位flags为dataType,后 4 字节直接存放data。此前ResTable._readValue将key误当作entrySize偏移并越界抛出RangeError(被apk.js吞掉后导致应用名与图标同时丢失)。at < 0 || entrySize < 8 || valueAt + 8 > buf.length检查,避免异常中断解析。parseConfiguiMode越界:uiMode位于偏移29,配置块长度需size >= 30 && off + 30 <= buf.length(此前size === 29会越界多读 1 字节)。本地测试(Windows 11, Node v26.13.1)
node test/run-tests.js:14 通过,0 失败(新增FLAG_COMPACT字符串/引用链及size=29边界回归测试)node test/i18n-test.js:26 通过,0 失败