-
-
-Yuzu GCA
-version v0.1.0-dav-android-5
-
-
-
-
-
diff --git a/packages/client-android/android/app/src/main/assets/index.html b/packages/client-android/android/app/src/main/assets/index.html
deleted file mode 100644
index d265b14..0000000
--- a/packages/client-android/android/app/src/main/assets/index.html
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-Yuzu GCA
-version v0.1.0-dav-android-5
-
-
-
-
diff --git a/packages/client-android/android/app/src/main/assets/skeleton.html b/packages/client-android/android/app/src/main/assets/skeleton.html
deleted file mode 100644
index 0c465ac..0000000
Binary files a/packages/client-android/android/app/src/main/assets/skeleton.html and /dev/null 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 8952259..a067574 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
@@ -1,76 +1,23 @@
package dev.yuzu.gca
import android.os.Bundle
-import android.util.Log
import android.webkit.WebView
import androidx.appcompat.app.AppCompatActivity
-import java.io.File
-import java.net.HttpURLConnection
-import java.net.URL
+/**
+ * Minimal MainActivity 鈥?loads React Native dev server.
+ * Run `npx expo start ` and APK connects to it.
+ * No OTA, no Bridge, no complexity.
+ */
class MainActivity : AppCompatActivity() {
-
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
-
- val cacheFile = File(filesDir, "gca_hot.html")
- val wv = WebView(this).apply {
+ WebView(this).apply {
settings.javaScriptEnabled = true
settings.domStorageEnabled = true
- settings.allowFileAccess = true
- addJavascriptInterface(Bridge(this@MainActivity), "Android")
-
- if (cacheFile.exists()) {
- val html = cacheFile.readText()
- loadDataWithBaseURL("file:///android_asset/", html, "text/html", "UTF-8", null)
- Log.i(TAG, "Loaded cached HTML (${cacheFile.length()}B)")
- } else {
- val html = assets.open("frame.html").bufferedReader().readText()
- loadDataWithBaseURL("file:///android_asset/", html, "text/html", "utf-8", null)
- Log.i(TAG, "Loaded frame.html (${html.length}B)")
- }
- }
- setContentView(wv)
+ // Load Expo dev server on local network
+ // Change to your PC's LAN IP (e.g. 192.168.x.x)
+ loadUrl("http://10.0.2.2:8081")
+ }.also { setContentView(it) }
}
-
- inner class Bridge(private val ctx: MainActivity) {
- @android.webkit.JavascriptInterface
- fun saveCache(html: String) {
- if (html.length > 500_000) { Log.w(TAG, "Cache too large"); return }
- File(ctx.filesDir, "gca_hot.html").writeText(html)
- Log.i(TAG, "Saved ${html.length}B")
- }
-
- @android.webkit.JavascriptInterface
- fun clearCache() { File(ctx.filesDir, "gca_hot.html").delete() }
-
- @android.webkit.JavascriptInterface
- fun sha256(input: String): String {
- val md = java.security.MessageDigest.getInstance("SHA-256")
- return md.digest(input.toByteArray(Charsets.UTF_8)).joinToString("") { "%02x".format(it) }
- }
-
- @android.webkit.JavascriptInterface
- fun fetchManifest(channel: String): String {
- val url = "https://git.childish-ghost.com/LukeMackin/Yuzu-GCA/raw/branch/main/ota/manifest.json"
- return try {
- val conn = URL(url).openConnection() as HttpURLConnection
- conn.connectTimeout = 10000; conn.readTimeout = 10000
- val raw = conn.inputStream.bufferedReader().readText()
- org.json.JSONObject(raw).getJSONObject(channel).toString()
- } catch (e: Exception) { """{"error":"${e.message}"}""" }
- }
-
- @android.webkit.JavascriptInterface
- fun fetchText(path: String): String {
- val safe = path.replace("..", "").replace("..", "").replace("\\", "/")
- val url = "https://git.childish-ghost.com/LukeMackin/Yuzu-GCA/raw/branch/main/ota/$safe"
- return try {
- URL(url).openConnection().apply { connectTimeout = 10000; readTimeout = 10000 }
- .getInputStream().bufferedReader().readText()
- } catch (e: Exception) { "ERROR: ${e.message}" }
- }
- }
-
- companion object { private const val TAG = "GCA" }
}
diff --git a/packages/client-android/index.js b/packages/client-android/index.js
index 9f552f6..5fd059f 100644
--- a/packages/client-android/index.js
+++ b/packages/client-android/index.js
@@ -1,43 +1,4 @@
-var React = require("react");
-var View = require("react-native").View;
-var Text = require("react-native").Text;
-var AppRegistry = require("react-native").AppRegistry;
-var Updates = require("expo-updates");
+import { registerRootComponent } from 'expo';
+import App from './App';
-function App() {
- var [msg, setMsg] = React.useState("checking...");
-
- React.useEffect(function() {
- async function check() {
- try {
- var rv = Updates.runtimeVersion || "empty";
- var ch = Updates.channel || "default";
- var id = Updates.updateId || "none";
- var emb = Updates.isEmbeddedLaunch ? "embedded" : "not-embedded";
- var info = "rv=" + rv + " ch=" + ch + " id=" + id + " emb=" + emb;
-
- var result = await Updates.checkForUpdateAsync();
- if (result.isAvailable) {
- info += "\nUPDATE AVAILABLE! downloading...";
- await Updates.fetchUpdateAsync();
- info += "\ndownloaded. Restart app.";
- await Updates.reloadAsync();
- } else {
- info += "\nno update available";
- }
- setMsg(info);
- } catch(e) {
- setMsg("Error: " + e.message);
- }
- }
- check();
- }, []);
-
- return React.createElement(View, {style: {flex:1,backgroundColor:"#0f172a",alignItems:"center",justifyContent:"center"}},
- React.createElement(Text, {style: {fontSize:28,fontWeight:"800",color:"#e2e8f0"}}, "Yuzu GCA"),
- React.createElement(Text, {style: {fontSize:14,color:"#64748b",marginTop:8}}, "v0.1.0-dav-android-10"),
- React.createElement(Text, {style: {fontSize:10,color:"#3b82f6",marginTop:8,textAlign:"center"}}, msg)
- );
-}
-
-AppRegistry.registerComponent("main", function() { return App; });
+registerRootComponent(App);
diff --git a/packages/client-android/package.json b/packages/client-android/package.json
index b47ce0f..116fe1e 100644
--- a/packages/client-android/package.json
+++ b/packages/client-android/package.json
@@ -1,27 +1,27 @@
-{
- "name": "@yuzu-gca/client-android",
- "version": "0.1.0",
- "private": true,
- "main": "expo-router/entry",
- "scripts": {
- "start": "expo start",
- "android": "expo start --android",
- "build": "eas build -p android --profile preview",
- "export": "expo export --platform android",
- "prebuild": "expo prebuild --platform android"
- },
- "dependencies": {
- "@yuzu-gca/shared": "workspace:*",
- "expo": "~52.0.0",
- "expo-constants": "~17.0.0",
- "expo-file-system": "~18.0.0",
- "expo-status-bar": "~2.0.0",
- "expo-updates": "~26.0.0",
- "react": "18.3.1",
- "react-native": "0.76.5"
- },
- "devDependencies": {
- "@types/react": "~18.3.0",
- "typescript": "^5.5.0"
- }
+{
+ "name": "@yuzu-gca/client-android",
+ "version": "0.1.0",
+ "private": true,
+ "main": "index.js",
+ "scripts": {
+ "start": "expo start",
+ "android": "expo start --android",
+ "build": "eas build -p android --profile preview",
+ "export": "expo export --platform android",
+ "prebuild": "expo prebuild --platform android"
+ },
+ "dependencies": {
+ "@yuzu-gca/shared": "workspace:*",
+ "expo": "~52.0.0",
+ "expo-constants": "~17.0.0",
+ "expo-file-system": "~18.0.0",
+ "expo-status-bar": "~2.0.0",
+ "expo-updates": "~26.0.0",
+ "react": "18.3.1",
+ "react-native": "0.76.5"
+ },
+ "devDependencies": {
+ "@types/react": "~18.3.0",
+ "typescript": "^5.5.0"
+ }
}