From 9406c37d29c9c1d17f33c10ec31f39a3251107d7 Mon Sep 17 00:00:00 2001 From: Ralph-Gordon Paul Date: Tue, 26 Mar 2024 11:30:30 +0100 Subject: [PATCH 1/3] Squashed commit of the following: commit d79071aaebd23995a7219308a47393d1d86363c3 Author: jan Date: Tue Mar 26 11:10:10 2024 +0100 dont use local paths. Only override android package commit 7cbd7e7e189c2cab603a7f00e2103f679ab7b9ee Author: jan Date: Tue Mar 26 10:47:10 2024 +0100 Use native service address --- .../flutter/nsd_android/Serialization.kt | 2 ++ .../lib/src/method_channel_nsd_platform.dart | 2 +- .../lib/src/serialization.dart | 19 +++++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/nsd_android/android/src/main/kotlin/com/haberey/flutter/nsd_android/Serialization.kt b/nsd_android/android/src/main/kotlin/com/haberey/flutter/nsd_android/Serialization.kt index 1e3edb8..21d5524 100644 --- a/nsd_android/android/src/main/kotlin/com/haberey/flutter/nsd_android/Serialization.kt +++ b/nsd_android/android/src/main/kotlin/com/haberey/flutter/nsd_android/Serialization.kt @@ -12,6 +12,7 @@ private enum class Key(val serializeKey: String) { SERVICE_TYPE("service.type"), SERVICE_HOST("service.host"), SERVICE_PORT("service.port"), + SERVICE_ADDRESSES("service.addresses"), SERVICE_TXT("service.txt"), ERROR_CAUSE("error.cause"), ERROR_MESSAGE("error.message"), @@ -110,6 +111,7 @@ internal fun serializeServiceInfo(nsdServiceInfo: NsdServiceInfo): Map.from(data['service.txt']) - : null; - - if (name == null && - type == null && - host == null && - port == null && + final addresses = data['service.addresses'] as String?; + final txt = data['service.txt'] != null ? Map.from(data['service.txt']) : null; + + if (name == null && + type == null && + host == null && + port == null && + addresses == null && txt == null) { return null; } - return Service(name: name, type: type, host: host, port: port, txt: txt); + final inetAddresses = addresses != null ? [InternetAddress(addresses)] : null; + + return Service(name: name, type: type, host: host, port: port, addresses: inetAddresses, txt: txt); } Map serializeHandle(String value) => { From 85fd7cfbca8f74433f4401dc0283cd56aebc00d7 Mon Sep 17 00:00:00 2001 From: Jan <99361651+jan-mu@users.noreply.github.com> Date: Fri, 5 Apr 2024 08:40:17 +0200 Subject: [PATCH 2/3] Update serialization.dart --- nsd_platform_interface/lib/src/serialization.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/nsd_platform_interface/lib/src/serialization.dart b/nsd_platform_interface/lib/src/serialization.dart index b88b8bd..1c38571 100644 --- a/nsd_platform_interface/lib/src/serialization.dart +++ b/nsd_platform_interface/lib/src/serialization.dart @@ -51,7 +51,6 @@ Service? deserializeService(dynamic arguments) { final type = data['service.type'] as String?; final host = data['service.host'] as String?; final port = data['service.port'] as int?; - final txt = data['service.txt'] != null final addresses = data['service.addresses'] as String?; final txt = data['service.txt'] != null ? Map.from(data['service.txt']) : null; From a2bf7e72b9cd3d35d7425bdfe0709560f60ab96d Mon Sep 17 00:00:00 2001 From: Jan <99361651+jan-mu@users.noreply.github.com> Date: Fri, 5 Apr 2024 08:41:04 +0200 Subject: [PATCH 3/3] Update serialization.dart --- nsd_platform_interface/lib/src/serialization.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/nsd_platform_interface/lib/src/serialization.dart b/nsd_platform_interface/lib/src/serialization.dart index 1c38571..7ffc6eb 100644 --- a/nsd_platform_interface/lib/src/serialization.dart +++ b/nsd_platform_interface/lib/src/serialization.dart @@ -1,3 +1,4 @@ +import 'dart:io'; import 'dart:typed_data'; import 'nsd_platform_interface.dart';