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
e989195a
Commit
e989195a
authored
Nov 30, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update magiskpolicy
parent
997d5893
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
40 deletions
+6
-40
Android.mk
jni/Android.mk
+1
-0
daemon.c
jni/core/daemon.c
+0
-1
magiskinit.c
jni/core/magiskinit.c
+4
-2
magiskpolicy.h
jni/include/magiskpolicy.h
+0
-36
magiskpolicy
jni/magiskpolicy
+1
-1
No files found.
jni/Android.mk
View file @
e989195a
...
@@ -63,6 +63,7 @@ LOCAL_MODULE := magiskinit
...
@@ -63,6 +63,7 @@ LOCAL_MODULE := magiskinit
LOCAL_STATIC_LIBRARIES := libsepol liblzma
LOCAL_STATIC_LIBRARIES := libsepol liblzma
LOCAL_C_INCLUDES := \
LOCAL_C_INCLUDES := \
jni/include \
jni/include \
jni/magiskpolicy \
out/$(TARGET_ARCH_ABI) \
out/$(TARGET_ARCH_ABI) \
$(LIBSEPOL) \
$(LIBSEPOL) \
$(LIBLZMA)
$(LIBLZMA)
...
...
jni/core/daemon.c
View file @
e989195a
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
#include "magisk.h"
#include "magisk.h"
#include "utils.h"
#include "utils.h"
#include "daemon.h"
#include "daemon.h"
#include "magiskpolicy.h"
#include "resetprop.h"
#include "resetprop.h"
pthread_t
sepol_patch
;
pthread_t
sepol_patch
;
...
...
jni/core/magiskinit.c
View file @
e989195a
...
@@ -299,7 +299,7 @@ static void patch_sepolicy() {
...
@@ -299,7 +299,7 @@ static void patch_sepolicy() {
compile_cil
();
compile_cil
();
}
}
sepol_m
ed
_rules
();
sepol_m
agisk
_rules
();
dump_policydb
(
"/sepolicy"
);
dump_policydb
(
"/sepolicy"
);
}
}
...
@@ -345,6 +345,8 @@ static int dump_magiskrc(const char *path, mode_t mode) {
...
@@ -345,6 +345,8 @@ static int dump_magiskrc(const char *path, mode_t mode) {
static
void
magisk_init_daemon
()
{
static
void
magisk_init_daemon
()
{
setsid
();
setsid
();
// Full patch
sepol_allow
(
"su"
,
ALL
,
ALL
,
ALL
);
sepol_allow
(
"su"
,
ALL
,
ALL
,
ALL
);
// Wait till init cold boot done
// Wait till init cold boot done
...
@@ -358,7 +360,7 @@ static void magisk_init_daemon() {
...
@@ -358,7 +360,7 @@ static void magisk_init_daemon() {
// Dump full patch to kernel
// Dump full patch to kernel
dump_policydb
(
SELINUX_LOAD
);
dump_policydb
(
SELINUX_LOAD
);
close
(
open
(
PATCHDONE
,
O_RDONLY
|
O_CREAT
,
0
));
close
(
creat
(
PATCHDONE
,
0
));
destroy_policydb
();
destroy_policydb
();
// Keep Magisk daemon always alive
// Keep Magisk daemon always alive
...
...
jni/include/magiskpolicy.h
deleted
100644 → 0
View file @
997d5893
/* magiskpolicy.h - Public API for policy patching
*/
#ifndef _MAGISKPOLICY_H
#define _MAGISKPOLICY_H
#include <stdlib.h>
#define ALL NULL
// policydb functions
int
load_policydb
(
const
char
*
filename
);
int
dump_policydb
(
const
char
*
filename
);
void
destroy_policydb
();
// Handy functions
int
sepol_allow
(
char
*
s
,
char
*
t
,
char
*
c
,
char
*
p
);
int
sepol_deny
(
char
*
s
,
char
*
t
,
char
*
c
,
char
*
p
);
int
sepol_auditallow
(
char
*
s
,
char
*
t
,
char
*
c
,
char
*
p
);
int
sepol_auditdeny
(
char
*
s
,
char
*
t
,
char
*
c
,
char
*
p
);
int
sepol_typetrans
(
char
*
s
,
char
*
t
,
char
*
c
,
char
*
d
,
char
*
o
);
int
sepol_allowxperm
(
char
*
s
,
char
*
t
,
char
*
c
,
char
*
range
);
int
sepol_auditallowxperm
(
char
*
s
,
char
*
t
,
char
*
c
,
char
*
range
);
int
sepol_dontauditxperm
(
char
*
s
,
char
*
t
,
char
*
c
,
char
*
range
);
int
sepol_create
(
char
*
s
);
int
sepol_permissive
(
char
*
s
);
int
sepol_enforce
(
char
*
s
);
int
sepol_attradd
(
char
*
s
,
char
*
a
);
int
sepol_exists
(
char
*
source
);
// Built in rules
void
sepol_min_rules
();
void
sepol_med_rules
();
void
sepol_full_rules
();
#endif
magiskpolicy
@
d7a61272
Subproject commit
8ee9984e4e0a0ce1917d4b131205c79a15f85876
Subproject commit
d7a6127273407a32bccf75e70fa7bbe84c14e4f8
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