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
2f7cfa7a
Commit
2f7cfa7a
authored
Apr 15, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link binaries when daemon started
parent
bdcb813e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
14 deletions
+32
-14
daemon.c
jni/daemon/daemon.c
+15
-0
daemon.h
jni/daemon/daemon.h
+17
-0
magisk.h
jni/magisk.h
+0
-14
No files found.
jni/daemon/daemon.c
View file @
2f7cfa7a
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include "magisk.h"
#include "magisk.h"
#include "utils.h"
#include "utils.h"
...
@@ -46,6 +47,15 @@ static void request_handler(int client) {
...
@@ -46,6 +47,15 @@ static void request_handler(int client) {
write_int
(
client
,
VERSION_CODE
);
write_int
(
client
,
VERSION_CODE
);
close
(
client
);
close
(
client
);
break
;
break
;
case
POST_FS
:
// TODO: post-fs
break
;
case
POST_FS_DATA
:
// TODO: post-fs-data
break
;
case
LATE_START_SERVICE
:
// TODO: late_start service
break
;
case
TEST
:
case
TEST
:
s
=
read_string
(
client
);
s
=
read_string
(
client
);
LOGI
(
"%s
\n
"
,
s
);
LOGI
(
"%s
\n
"
,
s
);
...
@@ -107,6 +117,11 @@ void start_daemon() {
...
@@ -107,6 +117,11 @@ void start_daemon() {
// Unlock all blocks for rw
// Unlock all blocks for rw
unlock_blocks
();
unlock_blocks
();
// Setup links under /sbin
mount
(
NULL
,
"/"
,
NULL
,
MS_REMOUNT
,
NULL
);
create_links
(
NULL
,
"/sbin"
);
mount
(
NULL
,
"/"
,
NULL
,
MS_REMOUNT
|
MS_RDONLY
,
NULL
);
// Loop forever to listen to requests
// Loop forever to listen to requests
while
(
1
)
{
while
(
1
)
{
request_handler
(
xaccept
(
fd
,
NULL
,
NULL
));
request_handler
(
xaccept
(
fd
,
NULL
,
NULL
));
...
...
jni/daemon/daemon.h
View file @
2f7cfa7a
...
@@ -14,6 +14,9 @@ typedef enum {
...
@@ -14,6 +14,9 @@ typedef enum {
SUPERUSER
,
SUPERUSER
,
CHECK_VERSION
,
CHECK_VERSION
,
CHECK_VERSION_CODE
,
CHECK_VERSION_CODE
,
POST_FS
,
POST_FS_DATA
,
LATE_START_SERVICE
,
TEST
TEST
}
client_request
;
}
client_request
;
...
@@ -35,4 +38,18 @@ void write_string(int fd, const char* val);
...
@@ -35,4 +38,18 @@ void write_string(int fd, const char* val);
void
monitor_logs
();
void
monitor_logs
();
/**************
* MagiskHide *
**************/
void
launch_magiskhide
(
int
client
);
void
stop_magiskhide
(
int
client
);
/*************
* Superuser *
*************/
void
su_daemon_receiver
(
int
client
);
#endif
#endif
jni/magisk.h
View file @
2f7cfa7a
...
@@ -62,18 +62,4 @@ int resetprop_main(int argc, char *argv[]);
...
@@ -62,18 +62,4 @@ int resetprop_main(int argc, char *argv[]);
}
}
#endif
#endif
/**************
* MagiskHide *
**************/
void
launch_magiskhide
(
int
client
);
void
stop_magiskhide
(
int
client
);
/*************
* Superuser *
*************/
void
su_daemon_receiver
(
int
client
);
#endif
#endif
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