Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 927d5068 authored by Simon Chan's avatar Simon Chan
Browse files

feat(adb): expose `onPublicKeyAuthentication` on `AdbDaemonTransport.authenticate`

parent 6575d794
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -160,7 +160,10 @@ export class AdbDaemonTransport implements AdbTransport {
    }: AdbDaemonAuthenticationOptions &
        (
            | { authenticator: AdbAuthenticator }
            | { credentialStore: AdbCredentialStore }
            | {
                  credentialStore: AdbCredentialStore;
                  onPublicKeyAuthentication?: (() => void) | undefined;
              }
        )): Promise<AdbDaemonTransport> {
        // Initially, set to highest-supported version and payload size.
        let version = 0x01000001;
@@ -175,6 +178,11 @@ export class AdbDaemonTransport implements AdbTransport {
            authenticator = new AdbDefaultAuthenticator(
                options.credentialStore,
            );
            if (options.onPublicKeyAuthentication) {
                (
                    authenticator as AdbDefaultAuthenticator
                ).onPublicKeyAuthentication(options.onPublicKeyAuthentication);
            }
        }

        // Here is similar to `AdbPacketDispatcher`,