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
0cfc5273
Commit
0cfc5273
authored
Mar 29, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete minimal patch
parent
f66a820e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
58 deletions
+17
-58
rules.c
rules.c
+17
-58
No files found.
rules.c
View file @
0cfc5273
...
@@ -135,10 +135,10 @@ void su_rules() {
...
@@ -135,10 +135,10 @@ void su_rules() {
if
(
exists
(
"knox_system_app"
))
if
(
exists
(
"knox_system_app"
))
samsung
();
samsung
();
// Min rules first
min_rules
();
// Create domains if they don't exist
// Create domains if they don't exist
if
(
!
exists
(
"su"
))
create
(
"su"
);
permissive
(
"su"
);
if
(
!
exists
(
"su_device"
))
if
(
!
exists
(
"su_device"
))
create
(
"su_device"
);
create
(
"su_device"
);
enforce
(
"su_device"
);
enforce
(
"su_device"
);
...
@@ -185,14 +185,15 @@ void min_rules() {
...
@@ -185,14 +185,15 @@ void min_rules() {
attradd
(
"su"
,
"mlstrustedsubject"
);
attradd
(
"su"
,
"mlstrustedsubject"
);
// Let init run stuffs in su context
allow
(
"kernel"
,
"su"
,
"fd"
,
"use"
);
allow
(
"kernel"
,
"su"
,
"fd"
,
"use"
);
allow
(
"init"
,
"su"
,
"process"
,
ALL
);
allow
(
"init"
,
"su"
,
"process"
,
ALL
);
allow
(
"init"
,
"system_file"
,
"dir"
,
ALL
);
allow
(
"init"
,
"system_file"
,
"dir"
,
ALL
);
allow
(
"init"
,
"system_file"
,
"lnk_file"
,
ALL
);
allow
(
"init"
,
"system_file"
,
"lnk_file"
,
ALL
);
allow
(
"init"
,
"system_file"
,
"file"
,
ALL
);
allow
(
"init"
,
"system_file"
,
"file"
,
ALL
);
// Misc: basic shell scripts, prop management etc.
allow
(
"su"
,
"property_socket"
,
"sock_file"
,
"write"
);
allow
(
"su"
,
"property_socket"
,
"sock_file"
,
"write"
);
allow
(
"su"
,
"shell_exec"
,
"file"
,
ALL
);
allow
(
"su"
,
"init"
,
"unix_stream_socket"
,
"connectto"
);
allow
(
"su"
,
"init"
,
"unix_stream_socket"
,
"connectto"
);
allow
(
"su"
,
"su"
,
"unix_dgram_socket"
,
ALL
);
allow
(
"su"
,
"su"
,
"unix_dgram_socket"
,
ALL
);
allow
(
"su"
,
"su"
,
"unix_stream_socket"
,
ALL
);
allow
(
"su"
,
"su"
,
"unix_stream_socket"
,
ALL
);
...
@@ -203,67 +204,25 @@ void min_rules() {
...
@@ -203,67 +204,25 @@ void min_rules() {
allow
(
"su"
,
"su"
,
"lnk_file"
,
ALL
);
allow
(
"su"
,
"su"
,
"lnk_file"
,
ALL
);
allow
(
"su"
,
"su"
,
"dir"
,
ALL
);
allow
(
"su"
,
"su"
,
"dir"
,
ALL
);
// vold, bootanim, surfaceflinger might require mounts in multirom
// Allow su to do anything to files/dir/links
allow
(
"su"
,
"vold_exec"
,
"file"
,
ALL
);
allow
(
"su"
,
ALL
,
"file"
,
ALL
);
allow
(
"su"
,
"bootanim_exec"
,
"file"
,
ALL
);
allow
(
"su"
,
ALL
,
"dir"
,
ALL
);
allow
(
"su"
,
"surfaceflinger_exec"
,
"file"
,
ALL
);
allow
(
"su"
,
ALL
,
"lnk_file"
,
ALL
);
// Access toolbox/toybox tools
allow
(
"su"
,
"toolbox_exec"
,
"file"
,
ALL
);
allow
(
"su"
,
"toolbox_exec"
,
"lnk_file"
,
ALL
);
// For /dev
allow
(
"su"
,
"device"
,
"file"
,
ALL
);
allow
(
"su"
,
"device"
,
"fifo_file"
,
ALL
);
allow
(
"su"
,
"device"
,
"lnk_file"
,
ALL
);
allow
(
"su"
,
"device"
,
"dir"
,
ALL
);
// For rootfs
allow
(
"su"
,
"rootfs"
,
"file"
,
ALL
);
allow
(
"su"
,
"rootfs"
,
"fifo_file"
,
ALL
);
allow
(
"su"
,
"rootfs"
,
"lnk_file"
,
ALL
);
allow
(
"su"
,
"rootfs"
,
"dir"
,
ALL
);
// For system/cache/data files
allow
(
"su"
,
"system_file"
,
"file"
,
ALL
);
allow
(
"su"
,
"system_file"
,
"fifo_file"
,
ALL
);
allow
(
"su"
,
"system_file"
,
"lnk_file"
,
ALL
);
allow
(
"su"
,
"system_file"
,
"dir"
,
ALL
);
allow
(
"su"
,
"system_data_file"
,
"file"
,
ALL
);
allow
(
"su"
,
"system_data_file"
,
"fifo_file"
,
ALL
);
allow
(
"su"
,
"system_data_file"
,
"lnk_file"
,
ALL
);
allow
(
"su"
,
"system_data_file"
,
"dir"
,
ALL
);
allow
(
"su"
,
"cache_file"
,
"file"
,
ALL
);
allow
(
"su"
,
"cache_file"
,
"fifo_file"
,
ALL
);
allow
(
"su"
,
"cache_file"
,
"lnk_file"
,
ALL
);
allow
(
"su"
,
"cache_file"
,
"dir"
,
ALL
);
// For sepolicy live patching
// For sepolicy live patching
allow
(
"su"
,
"kernel"
,
"security"
,
"read_policy"
);
allow
(
"su"
,
"kernel"
,
"security"
,
"read_policy"
);
allow
(
"su"
,
"kernel"
,
"security"
,
"load_policy"
);
allow
(
"su"
,
"kernel"
,
"security"
,
"load_policy"
);
allow
(
"su"
,
"selinuxfs"
,
"file"
,
ALL
);
// For detecting current mount status
// For mounting loop devices and mirrors
allow
(
"su"
,
"storage_file"
,
"file"
,
ALL
);
allow
(
"su"
,
"kernel"
,
"process"
,
"setsched"
);
allow
(
"su"
,
"storage_file"
,
"fifo_file"
,
ALL
);
allow
(
"su"
,
"labeledfs"
,
"filesystem"
,
"mount"
);
allow
(
"su"
,
"storage_file"
,
"lnk_file"
,
ALL
);
allow
(
"su"
,
"labeledfs"
,
"filesystem"
,
"unmount"
);
allow
(
"su"
,
"storage_file"
,
"dir"
,
ALL
);
allow
(
"su"
,
"loop_device"
,
"blk_file"
,
ALL
);
allow
(
"su"
,
"sysfs"
,
"file"
,
ALL
);
allow
(
"su"
,
"block_device"
,
"blk_file"
,
ALL
);
allow
(
"su"
,
"sysfs"
,
"fifo_file"
,
ALL
);
allow
(
"su"
,
"system_block_device"
,
"blk_file"
,
ALL
);
allow
(
"su"
,
"sysfs"
,
"lnk_file"
,
ALL
);
allow
(
"su"
,
"sysfs"
,
"dir"
,
ALL
);
allow
(
"su"
,
"block_device"
,
"file"
,
ALL
);
allow
(
"su"
,
"block_device"
,
"fifo_file"
,
ALL
);
allow
(
"su"
,
"block_device"
,
"lnk_file"
,
ALL
);
allow
(
"su"
,
"block_device"
,
"dir"
,
ALL
);
// Xposed
// Xposed
allow
(
"untrusted_app"
,
"untrusted_app"
,
"capability"
,
"setgid"
);
allow
(
"untrusted_app"
,
"untrusted_app"
,
"capability"
,
"setgid"
);
allow
(
"system_server"
,
"dex2oat_exec"
,
"file"
,
ALL
);
allow
(
"system_server"
,
"dex2oat_exec"
,
"file"
,
ALL
);
// SuperSU
allow
(
"init"
,
"system_file"
,
"file"
,
"execute_no_trans"
);
allow
(
"init"
,
"su"
,
"fd"
,
"use"
);
allow
(
"init"
,
"kernel"
,
"security"
,
"read_policy"
);
allow
(
"init"
,
"kernel"
,
"security"
,
"load_policy"
);
}
}
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