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
495654f9
Commit
495654f9
authored
Apr 24, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small tweaks
parent
95fec210
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
8 deletions
+15
-8
daemon.c
jni/daemon/daemon.c
+1
-2
magisk.h
jni/magisk.h
+2
-1
list_manager.c
jni/magiskhide/list_manager.c
+1
-1
magiskhide.c
jni/magiskhide/magiskhide.c
+9
-2
proc_monitor.c
jni/magiskhide/proc_monitor.c
+1
-1
su
jni/su
+1
-1
No files found.
jni/daemon/daemon.c
View file @
495654f9
...
...
@@ -89,8 +89,6 @@ static int setup_socket(struct sockaddr_un *sun) {
return
fd
;
}
static
void
do_nothing
()
{}
static
void
*
large_sepol_patch
(
void
*
args
)
{
LOGD
(
"sepol: Starting large patch thread
\n
"
);
// Patch su to everything
...
...
@@ -117,6 +115,7 @@ void start_daemon() {
}
xsetsid
();
xsetcon
(
"u:r:su:s0"
);
umask
(
022
);
// Patch selinux with medium patch before we do anything
load_policydb
(
"/sys/fs/selinux/policy"
);
...
...
jni/magisk.h
View file @
495654f9
...
...
@@ -33,9 +33,10 @@
// Global handler for PLOGE
extern
__thread
void
(
*
err_handler
)(
void
);
//
Two c
ommon error handlers
//
C
ommon error handlers
static
inline
void
exit_proc
()
{
exit
(
1
);
}
static
inline
void
exit_thread
()
{
pthread_exit
(
NULL
);
}
static
inline
void
do_nothing
()
{}
// Dummy function to depress debug message
static
inline
void
stub
(
const
char
*
fmt
,
...)
{}
...
...
jni/magiskhide/list_manager.c
View file @
495654f9
...
...
@@ -102,7 +102,7 @@ int init_list() {
return
1
;
vec_init
(
hide_list
);
// Might
return 1 if first time
// Might
error if file doesn't exist, no need to report
file_to_vector
(
HIDELIST
,
hide_list
);
char
*
line
;
...
...
jni/magiskhide/magiskhide.c
View file @
495654f9
...
...
@@ -43,6 +43,9 @@ static void usage(char *arg0) {
}
void
launch_magiskhide
(
int
client
)
{
// We manually handle crashes
err_handler
=
do_nothing
;
if
(
hideEnabled
)
{
write_int
(
client
,
HIDE_IS_ENABLED
);
close
(
client
);
...
...
@@ -52,8 +55,12 @@ void launch_magiskhide(int client) {
LOGI
(
"* Starting MagiskHide
\n
"
);
hideEnabled
=
1
;
init_resetprop
();
setprop2
(
"persist.magisk.hide"
,
"1"
,
0
);
if
(
init_resetprop
())
goto
error
;
if
(
setprop2
(
"persist.magisk.hide"
,
"1"
,
0
))
goto
error
;
hide_sensitive_props
();
...
...
jni/magiskhide/proc_monitor.c
View file @
495654f9
...
...
@@ -66,7 +66,7 @@ static void proc_monitor_err() {
void
proc_monitor
()
{
// Register the cancel signal
signal
(
SIGUSR1
,
quit_pthread
);
// The error handler should
only exit the thread, not the whole proces
s
// The error handler should
stop magiskhide service
s
err_handler
=
proc_monitor_err
;
int
pid
;
...
...
su
@
c5583620
Subproject commit
b499ac8abacc9d009d110146e2f681a9b0a66f19
Subproject commit
c5583620349aa7700435bda0b0f356c3510e550e
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