fix(adb): trim null character from reverse tunnel address

fix #642, fix #628
This commit is contained in:
Simon Chan 2024-06-17 20:56:52 +08:00
parent 5620716a4f
commit 68ef8d62d0
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD

View file

@ -286,7 +286,11 @@ export class AdbPacketDispatcher implements Closeable {
const remoteId = packet.arg0; const remoteId = packet.arg0;
let availableWriteBytes = packet.arg1; let availableWriteBytes = packet.arg1;
const service = decodeUtf8(packet.payload); let service = decodeUtf8(packet.payload);
// ADB Daemon still adds a null character to the service string
if (service.endsWith("\0")) {
service = service.substring(0, service.length - 1);
}
// Check remote delayed ack enablement is consistent with local // Check remote delayed ack enablement is consistent with local
if (this.options.initialDelayedAckBytes === 0) { if (this.options.initialDelayedAckBytes === 0) {