Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Added test case for ch/qos/logback/classic/spi/ClassPackagingData which exposed a precision loss bug: the smali parser was converting 64-bit hex literals with L suffix to JavaScript numbers, losing precision beyond 53 bits.

Example of the bug:

// Input smali: .field serialVersionUID:J = -0xb2aaacd13ec78e9L
// Expected: -804643281218337001n
// Actual:   -804643281218337024n (23 off due to precision loss)

Changes

  • smaliParser.ts: Modified smaliHexNumberParser to detect L suffix and return BigInt instead of using Number.parseInt()
  • smaliParser.ts: Added smaliFieldValueParser union to support both number | bigint for field initial values while keeping existing parsers typed as number only
  • smaliParser.ts: Updated static value detection and array building to handle bigint type
  • dalvikExecutableParserAgainstSmaliParser.test.ts: Added ch/qos/logback/classic/spi/ClassPackagingData test case
Original prompt

This section details on the original issue you should resolve

<issue_title>Add bafybeibbupm7uzhuq4pa674rb2amxsenbdaoijigmaf4onaodaql4mh7yy + ch/qos/logback/classic/spi/ClassPackagingData parseDexAgainstSmaliMacro test like others and make it pass</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…gInt parsing in smali parser

Co-authored-by: futpib <4330357+futpib@users.noreply.github.com>
@futpib futpib marked this pull request as ready for review November 14, 2025 17:33
Copilot AI changed the title [WIP] Add parseDexAgainstSmaliMacro test and make it pass Add ClassPackagingData test and fix BigInt precision loss in smali parser Nov 14, 2025
Copilot AI requested a review from futpib November 14, 2025 17:40
@coveralls
Copy link

coveralls commented Nov 14, 2025

Pull Request Test Coverage Report for Build 19372591822

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 63 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.08%) to 94.088%

Files with Coverage Reduction New Missed Lines %
build/smaliParser.js 63 95.43%
Totals Coverage Status
Change from base Build 19371936368: -0.08%
Covered Lines: 7942
Relevant Lines: 8434

💛 - Coveralls

@futpib futpib merged commit 8aaa722 into master Nov 14, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants