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
6cde6951
Commit
6cde6951
authored
Jun 24, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Q dirty hacks in SARCompat
parent
a1a1ac0b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
21 deletions
+1
-21
early_mount.cpp
native/jni/init/early_mount.cpp
+0
-8
init.h
native/jni/init/init.h
+0
-1
rootdir.cpp
native/jni/init/rootdir.cpp
+1
-12
No files found.
native/jni/init/early_mount.cpp
View file @
6cde6951
...
@@ -135,14 +135,6 @@ void SARCompatInit::early_mount() {
...
@@ -135,14 +135,6 @@ void SARCompatInit::early_mount() {
xmkdir
(
"/system"
,
0755
);
xmkdir
(
"/system"
,
0755
);
xmount
(
"/system_root/system"
,
"/system"
,
nullptr
,
MS_BIND
,
nullptr
);
xmount
(
"/system_root/system"
,
"/system"
,
nullptr
,
MS_BIND
,
nullptr
);
// Android Q
if
(
is_lnk
(
"/system_root/init"
))
load_sepol
=
true
;
// System-as-root with monolithic sepolicy
if
(
access
(
"/system_root/sepolicy"
,
F_OK
)
==
0
)
cp_afc
(
"/system_root/sepolicy"
,
"/sepolicy"
);
link_root
(
"/vendor"
);
link_root
(
"/vendor"
);
link_root
(
"/product"
);
link_root
(
"/product"
);
link_root
(
"/odm"
);
link_root
(
"/odm"
);
...
...
native/jni/init/init.h
View file @
6cde6951
...
@@ -27,7 +27,6 @@ class MagiskInit : public BaseInit {
...
@@ -27,7 +27,6 @@ class MagiskInit : public BaseInit {
protected
:
protected
:
raw_data
self
{};
raw_data
self
{};
int
root
=
-
1
;
int
root
=
-
1
;
bool
load_sepol
=
false
;
bool
mnt_system
=
false
;
bool
mnt_system
=
false
;
bool
mnt_vendor
=
false
;
bool
mnt_vendor
=
false
;
bool
mnt_product
=
false
;
bool
mnt_product
=
false
;
...
...
native/jni/init/rootdir.cpp
View file @
6cde6951
...
@@ -40,8 +40,6 @@ constexpr const char wrapper[] =
...
@@ -40,8 +40,6 @@ constexpr const char wrapper[] =
;
;
void
RootFSInit
::
setup_rootfs
()
{
void
RootFSInit
::
setup_rootfs
()
{
bool
patch_init
=
patch_sepolicy
();
if
(
cmd
->
system_as_root
)
{
if
(
cmd
->
system_as_root
)
{
// Clone rootfs
// Clone rootfs
LOGD
(
"Clone root dir from system to rootfs
\n
"
);
LOGD
(
"Clone root dir from system to rootfs
\n
"
);
...
@@ -50,7 +48,7 @@ void RootFSInit::setup_rootfs() {
...
@@ -50,7 +48,7 @@ void RootFSInit::setup_rootfs() {
close
(
system_root
);
close
(
system_root
);
}
}
if
(
patch_
init
)
{
if
(
patch_
sepolicy
()
)
{
constexpr
char
SYSTEM_INIT
[]
=
"/system/bin/init"
;
constexpr
char
SYSTEM_INIT
[]
=
"/system/bin/init"
;
// If init is symlink, copy it to rootfs so we can patch
// If init is symlink, copy it to rootfs so we can patch
if
(
is_lnk
(
"/init"
))
if
(
is_lnk
(
"/init"
))
...
@@ -157,21 +155,12 @@ bool MagiskInit::patch_sepolicy() {
...
@@ -157,21 +155,12 @@ bool MagiskInit::patch_sepolicy() {
sepol_allow
(
SEPOL_PROC_DOMAIN
,
ALL
,
ALL
,
ALL
);
sepol_allow
(
SEPOL_PROC_DOMAIN
,
ALL
,
ALL
,
ALL
);
dump_policydb
(
"/sepolicy"
);
dump_policydb
(
"/sepolicy"
);
// Load policy to kernel so we can label rootfs
if
(
load_sepol
)
{
LOGD
(
"sepol: preload sepolicy
\n
"
);
dump_policydb
(
SELINUX_LOAD
);
}
// Remove OnePlus stupid debug sepolicy and use our own
// Remove OnePlus stupid debug sepolicy and use our own
if
(
access
(
"/sepolicy_debug"
,
F_OK
)
==
0
)
{
if
(
access
(
"/sepolicy_debug"
,
F_OK
)
==
0
)
{
unlink
(
"/sepolicy_debug"
);
unlink
(
"/sepolicy_debug"
);
link
(
"/sepolicy"
,
"/sepolicy_debug"
);
link
(
"/sepolicy"
,
"/sepolicy_debug"
);
}
}
// Enable selinux functions
selinux_builtin_impl
();
return
patch_init
;
return
patch_init
;
}
}
...
...
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