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
e76dba0f
Commit
e76dba0f
authored
Nov 08, 2016
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Magisk Version now double, also support custom version names
parent
aababe1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
MagiskFragment.java
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
+11
-6
Async.java
app/src/main/java/com/topjohnwu/magisk/utils/Async.java
+1
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
View file @
e76dba0f
...
...
@@ -33,8 +33,9 @@ import butterknife.ButterKnife;
public
class
MagiskFragment
extends
Fragment
{
public
static
int
magiskVersion
,
remoteMagiskVersion
=
-
1
,
remoteAppVersionCode
=
-
1
;
public
static
String
magiskLink
,
magiskChangelog
,
appLink
,
appChangelog
,
remoteAppVersion
;
public
static
int
remoteAppVersionCode
=
-
1
;
public
static
double
magiskVersion
,
remoteMagiskVersion
=
-
1
;
public
static
String
magiskVersionString
,
magiskLink
,
magiskChangelog
,
appLink
,
appChangelog
,
remoteAppVersion
;
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
...
...
@@ -174,10 +175,14 @@ public class MagiskFragment extends Fragment {
private
void
updateMagiskVersion
()
{
List
<
String
>
ret
=
Shell
.
sh
(
"getprop magisk.version"
);
try
{
magiskVersion
=
Integer
.
parseInt
(
ret
.
get
(
0
));
}
catch
(
NumberFormatException
e
)
{
if
(
ret
.
get
(
0
).
length
()
==
0
)
{
magiskVersion
=
-
1
;
}
else
try
{
magiskVersionString
=
ret
.
get
(
0
);
magiskVersion
=
Double
.
parseDouble
(
ret
.
get
(
0
));
}
catch
(
NumberFormatException
e
)
{
// Custom version don't need to receive updates
magiskVersion
=
Double
.
POSITIVE_INFINITY
;
}
if
(
magiskVersion
==
-
1
)
{
...
...
@@ -190,7 +195,7 @@ public class MagiskFragment extends Fragment {
magiskStatusContainer
.
setBackgroundColor
(
colorOK
);
magiskStatusIcon
.
setImageResource
(
statusOK
);
magiskVersionText
.
setText
(
getString
(
R
.
string
.
magisk_version
,
String
.
valueOf
(
magiskVersion
)
));
magiskVersionText
.
setText
(
getString
(
R
.
string
.
magisk_version
,
magiskVersionString
));
magiskVersionText
.
setTextColor
(
colorOK
);
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/utils/Async.java
View file @
e76dba0f
...
...
@@ -107,7 +107,7 @@ public class Async {
JSONObject
magisk
=
json
.
getJSONObject
(
"magisk"
);
JSONObject
app
=
json
.
getJSONObject
(
"app"
);
MagiskFragment
.
remoteMagiskVersion
=
magisk
.
get
Int
(
"versionCode"
);
MagiskFragment
.
remoteMagiskVersion
=
magisk
.
get
Double
(
"versionCode"
);
MagiskFragment
.
magiskLink
=
magisk
.
getString
(
"link"
);
MagiskFragment
.
magiskChangelog
=
magisk
.
getString
(
"changelog"
);
...
...
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