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
d780b5a0
Commit
d780b5a0
authored
Feb 22, 2018
by
worstperson
Committed by
John Wu
Mar 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for the Nook Tablet, Acclaim
Also changed occurences of NOOK with NOOKHD
parent
3e48427e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
11 deletions
+21
-11
bootimg.c
native/jni/magiskboot/bootimg.c
+14
-7
bootimg.h
native/jni/magiskboot/bootimg.h
+2
-1
format.h
native/jni/magiskboot/format.h
+5
-3
No files found.
native/jni/magiskboot/bootimg.c
View file @
d780b5a0
...
...
@@ -124,11 +124,16 @@ int parse_img(const char *image, boot_img *boot) {
fprintf
(
stderr
,
"PXA_BOOT_HDR
\n
"
);
boot
->
hdr
=
malloc
(
sizeof
(
pxa_boot_img_hdr
));
memcpy
(
boot
->
hdr
,
head
,
sizeof
(
pxa_boot_img_hdr
));
}
else
if
(
memcmp
(((
boot_img_hdr
*
)
head
)
->
cmdline
,
NOOK_MAGIC
,
12
)
==
0
||
memcmp
(((
boot_img_hdr
*
)
head
)
->
cmdline
,
NOOK_NEW_MAGIC
,
26
)
==
0
)
{
boot
->
flags
|=
NOOK_FLAG
;
fprintf
(
stderr
,
"NOOK_GREEN_LOADER
\n
"
);
head
+=
NOOK_PRE_HEADER_SZ
-
1
;
}
else
if
(
memcmp
(((
boot_img_hdr
*
)
head
)
->
cmdline
,
NOOKHD_MAGIC
,
12
)
==
0
||
memcmp
(((
boot_img_hdr
*
)
head
)
->
cmdline
,
NOOKHD_NEW_MAGIC
,
26
)
==
0
)
{
boot
->
flags
|=
NOOKHD_FLAG
;
fprintf
(
stderr
,
"NOOKHD_GREEN_LOADER
\n
"
);
head
+=
NOOKHD_PRE_HEADER_SZ
-
1
;
continue
;
}
else
if
(
memcmp
(((
boot_img_hdr
*
)
head
)
->
name
,
ACCLAIM_MAGIC
,
10
)
==
0
)
{
boot
->
flags
|=
ACCLAIM_FLAG
;
fprintf
(
stderr
,
"ACCLAIM_BAUWKSBOOT
\n
"
);
head
+=
ACCLAIM_PRE_HEADER_SZ
-
1
;
continue
;
}
else
{
boot
->
hdr
=
malloc
(
sizeof
(
boot_img_hdr
));
...
...
@@ -289,8 +294,10 @@ void repack(const char* orig_image, const char* out_image) {
}
else
if
(
boot
.
flags
&
BLOB_FLAG
)
{
// Skip blob header
write_zero
(
fd
,
sizeof
(
blob_hdr
));
}
else
if
(
boot
.
flags
&
NOOK_FLAG
)
{
restore_buf
(
fd
,
boot
.
map_addr
,
NOOK_PRE_HEADER_SZ
);
}
else
if
(
boot
.
flags
&
NOOKHD_FLAG
)
{
restore_buf
(
fd
,
boot
.
map_addr
,
NOOKHD_PRE_HEADER_SZ
);
}
else
if
(
boot
.
flags
&
ACCLAIM_FLAG
)
{
restore_buf
(
fd
,
boot
.
map_addr
,
ACCLAIM_PRE_HEADER_SZ
);
}
// Skip a page for header
...
...
native/jni/magiskboot/bootimg.h
View file @
d780b5a0
...
...
@@ -130,7 +130,8 @@ typedef struct blob_hdr {
#define LG_BUMP_FLAG 0x0040
#define SHA256_FLAG 0x0080
#define BLOB_FLAG 0x0100
#define NOOK_FLAG 0x0200
#define NOOKHD_FLAG 0x0200
#define ACCLAIM_FLAG 0x0400
typedef
struct
boot_img
{
// Memory map of the whole image
...
...
native/jni/magiskboot/format.h
View file @
d780b5a0
...
...
@@ -38,9 +38,11 @@ typedef enum {
#define DHTB_MAGIC "\x44\x48\x54\x42\x01\x00\x00\x00"
#define SEANDROID_MAGIC "SEANDROIDENFORCE"
#define TEGRABLOB_MAGIC "-SIGNED-BY-SIGNBLOB-"
#define NOOK_MAGIC "Green Loader"
#define NOOK_NEW_MAGIC "eMMC boot.img+secondloader"
#define NOOK_PRE_HEADER_SZ 1048576
#define NOOKHD_MAGIC "Green Loader"
#define NOOKHD_NEW_MAGIC "eMMC boot.img+secondloader"
#define NOOKHD_PRE_HEADER_SZ 1048576
#define ACCLAIM_MAGIC "BauwksBoot"
#define ACCLAIM_PRE_HEADER_SZ 262144
#define SUP_LIST ((char *[]) { "gzip", "xz", "lzma", "bzip2", "lz4", "lz4_legacy", NULL })
#define SUP_EXT_LIST ((char *[]) { "gz", "xz", "lzma", "bz2", "lz4", "lz4", NULL })
...
...
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