diff --git a/payload_reader/src/main/java/com/meituan/android/walle/ApkUtil.java b/payload_reader/src/main/java/com/meituan/android/walle/ApkUtil.java index e5151da..a730064 100644 --- a/payload_reader/src/main/java/com/meituan/android/walle/ApkUtil.java +++ b/payload_reader/src/main/java/com/meituan/android/walle/ApkUtil.java @@ -126,7 +126,7 @@ public static long findCentralDirStartOffset(final FileChannel fileChannel, fina zipCentralDirectoryStart.order(ByteOrder.LITTLE_ENDIAN); fileChannel.position(fileChannel.size() - commentLength - 6); // 6 = 2 (Comment length) + 4 (Offset of start of central directory, relative to start of archive) fileChannel.read(zipCentralDirectoryStart); - final long centralDirStartOffset = zipCentralDirectoryStart.getInt(0); + final long centralDirStartOffset = zipCentralDirectoryStart.getInt(0) & 0xFFFFFFFFL; return centralDirStartOffset; }