feat: add Bluetooth Android companion

This commit is contained in:
2026-07-31 23:32:57 +02:00
parent e53b7400bd
commit 2d715abb12
35 changed files with 1739 additions and 4 deletions
+23
View File
@@ -114,6 +114,14 @@ export type AdbShortcut = AdbTarget & {
createdAt: string;
};
export type MobileDevice = {
id: string;
name: string;
createdAt: string;
lastSeenAt: string;
revokedAt: string | null;
};
export type CarTelemetry = {
available: true;
collectedAt: string;
@@ -247,6 +255,21 @@ export async function getAdbShortcuts(): Promise<AdbShortcut[]> {
return response.shortcuts;
}
export async function getMobileDevices(): Promise<MobileDevice[]> {
const response = await parseResponse<{ devices: MobileDevice[] }>(
await fetch("/api/mobile/devices", { credentials: "same-origin" })
);
return response.devices;
}
export async function revokeMobileDevice(id: string, csrfToken: string): Promise<void> {
await parseResponse(await fetch(`/api/mobile/devices/${encodeURIComponent(id)}`, {
method: "DELETE",
credentials: "same-origin",
headers: { "X-CSRF-Token": csrfToken }
}));
}
export async function uploadApk(file: File, csrfToken: string): Promise<void> {
await parseResponse(
await fetch("/api/adb/install", {