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
8 changes: 4 additions & 4 deletions src/dalvikExecutableParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -947,11 +947,11 @@ const encodedValueIntParser: Parser<DalvikExecutableTaggedEncodedValue, Uint8Arr
return promiseCompose(
createFixedLengthSequenceParser(size),
uint8Array => {
const firstByte = uint8Array[0];
const firstBit = (firstByte & 0b1000_0000) >> 7;
const extensionByte = firstBit === 1 ? 0xFF : 0x00;
const lastByte = uint8Array[uint8Array.length - 1];
const signBit = (lastByte & 0b1000_0000) >> 7;
const extensionByte = signBit === 1 ? 0xFF : 0x00;

const buffer = Buffer.from([ extensionByte, ...uint8Array ]);
const buffer = Buffer.from([ ...uint8Array, extensionByte ]);
return { type: 'int' as const, value: buffer.readInt32LE(0) };
},
);
Expand Down
1 change: 1 addition & 0 deletions src/dalvikExecutableParserAgainstSmaliParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ const testCasesByCid: Record<string, Array<string | { smaliFilePath: string; iso
{ smaliFilePath: 'androidx/core/content/FileProvider', isolate: true },
{ smaliFilePath: 'androidx/core/view/KeyEventDispatcher', isolate: true },
{ smaliFilePath: 'com/google/android/exoplayer2/audio/Sonic', isolate: true },
{ smaliFilePath: 'com/google/android/exoplayer2/ext/opus/OpusDecoder', isolate: true },
{ smaliFilePath: 'com/google/android/gms/internal/common/zzg', isolate: true },
{ smaliFilePath: 'com/google/android/play/core/integrity/model/StandardIntegrityErrorCode', isolate: true },
{ smaliFilePath: 'com/google/common/math/IntMath', isolate: true },
Expand Down