fix(gui): remove tun stack selection, default to ostp; fix(flutter): add missing ic_launcher_background.xml for icon build

This commit is contained in:
ospab 2026-06-02 23:27:04 +03:00
parent 6c2417232a
commit 61aa883cbc
3 changed files with 7 additions and 18 deletions

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#fff</color>
</resources>

View File

@ -257,13 +257,6 @@
</label> </label>
</div> </div>
<div class="field-group" id="group-tun-stack">
<label class="field-label" for="in-tun-stack" data-i18n="label_tun_stack">TUN Stack</label>
<select id="in-tun-stack" class="field-input">
<option value="system">System (tun2socks)</option>
<option value="ostp">OSTP (Native)</option>
</select>
</div>
<div class="toggle-row"> <div class="toggle-row">
<div class="toggle-text"> <div class="toggle-text">

View File

@ -51,8 +51,6 @@ const inPbk = $('in-pbk');
const inSid = $('in-sid'); const inSid = $('in-sid');
const inMtu = $('in-mtu'); const inMtu = $('in-mtu');
const inTun = $('in-tun-mode'); const inTun = $('in-tun-mode');
const inTunStack = $('in-tun-stack');
const groupTunStack = $('group-tun-stack');
const inMux = $('in-mux-mode'); const inMux = $('in-mux-mode');
const inMuxSessions = $('in-mux-sessions'); const inMuxSessions = $('in-mux-sessions');
const inDebug = $('in-debug'); const inDebug = $('in-debug');
@ -245,13 +243,10 @@ async function loadConfigIntoForm() {
inPbk.value = c.reality?.pbk || ''; inPbk.value = c.reality?.pbk || '';
inSid.value = c.reality?.sid || ''; inSid.value = c.reality?.sid || '';
inMtu.value = c.mtu || ''; inMtu.value = c.mtu || '';
inTun.checked = !!c.tun?.enable; inTun.checked = !!c.tun?.enabled;
inTunStack.value = c.tun?.stack || 'system';
inMux.checked = !!c.mux?.enabled; inMux.checked = !!c.mux?.enabled;
inMuxSessions.value = c.mux?.sessions || ''; inMuxSessions.value = c.mux?.sessions || '';
groupTunStack.style.display = inTun.checked ? 'block' : 'none';
// owndns: detect if saved dns is 10.1.0.1 // owndns: detect if saved dns is 10.1.0.1
const savedDns = c.tun?.dns || ''; const savedDns = c.tun?.dns || '';
const isOwndns = savedDns === '10.1.0.1'; const isOwndns = savedDns === '10.1.0.1';
@ -322,13 +317,11 @@ async function handleSave(silent = false) {
delete rawConfig.mux; delete rawConfig.mux;
} }
if (!rawConfig.tun) { rawConfig.tun = rawConfig.tun || {};
rawConfig.tun = { wintun_path: './wintun.dll', ipv4_address: '10.1.0.2/24' };
}
rawConfig.tun.enable = inTun.checked; rawConfig.tun.enable = inTun.checked;
rawConfig.tun.stack = 'ostp';
// owndns: if toggle is on, always write 10.1.0.1; otherwise use the custom field // owndns: if toggle is on, always write 10.1.0.1; otherwise use the custom field
rawConfig.tun.dns = inOwndns.checked ? '10.1.0.1' : (inDns.value.trim() || null); rawConfig.tun.dns = inOwndns.checked ? '10.1.0.1' : (inDns.value.trim() || null);
rawConfig.tun.stack = inTunStack.value;
rawConfig.exclude = { rawConfig.exclude = {
domains: splitLines(inDomains.value), domains: splitLines(inDomains.value),
@ -479,7 +472,6 @@ window.addEventListener('DOMContentLoaded', async () => {
updateDnsVisibility(); updateDnsVisibility();
scheduleAutoSave(); scheduleAutoSave();
}); });
inTun.addEventListener('change', () => { groupTunStack.style.display = inTun.checked ? 'block' : 'none'; });
importInput.addEventListener('keydown', e => { if (e.key === 'Enter') handleImport(); }); importInput.addEventListener('keydown', e => { if (e.key === 'Enter') handleImport(); });
// Auto-save wiring // Auto-save wiring