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
c7c9fb95
Commit
c7c9fb95
authored
Jul 21, 2022
by
vvb2060
Committed by
John Wu
Jul 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore context before copy
fix magiskpolicy context
parent
8b095de0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
0 deletions
+6
-0
selinux.hpp
native/jni/base/include/selinux.hpp
+1
-0
bootstages.cpp
native/jni/core/bootstages.cpp
+2
-0
restorecon.cpp
native/jni/core/restorecon.cpp
+3
-0
No files found.
native/jni/base/include/selinux.hpp
View file @
c7c9fb95
...
@@ -40,3 +40,4 @@ bool selinux_enabled();
...
@@ -40,3 +40,4 @@ bool selinux_enabled();
void
enable_selinux
();
void
enable_selinux
();
void
restorecon
();
void
restorecon
();
void
restore_tmpcon
();
void
restore_tmpcon
();
void
restore_databincon
();
native/jni/core/bootstages.cpp
View file @
c7c9fb95
...
@@ -152,6 +152,8 @@ static bool magisk_env() {
...
@@ -152,6 +152,8 @@ static bool magisk_env() {
xmkdir
(
SECURE_DIR
"/post-fs-data.d"
,
0755
);
xmkdir
(
SECURE_DIR
"/post-fs-data.d"
,
0755
);
xmkdir
(
SECURE_DIR
"/service.d"
,
0755
);
xmkdir
(
SECURE_DIR
"/service.d"
,
0755
);
restore_databincon
();
if
(
access
(
DATABIN
"/busybox"
,
X_OK
))
if
(
access
(
DATABIN
"/busybox"
,
X_OK
))
return
false
;
return
false
;
...
...
native/jni/core/restorecon.cpp
View file @
c7c9fb95
...
@@ -74,6 +74,9 @@ void restorecon() {
...
@@ -74,6 +74,9 @@ void restorecon() {
close
(
fd
);
close
(
fd
);
lsetfilecon
(
MODULEROOT
,
SYSTEM_CON
);
lsetfilecon
(
MODULEROOT
,
SYSTEM_CON
);
restore_syscon
(
xopen
(
MODULEROOT
,
O_RDONLY
|
O_CLOEXEC
));
restore_syscon
(
xopen
(
MODULEROOT
,
O_RDONLY
|
O_CLOEXEC
));
}
void
restore_databincon
()
{
restore_magiskcon
(
xopen
(
DATABIN
,
O_RDONLY
|
O_CLOEXEC
));
restore_magiskcon
(
xopen
(
DATABIN
,
O_RDONLY
|
O_CLOEXEC
));
}
}
...
...
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