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

Commit ab61da36 authored by Daniel Jacob Chittoor's avatar Daniel Jacob Chittoor Committed by Jackeagle
Browse files

Fix duplicate condition, add missing protocolCode check

getInOutEndpoints() checks interfaceSubclass twice instead of checking
all three USB interface attributes. The WebUsbDeviceFilter defines
classCode, subclassCode, and protocolCode, but protocolCode was never
validated.

Replace the duplicate interfaceSubclass check with interfaceProtocol
to properly filter USB interfaces matching the ADB protocol
(class=0xff, subclass=0x42, protocol=1).
parent 9d66a3cd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -100,9 +100,9 @@ export class Recovery extends Device {
      for (const interface_ of configuration.interfaces) {
        for (const alternate of interface_.alternates) {
          if (
            alternate.interfaceSubclass === WebUsbDeviceFilter.subclassCode &&
            alternate.interfaceClass === WebUsbDeviceFilter.classCode &&
            alternate.interfaceSubclass === WebUsbDeviceFilter.subclassCode
            alternate.interfaceSubclass === WebUsbDeviceFilter.subclassCode &&
            alternate.interfaceProtocol === WebUsbDeviceFilter.protocolCode
          ) {
            if (
              ((_a = this.adbDaemonWebUsbDevice.configuration) === null ||