From a2ceff9192740977faaf7ec81066aad6afe9d1e1 Mon Sep 17 00:00:00 2001 From: codeskyblue Date: Sat, 12 Jan 2019 22:27:35 +0800 Subject: [PATCH] fix reverse close --- adb/tcpusb.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/adb/tcpusb.go b/adb/tcpusb.go index 881cc79..7a169bf 100644 --- a/adb/tcpusb.go +++ b/adb/tcpusb.go @@ -168,18 +168,19 @@ func (sess *Session) onOpen(pkt Packet) { log.Infof("Calling #%s, remoteId: %d, localId: %d", name, remoteId, localId) if strings.HasPrefix(name, "reverse:") { - failMessage := "reverse service not supported" - sess.writePacket(_OKAY, localId, remoteId, nil) - sess.writePacket(_WRTE, localId, remoteId, []byte("FAIL"+fmt.Sprintf( - "%04x%s", len(failMessage), failMessage, - ))) - sess.writePacket(_CLSE, localId, remoteId, nil) - return + name = "xxxx" + name[4:] + // failMessage := "reverse service not supported" + // sess.writePacket(_OKAY, localId, remoteId, nil) + // sess.writePacket(_WRTE, localId, remoteId, []byte("FAIL"+fmt.Sprintf( + // "%04x%s", len(failMessage), failMessage, + // ))) + // sess.writePacket(_CLSE, localId, remoteId, nil) + // return } // Session service - device := NewClient("").Device(AnyUsbDevice()) - conn, err := device.OpenTransport() + // device := NewClient("").Device(AnyUsbDevice()) + conn, err := sess.device.OpenTransport() if err != nil { sess.err = err return