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
66b6098d
Commit
66b6098d
authored
Aug 22, 2016
by
Pierre-Hugues Husson
Committed by
topjohnwu
Sep 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MTK ramdisk: Specify whether ramdisk is for boot.img or recovery.img
parent
348bc1d0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
extract.c
jni/extract.c
+7
-0
repack.c
jni/repack.c
+7
-1
No files found.
jni/extract.c
View file @
66b6098d
...
...
@@ -27,6 +27,13 @@ void dump_ramdisk(uint8_t *ptr, size_t size) {
dump
(
ptr
,
size
,
"ramdisk.gz"
);
//MTK header
}
else
if
(
memcmp
(
ptr
,
"
\x88\x16\x88\x58
"
,
4
)
==
0
)
{
if
(
memcmp
(
ptr
+
4
,
"RECOVERY"
,
8
)
==
0
)
{
dump
(
ptr
,
0
,
"ramdisk-mtk-recovery"
);
}
else
if
(
memcmp
(
ptr
+
4
,
"ROOTFS
\0\0
"
,
8
)
==
0
)
{
dump
(
ptr
,
0
,
"ramdisk-mtk-boot"
);
}
else
{
exit
(
1
);
}
dump
(
ptr
,
0
,
"ramdisk-mtk"
);
//Create an mtk flag
dump_ramdisk
(
ptr
+
512
,
size
-
512
);
}
else
{
...
...
jni/repack.c
View file @
66b6098d
...
...
@@ -39,7 +39,13 @@ int append_ramdisk(int ofd, off_t pos) {
//TODO: RECOVERY OR ROOTFS?
char
str
[
32
];
memset
(
str
,
0
,
sizeof
(
str
));
if
(
access
(
"ramdisk-mtk-boot"
,
R_OK
)
==
0
)
{
strcpy
(
str
,
"ROOTFS"
);
}
else
if
(
access
(
"ramdisk-mtk-recovery"
,
R_OK
)
==
0
)
{
strcpy
(
str
,
"RECOVERY"
);
}
else
{
exit
(
1
);
}
memcpy
(
buf
+
8
,
str
,
sizeof
(
str
));
memset
(
buf
+
8
+
sizeof
(
str
),
0xff
,
512
-
8
-
sizeof
(
str
));
...
...
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