change: security-check, memory-check [untest]

- fix high risk security issues
- fix high memory usage
- change adb to connection pool single instance

Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
pakintada@gmail.com 2026-06-22 10:55:47 +07:00
parent f0619c5a10
commit 4f464a8513
23 changed files with 413 additions and 73 deletions

View file

@ -18,7 +18,8 @@
AdbDaemonWebUsbDeviceManager
} from '@yume-chan/adb-daemon-webusb';
import AdbWebCredentialStore from '@yume-chan/adb-credential-web';
import { onMount } from 'svelte';
import { onMount, onDestroy } from 'svelte';
import { adbConnectionStatus } from '$lib/core/stores/adbConnectionStore';
import { deviceCredentialManager } from '$lib/core/adb/deviceCredManager';
import { file } from 'zod/mini';
import { addNotification } from '$lib/core/stores/noti';
@ -346,8 +347,10 @@
return false;
}
// update every 1s
setInterval(async function () {
// Poll device connection status every 1s so the UI button reflects the
// current state. The interval is saved and cleaned up on destroy to
// prevent leaks when this component is mounted/unmounted.
const _connPollInterval = setInterval(async function () {
checkDeviceConnection();
}, 1000);
@ -355,6 +358,10 @@
await checkStoredCredentials();
if (!connectDeviceOk && !adb.getAdbInstance()) await tryAutoConnect();
});
onDestroy(() => {
clearInterval(_connPollInterval);
});
</script>
<div class="p-4">