Skip to content

Commit 852f0ca

Browse files
committed
Switch APM module index to GitHub: 947AAA/FolkPatch-APM-download
- Replace folk.mysqil.com API with public GitHub raw JSON - Remove token auth, no auth needed for public repo - Format compatible: name/version/url/description[_en]
1 parent 6ce11cc commit 852f0ca

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

app/src/main/java/me/bmax/apatch/ui/viewmodel/OnlineModuleViewModel.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import androidx.lifecycle.ViewModel
88
import androidx.lifecycle.viewModelScope
99
import kotlinx.coroutines.Dispatchers
1010
import kotlinx.coroutines.launch
11-
import me.bmax.apatch.apApp
1211
import me.bmax.apatch.util.FolkApiClient
1312
import org.json.JSONArray
1413
import android.net.Uri
@@ -17,8 +16,8 @@ import java.util.Locale
1716
class OnlineModuleViewModel : ViewModel() {
1817
companion object {
1918
private const val TAG = "OnlineModuleViewModel"
20-
// Placeholder URL. User should update this.
21-
const val MODULES_URL = "https://folk.mysqil.com/api/modules?type=apm"
19+
const val MODULES_URL =
20+
"https://raw.githubusercontent.com/947AAA/FolkPatch-APM-download/main/modules.json"
2221
}
2322

2423
data class OnlineModule(
@@ -68,10 +67,8 @@ class OnlineModuleViewModel : ViewModel() {
6867
val locale = Locale.getDefault()
6968
val language = locale.language
7069
val lang = if (language == "zh" || language == "mgl") "zh" else "en"
71-
val token = me.bmax.apatch.Natives.getApiToken(apApp)
72-
val url = "$MODULES_URL&lang=$lang&token=$token"
7370

74-
val result = FolkApiClient.fetchJson(url)
71+
val result = FolkApiClient.fetchJson(MODULES_URL)
7572
val jsonString = result.getOrNull()
7673
if (jsonString != null) {
7774
val jsonArray = JSONArray(jsonString)

0 commit comments

Comments
 (0)