Files
Yuzu-GCA/packages/client-android/android/app/src/main/assets/skeleton.html
LukeMackin e9bcb7d804 fix: MainActivity精简+frame.html骨架页[V5]标记
- 移除cacheFile逻辑,始终加载frame.html
- loadDataWithBaseURL避免WebView缓存
- frame.html添加[V5]标记区分版本
- Bridge保留(manifest/fetchText/sha256)
2026-07-22 00:43:06 +08:00

47 lines
4.6 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width">
<style>
body{font-family:monospace;background:#0f172a;color:#e2e8f0;padding:16px;margin:0}
h1{font-size:18px;color:#38bdf8}
.btn{display:block;width:100%;padding:14px;margin:8px 0;border:none;border-radius:8px;font-size:16px;cursor:pointer}
.btn-check{background:#1e40af;color:#fff}
.btn-download{background:#15803d;color:#fff}
.log{background:#1e293b;padding:12px;border-radius:8px;margin-top:12px;max-height:300px;overflow-y:auto;font-size:12px;white-space:pre-wrap}
.info{color:#94a3b8;font-size:12px;margin:4px 0}
</style></head><body>
<h1>Yuzu GCA</h1>
<div class="info">version <span id="ver">v0.1.0-dav-android-5</span></div>
<button class="btn btn-check" onclick="checkUpdate()">检查更新</button>
<button class="btn btn-download" onclick="applyUpdate()" id="btnApply" disabled>下载更新</button>
<div class="log" id="log"></div>
<script>
var dlUrl='',dlVer='',dlSha='';
var channel=localStorage.getItem('gca_channel')||'stable';
function log(m){document.getElementById('log').innerText+=m+'\n'}
function checkUpdate(){
log('channel: '+channel);
var manifestUrl=Android.fetchText('version.txt').trim();
if(!manifestUrl.startsWith('http')){log('ERR: invalid version.txt');return}
var j=JSON.parse(Android.fetchManifest(channel));
if(j.error){log('ERR: '+j.error);return}
var h5=j.h5;log('latest: '+h5.latest+' min: '+h5.min_version);
var v=(h5.min_version||'').replace(/[^0-9]/g,''),my=(document.getElementById('ver').innerText||'').replace(/[^0-9]/g,'');
if(parseInt(my||'0')<parseInt(v||'0')){log('ERR: APK too old (need v'+h5.min_version+')');return}
dlUrl=h5.url;dlSha=h5.sha256||'';
if(!dlSha||/^0{64}$/.test(dlSha)){log('ERR: channel no build');return}
if(h5.latest!==document.getElementById('ver').innerText&&h5.latest!=='v'+document.getElementById('ver').innerText){
dlVer=h5.latest;document.getElementById('btnApply').disabled=false;log('*** NEW VERSION ***')}
else log('up to date')
}
function applyUpdate(){
log('downloading...');
var p=dlUrl.split('/h5/');var rel=p.length>1?'h5/'+p[1]:dlUrl;
var t=Android.fetchText(rel);
if(typeof t!=='string'||t.startsWith('ERROR:')){log('ERR: '+t);return}
var h=Android.sha256(t);
if(h!==dlSha){log('SHA256 MISMATCH!');return}
Android.saveCache(t);log('OK! restart app to apply')
}
</script></body></html>