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
bd4e5bfc
Commit
bd4e5bfc
authored
Feb 24, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some minor optmizations
parent
621fd0ee
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
applets.cpp
native/jni/core/applets.cpp
+1
-3
selinux.cpp
native/jni/utils/selinux.cpp
+3
-5
No files found.
native/jni/core/applets.cpp
View file @
bd4e5bfc
...
...
@@ -28,9 +28,7 @@ int main(int argc, char *argv[]) {
cmdline_logging
();
init_argv0
(
argc
,
argv
);
if
(
strcmp
(
basename
(
argv
[
0
]),
"magisk.bin"
)
==
0
||
(
strcmp
(
basename
(
argv
[
0
]),
"magisk"
)
==
0
&&
argc
>
1
&&
argv
[
1
][
0
]
!=
'-'
))
{
if
((
strcmp
(
basename
(
argv
[
0
]),
"magisk"
)
==
0
&&
argc
>
1
&&
argv
[
1
][
0
]
!=
'-'
))
{
--
argc
;
++
argv
;
}
...
...
native/jni/utils/selinux.cpp
View file @
bd4e5bfc
...
...
@@ -79,18 +79,16 @@ void selinux_builtin_impl() {
getfilecon
=
__getfilecon
;
lgetfilecon
=
__lgetfilecon
;
setfilecon
=
__setfilecon
;
setfilecon
=
__lsetfilecon
;
l
setfilecon
=
__lsetfilecon
;
}
void
dload_selinux
()
{
void
*
handle
=
dlopen
(
"libselinux.so"
,
RTLD_LAZY
);
if
(
handle
==
nullptr
)
if
(
access
(
"/system/lib/libselinux.so"
,
F_OK
))
return
;
/* We only
use dlopen to know whether libselinux.so exists
.
/* We only
check whether libselinux.so exists but don't dlopen
.
* For some reason calling symbols returned from dlsym
* will result to SEGV_ACCERR on some devices.
* Always use builtin implementations for SELinux stuffs. */
dlclose
(
handle
);
selinux_builtin_impl
();
}
...
...
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