mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 09:17:50 +00:00
parent
22662d7e03
commit
e613855a4f
@ -196,6 +196,9 @@ public class SignBoot {
|
|||||||
int secondSize = image.getInt();
|
int secondSize = image.getInt();
|
||||||
image.getLong(); // second_addr + tags_addr
|
image.getLong(); // second_addr + tags_addr
|
||||||
int pageSize = image.getInt();
|
int pageSize = image.getInt();
|
||||||
|
if (pageSize >= 0x02000000) {
|
||||||
|
throw new IllegalArgumentException("Invalid image header: PXA header detected");
|
||||||
|
}
|
||||||
int length = pageSize // include the page aligned image header
|
int length = pageSize // include the page aligned image header
|
||||||
+ ((kernelSize + pageSize - 1) / pageSize) * pageSize
|
+ ((kernelSize + pageSize - 1) / pageSize) * pageSize
|
||||||
+ ((ramdskSize + pageSize - 1) / pageSize) * pageSize
|
+ ((ramdskSize + pageSize - 1) / pageSize) * pageSize
|
||||||
@ -214,8 +217,7 @@ public class SignBoot {
|
|||||||
image.getLong(); // dtb address
|
image.getLong(); // dtb address
|
||||||
}
|
}
|
||||||
if (image.position() != headerSize) {
|
if (image.position() != headerSize) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException("Invalid image header: invalid header length");
|
||||||
"Invalid image header: invalid header length");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// headerVersion is 0 or actually dt/extra size in this case
|
// headerVersion is 0 or actually dt/extra size in this case
|
||||||
|
Loading…
x
Reference in New Issue
Block a user