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
90545057
Commit
90545057
authored
May 06, 2022
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always initialize module_list
Close #5712
parent
cffd024e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
26 deletions
+24
-26
daemon.cpp
native/jni/core/daemon.cpp
+1
-0
module.cpp
native/jni/core/module.cpp
+23
-26
No files found.
native/jni/core/daemon.cpp
View file @
90545057
...
...
@@ -391,6 +391,7 @@ static void daemon_entry() {
default_new
(
poll_map
);
default_new
(
poll_fds
);
default_new
(
module_list
);
// Register handler for main socket
pollfd
main_socket_pfd
=
{
fd
,
POLLIN
,
0
};
...
...
native/jni/core/module.cpp
View file @
90545057
...
...
@@ -583,34 +583,32 @@ void magic_mount() {
char
buf
[
4096
];
LOGI
(
"* Loading modules
\n
"
);
if
(
module_list
)
{
for
(
const
auto
&
m
:
*
module_list
)
{
const
char
*
module
=
m
.
name
.
data
();
char
*
b
=
buf
+
sprintf
(
buf
,
"%s/"
MODULEMNT
"/%s/"
,
MAGISKTMP
.
data
(),
module
);
// Read props
strcpy
(
b
,
"system.prop"
);
if
(
access
(
buf
,
F_OK
)
==
0
)
{
LOGI
(
"%s: loading [system.prop]
\n
"
,
module
);
load_prop_file
(
buf
,
false
);
}
for
(
const
auto
&
m
:
*
module_list
)
{
const
char
*
module
=
m
.
name
.
data
();
char
*
b
=
buf
+
sprintf
(
buf
,
"%s/"
MODULEMNT
"/%s/"
,
MAGISKTMP
.
data
(),
module
);
// Read props
strcpy
(
b
,
"system.prop"
);
if
(
access
(
buf
,
F_OK
)
==
0
)
{
LOGI
(
"%s: loading [system.prop]
\n
"
,
module
);
load_prop_file
(
buf
,
false
);
}
// Check whether skip mounting
strcpy
(
b
,
"skip_mount"
);
if
(
access
(
buf
,
F_OK
)
==
0
)
continue
;
// Check whether skip mounting
strcpy
(
b
,
"skip_mount"
);
if
(
access
(
buf
,
F_OK
)
==
0
)
continue
;
// Double check whether the system folder exists
strcpy
(
b
,
"system"
);
if
(
access
(
buf
,
F_OK
)
!=
0
)
continue
;
// Double check whether the system folder exists
strcpy
(
b
,
"system"
);
if
(
access
(
buf
,
F_OK
)
!=
0
)
continue
;
LOGI
(
"%s: loading mount files
\n
"
,
module
);
b
[
-
1
]
=
'\0'
;
int
fd
=
xopen
(
buf
,
O_RDONLY
|
O_CLOEXEC
);
system
->
collect_files
(
module
,
fd
);
close
(
fd
);
}
LOGI
(
"%s: loading mount files
\n
"
,
module
);
b
[
-
1
]
=
'\0'
;
int
fd
=
xopen
(
buf
,
O_RDONLY
|
O_CLOEXEC
);
system
->
collect_files
(
module
,
fd
);
close
(
fd
);
}
if
(
MAGISKTMP
!=
"/sbin"
)
{
// Need to inject our binaries into /system/bin
...
...
@@ -768,7 +766,6 @@ static void collect_modules(bool open_zygisk) {
}
void
handle_modules
()
{
default_new
(
module_list
);
prepare_modules
();
collect_modules
(
false
);
exec_module_scripts
(
"post-fs-data"
);
...
...
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