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
a7824af5
Commit
a7824af5
authored
Nov 03, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose persist prop API
parent
1eb7d7b7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
18 deletions
+11
-18
resetprop.h
native/jni/include/resetprop.h
+1
-1
hide_utils.cpp
native/jni/magiskhide/hide_utils.cpp
+4
-5
resetprop.cpp
native/jni/resetprop/resetprop.cpp
+6
-12
No files found.
native/jni/include/resetprop.h
View file @
a7824af5
...
...
@@ -16,7 +16,7 @@ char *getprop2(const char *name, int persist);
int
deleteprop
(
const
char
*
name
);
int
deleteprop2
(
const
char
*
name
,
const
int
persist
);
int
read_prop_file
(
const
char
*
filename
,
const
int
trigger
);
void
getprop_all
(
void
(
*
callback
)(
const
char
*
,
const
char
*
,
void
*
),
void
*
cookie
);
void
getprop_all
(
void
(
*
callback
)(
const
char
*
,
const
char
*
,
void
*
),
void
*
cookie
,
int
persist
);
#ifdef __cplusplus
}
...
...
native/jni/magiskhide/hide_utils.cpp
View file @
a7824af5
...
...
@@ -133,11 +133,10 @@ static void kill_process(const char *name) {
void
clean_magisk_props
()
{
LOGD
(
"hide_utils: Cleaning magisk props
\n
"
);
getprop_all
([]
(
const
char
*
name
,
auto
,
auto
)
->
void
{
getprop_all
([](
const
char
*
name
,
auto
,
auto
)
->
void
{
if
(
strstr
(
name
,
"magisk"
))
deleteprop2
(
name
,
0
);
},
nullptr
);
},
nullptr
,
0
);
}
static
int
add_list
(
sqlite3
*
db
,
char
*
proc
)
{
...
...
native/jni/resetprop/resetprop.cpp
View file @
a7824af5
/* resetprop.cpp - Manipulate any system props
*
* Copyright 2016 nkk71 <nkk71x@gmail.com>
* Copyright 2016 topjohnwu <topjohnwu@gmail.com>
*/
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
...
...
@@ -120,11 +114,7 @@ static int init_resetprop() {
static
void
print_props
(
int
persist
)
{
auto
prop_list
=
Array
<
prop_t
>
();
getprop_all
(
collect_props
,
&
prop_list
);
if
(
persist
)
{
read_cb_t
read_cb
(
collect_unique_props
,
&
prop_list
);
persist_getprop_all
(
&
read_cb
);
}
getprop_all
(
collect_props
,
&
prop_list
,
persist
);
prop_list
.
sort
();
for
(
auto
&
prop
:
prop_list
)
printf
(
"[%s]: [%s]
\n
"
,
prop
.
name
,
prop
.
value
);
...
...
@@ -167,10 +157,14 @@ char *getprop2(const char *name, int persist) {
}
}
void
getprop_all
(
void
(
*
callback
)(
const
char
*
,
const
char
*
,
void
*
),
void
*
cookie
)
{
void
getprop_all
(
void
(
*
callback
)(
const
char
*
,
const
char
*
,
void
*
),
void
*
cookie
,
int
persist
)
{
if
(
init_resetprop
())
return
;
read_cb_t
read_cb
(
callback
,
cookie
);
__system_property_foreach
(
read_props
,
&
read_cb
);
if
(
persist
)
{
read_cb
.
cb
=
collect_unique_props
;
persist_getprop_all
(
&
read_cb
);
}
}
int
setprop
(
const
char
*
name
,
const
char
*
value
)
{
...
...
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