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
15f2a664
Commit
15f2a664
authored
Aug 14, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update help messages
parent
70b4f62d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
40 deletions
+43
-40
Android.mk
jni/Android.mk
+5
-5
magisk.c
jni/daemon/magisk.c
+13
-12
magiskhide.c
jni/magiskhide/magiskhide.c
+6
-6
magiskpolicy
jni/magiskpolicy
+1
-1
resetprop.cpp
jni/resetprop/resetprop.cpp
+18
-16
No files found.
jni/Android.mk
View file @
15f2a664
...
@@ -16,16 +16,16 @@ LOCAL_C_INCLUDES := \
...
@@ -16,16 +16,16 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/selinux/libsepol/include
$(LOCAL_PATH)/selinux/libsepol/include
LOCAL_SRC_FILES := \
LOCAL_SRC_FILES := \
main.c \
daemon/magisk.c \
daemon/daemon.c \
daemon/socket_trans.c \
daemon/log_monitor.c \
daemon/bootstages.c \
utils/misc.c \
utils/misc.c \
utils/vector.c \
utils/vector.c \
utils/xwrap.c \
utils/xwrap.c \
utils/list.c \
utils/list.c \
utils/img.c \
utils/img.c \
daemon/daemon.c \
daemon/socket_trans.c \
daemon/log_monitor.c \
daemon/bootstages.c \
magiskhide/magiskhide.c \
magiskhide/magiskhide.c \
magiskhide/proc_monitor.c \
magiskhide/proc_monitor.c \
magiskhide/hide_utils.c \
magiskhide/hide_utils.c \
...
...
jni/
main
.c
→
jni/
daemon/magisk
.c
View file @
15f2a664
...
@@ -25,34 +25,35 @@ static void usage() {
...
@@ -25,34 +25,35 @@ static void usage() {
"Magisk v"
xstr
(
MAGISK_VERSION
)
"("
xstr
(
MAGISK_VER_CODE
)
") (by topjohnwu) multi-call binary
\n
"
"Magisk v"
xstr
(
MAGISK_VERSION
)
"("
xstr
(
MAGISK_VER_CODE
)
") (by topjohnwu) multi-call binary
\n
"
"
\n
"
"
\n
"
"Usage: %s [applet [arguments]...]
\n
"
"Usage: %s [applet [arguments]...]
\n
"
" or: %s --install [SOURCE] <DIR>
\n
"
" or: %s --install [SOURCE] DIR
\n
"
" if SOURCE not provided, will link itself
\n
"
" or: %s --list
\n
"
" or: %s --list
\n
"
" or: %s --createimg
<PATH> <SIZE>
\n
"
" or: %s --createimg
IMG SIZE
\n
"
" create ext4 image, SIZE is interpreted in MB
\n
"
" create ext4 image, SIZE is interpreted in MB
\n
"
" or: %s --imgsize
<PATH>
\n
"
" or: %s --imgsize
IMG
\n
"
" or: %s --resizeimg
<PATH> <SIZE>
\n
"
" or: %s --resizeimg
IMG SIZE
\n
"
" SIZE is interpreted in MB
\n
"
" SIZE is interpreted in MB
\n
"
" or: %s --mountimg
<IMG> <PATH>
\n
"
" or: %s --mountimg
IMG PATH
\n
"
"
Prints out
the loop device
\n
"
"
mount IMG to PATH and prints
the loop device
\n
"
" or: %s --umountimg
<PATH> <LOOP>
\n
"
" or: %s --umountimg
PATH LOOP
\n
"
" or: %s --[boot stage]
\n
"
" or: %s --[boot stage]
\n
"
" start boot stage service
\n
"
" start boot stage service
\n
"
" or: %s [options]
\n
"
" or: %s [options]
\n
"
" or: applet [arguments]...
\n
"
" or: applet [arguments]...
\n
"
"
\n
"
"
\n
"
"Supported boot stages:
\n
"
"Supported boot stages:
\n
"
"
post-fs, post-fs-data, service
\n
"
" post-fs, post-fs-data, service
\n
"
"
\n
"
"
\n
"
"Options:
\n
"
"Options:
\n
"
"
-c
print client version
\n
"
"
-c
print client version
\n
"
"
-v
print daemon version
\n
"
"
-v
print daemon version
\n
"
"
-V
print daemon version code
\n
"
"
-V
print daemon version code
\n
"
"
\n
"
"
\n
"
"Supported applets:
\n
"
"Supported applets:
\n
"
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
);
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
,
argv0
);
for
(
int
i
=
0
;
applet
[
i
];
++
i
)
{
for
(
int
i
=
0
;
applet
[
i
];
++
i
)
{
fprintf
(
stderr
,
i
?
", %s"
:
"
%s"
,
applet
[
i
]);
fprintf
(
stderr
,
i
?
", %s"
:
" %s"
,
applet
[
i
]);
}
}
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
exit
(
1
);
exit
(
1
);
...
...
jni/magiskhide/magiskhide.c
View file @
15f2a664
...
@@ -29,13 +29,13 @@ void kill_proc(int pid) {
...
@@ -29,13 +29,13 @@ void kill_proc(int pid) {
static
void
usage
(
char
*
arg0
)
{
static
void
usage
(
char
*
arg0
)
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"MagiskHide v"
xstr
(
MAGISK_VERSION
)
"("
xstr
(
MAGISK_VER_CODE
)
") (by topjohnwu) - Hide Magisk!
\n\n
"
"MagiskHide v"
xstr
(
MAGISK_VERSION
)
"("
xstr
(
MAGISK_VER_CODE
)
") (by topjohnwu) - Hide Magisk!
\n\n
"
"%s [--options [arguments...] ]
\n\n
"
"
Usage:
%s [--options [arguments...] ]
\n\n
"
"Options:
\n
"
"Options:
\n
"
" --enable
: Start the magiskhide daemon
\n
"
" --enable
Start magiskhide
\n
"
" --disable
: Stop the magiskhide daemon
\n
"
" --disable
Stop magiskhide
\n
"
" --add
<process name>: Add <process name> to th
e list
\n
"
" --add
PROCESS Add PROCESS to the hid
e list
\n
"
" --rm
<process name>: Remove <process name> from th
e list
\n
"
" --rm
PROCESS Remove PROCESS from the hid
e list
\n
"
" --ls
:
Print out the current hide list
\n
"
" --ls
Print out the current hide list
\n
"
,
arg0
);
,
arg0
);
exit
(
1
);
exit
(
1
);
}
}
...
...
magiskpolicy
@
93b66d26
Subproject commit
a0be47ab8b2e1d7778a73a5b5a8122b1881368b5
Subproject commit
93b66d26ff86a22dec12cec862a7cdd1db50a454
jni/resetprop/resetprop.cpp
View file @
15f2a664
/* resetprop.cpp - Manipulate any system props
/* resetprop.cpp - Manipulate any system props
*
*
* Copyright 2016 nkk71 <nkk71x@gmail.com>
* Copyright 2016 nkk71 <nkk71x@gmail.com>
* Copyright 2016 topjohnwu <topjohnwu@gmail.com>
* Copyright 2016 topjohnwu <topjohnwu@gmail.com>
*
*
* Info:
* Info:
*
*
* all changes are in
* all changes are in
*
*
* bionic/libc/bionic/system_properties.cpp
* bionic/libc/bionic/system_properties.cpp
...
@@ -26,23 +26,23 @@
...
@@ -26,23 +26,23 @@
*
*
* static prop_area* map_fd_ro(const int fd)
* static prop_area* map_fd_ro(const int fd)
* we dont want this read only so change: 'PROT_READ' to 'PROT_READ | PROT_WRITE'
* we dont want this read only so change: 'PROT_READ' to 'PROT_READ | PROT_WRITE'
*
*
*
*
* Copy the code of prop_info *prop_area::find_property, and modify to delete props
* Copy the code of prop_info *prop_area::find_property, and modify to delete props
* const prop_info *prop_area::find_property_and_del(prop_bt *const trie, const char *name)
* const prop_info *prop_area::find_property_and_del(prop_bt *const trie, const char *name)
* {
* {
* ...
* ...
* ... Do not alloc a new prop_bt here, remove all code involve alloc_if_needed
* ... Do not alloc a new prop_bt here, remove all code involve alloc_if_needed
* ...
* ...
*
*
* if (prop_offset != 0) {
* if (prop_offset != 0) {
* atomic_store_explicit(¤t->prop, 0, memory_order_release); // Add this line to nullify the prop entry
* atomic_store_explicit(¤t->prop, 0, memory_order_release); // Add this line to nullify the prop entry
* return to_prop_info(¤t->prop);
* return to_prop_info(¤t->prop);
* } else {
* } else {
*
*
* ....
* ....
* }
* }
*
*
*
*
* by patching just those functions directly, all other functions should be ok
* by patching just those functions directly, all other functions should be ok
* as is.
* as is.
...
@@ -98,14 +98,16 @@ static int usage(char* arg0) {
...
@@ -98,14 +98,16 @@ static int usage(char* arg0) {
fprintf
(
stderr
,
fprintf
(
stderr
,
"resetprop v"
xstr
(
MAGISK_VERSION
)
"("
xstr
(
MAGISK_VER_CODE
)
") (by topjohnwu & nkk71) - System Props Modification Tool
\n\n
"
"resetprop v"
xstr
(
MAGISK_VERSION
)
"("
xstr
(
MAGISK_VER_CODE
)
") (by topjohnwu & nkk71) - System Props Modification Tool
\n\n
"
"Usage: %s [options] [args...]
\n
"
"Usage: %s [options] [args...]
\n
"
"%s <name> <value>: Set property entry <name> with <value>
\n
"
"%s --file <prop file>: Load props from <prop file>
\n
"
"%s --delete <name>: Remove prop entry <name>
\n
"
"
\n
"
"
\n
"
"Options:
\n
"
"Options:
\n
"
" -v verbose output
\n
"
" -v show verbose output
\n
"
" -n don't trigger events when changing props
\n
"
" -n only modify property in memory
\n
"
" if used with deleteprop determines whether remove persist prop file
\n
"
"
\n
"
"%s NAME VALUE set property entry NAME with VALUE
\n
"
"%s --file FILE load props from FILE
\n
"
"%s --delete NAME remove prop entry NAME
\n
"
"
\n
"
,
arg0
,
arg0
,
arg0
,
arg0
);
,
arg0
,
arg0
,
arg0
,
arg0
);
return
1
;
return
1
;
}
}
...
@@ -164,7 +166,7 @@ int setprop(const char *name, const char *value) {
...
@@ -164,7 +166,7 @@ int setprop(const char *name, const char *value) {
int
setprop2
(
const
char
*
name
,
const
char
*
value
,
const
int
trigger
)
{
int
setprop2
(
const
char
*
name
,
const
char
*
value
,
const
int
trigger
)
{
if
(
init_resetprop
())
return
-
1
;
if
(
init_resetprop
())
return
-
1
;
int
ret
;
int
ret
;
prop_info
*
pi
=
(
prop_info
*
)
__system_property_find2
(
name
);
prop_info
*
pi
=
(
prop_info
*
)
__system_property_find2
(
name
);
if
(
pi
!=
NULL
)
{
if
(
pi
!=
NULL
)
{
if
(
trigger
)
{
if
(
trigger
)
{
...
@@ -250,7 +252,7 @@ int read_prop_file(const char* filename, const int trigger) {
...
@@ -250,7 +252,7 @@ int read_prop_file(const char* filename, const int trigger) {
int
resetprop_main
(
int
argc
,
char
*
argv
[])
{
int
resetprop_main
(
int
argc
,
char
*
argv
[])
{
int
del
=
0
,
file
=
0
,
trigger
=
1
;
int
del
=
0
,
file
=
0
,
trigger
=
1
;
int
exp_arg
=
2
;
int
exp_arg
=
2
;
char
*
name
,
*
value
,
*
filename
;
char
*
name
,
*
value
,
*
filename
;
...
...
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