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
ae5277a8
Commit
ae5277a8
authored
Feb 12, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multiusers conflicting
parent
bffa8378
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
SuDatabaseHelper.java
.../java/com/topjohnwu/magisk/database/SuDatabaseHelper.java
+10
-5
No files found.
src/main/java/com/topjohnwu/magisk/database/SuDatabaseHelper.java
View file @
ae5277a8
...
...
@@ -41,16 +41,21 @@ public class SuDatabaseHelper {
try
{
return
new
SuDatabaseHelper
(
mm
);
}
catch
(
Exception
e
)
{
// Let's cleanup and try again
cleanup
();
// Let's cleanup
everything
and try again
cleanup
(
"*"
);
return
new
SuDatabaseHelper
(
mm
);
}
}
public
static
void
cleanup
()
{
cleanup
(
String
.
valueOf
(
Const
.
USER_ID
));
}
public
static
void
cleanup
(
String
s
)
{
Shell
.
Sync
.
su
(
"umount -l /data/user*/*/*/databases/su.db /sbin/.core/db-*/magisk.db"
,
"rm -rf /sbin/.core/db-*"
);
"umount -l /data/user*/*/*/databases/su.db"
,
"umount -l /sbin/.core/db-"
+
s
+
"/magisk.db"
,
"rm -rf /sbin/.core/db-"
+
s
);
}
private
SuDatabaseHelper
(
MagiskManager
mm
)
{
...
...
@@ -68,7 +73,7 @@ public class SuDatabaseHelper {
private
SQLiteDatabase
openDatabase
(
MagiskManager
mm
)
{
String
GLOBAL_DB
=
"/data/adb/magisk.db"
;
DB_FILE
=
new
File
(
Utils
.
fmt
(
"/sbin/.core/db-%
s/magisk.db"
,
mm
.
getPackageName
()
));
DB_FILE
=
new
File
(
Utils
.
fmt
(
"/sbin/.core/db-%
d/magisk.db"
,
Const
.
USER_ID
));
Context
de
=
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
?
mm
.
createDeviceProtectedStorageContext
()
:
mm
;
if
(!
DB_FILE
.
exists
())
{
...
...
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