mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-26 12:07:25 +00:00
Remove more code
This commit is contained in:
parent
abfec57972
commit
b6298f8602
@ -21,8 +21,6 @@ object Const {
|
|||||||
const val MAGISK_LOG = "/cache/magisk.log"
|
const val MAGISK_LOG = "/cache/magisk.log"
|
||||||
|
|
||||||
// Versions
|
// Versions
|
||||||
const val SNET_EXT_VER = 17
|
|
||||||
const val SNET_REVISION = "23.0"
|
|
||||||
const val BOOTCTL_REVISION = "22.0"
|
const val BOOTCTL_REVISION = "22.0"
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
@ -59,7 +57,6 @@ object Const {
|
|||||||
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 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"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object Key {
|
object Key {
|
||||||
|
@ -35,13 +35,6 @@ data class ModuleJson(
|
|||||||
val notes_url: String
|
val notes_url: String
|
||||||
)
|
)
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
|
||||||
data class RepoJson(
|
|
||||||
val name: String,
|
|
||||||
val last_update: Long,
|
|
||||||
val modules: List<ModuleJson>
|
|
||||||
)
|
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class CommitInfo(
|
data class CommitInfo(
|
||||||
val sha: String
|
val sha: String
|
||||||
|
@ -2,7 +2,6 @@ package com.topjohnwu.magisk.data.network
|
|||||||
|
|
||||||
import com.topjohnwu.magisk.core.Const
|
import com.topjohnwu.magisk.core.Const
|
||||||
import com.topjohnwu.magisk.core.model.BranchInfo
|
import com.topjohnwu.magisk.core.model.BranchInfo
|
||||||
import com.topjohnwu.magisk.core.model.RepoJson
|
|
||||||
import com.topjohnwu.magisk.core.model.UpdateInfo
|
import com.topjohnwu.magisk.core.model.UpdateInfo
|
||||||
import okhttp3.ResponseBody
|
import okhttp3.ResponseBody
|
||||||
import retrofit2.http.*
|
import retrofit2.http.*
|
||||||
@ -23,10 +22,6 @@ interface GithubPageServices {
|
|||||||
|
|
||||||
interface JSDelivrServices {
|
interface JSDelivrServices {
|
||||||
|
|
||||||
@GET("$MAGISK_FILES@{$REVISION}/snet")
|
|
||||||
@Streaming
|
|
||||||
suspend fun fetchSafetynet(@Path(REVISION) revision: String = Const.SNET_REVISION): ResponseBody
|
|
||||||
|
|
||||||
@GET("$MAGISK_FILES@{$REVISION}/bootctl")
|
@GET("$MAGISK_FILES@{$REVISION}/bootctl")
|
||||||
@Streaming
|
@Streaming
|
||||||
suspend fun fetchBootctl(@Path(REVISION) revision: String = Const.BOOTCTL_REVISION): ResponseBody
|
suspend fun fetchBootctl(@Path(REVISION) revision: String = Const.BOOTCTL_REVISION): ResponseBody
|
||||||
@ -41,9 +36,6 @@ interface RawServices {
|
|||||||
@GET
|
@GET
|
||||||
suspend fun fetchCustomUpdate(@Url url: String): UpdateInfo
|
suspend fun fetchCustomUpdate(@Url url: String): UpdateInfo
|
||||||
|
|
||||||
@GET
|
|
||||||
suspend fun fetchRepoInfo(@Url url: String): RepoJson
|
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Streaming
|
@Streaming
|
||||||
suspend fun fetchFile(@Url url: String): ResponseBody
|
suspend fun fetchFile(@Url url: String): ResponseBody
|
||||||
@ -62,4 +54,3 @@ interface GithubApiServices {
|
|||||||
@Path(BRANCH) branch: String
|
@Path(BRANCH) branch: String
|
||||||
): BranchInfo
|
): BranchInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import com.topjohnwu.magisk.core.Config.Value.CANARY_CHANNEL
|
|||||||
import com.topjohnwu.magisk.core.Config.Value.CUSTOM_CHANNEL
|
import com.topjohnwu.magisk.core.Config.Value.CUSTOM_CHANNEL
|
||||||
import com.topjohnwu.magisk.core.Config.Value.DEFAULT_CHANNEL
|
import com.topjohnwu.magisk.core.Config.Value.DEFAULT_CHANNEL
|
||||||
import com.topjohnwu.magisk.core.Config.Value.STABLE_CHANNEL
|
import com.topjohnwu.magisk.core.Config.Value.STABLE_CHANNEL
|
||||||
import com.topjohnwu.magisk.core.Const
|
|
||||||
import com.topjohnwu.magisk.core.Info
|
import com.topjohnwu.magisk.core.Info
|
||||||
import com.topjohnwu.magisk.data.network.*
|
import com.topjohnwu.magisk.data.network.*
|
||||||
import retrofit2.HttpException
|
import retrofit2.HttpException
|
||||||
@ -59,13 +58,7 @@ class NetworkService(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modules related
|
|
||||||
suspend fun fetchRepoInfo(url: String = Const.Url.OFFICIAL_REPO) = safe {
|
|
||||||
raw.fetchRepoInfo(url)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch files
|
// Fetch files
|
||||||
suspend fun fetchSafetynet() = wrap { jsd.fetchSafetynet() }
|
|
||||||
suspend fun fetchBootctl() = wrap { jsd.fetchBootctl() }
|
suspend fun fetchBootctl() = wrap { jsd.fetchBootctl() }
|
||||||
suspend fun fetchInstaller() = wrap {
|
suspend fun fetchInstaller() = wrap {
|
||||||
val sha = fetchMainVersion()
|
val sha = fetchMainVersion()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user