mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 20:17:37 +00:00
Try to repair boot_hdr v1 entries
This commit is contained in:
parent
5d3a8a5b1a
commit
08cd5b81d1
@ -440,6 +440,10 @@ void repack(const char* orig_image, const char* out_image) {
|
|||||||
// Print new image info
|
// Print new image info
|
||||||
boot.print_hdr();
|
boot.print_hdr();
|
||||||
|
|
||||||
|
// Try to fix the header
|
||||||
|
if (boot.header_version() && boot.header_size() == 0)
|
||||||
|
boot.header_size(sizeof(boot_img_hdr));
|
||||||
|
|
||||||
// Main header
|
// Main header
|
||||||
memcpy(boot.map_addr + header_off, boot.hdr, boot.hdr_size());
|
memcpy(boot.map_addr + header_off, boot.hdr, boot.hdr_size());
|
||||||
|
|
||||||
|
@ -207,6 +207,8 @@ static_cast<boot_img_hdr_v1 *>(hdr)->x)
|
|||||||
hdr_set(recovery_dtbo_size, uint32_t);
|
hdr_set(recovery_dtbo_size, uint32_t);
|
||||||
hdr_get(recovery_dtbo_offset, uint32_t);
|
hdr_get(recovery_dtbo_offset, uint32_t);
|
||||||
hdr_set(recovery_dtbo_offset, uint32_t);
|
hdr_set(recovery_dtbo_offset, uint32_t);
|
||||||
|
hdr_get(header_size, uint32_t);
|
||||||
|
hdr_set(header_size, uint32_t);
|
||||||
|
|
||||||
uint32_t header_version() {
|
uint32_t header_version() {
|
||||||
if (IS_PXA)
|
if (IS_PXA)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user