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
cf54cad3
Commit
cf54cad3
authored
Mar 09, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deleteprop -> delprop
parent
a0998009
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
resetprop.hpp
native/jni/include/resetprop.hpp
+1
-4
resetprop.cpp
native/jni/resetprop/resetprop.cpp
+5
-5
No files found.
native/jni/include/resetprop.hpp
View file @
cf54cad3
/* resetprop.h - API for resetprop
*/
#pragma once
#include <string>
...
...
@@ -10,5 +7,5 @@ int prop_exist(const char *name);
int
setprop
(
const
char
*
name
,
const
char
*
value
,
bool
trigger
=
true
);
std
::
string
getprop
(
const
char
*
name
,
bool
persist
=
false
);
void
getprop
(
void
(
*
callback
)(
const
char
*
,
const
char
*
,
void
*
),
void
*
cookie
,
bool
persist
=
false
);
int
del
ete
prop
(
const
char
*
name
,
bool
persist
=
false
);
int
delprop
(
const
char
*
name
,
bool
persist
=
false
);
void
load_prop_file
(
const
char
*
filename
,
bool
trigger
=
true
);
native/jni/resetprop/resetprop.cpp
View file @
cf54cad3
...
...
@@ -71,7 +71,7 @@ illegal:
" -n set properties without init triggers
\n
"
" only affects setprop
\n
"
" -p access actual persist storage
\n
"
" only affects getprop and del
ete
prop
\n
"
" only affects getprop and delprop
\n
"
"
\n
"
,
arg0
);
...
...
@@ -172,7 +172,7 @@ int setprop(const char *name, const char *value, bool trigger) {
auto
pi
=
(
prop_info
*
)
__system_property_find
(
name
);
if
(
pi
!=
nullptr
)
{
if
(
trigger
)
{
if
(
strncmp
(
name
,
"ro."
,
3
)
==
0
)
del
ete
prop
(
name
);
if
(
strncmp
(
name
,
"ro."
,
3
)
==
0
)
delprop
(
name
);
ret
=
__system_property_set
(
name
,
value
);
}
else
{
ret
=
__system_property_update
(
pi
,
value
,
strlen
(
value
));
...
...
@@ -195,13 +195,13 @@ int setprop(const char *name, const char *value, bool trigger) {
return
ret
;
}
int
del
ete
prop
(
const
char
*
name
,
bool
persist
)
{
int
delprop
(
const
char
*
name
,
bool
persist
)
{
if
(
!
check_legal_property_name
(
name
))
return
1
;
ENSURE_INIT
(
-
1
);
char
path
[
PATH_MAX
];
path
[
0
]
=
'\0'
;
LOGD
(
"resetprop: del
ete
prop [%s]
\n
"
,
name
);
LOGD
(
"resetprop: delprop [%s]
\n
"
,
name
);
if
(
persist
&&
strncmp
(
name
,
"persist."
,
8
)
==
0
)
persist
=
persist_deleteprop
(
name
);
return
__system_property_del
(
name
)
&&
!
(
persist
&&
strncmp
(
name
,
"persist."
,
8
)
==
0
);
...
...
@@ -235,7 +235,7 @@ int resetprop_main(int argc, char *argv[]) {
load_prop_file
(
argv
[
1
],
trigger
);
return
0
;
}
else
if
(
strcmp
(
argv
[
0
],
"--delete"
)
==
0
&&
argc
==
2
)
{
return
del
ete
prop
(
argv
[
1
],
persist
);
return
delprop
(
argv
[
1
],
persist
);
}
else
if
(
strcmp
(
argv
[
0
],
"--help"
)
==
0
)
{
usage
(
argv0
);
}
...
...
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