Skip to content

Commit

Permalink
manager: use production template url
Browse files Browse the repository at this point in the history
  • Loading branch information
tiann committed Oct 21, 2023
1 parent fd03626 commit 1df5fec
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ import java.util.Locale
* @author weishu
* @date 2023/10/20.
*/
const val TEMPLATE_INDEX_URL = "https://kernelsu.org/templates/index.json"
const val TEMPLATE_URL = "https://kernelsu.org/templates/%s"

//const val TEMPLATE_INDEX_URL = "https://kernelsu.org/templates/index.json"
//const val TEMPLATE_URL = "https://kernelsu.org/templates/%s"

const val TEMPLATE_INDEX_URL = "http://192.168.31.99/templates/index.json"
const val TEMPLATE_URL = "http://192.168.31.99/templates/%s"
const val TAG = "TemplateViewModel"

class TemplateViewModel : ViewModel() {
Expand Down Expand Up @@ -133,6 +130,7 @@ private fun fetchRemoteTemplates() {
}
}

@Suppress("UNCHECKED_CAST")
private fun <T, R> JSONArray.mapCatching(
transform: (T) -> R, onFail: (Throwable) -> Unit
): List<R> {
Expand Down Expand Up @@ -191,6 +189,7 @@ private fun fromJSON(templateJson: JSONObject): TemplateViewModel.TemplateInfo?
}.getOrNull()
}

@Suppress("unused")
fun generateTemplates() {
val templateJson = JSONObject()
templateJson.put("id", "com.example")
Expand Down

0 comments on commit 1df5fec

Please sign in to comment.