cleanup: 删除 feat/expo-ota 分支,回滚到 main
- 删除远程 feat/expo-ota 分支 - 删除 Gitea Releases #5~#10 + Tags v5~v10 - 清除 Expo 产物(npmrc, package-lock, expo-manifest) - 保留 index.js + index.html(H5热更新) - MainActivity 改为 WebView + Android Bridge 模式 - 构建验证通过(33 tasks, 54s)
This commit is contained in:
43
packages/client-android/index.js
Normal file
43
packages/client-android/index.js
Normal file
@@ -0,0 +1,43 @@
|
||||
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");
|
||||
|
||||
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; });
|
||||
Reference in New Issue
Block a user