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
afcb3d8f
Commit
afcb3d8f
authored
Aug 10, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix XZ decompression in magiskinit
parent
9fbffafd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
magiskinit.c
native/jni/core/magiskinit.c
+11
-2
No files found.
native/jni/core/magiskinit.c
View file @
afcb3d8f
...
...
@@ -247,6 +247,7 @@ static int patch_sepolicy() {
static
int
unxz
(
int
fd
,
const
void
*
buf
,
size_t
size
)
{
uint8_t
out
[
8192
];
xz_crc32_init
();
struct
xz_dec
*
dec
=
xz_dec_init
(
XZ_DYNALLOC
,
1
<<
26
);
struct
xz_buf
b
=
{
.
in
=
buf
,
...
...
@@ -269,20 +270,28 @@ static int unxz(int fd, const void *buf, size_t size) {
static
int
dump_magisk
(
const
char
*
path
,
mode_t
mode
)
{
int
fd
=
creat
(
path
,
mode
);
unxz
(
fd
,
magisk_xz
,
sizeof
(
magisk_xz
));
if
(
fd
<
0
)
return
1
;
if
(
unxz
(
fd
,
magisk_xz
,
sizeof
(
magisk_xz
)))
return
1
;
close
(
fd
);
return
0
;
}
static
int
dump_manager
(
const
char
*
path
,
mode_t
mode
)
{
int
fd
=
creat
(
path
,
mode
);
unxz
(
fd
,
manager_xz
,
sizeof
(
manager_xz
));
if
(
fd
<
0
)
return
1
;
if
(
unxz
(
fd
,
manager_xz
,
sizeof
(
manager_xz
)))
return
1
;
close
(
fd
);
return
0
;
}
static
int
dump_magiskrc
(
const
char
*
path
,
mode_t
mode
)
{
int
fd
=
creat
(
path
,
mode
);
if
(
fd
<
0
)
return
1
;
xwrite
(
fd
,
magiskrc
,
sizeof
(
magiskrc
));
close
(
fd
);
return
0
;
...
...
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