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
a1827fd6
Commit
a1827fd6
authored
Mar 11, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure to read db before
parent
9ce334fe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
Config.java
app/src/main/java/com/topjohnwu/magisk/Config.java
+16
-4
No files found.
app/src/main/java/com/topjohnwu/magisk/Config.java
View file @
a1827fd6
...
...
@@ -342,23 +342,35 @@ public class Config {
}
private
static
void
setDefs
(
SharedPreferences
pref
,
SharedPreferences
.
Editor
editor
)
{
App
app
=
App
.
self
;
for
(
String
key
:
defs
.
keySet
())
{
int
type
=
getConfigType
(
key
);
switch
(
type
)
{
case
DB_INT:
editor
.
putString
(
key
,
String
.
valueOf
(
app
.
mDB
.
getSettings
(
key
,
(
Integer
)
defs
.
get
(
key
))));
continue
;
case
DB_STR:
editor
.
putString
(
key
,
app
.
mDB
.
getStrings
(
key
,
(
String
)
defs
.
get
(
key
)));
continue
;
case
DB_BOOL:
int
bs
=
app
.
mDB
.
getSettings
(
key
,
-
1
);
editor
.
putBoolean
(
key
,
bs
<
0
?
(
Boolean
)
defs
.
get
(
key
)
:
bs
!=
0
);
continue
;
}
if
(
pref
.
contains
(
key
))
continue
;
switch
(
getConfigType
(
key
)
)
{
switch
(
type
)
{
case
PREF_INT:
editor
.
putInt
(
key
,
(
Integer
)
defs
.
get
(
key
));
break
;
case
DB_INT:
case
PREF_STR_INT:
editor
.
putString
(
key
,
String
.
valueOf
(
defs
.
get
(
key
)));
break
;
case
PREF_STR:
case
DB_STR:
editor
.
putString
(
key
,
(
String
)
defs
.
get
(
key
));
break
;
case
PREF_BOOL:
case
DB_BOOL:
editor
.
putBoolean
(
key
,
(
Boolean
)
defs
.
get
(
key
));
break
;
}
...
...
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