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
dc61dfbd
Commit
dc61dfbd
authored
Jan 25, 2021
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache update check results
parent
21466426
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
5 deletions
+17
-5
Info.kt
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
+8
-1
NetworkService.kt
...va/com/topjohnwu/magisk/data/repository/NetworkService.kt
+0
-1
HomeViewModel.kt
...c/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
+1
-1
SettingsItems.kt
...in/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt
+8
-2
No files found.
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
View file @
dc61dfbd
...
...
@@ -4,6 +4,7 @@ import androidx.databinding.ObservableBoolean
import
com.topjohnwu.magisk.DynAPK
import
com.topjohnwu.magisk.core.model.UpdateInfo
import
com.topjohnwu.magisk.core.utils.net.NetworkObserver
import
com.topjohnwu.magisk.data.repository.NetworkService
import
com.topjohnwu.magisk.ktx.get
import
com.topjohnwu.magisk.ktx.getProperty
import
com.topjohnwu.superuser.Shell
...
...
@@ -18,7 +19,13 @@ object Info {
var
stub
:
DynAPK
.
Data
?
=
null
var
remote
=
UpdateInfo
()
val
EMPTY_REMOTE
=
UpdateInfo
()
var
remote
=
EMPTY_REMOTE
suspend
fun
getRemote
(
svc
:
NetworkService
):
UpdateInfo
?
{
return
if
(
remote
===
EMPTY_REMOTE
)
{
svc
.
fetchUpdate
()
?.
apply
{
remote
=
this
}
}
else
remote
}
// Device state
@JvmStatic
val
env
by
lazy
{
loadState
()
}
...
...
app/src/main/java/com/topjohnwu/magisk/data/repository/NetworkService.kt
View file @
dc61dfbd
...
...
@@ -36,7 +36,6 @@ class NetworkService(
Config
.
updateChannel
=
BETA_CHANNEL
info
=
fetchBetaUpdate
()
}
Info
.
remote
=
info
info
}
...
...
app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
View file @
dc61dfbd
...
...
@@ -76,7 +76,7 @@ class HomeViewModel(
override
fun
refresh
()
=
viewModelScope
.
launch
{
state
=
State
.
LOADING
notifyPropertyChanged
(
BR
.
showSafetyNet
)
svc
.
fetchUpdate
(
)
?.
apply
{
Info
.
getRemote
(
svc
)
?.
apply
{
state
=
State
.
LOADED
stateManager
=
when
{
...
...
app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt
View file @
dc61dfbd
...
...
@@ -141,7 +141,10 @@ object DownloadPath : BaseSettingsItem.Input() {
object
UpdateChannel
:
BaseSettingsItem
.
Selector
()
{
override
var
value
=
Config
.
updateChannel
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
Config
.
updateChannel
=
it
}
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
Config
.
updateChannel
=
it
Info
.
remote
=
Info
.
EMPTY_REMOTE
}
override
val
title
=
R
.
string
.
settings_update_channel_title
.
asTransitive
()
override
val
entries
:
Array
<
String
>
=
resources
.
getStringArray
(
R
.
array
.
update_channel
).
let
{
...
...
@@ -155,7 +158,10 @@ object UpdateChannel : BaseSettingsItem.Selector() {
object
UpdateChannelUrl
:
BaseSettingsItem
.
Input
()
{
override
val
title
=
R
.
string
.
settings_update_custom
.
asTransitive
()
override
var
value
=
Config
.
customChannelUrl
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
Config
.
customChannelUrl
=
it
}
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
Config
.
customChannelUrl
=
it
Info
.
remote
=
Info
.
EMPTY_REMOTE
}
override
val
description
get
()
=
value
.
asTransitive
()
override
val
inputResult
get
()
=
result
...
...
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