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
257ceb99
Commit
257ceb99
authored
Apr 09, 2021
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SDK < 21 is EOL
parent
706d5306
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
Const.kt
app/src/main/java/com/topjohnwu/magisk/core/Const.kt
+1
-0
NetworkService.kt
...va/com/topjohnwu/magisk/data/repository/NetworkService.kt
+5
-0
NetworkingModule.kt
...src/main/java/com/topjohnwu/magisk/di/NetworkingModule.kt
+4
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/core/Const.kt
View file @
257ceb99
...
@@ -63,6 +63,7 @@ object Const {
...
@@ -63,6 +63,7 @@ object Const {
const
val
GITHUB_RAW_URL
=
"https://raw.githubusercontent.com/"
const
val
GITHUB_RAW_URL
=
"https://raw.githubusercontent.com/"
const
val
GITHUB_API_URL
=
"https://api.github.com/"
const
val
GITHUB_API_URL
=
"https://api.github.com/"
const
val
GITHUB_PAGE_URL
=
"https://topjohnwu.github.io/magisk-files/"
const
val
GITHUB_PAGE_URL
=
"https://topjohnwu.github.io/magisk-files/"
const
val
GITHUB_OLD_PAGE_URL
=
"https://topjohnwu.github.io/magisk_files/"
const
val
JS_DELIVR_URL
=
"https://cdn.jsdelivr.net/gh/"
const
val
JS_DELIVR_URL
=
"https://cdn.jsdelivr.net/gh/"
const
val
OFFICIAL_REPO
=
"https://magisk-modules-repo.github.io/submission/modules.json"
const
val
OFFICIAL_REPO
=
"https://magisk-modules-repo.github.io/submission/modules.json"
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/data/repository/NetworkService.kt
View file @
257ceb99
package
com.topjohnwu.magisk.data.repository
package
com.topjohnwu.magisk.data.repository
import
android.os.Build
import
com.topjohnwu.magisk.core.Config
import
com.topjohnwu.magisk.core.Config
import
com.topjohnwu.magisk.core.Config.Value.BETA_CHANNEL
import
com.topjohnwu.magisk.core.Config.Value.BETA_CHANNEL
import
com.topjohnwu.magisk.core.Config.Value.CANARY_CHANNEL
import
com.topjohnwu.magisk.core.Config.Value.CANARY_CHANNEL
...
@@ -20,6 +21,10 @@ class NetworkService(
...
@@ -20,6 +21,10 @@ class NetworkService(
private
val
api
:
GithubApiServices
private
val
api
:
GithubApiServices
)
{
)
{
suspend
fun
fetchUpdate
()
=
safe
{
suspend
fun
fetchUpdate
()
=
safe
{
// Pre SDK 21 no longer receives any major updates
if
(
Build
.
VERSION
.
SDK_INT
<
21
)
return
fetchStableUpdate
()
var
info
=
when
(
Config
.
updateChannel
)
{
var
info
=
when
(
Config
.
updateChannel
)
{
DEFAULT_CHANNEL
,
STABLE_CHANNEL
->
fetchStableUpdate
()
DEFAULT_CHANNEL
,
STABLE_CHANNEL
->
fetchStableUpdate
()
BETA_CHANNEL
->
fetchBetaUpdate
()
BETA_CHANNEL
->
fetchBetaUpdate
()
...
...
app/src/main/java/com/topjohnwu/magisk/di/NetworkingModule.kt
View file @
257ceb99
...
@@ -34,7 +34,10 @@ val networkingModule = module {
...
@@ -34,7 +34,10 @@ val networkingModule = module {
single
{
createRetrofit
(
get
())
}
single
{
createRetrofit
(
get
())
}
single
{
createApiService
<
RawServices
>(
get
(),
Const
.
Url
.
GITHUB_RAW_URL
)
}
single
{
createApiService
<
RawServices
>(
get
(),
Const
.
Url
.
GITHUB_RAW_URL
)
}
single
{
createApiService
<
GithubApiServices
>(
get
(),
Const
.
Url
.
GITHUB_API_URL
)
}
single
{
createApiService
<
GithubApiServices
>(
get
(),
Const
.
Url
.
GITHUB_API_URL
)
}
single
{
createApiService
<
GithubPageServices
>(
get
(),
Const
.
Url
.
GITHUB_PAGE_URL
)
}
single
{
createApiService
<
GithubPageServices
>(
get
(),
if
(
Build
.
VERSION
.
SDK_INT
<
21
)
Const
.
Url
.
GITHUB_OLD_PAGE_URL
else
Const
.
Url
.
GITHUB_PAGE_URL
)
}
single
{
createApiService
<
JSDelivrServices
>(
get
(),
Const
.
Url
.
JS_DELIVR_URL
)
}
single
{
createApiService
<
JSDelivrServices
>(
get
(),
Const
.
Url
.
JS_DELIVR_URL
)
}
single
{
createMarkwon
(
get
(),
get
())
}
single
{
createMarkwon
(
get
(),
get
())
}
}
}
...
...
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