Support modules update

This commit is contained in:
vvb2060
2022-01-17 15:08:54 +08:00
committed by John Wu
parent 2997258fd0
commit bc0c1980db
15 changed files with 120 additions and 664 deletions
@@ -1,6 +1,7 @@
package com.topjohnwu.magisk.data.network
import com.topjohnwu.magisk.core.model.BranchInfo
import com.topjohnwu.magisk.core.model.ModuleJson
import com.topjohnwu.magisk.core.model.UpdateInfo
import okhttp3.ResponseBody
import retrofit2.http.*
@@ -37,6 +38,9 @@ interface RawServices {
@GET
suspend fun fetchString(@Url url: String): String
@GET
suspend fun fetchModuleJson(@Url url: String): ModuleJson
}
interface GithubApiServices {
@@ -65,6 +65,7 @@ class NetworkService(
}
suspend fun fetchFile(url: String) = wrap { raw.fetchFile(url) }
suspend fun fetchString(url: String) = wrap { raw.fetchString(url) }
suspend fun fetchModuleJson(url: String) = wrap { raw.fetchModuleJson(url) }
private suspend fun fetchMainVersion() = api.fetchBranch(MAGISK_MAIN, "master").commit.sha
}