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
ad47dba0
Commit
ad47dba0
authored
Dec 14, 2021
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename magiskVersion* -> version*
parent
41b70184
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
Const.kt
app/src/main/java/com/topjohnwu/magisk/core/Const.kt
+3
-3
Info.kt
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
+3
-3
NetworkService.kt
...va/com/topjohnwu/magisk/data/repository/NetworkService.kt
+1
-1
HomeViewModel.kt
...c/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
+3
-3
LogViewModel.kt
...src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt
+1
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/core/Const.kt
View file @
ad47dba0
...
@@ -31,9 +31,9 @@ object Const {
...
@@ -31,9 +31,9 @@ object Const {
const
val
MIN_VERSION
=
"v20.4"
const
val
MIN_VERSION
=
"v20.4"
const
val
MIN_VERCODE
=
20400
const
val
MIN_VERCODE
=
20400
fun
atLeast_21_0
()
=
Info
.
env
.
magiskV
ersionCode
>=
21000
||
isCanary
()
fun
atLeast_21_0
()
=
Info
.
env
.
v
ersionCode
>=
21000
||
isCanary
()
fun
atLeast_21_2
()
=
Info
.
env
.
magiskV
ersionCode
>=
21200
||
isCanary
()
fun
atLeast_21_2
()
=
Info
.
env
.
v
ersionCode
>=
21200
||
isCanary
()
fun
isCanary
()
=
isCanary
(
Info
.
env
.
magiskV
ersionCode
)
fun
isCanary
()
=
isCanary
(
Info
.
env
.
v
ersionCode
)
fun
isCanary
(
ver
:
Int
)
=
ver
>
0
&&
ver
%
100
!=
0
fun
isCanary
(
ver
:
Int
)
=
ver
>
0
&&
ver
%
100
!=
0
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
View file @
ad47dba0
...
@@ -56,14 +56,14 @@ object Info {
...
@@ -56,14 +56,14 @@ object Info {
)
)
class
Env
(
class
Env
(
val
magiskV
ersionString
:
String
=
""
,
val
v
ersionString
:
String
=
""
,
code
:
Int
=
-
1
code
:
Int
=
-
1
)
{
)
{
val
magiskV
ersionCode
=
when
{
val
v
ersionCode
=
when
{
code
<
Const
.
Version
.
MIN_VERCODE
->
-
1
code
<
Const
.
Version
.
MIN_VERCODE
->
-
1
else
->
if
(
Shell
.
rootAccess
())
code
else
-
1
else
->
if
(
Shell
.
rootAccess
())
code
else
-
1
}
}
val
isUnsupported
=
code
>
0
&&
code
<
Const
.
Version
.
MIN_VERCODE
val
isUnsupported
=
code
>
0
&&
code
<
Const
.
Version
.
MIN_VERCODE
val
isActive
=
magiskV
ersionCode
>=
0
val
isActive
=
v
ersionCode
>=
0
}
}
}
}
app/src/main/java/com/topjohnwu/magisk/data/repository/NetworkService.kt
View file @
ad47dba0
...
@@ -26,7 +26,7 @@ class NetworkService(
...
@@ -26,7 +26,7 @@ class NetworkService(
CUSTOM_CHANNEL
->
fetchCustomUpdate
(
Config
.
customChannelUrl
)
CUSTOM_CHANNEL
->
fetchCustomUpdate
(
Config
.
customChannelUrl
)
else
->
throw
IllegalArgumentException
()
else
->
throw
IllegalArgumentException
()
}
}
if
(
info
.
magisk
.
versionCode
<
Info
.
env
.
magiskV
ersionCode
&&
if
(
info
.
magisk
.
versionCode
<
Info
.
env
.
v
ersionCode
&&
Config
.
updateChannel
==
DEFAULT_CHANNEL
Config
.
updateChannel
==
DEFAULT_CHANNEL
)
{
)
{
Config
.
updateChannel
=
BETA_CHANNEL
Config
.
updateChannel
=
BETA_CHANNEL
...
...
app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
View file @
ad47dba0
...
@@ -48,7 +48,7 @@ class HomeViewModel(
...
@@ -48,7 +48,7 @@ class HomeViewModel(
val
stateMagisk
val
stateMagisk
get
()
=
when
{
get
()
=
when
{
!
Info
.
env
.
isActive
->
MagiskState
.
NOT_INSTALLED
!
Info
.
env
.
isActive
->
MagiskState
.
NOT_INSTALLED
Info
.
env
.
magiskV
ersionCode
<
BuildConfig
.
VERSION_CODE
->
MagiskState
.
OBSOLETE
Info
.
env
.
v
ersionCode
<
BuildConfig
.
VERSION_CODE
->
MagiskState
.
OBSOLETE
else
->
MagiskState
.
UP_TO_DATE
else
->
MagiskState
.
UP_TO_DATE
}
}
...
@@ -59,7 +59,7 @@ class HomeViewModel(
...
@@ -59,7 +59,7 @@ class HomeViewModel(
val
magiskInstalledVersion
val
magiskInstalledVersion
get
()
=
Info
.
env
.
run
{
get
()
=
Info
.
env
.
run
{
if
(
isActive
)
if
(
isActive
)
"$
magiskVersionString ($magiskV
ersionCode)"
.
asText
()
"$
versionString ($v
ersionCode)"
.
asText
()
else
else
R
.
string
.
not_available
.
asText
()
R
.
string
.
not_available
.
asText
()
}
}
...
@@ -137,7 +137,7 @@ class HomeViewModel(
...
@@ -137,7 +137,7 @@ class HomeViewModel(
private
suspend
fun
ensureEnv
()
{
private
suspend
fun
ensureEnv
()
{
if
(
MagiskState
.
NOT_INSTALLED
==
stateMagisk
||
shownDialog
)
return
if
(
MagiskState
.
NOT_INSTALLED
==
stateMagisk
||
shownDialog
)
return
val
cmd
=
"env_check ${Info.env.
magiskVersionString} ${Info.env.magiskV
ersionCode}"
val
cmd
=
"env_check ${Info.env.
versionString} ${Info.env.v
ersionCode}"
if
(!
Shell
.
su
(
cmd
).
await
().
isSuccess
)
{
if
(!
Shell
.
su
(
cmd
).
await
().
isSuccess
)
{
shownDialog
=
true
shownDialog
=
true
EnvFixDialog
().
publish
()
EnvFixDialog
().
publish
()
...
...
app/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt
View file @
ad47dba0
...
@@ -75,7 +75,7 @@ class LogViewModel(
...
@@ -75,7 +75,7 @@ class LogViewModel(
FileInputStream
(
"/proc/self/mountinfo"
).
reader
().
use
{
it
.
copyTo
(
file
)
}
FileInputStream
(
"/proc/self/mountinfo"
).
reader
().
use
{
it
.
copyTo
(
file
)
}
file
.
write
(
"\n---Magisk Logs---\n"
)
file
.
write
(
"\n---Magisk Logs---\n"
)
file
.
write
(
"${Info.env.
magiskVersionString} (${Info.env.magiskV
ersionCode})\n\n"
)
file
.
write
(
"${Info.env.
versionString} (${Info.env.v
ersionCode})\n\n"
)
file
.
write
(
consoleText
)
file
.
write
(
consoleText
)
file
.
write
(
"\n---Manager Logs---\n"
)
file
.
write
(
"\n---Manager Logs---\n"
)
...
...
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