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
28350e3a
Commit
28350e3a
authored
Jan 29, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support Nook Green Loader
parent
f48e6c93
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
bootimg.c
native/jni/magiskboot/bootimg.c
+7
-0
bootimg.h
native/jni/magiskboot/bootimg.h
+1
-0
format.h
native/jni/magiskboot/format.h
+2
-0
No files found.
native/jni/magiskboot/bootimg.c
View file @
28350e3a
...
@@ -122,6 +122,11 @@ int parse_img(const char *image, boot_img *boot) {
...
@@ -122,6 +122,11 @@ int parse_img(const char *image, boot_img *boot) {
fprintf
(
stderr
,
"PXA_BOOT_HDR
\n
"
);
fprintf
(
stderr
,
"PXA_BOOT_HDR
\n
"
);
boot
->
hdr
=
malloc
(
sizeof
(
pxa_boot_img_hdr
));
boot
->
hdr
=
malloc
(
sizeof
(
pxa_boot_img_hdr
));
memcpy
(
boot
->
hdr
,
head
,
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
)
{
boot
->
flags
|=
NOOK_FLAG
;
fprintf
(
stderr
,
"NOOK_GREEN_LOADER
\n
"
);
head
+=
NOOK_PRE_HEADER_SZ
-
1
;
continue
;
}
else
{
}
else
{
boot
->
hdr
=
malloc
(
sizeof
(
boot_img_hdr
));
boot
->
hdr
=
malloc
(
sizeof
(
boot_img_hdr
));
memcpy
(
boot
->
hdr
,
head
,
sizeof
(
boot_img_hdr
));
memcpy
(
boot
->
hdr
,
head
,
sizeof
(
boot_img_hdr
));
...
@@ -285,6 +290,8 @@ void repack(const char* orig_image, const char* out_image) {
...
@@ -285,6 +290,8 @@ void repack(const char* orig_image, const char* out_image) {
}
else
if
(
boot
.
flags
&
BLOB_FLAG
)
{
}
else
if
(
boot
.
flags
&
BLOB_FLAG
)
{
// Skip blob header
// Skip blob header
write_zero
(
fd
,
sizeof
(
blob_hdr
));
write_zero
(
fd
,
sizeof
(
blob_hdr
));
}
else
if
(
boot
.
flags
&
NOOK_FLAG
)
{
restore_buf
(
fd
,
boot
.
map_addr
,
NOOK_PRE_HEADER_SZ
);
}
}
// Skip a page for header
// Skip a page for header
...
...
native/jni/magiskboot/bootimg.h
View file @
28350e3a
...
@@ -130,6 +130,7 @@ typedef struct blob_hdr {
...
@@ -130,6 +130,7 @@ typedef struct blob_hdr {
#define LG_BUMP_FLAG 0x0040
#define LG_BUMP_FLAG 0x0040
#define SHA256_FLAG 0x0080
#define SHA256_FLAG 0x0080
#define BLOB_FLAG 0x0100
#define BLOB_FLAG 0x0100
#define NOOK_FLAG 0x0200
typedef
struct
boot_img
{
typedef
struct
boot_img
{
// Memory map of the whole image
// Memory map of the whole image
...
...
native/jni/magiskboot/format.h
View file @
28350e3a
...
@@ -38,6 +38,8 @@ typedef enum {
...
@@ -38,6 +38,8 @@ typedef enum {
#define DHTB_MAGIC "\x44\x48\x54\x42\x01\x00\x00\x00"
#define DHTB_MAGIC "\x44\x48\x54\x42\x01\x00\x00\x00"
#define SEANDROID_MAGIC "SEANDROIDENFORCE"
#define SEANDROID_MAGIC "SEANDROIDENFORCE"
#define TEGRABLOB_MAGIC "-SIGNED-BY-SIGNBLOB-"
#define TEGRABLOB_MAGIC "-SIGNED-BY-SIGNBLOB-"
#define NOOK_MAGIC "Green Loader"
#define NOOK_PRE_HEADER_SZ 1048575
#define SUP_LIST ((char *[]) { "gzip", "xz", "lzma", "bzip2", "lz4", "lz4_legacy", NULL })
#define SUP_LIST ((char *[]) { "gzip", "xz", "lzma", "bzip2", "lz4", "lz4_legacy", NULL })
#define SUP_EXT_LIST ((char *[]) { "gz", "xz", "lzma", "bz2", "lz4", "lz4", 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