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
8de03eef
Commit
8de03eef
authored
Mar 23, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow modules to have custom uninstaller script
parent
8df942f9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
bootstages.cpp
native/jni/core/bootstages.cpp
+3
-0
scripting.cpp
native/jni/core/scripting.cpp
+8
-0
daemon.h
native/jni/include/daemon.h
+1
-0
No files found.
native/jni/core/bootstages.cpp
View file @
8de03eef
...
...
@@ -482,6 +482,9 @@ static void collect_modules() {
if
(
access
(
"remove"
,
F_OK
)
==
0
)
{
chdir
(
".."
);
LOGI
(
"%s: remove
\n
"
,
entry
->
d_name
);
sprintf
(
buf
,
"%s/uninstall.sh"
,
entry
->
d_name
);
if
(
access
(
buf
,
F_OK
)
==
0
)
exec_script
(
buf
);
rm_rf
(
entry
->
d_name
);
continue
;
}
...
...
native/jni/core/scripting.cpp
View file @
8de03eef
...
...
@@ -16,6 +16,14 @@ static void set_path() {
setenv
(
"PATH"
,
buf
,
1
);
}
void
exec_script
(
const
char
*
script
)
{
exec_t
exec
{
.
pre_exec
=
set_path
,
.
fork
=
fork_no_zombie
};
exec_command_sync
(
exec
,
"/system/bin/sh"
,
script
);
}
void
exec_common_script
(
const
char
*
stage
)
{
char
path
[
4096
];
DIR
*
dir
;
...
...
native/jni/include/daemon.h
View file @
8de03eef
...
...
@@ -69,6 +69,7 @@ void boot_complete(int client);
* Scripting *
*************/
void
exec_script
(
const
char
*
script
);
void
exec_common_script
(
const
char
*
stage
);
void
exec_module_script
(
const
char
*
stage
,
const
std
::
vector
<
std
::
string
>
&
module_list
);
void
migrate_img
(
const
char
*
img
);
...
...
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