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
23c1a1da
Commit
23c1a1da
authored
Oct 09, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some code reorganizing
parent
f5d054b9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
129 deletions
+129
-129
bootimg.cpp
native/jni/magiskboot/bootimg.cpp
+115
-119
bootimg.h
native/jni/magiskboot/bootimg.h
+13
-9
magiskboot.h
native/jni/magiskboot/magiskboot.h
+1
-1
No files found.
native/jni/magiskboot/bootimg.cpp
View file @
23c1a1da
This diff is collapsed.
Click to expand it.
native/jni/magiskboot/bootimg.h
View file @
23c1a1da
...
@@ -192,6 +192,10 @@ struct dyn_img_hdr {
...
@@ -192,6 +192,10 @@ struct dyn_img_hdr {
return
img_hdr
;
return
img_hdr
;
}
}
void
print
();
void
dump_hdr_file
();
void
load_hdr_file
();
protected
:
protected
:
union
{
union
{
/* Main header could be either AOSP or PXA,
/* Main header could be either AOSP or PXA,
...
@@ -298,11 +302,11 @@ struct boot_img {
...
@@ -298,11 +302,11 @@ struct boot_img {
uint8_t
*
map_addr
;
uint8_t
*
map_addr
;
size_t
map_size
;
size_t
map_size
;
//
Headers
//
Android image header
dyn_img_hdr
*
hdr
;
/* Android image header */
dyn_img_hdr
*
hdr
;
// Flags to indicate the state of current boot image
// Flags to indicate the state of current boot image
uint16_t
flags
;
uint16_t
flags
=
0
;
// The format of kernel and ramdisk
// The format of kernel and ramdisk
format_t
k_fmt
;
format_t
k_fmt
;
...
@@ -312,16 +316,17 @@ struct boot_img {
...
@@ -312,16 +316,17 @@ struct boot_img {
* Following pointers points within the mmap region
* Following pointers points within the mmap region
***************************************************/
***************************************************/
mtk_hdr
*
k_hdr
;
/* MTK kernel header */
// MTK headers
mtk_hdr
*
r_hdr
;
/* MTK ramdisk header */
mtk_hdr
*
k_hdr
;
mtk_hdr
*
r_hdr
;
// Pointer to dtb that is appended after kernel
// Pointer to dtb that is appended after kernel
uint8_t
*
kernel_dtb
;
uint8_t
*
kernel_dtb
;
uint32_t
kernel_dt_size
;
uint32_t
kernel_dt_size
=
0
;
// Pointer to end of image
// Pointer to end of image
uint8_t
*
tail
;
uint8_t
*
tail
;
size_t
tail_size
;
size_t
tail_size
=
0
;
// Pointers to blocks defined in header
// Pointers to blocks defined in header
uint8_t
*
img_start
;
uint8_t
*
img_start
;
...
@@ -332,10 +337,9 @@ struct boot_img {
...
@@ -332,10 +337,9 @@ struct boot_img {
uint8_t
*
recovery_dtbo
;
uint8_t
*
recovery_dtbo
;
uint8_t
*
dtb
;
uint8_t
*
dtb
;
boot_img
(
const
char
*
);
~
boot_img
();
~
boot_img
();
void
parse_file
(
const
char
*
);
void
parse_image
(
uint8_t
*
addr
);
void
parse_image
(
uint8_t
*
addr
);
void
find_kernel_dtb
();
void
find_kernel_dtb
();
void
print_hdr
();
};
};
native/jni/magiskboot/magiskboot.h
View file @
23c1a1da
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#define NEW_BOOT "new-boot.img"
#define NEW_BOOT "new-boot.img"
int
unpack
(
const
char
*
image
,
bool
hdr
=
false
);
int
unpack
(
const
char
*
image
,
bool
hdr
=
false
);
void
repack
(
const
char
*
orig_image
,
const
char
*
out_image
,
bool
nocomp
=
false
);
void
repack
(
const
char
*
src_img
,
const
char
*
out_img
,
bool
nocomp
=
false
);
int
hexpatch
(
const
char
*
image
,
const
char
*
from
,
const
char
*
to
);
int
hexpatch
(
const
char
*
image
,
const
char
*
from
,
const
char
*
to
);
int
cpio_commands
(
int
argc
,
char
*
argv
[]);
int
cpio_commands
(
int
argc
,
char
*
argv
[]);
int
dtb_commands
(
int
argc
,
char
*
argv
[]);
int
dtb_commands
(
int
argc
,
char
*
argv
[]);
...
...
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