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
78a444d6
Commit
78a444d6
authored
Dec 30, 2022
by
topjohnwu
Committed by
John Wu
Dec 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for root service to bind
parent
37b81ad1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
RootUtils.kt
...rc/main/java/com/topjohnwu/magisk/core/utils/RootUtils.kt
+11
-3
ModuleViewModel.kt
...in/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt
+4
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/core/utils/RootUtils.kt
View file @
78a444d6
...
@@ -111,15 +111,23 @@ class RootUtils(stub: Any?) : RootService() {
...
@@ -111,15 +111,23 @@ class RootUtils(stub: Any?) : RootService() {
}
}
fun
await
()
{
fun
await
()
{
// We cannot await on the main thread
if
(!
Info
.
isRooted
)
if
(
Info
.
isRooted
&&
!
ShellUtils
.
onMainThread
())
return
if
(!
ShellUtils
.
onMainThread
())
{
acquireSharedInterruptibly
(
1
)
acquireSharedInterruptibly
(
1
)
}
else
if
(
state
!=
0
)
{
throw
IllegalStateException
(
"Cannot await on the main thread"
)
}
}
}
}
}
companion
object
{
companion
object
{
var
bindTask
:
Shell
.
Task
?
=
null
var
bindTask
:
Shell
.
Task
?
=
null
var
fs
=
FileSystemManager
.
getLocal
()
var
fs
:
FileSystemManager
=
FileSystemManager
.
getLocal
()
get
()
{
Connection
.
await
()
return
field
}
private
set
private
set
var
obj
:
IRootUtils
?
=
null
var
obj
:
IRootUtils
?
=
null
get
()
{
get
()
{
...
...
app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt
View file @
78a444d6
...
@@ -35,7 +35,7 @@ class ModuleViewModel : AsyncLoadViewModel() {
...
@@ -35,7 +35,7 @@ class ModuleViewModel : AsyncLoadViewModel() {
var
loading
=
true
var
loading
=
true
private
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
loading
)
private
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
loading
)
init
{
private
suspend
fun
init
()
=
withContext
(
Dispatchers
.
IO
)
{
if
(
Info
.
env
.
isActive
&&
LocalModule
.
loaded
())
{
if
(
Info
.
env
.
isActive
&&
LocalModule
.
loaded
())
{
items
.
insertItem
(
InstallModule
)
items
.
insertItem
(
InstallModule
)
.
insertList
(
itemsInstalled
)
.
insertList
(
itemsInstalled
)
...
@@ -44,6 +44,9 @@ class ModuleViewModel : AsyncLoadViewModel() {
...
@@ -44,6 +44,9 @@ class ModuleViewModel : AsyncLoadViewModel() {
override
suspend
fun
doLoadWork
()
{
override
suspend
fun
doLoadWork
()
{
loading
=
true
loading
=
true
if
(
items
.
isEmpty
())
{
init
()
}
loadInstalled
()
loadInstalled
()
loading
=
false
loading
=
false
loadUpdateInfo
()
loadUpdateInfo
()
...
...
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