mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 04:10:13 +02:00
Fix the start offset when calculating the signature header value
This commit is contained in:
parent
20f675b86b
commit
b49126325f
@ -51,9 +51,15 @@ public class HeaderItem {
|
|||||||
|
|
||||||
public static final int CHECKSUM_OFFSET = 8;
|
public static final int CHECKSUM_OFFSET = 8;
|
||||||
|
|
||||||
|
// this is the start of the checksumed data
|
||||||
|
public static final int CHECKSUM_DATA_START_OFFSET = 12;
|
||||||
public static final int SIGNATURE_OFFSET = 12;
|
public static final int SIGNATURE_OFFSET = 12;
|
||||||
public static final int SIGNATURE_SIZE = 20;
|
public static final int SIGNATURE_SIZE = 20;
|
||||||
|
|
||||||
|
// this is the start of the sha-1 hashed data
|
||||||
|
public static final int SIGNATURE_DATA_START_OFFSET = 32;
|
||||||
|
public static final int FILE_SIZE_OFFSET = 32;
|
||||||
|
|
||||||
public static final int HEADER_SIZE_OFFSET = 36;
|
public static final int HEADER_SIZE_OFFSET = 36;
|
||||||
|
|
||||||
public static final int ENDIAN_TAG_OFFSET = 40;
|
public static final int ENDIAN_TAG_OFFSET = 40;
|
||||||
|
@ -236,7 +236,7 @@ public abstract class DexWriter<
|
|||||||
}
|
}
|
||||||
|
|
||||||
byte[] buffer = new byte[4 * 1024];
|
byte[] buffer = new byte[4 * 1024];
|
||||||
InputStream input = dataStore.readAt(HeaderItem.HEADER_SIZE_OFFSET);
|
InputStream input = dataStore.readAt(HeaderItem.SIGNATURE_DATA_START_OFFSET);
|
||||||
int bytesRead = input.read(buffer);
|
int bytesRead = input.read(buffer);
|
||||||
while (bytesRead >= 0) {
|
while (bytesRead >= 0) {
|
||||||
md.update(buffer, 0, bytesRead);
|
md.update(buffer, 0, bytesRead);
|
||||||
@ -258,7 +258,7 @@ public abstract class DexWriter<
|
|||||||
Adler32 a32 = new Adler32();
|
Adler32 a32 = new Adler32();
|
||||||
|
|
||||||
byte[] buffer = new byte[4 * 1024];
|
byte[] buffer = new byte[4 * 1024];
|
||||||
InputStream input = dataStore.readAt(HeaderItem.SIGNATURE_OFFSET);
|
InputStream input = dataStore.readAt(HeaderItem.CHECKSUM_DATA_START_OFFSET);
|
||||||
int bytesRead = input.read(buffer);
|
int bytesRead = input.read(buffer);
|
||||||
while (bytesRead >= 0) {
|
while (bytesRead >= 0) {
|
||||||
a32.update(buffer, 0, bytesRead);
|
a32.update(buffer, 0, bytesRead);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user