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
81542fc6
Commit
81542fc6
authored
Mar 28, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MTK header support
parent
5aced279
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
parseimg.c
jni/magiskboot/parseimg.c
+2
-1
repack.c
jni/magiskboot/repack.c
+2
-2
No files found.
jni/magiskboot/parseimg.c
View file @
81542fc6
...
...
@@ -16,9 +16,10 @@ static void check_headers() {
printf
(
"MTK header found in kernel
\n
"
);
mtk_kernel
=
1
;
}
if
(
check_type
(
ramdisk
)
==
MTK
)
{
if
(
ramdisk_type
==
MTK
)
{
printf
(
"MTK header found in ramdisk
\n
"
);
mtk_ramdisk
=
1
;
ramdisk_type
=
check_type
(
ramdisk
+
512
);
}
// Check dtb if ELF boot
...
...
jni/magiskboot/repack.c
View file @
81542fc6
...
...
@@ -53,7 +53,7 @@ void repack(const char* orig_image, const char* out_image) {
// Restore kernel
if
(
mtk_kernel
)
{
mtk_kernel_off
=
lseek
(
fd
,
0
,
SEEK_CUR
);
write_zero
(
fd
,
512
);
restore_buf
(
fd
,
kernel
,
512
);
memcpy
(
&
mtk_kernel_hdr
,
kernel
,
sizeof
(
mtk_kernel_hdr
));
}
hdr
.
kernel_size
=
restore
(
KERNEL_FILE
,
fd
);
...
...
@@ -62,7 +62,7 @@ void repack(const char* orig_image, const char* out_image) {
// Restore ramdisk
if
(
mtk_ramdisk
)
{
mtk_ramdisk_off
=
lseek
(
fd
,
0
,
SEEK_CUR
);
write_zero
(
fd
,
512
);
restore_buf
(
fd
,
ramdisk
,
512
);
memcpy
(
&
mtk_ramdisk_hdr
,
ramdisk
,
sizeof
(
mtk_ramdisk_hdr
));
}
if
(
access
(
RAMDISK_FILE
,
R_OK
)
==
0
)
{
...
...
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