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
745865ee
Commit
745865ee
authored
Mar 08, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add canary channels
Only show if user is already on canary channels
parent
c134fb19
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
0 deletions
+24
-0
Config.java
app-core/src/main/java/com/topjohnwu/magisk/Config.java
+2
-0
Const.java
app-core/src/main/java/com/topjohnwu/magisk/Const.java
+2
-0
CheckUpdates.java
...rc/main/java/com/topjohnwu/magisk/tasks/CheckUpdates.java
+6
-0
SettingsFragment.java
...java/com/topjohnwu/magisk/fragments/SettingsFragment.java
+10
-0
arrays.xml
app/src/full/res/values/arrays.xml
+4
-0
No files found.
app-core/src/main/java/com/topjohnwu/magisk/Config.java
View file @
745865ee
...
@@ -73,6 +73,8 @@ public class Config {
...
@@ -73,6 +73,8 @@ public class Config {
public
static
final
int
STABLE_CHANNEL
=
0
;
public
static
final
int
STABLE_CHANNEL
=
0
;
public
static
final
int
BETA_CHANNEL
=
1
;
public
static
final
int
BETA_CHANNEL
=
1
;
public
static
final
int
CUSTOM_CHANNEL
=
2
;
public
static
final
int
CUSTOM_CHANNEL
=
2
;
public
static
final
int
CANARY_CHANNEL
=
3
;
public
static
final
int
CANARY_DEBUG_CHANNEL
=
4
;
public
static
final
int
ROOT_ACCESS_DISABLED
=
0
;
public
static
final
int
ROOT_ACCESS_DISABLED
=
0
;
public
static
final
int
ROOT_ACCESS_APPS_ONLY
=
1
;
public
static
final
int
ROOT_ACCESS_APPS_ONLY
=
1
;
public
static
final
int
ROOT_ACCESS_ADB_ONLY
=
2
;
public
static
final
int
ROOT_ACCESS_ADB_ONLY
=
2
;
...
...
app-core/src/main/java/com/topjohnwu/magisk/Const.java
View file @
745865ee
...
@@ -63,6 +63,8 @@ public class Const {
...
@@ -63,6 +63,8 @@ public class Const {
}
}
public
static
final
String
STABLE_URL
=
getRaw
(
"master"
,
"stable.json"
);
public
static
final
String
STABLE_URL
=
getRaw
(
"master"
,
"stable.json"
);
public
static
final
String
BETA_URL
=
getRaw
(
"master"
,
"beta.json"
);
public
static
final
String
BETA_URL
=
getRaw
(
"master"
,
"beta.json"
);
public
static
final
String
CANARY_URL
=
getRaw
(
"master"
,
"canary_builds/release.json"
);
public
static
final
String
CANARY_DEBUG_URL
=
getRaw
(
"master"
,
"canary_builds/canary.json"
);
public
static
final
String
REPO_URL
=
"https://api.github.com/users/Magisk-Modules-Repo/repos?per_page=100&sort=pushed&page=%d"
;
public
static
final
String
REPO_URL
=
"https://api.github.com/users/Magisk-Modules-Repo/repos?per_page=100&sort=pushed&page=%d"
;
public
static
final
String
FILE_URL
=
"https://raw.githubusercontent.com/Magisk-Modules-Repo/%s/master/%s"
;
public
static
final
String
FILE_URL
=
"https://raw.githubusercontent.com/Magisk-Modules-Repo/%s/master/%s"
;
public
static
final
String
ZIP_URL
=
"https://github.com/Magisk-Modules-Repo/%s/archive/master.zip"
;
public
static
final
String
ZIP_URL
=
"https://github.com/Magisk-Modules-Repo/%s/archive/master.zip"
;
...
...
app-core/src/main/java/com/topjohnwu/magisk/tasks/CheckUpdates.java
View file @
745865ee
...
@@ -24,6 +24,12 @@ public class CheckUpdates {
...
@@ -24,6 +24,12 @@ public class CheckUpdates {
case
Config
.
Value
.
CUSTOM_CHANNEL
:
case
Config
.
Value
.
CUSTOM_CHANNEL
:
url
=
Config
.
get
(
Config
.
Key
.
CUSTOM_CHANNEL
);
url
=
Config
.
get
(
Config
.
Key
.
CUSTOM_CHANNEL
);
break
;
break
;
case
Config
.
Value
.
CANARY_CHANNEL
:
url
=
Const
.
Url
.
CANARY_URL
;
break
;
case
Config
.
Value
.
CANARY_DEBUG_CHANNEL
:
url
=
Const
.
Url
.
CANARY_DEBUG_URL
;
break
;
case
Config
.
Value
.
STABLE_CHANNEL
:
case
Config
.
Value
.
STABLE_CHANNEL
:
default
:
default
:
url
=
Const
.
Url
.
STABLE_URL
;
url
=
Const
.
Url
.
STABLE_URL
;
...
...
app/src/full/java/com/topjohnwu/magisk/fragments/SettingsFragment.java
View file @
745865ee
...
@@ -33,6 +33,7 @@ import com.topjohnwu.net.Networking;
...
@@ -33,6 +33,7 @@ import com.topjohnwu.net.Networking;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.Shell
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.Locale
;
import
java.util.Locale
;
public
class
SettingsFragment
extends
BasePreferenceFragment
implements
Topic
.
Subscriber
{
public
class
SettingsFragment
extends
BasePreferenceFragment
implements
Topic
.
Subscriber
{
...
@@ -109,6 +110,15 @@ public class SettingsFragment extends BasePreferenceFragment implements Topic.Su
...
@@ -109,6 +110,15 @@ public class SettingsFragment extends BasePreferenceFragment implements Topic.Su
return
true
;
return
true
;
});
});
/* We only show canary channels if user is already on canary channel
* or the user have already chosen canary channel */
if
(!
BuildConfig
.
VERSION_NAME
.
contains
(
"-"
)
&&
(
int
)
Config
.
get
(
Config
.
Key
.
UPDATE_CHANNEL
)
<
Config
.
Value
.
CANARY_CHANNEL
)
{
// Remove the last 2 entries
CharSequence
[]
entries
=
updateChannel
.
getEntries
();
updateChannel
.
setEntries
(
Arrays
.
copyOf
(
entries
,
entries
.
length
-
2
));
}
setSummary
();
setSummary
();
// Disable dangerous settings in secondary user
// Disable dangerous settings in secondary user
...
...
app/src/full/res/values/arrays.xml
View file @
745865ee
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
<item>
1
</item>
<item>
1
</item>
<item>
2
</item>
<item>
2
</item>
<item>
3
</item>
<item>
3
</item>
<item>
4
</item>
</string-array>
</string-array>
<string-array
name=
"request_timeout"
>
<string-array
name=
"request_timeout"
>
...
@@ -80,6 +81,9 @@
...
@@ -80,6 +81,9 @@
<item>
@string/settings_update_stable
</item>
<item>
@string/settings_update_stable
</item>
<item>
@string/settings_update_beta
</item>
<item>
@string/settings_update_beta
</item>
<item>
@string/settings_update_custom
</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>
<string-array
name=
"boot_formats"
>
<string-array
name=
"boot_formats"
>
...
...
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