Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
290a17a7
Commit
290a17a7
authored
May 20, 2019
by
Chris Renshaw
Committed by
topjohnwu
May 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
magiskboot: fix bootimg hdr v2 checksum generation
- new AOSP dtb section was missing from HASH_update
parent
8c40db57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
bootimg.cpp
native/jni/magiskboot/bootimg.cpp
+7
-1
No files found.
native/jni/magiskboot/bootimg.cpp
View file @
290a17a7
...
...
@@ -345,7 +345,7 @@ int unpack(const char *image, bool hdr) {
void
repack
(
const
char
*
orig_image
,
const
char
*
out_image
)
{
boot_img
boot
{};
off_t
header_off
,
kernel_off
,
ramdisk_off
,
second_off
,
extra_off
;
off_t
header_off
,
kernel_off
,
ramdisk_off
,
second_off
,
extra_off
,
dtb_off
;
// Parse original image
boot
.
parse_file
(
orig_image
);
...
...
@@ -475,6 +475,7 @@ void repack(const char* orig_image, const char* out_image) {
}
// dtb
dtb_off
=
lseek
(
fd
,
0
,
SEEK_CUR
);
if
(
access
(
DTB_FILE
,
R_OK
)
==
0
)
{
boot
.
hdr
.
dtb_size
()
=
restore
(
DTB_FILE
,
fd
);
file_align
();
...
...
@@ -527,6 +528,11 @@ void repack(const char* orig_image, const char* out_image) {
size
=
boot
.
hdr
.
recovery_dtbo_size
();
HASH_update
(
&
ctx
,
boot
.
map_addr
+
boot
.
hdr
.
recovery_dtbo_offset
(),
size
);
HASH_update
(
&
ctx
,
&
size
,
sizeof
(
size
));
size
=
boot
.
hdr
.
dtb_size
();
if
(
size
)
{
HASH_update
(
&
ctx
,
boot
.
map_addr
+
dtb_off
,
size
);
HASH_update
(
&
ctx
,
&
size
,
sizeof
(
size
));
}
}
memset
(
boot
.
hdr
.
id
(),
0
,
32
);
memcpy
(
boot
.
hdr
.
id
(),
HASH_final
(
&
ctx
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment