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
aaabd836
Commit
aaabd836
authored
May 23, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'john/master' into development
parents
076e5cea
3216ef9f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
16 deletions
+10
-16
build.gradle
build.gradle
+1
-1
gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+2
-2
bootimg.cpp
native/jni/magiskboot/bootimg.cpp
+7
-5
format.cpp
native/jni/magiskboot/format.cpp
+0
-4
format.h
native/jni/magiskboot/format.h
+0
-4
No files found.
build.gradle
View file @
aaabd836
...
@@ -16,7 +16,7 @@ buildscript {
...
@@ -16,7 +16,7 @@ buildscript {
}
}
dependencies
{
dependencies
{
classpath
'com.android.tools:r8:1.4.96'
classpath
'com.android.tools:r8:1.4.96'
classpath
'com.android.tools.build:gradle:3.5.0-beta0
1
'
classpath
'com.android.tools.build:gradle:3.5.0-beta0
2
'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
aaabd836
#
Fri Apr 26 14:06:46 CES
T 2019
#
Thu May 23 01:06:46 PD
T 2019
distributionBase
=
GRADLE_USER_HOME
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-5.4
-rc-
1-all.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-5.4
.
1-all.zip
native/jni/magiskboot/bootimg.cpp
View file @
aaabd836
...
@@ -90,10 +90,6 @@ int boot_img::parse_file(const char *image) {
...
@@ -90,10 +90,6 @@ int boot_img::parse_file(const char *image) {
case
AOSP
:
case
AOSP
:
return
parse_image
(
head
);
return
parse_image
(
head
);
/* Unsupported */
case
ELF32
:
case
ELF64
:
exit
(
UNSUPP_RET
);
default
:
default
:
break
;
break
;
}
}
...
@@ -345,7 +341,7 @@ int unpack(const char *image, bool hdr) {
...
@@ -345,7 +341,7 @@ int unpack(const char *image, bool hdr) {
void
repack
(
const
char
*
orig_image
,
const
char
*
out_image
)
{
void
repack
(
const
char
*
orig_image
,
const
char
*
out_image
)
{
boot_img
boot
{};
boot_img
boot
{};
off_t
header_off
,
kernel_off
,
ramdisk_off
,
second_off
,
extra_off
;
off_t
header_off
,
kernel_off
,
ramdisk_off
,
second_off
,
extra_off
,
dtb_off
;
// Parse original image
// Parse original image
boot
.
parse_file
(
orig_image
);
boot
.
parse_file
(
orig_image
);
...
@@ -475,6 +471,7 @@ void repack(const char* orig_image, const char* out_image) {
...
@@ -475,6 +471,7 @@ void repack(const char* orig_image, const char* out_image) {
}
}
// dtb
// dtb
dtb_off
=
lseek
(
fd
,
0
,
SEEK_CUR
);
if
(
access
(
DTB_FILE
,
R_OK
)
==
0
)
{
if
(
access
(
DTB_FILE
,
R_OK
)
==
0
)
{
boot
.
hdr
.
dtb_size
()
=
restore
(
DTB_FILE
,
fd
);
boot
.
hdr
.
dtb_size
()
=
restore
(
DTB_FILE
,
fd
);
file_align
();
file_align
();
...
@@ -527,6 +524,11 @@ void repack(const char* orig_image, const char* out_image) {
...
@@ -527,6 +524,11 @@ void repack(const char* orig_image, const char* out_image) {
size
=
boot
.
hdr
.
recovery_dtbo_size
();
size
=
boot
.
hdr
.
recovery_dtbo_size
();
HASH_update
(
&
ctx
,
boot
.
map_addr
+
boot
.
hdr
.
recovery_dtbo_offset
(),
size
);
HASH_update
(
&
ctx
,
boot
.
map_addr
+
boot
.
hdr
.
recovery_dtbo_offset
(),
size
);
HASH_update
(
&
ctx
,
&
size
,
sizeof
(
size
));
HASH_update
(
&
ctx
,
&
size
,
sizeof
(
size
));
size
=
boot
.
hdr
.
dtb_size
();
if
(
size
)
{
HASH_update
(
&
ctx
,
boot
.
map_addr
+
dtb_off
,
size
);
HASH_update
(
&
ctx
,
&
size
,
sizeof
(
size
));
}
}
}
memset
(
boot
.
hdr
.
id
(),
0
,
32
);
memset
(
boot
.
hdr
.
id
(),
0
,
32
);
memcpy
(
boot
.
hdr
.
id
(),
HASH_final
(
&
ctx
),
memcpy
(
boot
.
hdr
.
id
(),
HASH_final
(
&
ctx
),
...
...
native/jni/magiskboot/format.cpp
View file @
aaabd836
...
@@ -27,10 +27,6 @@ format_t check_fmt(const void *buf, size_t len) {
...
@@ -27,10 +27,6 @@ format_t check_fmt(const void *buf, size_t len) {
return
CHROMEOS
;
return
CHROMEOS
;
}
else
if
(
MATCH
(
BOOT_MAGIC
))
{
}
else
if
(
MATCH
(
BOOT_MAGIC
))
{
return
AOSP
;
return
AOSP
;
}
else
if
(
MATCH
(
ELF32_MAGIC
))
{
return
ELF32
;
}
else
if
(
MATCH
(
ELF64_MAGIC
))
{
return
ELF64
;
}
else
if
(
MATCH
(
GZIP1_MAGIC
)
||
MATCH
(
GZIP2_MAGIC
))
{
}
else
if
(
MATCH
(
GZIP1_MAGIC
)
||
MATCH
(
GZIP2_MAGIC
))
{
return
GZIP
;
return
GZIP
;
}
else
if
(
MATCH
(
LZOP_MAGIC
))
{
}
else
if
(
MATCH
(
LZOP_MAGIC
))
{
...
...
native/jni/magiskboot/format.h
View file @
aaabd836
...
@@ -8,8 +8,6 @@ typedef enum {
...
@@ -8,8 +8,6 @@ typedef enum {
/* Boot formats */
/* Boot formats */
CHROMEOS
,
CHROMEOS
,
AOSP
,
AOSP
,
ELF32
,
ELF64
,
DHTB
,
DHTB
,
BLOB
,
BLOB
,
/* Compression formats */
/* Compression formats */
...
@@ -29,8 +27,6 @@ typedef enum {
...
@@ -29,8 +27,6 @@ typedef enum {
#define BOOT_MAGIC "ANDROID!"
#define BOOT_MAGIC "ANDROID!"
#define CHROMEOS_MAGIC "CHROMEOS"
#define CHROMEOS_MAGIC "CHROMEOS"
#define ELF32_MAGIC "\x7f""ELF\x01"
#define ELF64_MAGIC "\x7f""ELF\x02"
#define GZIP1_MAGIC "\x1f\x8b"
#define GZIP1_MAGIC "\x1f\x8b"
#define GZIP2_MAGIC "\x1f\x9e"
#define GZIP2_MAGIC "\x1f\x9e"
#define LZOP_MAGIC "\x89""LZO"
#define LZOP_MAGIC "\x89""LZO"
...
...
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