diff --git a/ota/version.txt b/ota/version.txt index 253e5a9..afc5405 100644 --- a/ota/version.txt +++ b/ota/version.txt @@ -1 +1 @@ -0.1.0-dav-android-6|https://git.childish-ghost.com/LukeMackin/Yuzu-GCA/raw/branch/main/ota/h5/index-v6.html|0cf100fc879264e61e20ef595986fafb46d48c6be035215b6df07b2f33c78625 \ No newline at end of file +https://git.childish-ghost.com/LukeMackin/Yuzu-GCA/raw/branch/main/ota/manifest.json diff --git a/packages/client-android/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/packages/client-android/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock index f32ed8a..98c9c0f 100644 Binary files a/packages/client-android/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/packages/client-android/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/packages/client-android/android/app/src/main/assets/index.html b/packages/client-android/android/app/src/main/assets/index.html index c55b26b..0c465ac 100644 Binary files a/packages/client-android/android/app/src/main/assets/index.html and b/packages/client-android/android/app/src/main/assets/index.html differ diff --git a/packages/client-android/android/app/src/main/java/dev/yuzu/gca/MainActivity.kt b/packages/client-android/android/app/src/main/java/dev/yuzu/gca/MainActivity.kt index eb2b2c3..b26d065 100644 --- a/packages/client-android/android/app/src/main/java/dev/yuzu/gca/MainActivity.kt +++ b/packages/client-android/android/app/src/main/java/dev/yuzu/gca/MainActivity.kt @@ -62,21 +62,21 @@ class MainActivity : AppCompatActivity() { return digest.joinToString("") { "%02x".format(it) } } - /** Fetch manifest JSON from Gitea — proxy to avoid CORS in WebView */ + /** Fetch manifest JSON from Gitea and return channel's section */ @android.webkit.JavascriptInterface fun fetchManifest(channel: String): String { - val url = "https://git.childish-ghost.com/LukeMackin/Yuzu-GCA/raw/branch/main/ota/h5-manifest-$channel.json" - Log.i(TAG, "Bridge fetching $url") + val manifestUrl = "https://git.childish-ghost.com/LukeMackin/Yuzu-GCA/raw/branch/main/ota/manifest.json" + Log.i(TAG, "Bridge fetching $manifestUrl → $channel") return try { - val conn = URL(url).openConnection() as HttpURLConnection - conn.connectTimeout = 10_000 - conn.readTimeout = 10_000 + val conn = URL(manifestUrl).openConnection() as HttpURLConnection + conn.connectTimeout = 10_000; conn.readTimeout = 10_000 conn.instanceFollowRedirects = true - val code = conn.responseCode - if (code != 200) throw Exception("HTTP $code") - conn.inputStream.bufferedReader().readText() + if (conn.responseCode != 200) throw Exception("HTTP ${conn.responseCode}") + val raw = conn.inputStream.bufferedReader().readText() + val json = org.json.JSONObject(raw) + json.getJSONObject(channel).toString() } catch (e: Exception) { - Log.e(TAG, "Bridge fetch failed: ${e.message}") + Log.e(TAG, "Bridge fetchManifest($channel) failed: ${e.message}") """{"error":"${e.message}"}""" } }