Loading libraries/adb/src/commands/sync/response.ts +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import { decodeUtf8, string, struct, u32 } from "@yume-chan/struct"; import { unreachable } from "../../utils/no-op.js"; function encodeAsciiUnchecked(value: string): Uint8Array { function encodeAsciiUnchecked(value: string): Uint8Array<ArrayBuffer> { const result = new Uint8Array(value.length); for (let i = 0; i < value.length; i += 1) { result[i] = value.charCodeAt(i); Loading libraries/adb/src/daemon/crypto.ts +7 −2 Original line number Diff line number Diff line Loading @@ -140,7 +140,9 @@ export function adbGetPublicKeySize() { return 4 + 4 + ModulusLengthInBytes + ModulusLengthInBytes + 4; } export function adbGeneratePublicKey(privateKey: Uint8Array): Uint8Array; export function adbGeneratePublicKey( privateKey: Uint8Array, ): Uint8Array<ArrayBuffer>; export function adbGeneratePublicKey( privateKey: Uint8Array, output: Uint8Array, Loading Loading @@ -287,7 +289,10 @@ export const SHA1_DIGEST_INFO = new Uint8Array([ // encrypt the given data with its private key) // However SubtileCrypto.encrypt() doesn't accept 'RSASSA-PKCS1-v1_5' algorithm // So we need to implement the encryption by ourself export function rsaSign(privateKey: Uint8Array, data: Uint8Array): Uint8Array { export function rsaSign( privateKey: Uint8Array, data: Uint8Array, ): Uint8Array<ArrayBuffer> { const [n, d] = rsaParsePrivateKey(privateKey); // PKCS#1 padding Loading libraries/adb/src/utils/base64.ts +2 −2 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ export function calculateBase64EncodedLength( * @param input The input buffer * @returns The encoded output buffer */ export function encodeBase64(input: Uint8Array): Uint8Array; export function encodeBase64(input: Uint8Array): Uint8Array<ArrayBuffer>; /** * Encode the given input into base64 and write it to the output buffer. * Loading Loading @@ -295,7 +295,7 @@ function encodeBackward( } } export function decodeBase64(input: string): Uint8Array { export function decodeBase64(input: string): Uint8Array<ArrayBuffer> { let padding: number; if (input[input.length - 2] === "=") { padding = 2; Loading libraries/aoa/src/mouse.ts +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ export class HidMouse { buttons?: number; scrollX?: number; scrollY?: number; }): Uint8Array { }): Uint8Array<ArrayBuffer> { return new Uint8Array([ report.buttons ?? 0, report.movementX ?? 0, Loading libraries/aoa/src/touchscreen.ts +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ export class HidTouchScreen { this.#fingers.delete(id); } serializeInputReport(): Uint8Array { serializeInputReport(): Uint8Array<ArrayBuffer> { const report = new Uint8Array(1 + 6 * 10); report[0] = this.#fingers.size; let offset = 1; Loading Loading
libraries/adb/src/commands/sync/response.ts +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import { decodeUtf8, string, struct, u32 } from "@yume-chan/struct"; import { unreachable } from "../../utils/no-op.js"; function encodeAsciiUnchecked(value: string): Uint8Array { function encodeAsciiUnchecked(value: string): Uint8Array<ArrayBuffer> { const result = new Uint8Array(value.length); for (let i = 0; i < value.length; i += 1) { result[i] = value.charCodeAt(i); Loading
libraries/adb/src/daemon/crypto.ts +7 −2 Original line number Diff line number Diff line Loading @@ -140,7 +140,9 @@ export function adbGetPublicKeySize() { return 4 + 4 + ModulusLengthInBytes + ModulusLengthInBytes + 4; } export function adbGeneratePublicKey(privateKey: Uint8Array): Uint8Array; export function adbGeneratePublicKey( privateKey: Uint8Array, ): Uint8Array<ArrayBuffer>; export function adbGeneratePublicKey( privateKey: Uint8Array, output: Uint8Array, Loading Loading @@ -287,7 +289,10 @@ export const SHA1_DIGEST_INFO = new Uint8Array([ // encrypt the given data with its private key) // However SubtileCrypto.encrypt() doesn't accept 'RSASSA-PKCS1-v1_5' algorithm // So we need to implement the encryption by ourself export function rsaSign(privateKey: Uint8Array, data: Uint8Array): Uint8Array { export function rsaSign( privateKey: Uint8Array, data: Uint8Array, ): Uint8Array<ArrayBuffer> { const [n, d] = rsaParsePrivateKey(privateKey); // PKCS#1 padding Loading
libraries/adb/src/utils/base64.ts +2 −2 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ export function calculateBase64EncodedLength( * @param input The input buffer * @returns The encoded output buffer */ export function encodeBase64(input: Uint8Array): Uint8Array; export function encodeBase64(input: Uint8Array): Uint8Array<ArrayBuffer>; /** * Encode the given input into base64 and write it to the output buffer. * Loading Loading @@ -295,7 +295,7 @@ function encodeBackward( } } export function decodeBase64(input: string): Uint8Array { export function decodeBase64(input: string): Uint8Array<ArrayBuffer> { let padding: number; if (input[input.length - 2] === "=") { padding = 2; Loading
libraries/aoa/src/mouse.ts +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ export class HidMouse { buttons?: number; scrollX?: number; scrollY?: number; }): Uint8Array { }): Uint8Array<ArrayBuffer> { return new Uint8Array([ report.buttons ?? 0, report.movementX ?? 0, Loading
libraries/aoa/src/touchscreen.ts +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ export class HidTouchScreen { this.#fingers.delete(id); } serializeInputReport(): Uint8Array { serializeInputReport(): Uint8Array<ArrayBuffer> { const report = new Uint8Array(1 + 6 * 10); report[0] = this.#fingers.size; let offset = 1; Loading