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
45b5e899
Commit
45b5e899
authored
Jun 20, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove canary debug channel
All canary builds will be debug only
parent
a748d529
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
50 deletions
+38
-50
Config.kt
app/src/main/java/com/topjohnwu/magisk/core/Config.kt
+29
-31
Info.kt
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
+0
-2
GithubServices.kt
.../java/com/topjohnwu/magisk/data/network/GithubServices.kt
+7
-8
MagiskRepository.kt
.../com/topjohnwu/magisk/data/repository/MagiskRepository.kt
+1
-3
SettingsItems.kt
...in/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt
+1
-3
arrays.xml
app/src/main/res/values/arrays.xml
+0
-3
No files found.
app/src/main/java/com/topjohnwu/magisk/core/Config.kt
View file @
45b5e899
...
...
@@ -70,7 +70,6 @@ object Config : PreferenceModel, DBConfig {
const
val
BETA_CHANNEL
=
1
const
val
CUSTOM_CHANNEL
=
2
const
val
CANARY_CHANNEL
=
3
const
val
CANARY_DEBUG_CHANNEL
=
4
// root access mode
const
val
ROOT_ACCESS_DISABLED
=
0
...
...
@@ -106,12 +105,10 @@ object Config : PreferenceModel, DBConfig {
}
private
val
defaultChannel
=
if
(
isCanaryVersion
)
{
if
(
BuildConfig
.
DEBUG
)
Value
.
CANARY_DEBUG_CHANNEL
else
Value
.
CANARY_CHANNEL
}
else
Value
.
DEFAULT_CHANNEL
else
Value
.
DEFAULT_CHANNEL
var
bootId
by
preference
(
Key
.
BOOT_ID
,
""
)
...
...
@@ -154,15 +151,20 @@ object Config : PreferenceModel, DBConfig {
private
const
val
SU_FINGERPRINT
=
"su_fingerprint"
fun
initialize
()
=
prefs
.
also
{
if
(
it
.
getBoolean
(
SU_FINGERPRINT
,
false
))
{
suBiometric
=
true
}
}.
edit
{
parsePrefs
(
this
)
fun
initialize
()
{
prefs
.
edit
{
parsePrefs
()
}
// Legacy stuff
prefs
.
edit
{
// Settings migration
if
(
prefs
.
getBoolean
(
SU_FINGERPRINT
,
false
))
suBiometric
=
true
remove
(
SU_FINGERPRINT
)
prefs
.
getString
(
Key
.
UPDATE_CHANNEL
,
null
).
also
{
if
(
it
==
null
)
putString
(
Key
.
UPDATE_CHANNEL
,
defaultChannel
.
toString
())
else
if
(
it
.
toInt
()
>
Value
.
CANARY_CHANNEL
)
putString
(
Key
.
UPDATE_CHANNEL
,
Value
.
CANARY_CHANNEL
.
toString
())
}
// Get actual state
putBoolean
(
Key
.
COREONLY
,
Const
.
MAGISK_DISABLE_FILE
.
exists
())
...
...
@@ -172,15 +174,11 @@ object Config : PreferenceModel, DBConfig {
putString
(
Key
.
SU_MNT_NS
,
suMntNamespaceMode
.
toString
())
putString
(
Key
.
SU_MULTIUSER_MODE
,
suMultiuserMode
.
toString
())
putBoolean
(
Key
.
SU_BIOMETRIC
,
BiometricHelper
.
isEnabled
)
}.
also
{
if
(!
prefs
.
contains
(
Key
.
UPDATE_CHANNEL
))
prefs
.
edit
().
putString
(
Key
.
UPDATE_CHANNEL
,
defaultChannel
.
toString
()).
apply
()
}
}
private
fun
parsePrefs
(
editor
:
SharedPreferences
.
Editor
)
=
editor
.
apply
{
val
config
=
SuFile
.
open
(
"/data/adb"
,
Const
.
MANAGER_CONFIGS
)
private
fun
SharedPreferences
.
Editor
.
parsePrefs
()
{
val
config
=
SuFile
.
open
(
"/data/adb"
,
Const
.
MANAGER_CONFIGS
)
if
(
config
.
exists
())
runCatching
{
val
input
=
SuFileInputStream
(
config
)
val
parser
=
Xml
.
newPullParser
()
...
...
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
View file @
45b5e899
package
com.topjohnwu.magisk.core
import
com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork
import
com.topjohnwu.magisk.BuildConfig
import
com.topjohnwu.magisk.DynAPK
import
com.topjohnwu.magisk.core.model.UpdateInfo
import
com.topjohnwu.magisk.extensions.get
...
...
@@ -14,7 +13,6 @@ import java.io.FileInputStream
import
java.io.IOException
val
isRunningAsStub
get
()
=
Info
.
stub
!=
null
val
isCanaryVersion
=
!
BuildConfig
.
VERSION_NAME
.
contains
(
"."
)
object
Info
{
...
...
app/src/main/java/com/topjohnwu/magisk/data/network/GithubServices.kt
View file @
45b5e899
...
...
@@ -19,11 +19,8 @@ interface GithubRawServices {
@GET
(
"$MAGISK_FILES/master/beta.json"
)
fun
fetchBetaUpdate
():
Single
<
UpdateInfo
>
@GET
(
"$MAGISK_FILES/canary/release.json"
)
fun
fetchCanaryUpdate
():
Single
<
UpdateInfo
>
@GET
(
"$MAGISK_FILES/canary/debug.json"
)
fun
fetchCanary
Debug
Update
():
Single
<
UpdateInfo
>
fun
fetchCanaryUpdate
():
Single
<
UpdateInfo
>
@GET
fun
fetchCustomUpdate
(
@Url
url
:
String
):
Single
<
UpdateInfo
>
...
...
@@ -73,9 +70,11 @@ interface GithubRawServices {
interface
GithubApiServices
{
@GET
(
"repos"
)
fun
fetchRepos
(
@Query
(
"page"
)
page
:
Int
,
fun
fetchRepos
(
@Query
(
"page"
)
page
:
Int
,
@Header
(
Const
.
Key
.
IF_NONE_MATCH
)
etag
:
String
,
@Query
(
"sort"
)
sort
:
String
=
"pushed"
,
@Query
(
"per_page"
)
count
:
Int
=
100
):
Flowable
<
Result
<
List
<
GithubRepoInfo
>>>
@Query
(
"per_page"
)
count
:
Int
=
100
):
Flowable
<
Result
<
List
<
GithubRepoInfo
>>>
}
app/src/main/java/com/topjohnwu/magisk/data/repository/MagiskRepository.kt
View file @
45b5e899
...
...
@@ -23,9 +23,7 @@ class MagiskRepository(
Config
.
Value
.
DEFAULT_CHANNEL
,
Config
.
Value
.
STABLE_CHANNEL
->
apiRaw
.
fetchStableUpdate
()
Config
.
Value
.
BETA_CHANNEL
->
apiRaw
.
fetchBetaUpdate
()
Config
.
Value
.
CANARY_CHANNEL
->
apiRaw
.
fetchCanaryUpdate
()
Config
.
Value
.
CANARY_DEBUG_CHANNEL
->
apiRaw
.
fetchCanaryDebugUpdate
()
Config
.
Value
.
CUSTOM_CHANNEL
->
apiRaw
.
fetchCustomUpdate
(
Config
.
customChannelUrl
)
Config
.
Value
.
CUSTOM_CHANNEL
->
apiRaw
.
fetchCustomUpdate
(
Config
.
customChannelUrl
)
else
->
throw
IllegalArgumentException
()
}.
flatMap
{
// If remote version is lower than current installed, try switching to beta
...
...
app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt
View file @
45b5e899
...
...
@@ -12,7 +12,6 @@ import com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.core.Config
import
com.topjohnwu.magisk.core.Const
import
com.topjohnwu.magisk.core.Info
import
com.topjohnwu.magisk.core.isCanaryVersion
import
com.topjohnwu.magisk.core.utils.*
import
com.topjohnwu.magisk.databinding.DialogSettingsAppNameBinding
import
com.topjohnwu.magisk.databinding.DialogSettingsDownloadPathBinding
...
...
@@ -141,8 +140,7 @@ object UpdateChannel : SettingsItem.Selector() {
override
val
title
=
R
.
string
.
settings_update_channel_title
.
asTransitive
()
override
val
entries
get
()
=
resources
.
getStringArray
(
R
.
array
.
update_channel
).
let
{
if
(!
isCanaryVersion
&&
Config
.
updateChannel
<
Config
.
Value
.
CANARY_CHANNEL
)
it
.
take
(
it
.
size
-
2
).
toTypedArray
()
else
it
if
(
BuildConfig
.
DEBUG
)
it
.
toMutableList
().
apply
{
add
(
"Canary"
)
}.
toTypedArray
()
else
it
}
override
val
entryValRes
=
R
.
array
.
value_array
}
...
...
app/src/main/res/values/arrays.xml
View file @
45b5e899
...
...
@@ -81,9 +81,6 @@
<item>
@string/settings_update_stable
</item>
<item>
@string/settings_update_beta
</item>
<item>
@string/settings_update_custom
</item>
<!-- Debug only, don't care to translate -->
<item>
Canary
</item>
<item>
Canary (Debug)
</item>
</string-array>
<string-array
name=
"span_count"
>
...
...
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