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
f872a122
Commit
f872a122
authored
May 26, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preserve at least 32M free size
parent
aa92e4cb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
bootstages.c
jni/daemon/bootstages.c
+3
-3
magisk.h
jni/magisk.h
+2
-0
magiskhide.c
jni/magiskhide/magiskhide.c
+2
-2
No files found.
jni/daemon/bootstages.c
View file @
f872a122
...
...
@@ -110,7 +110,7 @@ static int get_img_size(const char *img, int *used, int *total) {
return
0
;
}
#define round_size(a) ((((a) / 32) +
1
) * 32)
#define round_size(a) ((((a) / 32) +
2
) * 32)
static
int
resize_img
(
const
char
*
img
,
int
size
)
{
LOGI
(
"resize %s to %dM
\n
"
,
img
,
size
);
...
...
@@ -179,7 +179,7 @@ static void trim_img(const char *img) {
int
used
,
total
,
new_size
;
get_img_size
(
img
,
&
used
,
&
total
);
new_size
=
round_size
(
used
);
if
(
new_size
<
total
)
if
(
new_size
!=
total
)
resize_img
(
img
,
new_size
);
}
...
...
@@ -694,7 +694,7 @@ void post_fs_data(int client) {
}
// Start magiskhide if enabled
char
*
hide_prop
=
getprop
(
"persist.magisk.hide"
);
char
*
hide_prop
=
getprop
(
MAGISKHIDE_PROP
);
if
(
hide_prop
)
{
if
(
strcmp
(
hide_prop
,
"1"
)
==
0
)
{
pthread_t
thread
;
...
...
jni/magisk.h
View file @
f872a122
...
...
@@ -45,6 +45,8 @@
#define SELINUX_POLICY SELINUX_PATH "policy"
#define SELINUX_LOAD SELINUX_PATH "load"
#define MAGISKHIDE_PROP "persist.magisk.hide"
// Global handler for PLOGE
extern
__thread
void
(
*
err_handler
)(
void
);
...
...
jni/magiskhide/magiskhide.c
View file @
f872a122
...
...
@@ -56,7 +56,7 @@ void launch_magiskhide(int client) {
hideEnabled
=
1
;
if
(
client
!=
-
1
)
{
if
(
setprop
(
"persist.magisk.hide"
,
"1"
))
if
(
setprop
(
MAGISKHIDE_PROP
,
"1"
))
goto
error
;
}
...
...
@@ -120,7 +120,7 @@ void stop_magiskhide(int client) {
LOGI
(
"* Stopping MagiskHide
\n
"
);
hideEnabled
=
0
;
setprop
(
"persist.magisk.hide"
,
"0"
);
setprop
(
MAGISKHIDE_PROP
,
"0"
);
pthread_kill
(
proc_monitor_thread
,
SIGUSR1
);
write_int
(
client
,
DAEMON_SUCCESS
);
...
...
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