Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/dalvikExecutableParserAgainstSmaliParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ const testCasesByCid: Record<string, Array<string | { smaliFilePath: string; iso
{ smaliFilePath: 'androidx/constraintlayout/widget/ConstraintLayout$a', isolate: true },
{ smaliFilePath: 'l4/a', isolate: true },
{ smaliFilePath: 'n4/o', isolate: true },
{ smaliFilePath: 'o6/f', isolate: true },
{ smaliFilePath: 'a', isolate: true },
{ smaliFilePath: 'a/b', isolate: true },
{ smaliFilePath: 'f/b', isolate: true },
Expand Down
6 changes: 3 additions & 3 deletions src/smaliParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2773,12 +2773,12 @@ export const smaliParser: Parser<DalvikExecutableClassDefinition<DalvikBytecode>
// Sort method annotations to match DEX file order (lexicographic by method name, then prototype shorty)
// This matches the method_idx order in the DEX file's method_id table
.sort((a, b) => {
// Sort by method name first
// Sort by method name first (using code point comparison, not locale-aware)
if (a.method.name !== b.method.name) {
return a.method.name.localeCompare(b.method.name);
return a.method.name < b.method.name ? -1 : 1;
}
// Then by shorty (prototype signature)
return a.method.prototype.shorty.localeCompare(b.method.prototype.shorty);
return a.method.prototype.shorty < b.method.prototype.shorty ? -1 : 1;
}),
parameterAnnotations: annotations.parameterAnnotations.map(parameterAnnotation => ({
...parameterAnnotation,
Expand Down