feat: add brew app connection

- initialize tcp communication with brew app
- WIP value editor sync

Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
pakintada@gmail.com 2026-04-03 17:25:27 +07:00
parent 08f7626dcb
commit 274025ed33
14 changed files with 431 additions and 69 deletions

View file

@ -12,11 +12,15 @@
import { handleIncomingMessages } from '$lib/core/handlers/messageHandler';
import { auth as authStore } from '$lib/core/stores/auth';
import { get } from 'svelte/store';
import { AdbDaemonWebUsbDeviceManager } from '@yume-chan/adb-daemon-webusb';
import {
AdbDaemonWebUsbDevice,
AdbDaemonWebUsbDeviceManager
} from '@yume-chan/adb-daemon-webusb';
import AdbWebCredentialStore from '@yume-chan/adb-credential-web';
import { onMount } from 'svelte';
import { deviceCredentialManager } from '$lib/core/adb/deviceCredManager';
import { file } from 'zod/mini';
import { addNotification } from '$lib/core/stores/noti';
let { enableComponent = true } = $props();
@ -161,6 +165,9 @@
} else {
console.log('push pull not ok', result);
}
// clean file
await adb.executeCmd('rm /sdcard/coffeevending/test.json');
}
} catch (error) {
console.log('test push file failed', error);
@ -205,6 +212,9 @@
}
async function disconnectAdb() {
// clean up no password flag
// return to engine
await adb.disconnect();
connectionButtonText = 'Connect';
connectionButtonVariant = 'default';
@ -313,6 +323,12 @@
} catch (ignored) {}
}
if (e instanceof AdbDaemonWebUsbDevice.DeviceBusyError) {
addNotification(
'ERR:Device is already in use by another program, please close the program and try again'
);
}
return false;
}
} catch (e: any) {