From acb774f6052bc51b106c58746bf1b55e02cf7773 Mon Sep 17 00:00:00 2001 From: guyluz Date: Mon, 27 Mar 2023 22:48:49 +0300 Subject: [PATCH 1/9] Fixing scan does not find mDNS results after last update --- .../host_scan_page/device_in_the_network.dart | 49 ++++- .../host_scna_bloc/host_scan_bloc.dart | 168 +++++++----------- 2 files changed, 110 insertions(+), 107 deletions(-) diff --git a/lib/pages/host_scan_page/device_in_the_network.dart b/lib/pages/host_scan_page/device_in_the_network.dart index 0e9c8399..88e1ed77 100644 --- a/lib/pages/host_scan_page/device_in_the_network.dart +++ b/lib/pages/host_scan_page/device_in_the_network.dart @@ -10,17 +10,22 @@ class DeviceInTheNetwork { /// Create basic device with default (not the correct) icon DeviceInTheNetwork({ required this.internetAddress, - required this.make, + required Future makeVar, required this.pingData, + MdnsInfo? mdnsVar, this.iconData = Icons.devices, this.hostId, - }); + }) { + make = makeVar; + _mdns = mdnsVar; + } /// Create the object from active host with the correct field and icon factory DeviceInTheNetwork.createFromActiveHost({ required ActiveHost activeHost, required String currentDeviceIp, required String gatewayIp, + MdnsInfo? mdns, }) { return DeviceInTheNetwork.createWithAllNecessaryFields( internetAddress: activeHost.internetAddress, @@ -29,6 +34,7 @@ class DeviceInTheNetwork { pingData: activeHost.pingData, currentDeviceIp: currentDeviceIp, gatewayIp: gatewayIp, + mdns: mdns, ); } @@ -40,6 +46,7 @@ class DeviceInTheNetwork { required PingData pingData, required String currentDeviceIp, required String gatewayIp, + required MdnsInfo? mdns, }) { final IconData iconData = getHostIcon( currentDeviceIp: currentDeviceIp, @@ -52,22 +59,53 @@ class DeviceInTheNetwork { hostIp: internetAddress.address, gatewayIp: gatewayIp, hostMake: make, + mdns: mdns, ); return DeviceInTheNetwork( internetAddress: internetAddress, - make: deviceMake, + makeVar: deviceMake, pingData: pingData, hostId: hostId, iconData: iconData, + mdnsVar: mdns, ); } /// Ip of the device final InternetAddress internetAddress; - final Future make; + late Future _make; + + set make(Future makeVar) { + _make = makeVar; + } + + Future get make { + return _make; + } + final PingData pingData; final IconData iconData; + MdnsInfo? _mdns; + + MdnsInfo? get mdns { + return _mdns; + } + + set mdns(MdnsInfo? name) { + _mdns = name; + + final Future deviceMake = getDeviceMake( + currentDeviceIp: '', + hostIp: internetAddress.address, + gatewayIp: '', + hostMake: make, + mdns: _mdns, + ); + make = deviceMake; + } + + /// Some name to show the user String? hostId; static Future getDeviceMake({ @@ -75,11 +113,14 @@ class DeviceInTheNetwork { required String hostIp, required String gatewayIp, required Future hostMake, + required MdnsInfo? mdns, }) { if (currentDeviceIp == hostIp) { return Future.value('This device'); } else if (gatewayIp == hostIp) { return Future.value('Router/Gateway'); + } else if (mdns != null) { + return Future.value(mdns.mdnsDomainName); } return hostMake; } diff --git a/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart index de2ea25f..10bf36e8 100644 --- a/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart @@ -1,10 +1,8 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; -import 'package:flutter/material.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:injectable/injectable.dart'; -import 'package:isolate_contactor/isolate_contactor.dart'; import 'package:network_info_plus/network_info_plus.dart'; import 'package:network_tools/network_tools.dart'; import 'package:vernet/main.dart'; @@ -30,7 +28,10 @@ class HostScanBloc extends Bloc { String? subnet; /// List of all ActiveHost devices that got found in the current scan - List activeHostList = []; + List deviceInTheNetworkList = []; + + /// mDNS for each ip + Map mDnsDevices = {}; Future _initialized( Initialized event, @@ -44,83 +45,76 @@ class HostScanBloc extends Bloc { add(const HostScanEvent.startNewScan()); } - @Deprecated("Now network_tools support running scan inside isolate") - // ignore: unused_element - Future _startNewScan( + Future _startNewScanBuiltInIsolate( StartNewScan event, Emitter emit, ) async { - const int scanRangeForIsolate = 51; - for (int i = appSettings.firstSubnet; - i <= appSettings.lastSubnet; - i += scanRangeForIsolate + 1) { - final IsolateContactor isolateContactor = - await IsolateContactor.createOwnIsolate(startSearchingDevices); - int limit = i + scanRangeForIsolate; - if (limit >= appSettings.lastSubnet) { - limit = appSettings.lastSubnet; - } - isolateContactor.sendMessage([ - subnet!, - i.toString(), - limit.toString(), - ]); - await for (final dynamic message in isolateContactor.onMessage) { - try { - if (message is ActiveHost) { - final DeviceInTheNetwork tempDeviceInTheNetwork = - DeviceInTheNetwork.createFromActiveHost( - activeHost: message, + MdnsScanner.searchMdnsDevices() + .then((List activeHostList) async { + for (final ActiveHost activeHost in activeHostList) { + final int index = indexOfActiveHost(activeHost.address); + final MdnsInfo? mDns = await activeHost.mdnsInfo; + if (mDns == null) { + continue; + } + + if (index == -1) { + deviceInTheNetworkList.add( + DeviceInTheNetwork.createFromActiveHost( + activeHost: activeHost, currentDeviceIp: ip!, gatewayIp: gatewayIp!, - ); - - activeHostList.add(tempDeviceInTheNetwork); - activeHostList.sort((a, b) { - final int aIp = int.parse( - a.internetAddress.address - .substring(a.internetAddress.address.lastIndexOf('.') + 1), - ); - final int bIp = int.parse( - b.internetAddress.address - .substring(b.internetAddress.address.lastIndexOf('.') + 1), - ); - return aIp.compareTo(bIp); - }); - emit(const HostScanState.loadInProgress()); - emit(HostScanState.foundNewDevice(activeHostList)); - } else if (message is String && message == 'Done') { - isolateContactor.dispose(); - } - } catch (e) { - emit(const HostScanState.error()); + mdns: mDns, + ), + ); + } else { + deviceInTheNetworkList[index] = deviceInTheNetworkList[index] + ..mdns = mDns; } - } - } - debugPrint('The end of the scan'); - // emit(HostScanState.loadSuccess(activeHostList)); - } + deviceInTheNetworkList.sort((a, b) { + final int aIp = int.parse( + a.internetAddress.address + .substring(a.internetAddress.address.lastIndexOf('.') + 1), + ); + final int bIp = int.parse( + b.internetAddress.address + .substring(b.internetAddress.address.lastIndexOf('.') + 1), + ); + return aIp.compareTo(bIp); + }); + + emit(const HostScanState.loadInProgress()); + emit(HostScanState.foundNewDevice(deviceInTheNetworkList)); + } + }); - Future _startNewScanBuiltInIsolate( - StartNewScan event, - Emitter emit, - ) async { final streamController = HostScanner.getAllPingableDevicesAsync( subnet!, firstHostId: appSettings.firstSubnet, lastHostId: appSettings.lastSubnet, ); await for (final ActiveHost activeHost in streamController) { - final DeviceInTheNetwork tempDeviceInTheNetwork = + final int index = indexOfActiveHost(activeHost.address); + + if (index == -1) { + deviceInTheNetworkList.add( DeviceInTheNetwork.createFromActiveHost( - activeHost: activeHost, - currentDeviceIp: ip!, - gatewayIp: gatewayIp!, - ); + activeHost: activeHost, + currentDeviceIp: ip!, + gatewayIp: gatewayIp!, + ), + ); + } else { + deviceInTheNetworkList[index] = DeviceInTheNetwork.createFromActiveHost( + activeHost: activeHost, + currentDeviceIp: ip!, + gatewayIp: gatewayIp!, + mdns: deviceInTheNetworkList[index].mdns, + ); + } - activeHostList.add(tempDeviceInTheNetwork); - activeHostList.sort((a, b) { + deviceInTheNetworkList.sort((a, b) { final int aIp = int.parse( a.internetAddress.address .substring(a.internetAddress.address.lastIndexOf('.') + 1), @@ -131,48 +125,16 @@ class HostScanBloc extends Bloc { ); return aIp.compareTo(bIp); }); + emit(const HostScanState.loadInProgress()); - emit(HostScanState.foundNewDevice(activeHostList)); + emit(HostScanState.foundNewDevice(deviceInTheNetworkList)); } } - @Deprecated("Now network_tools support running scan inside isolate") - - /// Will search devices in the network inside new isolate - static Future startSearchingDevices(dynamic params) async { - final channel = IsolateContactorController(params); - channel.onIsolateMessage.listen((message) async { - List paramsListString = []; - if (message is List) { - paramsListString = message; - } else { - return; - } - - final String subnetIsolate = paramsListString[0]; - final int firstSubnetIsolate = int.parse(paramsListString[1]); - final int lastSubnetIsolate = int.parse(paramsListString[2]); - debugPrint('Scanning from $firstSubnetIsolate to $lastSubnetIsolate'); - - /// Will contain all the hosts that got discovered in the network, will - /// be use inorder to cancel on dispose of the page. - final Stream hostsDiscoveredInNetwork = - HostScanner.getAllPingableDevices( - subnetIsolate, - firstHostId: firstSubnetIsolate, - lastHostId: lastSubnetIsolate, - ); - - await for (final ActiveHost activeHostFound in hostsDiscoveredInNetwork) { - activeHostFound.deviceName.then((value) { - activeHostFound.mdnsInfo.then((value) { - activeHostFound.hostName.then((value) { - channel.sendResult(activeHostFound); - }); - }); - }); - } - channel.sendResult('Done'); - }); + /// Getting active host IP and finds it's index inside of activeHostList + /// Returns -1 if didn't find + int indexOfActiveHost(String ip) { + return deviceInTheNetworkList + .indexWhere((element) => element.internetAddress.address == ip); } } From 307fc9a172afa89fe748df3e2fe3cbfe9e3646cf Mon Sep 17 00:00:00 2001 From: guyluz Date: Mon, 3 Apr 2023 23:34:02 +0300 Subject: [PATCH 2/9] Fixing lint --- lib/pages/host_scan_page/device_in_the_network.dart | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/pages/host_scan_page/device_in_the_network.dart b/lib/pages/host_scan_page/device_in_the_network.dart index 88e1ed77..614be780 100644 --- a/lib/pages/host_scan_page/device_in_the_network.dart +++ b/lib/pages/host_scan_page/device_in_the_network.dart @@ -74,15 +74,7 @@ class DeviceInTheNetwork { /// Ip of the device final InternetAddress internetAddress; - late Future _make; - - set make(Future makeVar) { - _make = makeVar; - } - - Future get make { - return _make; - } + late Future make; final PingData pingData; final IconData iconData; From 8b7a284f28f179577509ab9607e13f645e2a76c1 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Tue, 5 Sep 2023 11:33:42 +0530 Subject: [PATCH 3/9] Host scan support for iOS --- ios/Podfile.lock | 31 ++++-- ios/Runner.xcodeproj/project.pbxproj | 7 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- ios/Runner/Info.plist | 2 + lib/pages/base_page.dart | 4 +- lib/pages/home_page.dart | 6 +- .../host_scna_bloc/host_scan_bloc.dart | 103 +----------------- .../widgets/host_scan_widget.dart | 4 +- .../network_troubleshoot/port_scan_page.dart | 13 ++- lib/pages/ping_page/ping_page.dart | 2 +- lib/pages/settings_page.dart | 2 +- pubspec.yaml | 9 +- 12 files changed, 53 insertions(+), 132 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 751c0ea2..b5b82252 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,46 +1,59 @@ PODS: - Flutter (1.0.0) + - flutter_icmp_ping (0.0.1): + - Flutter + - flutter_isolate (0.0.1): + - Flutter - network_info_plus (0.0.1): - Flutter - package_info_plus (0.4.5): - Flutter - - permission_handler_apple (9.0.4): + - permission_handler_apple (9.1.1): - Flutter - - shared_preferences_ios (0.0.1): + - shared_preferences_foundation (0.0.1): - Flutter + - FlutterMacOS - url_launcher_ios (0.0.1): - Flutter DEPENDENCIES: - Flutter (from `Flutter`) + - flutter_icmp_ping (from `.symlinks/plugins/flutter_icmp_ping/ios`) + - flutter_isolate (from `.symlinks/plugins/flutter_isolate/ios`) - network_info_plus (from `.symlinks/plugins/network_info_plus/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - - shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`) + - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) EXTERNAL SOURCES: Flutter: :path: Flutter + flutter_icmp_ping: + :path: ".symlinks/plugins/flutter_icmp_ping/ios" + flutter_isolate: + :path: ".symlinks/plugins/flutter_isolate/ios" network_info_plus: :path: ".symlinks/plugins/network_info_plus/ios" package_info_plus: :path: ".symlinks/plugins/package_info_plus/ios" permission_handler_apple: :path: ".symlinks/plugins/permission_handler_apple/ios" - shared_preferences_ios: - :path: ".symlinks/plugins/shared_preferences_ios/ios" + shared_preferences_foundation: + :path: ".symlinks/plugins/shared_preferences_foundation/darwin" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" SPEC CHECKSUMS: Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + flutter_icmp_ping: 2b159955eee0c487c766ad83fec224ae35e7c935 + flutter_isolate: 0edf5081826d071adf21759d1eb10ff5c24503b5 network_info_plus: b78876159360f5580608c2cea620d6ceffabd0ad package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e - permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce - shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad - url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de + permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 + shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 + url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 88510b3b..9cf1d843 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -161,7 +161,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -222,10 +222,12 @@ }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -236,6 +238,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a3..a6b826db 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ com.apple.developer.networking.wifi-info + UIApplicationSupportsIndirectInputEvents + diff --git a/lib/pages/base_page.dart b/lib/pages/base_page.dart index 445aebf8..60e0dc27 100644 --- a/lib/pages/base_page.dart +++ b/lib/pages/base_page.dart @@ -34,7 +34,7 @@ abstract class BasePage extends State { _getDomainChip('youtube.com'), _getDomainChip('apple.com'), _getDomainChip('amazon.com'), - _getDomainChip('cloudflare.com') + _getDomainChip('cloudflare.com'), ], ), ), @@ -95,7 +95,7 @@ abstract class BasePage extends State { buildPopularChips(), Expanded( child: buildResults(context), - ) + ), ], ), ), diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 745ce03a..4ffac460 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -139,7 +139,7 @@ class _WifiDetailState extends State { }, icon: const Icon(Icons.radar), label: const Text('Scan open ports'), - ) + ), ], ), ], @@ -180,7 +180,7 @@ class _WifiDetailState extends State { }, icon: const Icon(Icons.find_replace), label: const Text('Reverse Lookup'), - ) + ), ], ), ], @@ -226,7 +226,7 @@ class _WifiDetailState extends State { child: Text(snapshot.data!.location.address), ), const SizedBox(height: 5), - const Divider(height: 3) + const Divider(height: 3), ], ); } diff --git a/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart index de2ea25f..1d1d52a2 100644 --- a/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart @@ -1,12 +1,11 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; -import 'package:flutter/material.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:injectable/injectable.dart'; -import 'package:isolate_contactor/isolate_contactor.dart'; import 'package:network_info_plus/network_info_plus.dart'; import 'package:network_tools/network_tools.dart'; +import 'package:network_tools_flutter/network_tools_flutter.dart'; import 'package:vernet/main.dart'; import 'package:vernet/pages/host_scan_page/device_in_the_network.dart'; @@ -44,69 +43,11 @@ class HostScanBloc extends Bloc { add(const HostScanEvent.startNewScan()); } - @Deprecated("Now network_tools support running scan inside isolate") - // ignore: unused_element - Future _startNewScan( - StartNewScan event, - Emitter emit, - ) async { - const int scanRangeForIsolate = 51; - for (int i = appSettings.firstSubnet; - i <= appSettings.lastSubnet; - i += scanRangeForIsolate + 1) { - final IsolateContactor isolateContactor = - await IsolateContactor.createOwnIsolate(startSearchingDevices); - int limit = i + scanRangeForIsolate; - if (limit >= appSettings.lastSubnet) { - limit = appSettings.lastSubnet; - } - isolateContactor.sendMessage([ - subnet!, - i.toString(), - limit.toString(), - ]); - await for (final dynamic message in isolateContactor.onMessage) { - try { - if (message is ActiveHost) { - final DeviceInTheNetwork tempDeviceInTheNetwork = - DeviceInTheNetwork.createFromActiveHost( - activeHost: message, - currentDeviceIp: ip!, - gatewayIp: gatewayIp!, - ); - - activeHostList.add(tempDeviceInTheNetwork); - activeHostList.sort((a, b) { - final int aIp = int.parse( - a.internetAddress.address - .substring(a.internetAddress.address.lastIndexOf('.') + 1), - ); - final int bIp = int.parse( - b.internetAddress.address - .substring(b.internetAddress.address.lastIndexOf('.') + 1), - ); - return aIp.compareTo(bIp); - }); - emit(const HostScanState.loadInProgress()); - emit(HostScanState.foundNewDevice(activeHostList)); - } else if (message is String && message == 'Done') { - isolateContactor.dispose(); - } - } catch (e) { - emit(const HostScanState.error()); - } - } - } - debugPrint('The end of the scan'); - - // emit(HostScanState.loadSuccess(activeHostList)); - } - Future _startNewScanBuiltInIsolate( StartNewScan event, Emitter emit, ) async { - final streamController = HostScanner.getAllPingableDevicesAsync( + final streamController = HostScannerFlutter.getAllPingableDevices( subnet!, firstHostId: appSettings.firstSubnet, lastHostId: appSettings.lastSubnet, @@ -135,44 +76,4 @@ class HostScanBloc extends Bloc { emit(HostScanState.foundNewDevice(activeHostList)); } } - - @Deprecated("Now network_tools support running scan inside isolate") - - /// Will search devices in the network inside new isolate - static Future startSearchingDevices(dynamic params) async { - final channel = IsolateContactorController(params); - channel.onIsolateMessage.listen((message) async { - List paramsListString = []; - if (message is List) { - paramsListString = message; - } else { - return; - } - - final String subnetIsolate = paramsListString[0]; - final int firstSubnetIsolate = int.parse(paramsListString[1]); - final int lastSubnetIsolate = int.parse(paramsListString[2]); - debugPrint('Scanning from $firstSubnetIsolate to $lastSubnetIsolate'); - - /// Will contain all the hosts that got discovered in the network, will - /// be use inorder to cancel on dispose of the page. - final Stream hostsDiscoveredInNetwork = - HostScanner.getAllPingableDevices( - subnetIsolate, - firstHostId: firstSubnetIsolate, - lastHostId: lastSubnetIsolate, - ); - - await for (final ActiveHost activeHostFound in hostsDiscoveredInNetwork) { - activeHostFound.deviceName.then((value) { - activeHostFound.mdnsInfo.then((value) { - activeHostFound.hostName.then((value) { - channel.sendResult(activeHostFound); - }); - }); - }); - } - channel.sendResult('Done'); - }); - } } diff --git a/lib/pages/host_scan_page/widgets/host_scan_widget.dart b/lib/pages/host_scan_page/widgets/host_scan_widget.dart index 2a1e494f..714d9bb7 100644 --- a/lib/pages/host_scan_page/widgets/host_scan_widget.dart +++ b/lib/pages/host_scan_page/widgets/host_scan_widget.dart @@ -19,9 +19,9 @@ class HostScanWidget extends StatelessWidget { return Expanded( child: Container( margin: const EdgeInsets.all(30), - child: Column( + child: const Column( mainAxisAlignment: MainAxisAlignment.center, - children: const [ + children: [ CircularProgressIndicator(), SizedBox( height: 30, diff --git a/lib/pages/network_troubleshoot/port_scan_page.dart b/lib/pages/network_troubleshoot/port_scan_page.dart index 910fae0e..14402c2a 100644 --- a/lib/pages/network_troubleshoot/port_scan_page.dart +++ b/lib/pages/network_troubleshoot/port_scan_page.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:network_tools/network_tools.dart'; +import 'package:network_tools_flutter/network_tools_flutter.dart'; import 'package:percent_indicator/percent_indicator.dart'; import 'package:vernet/helper/port_desc_loader.dart'; import 'package:vernet/main.dart'; @@ -38,7 +39,7 @@ class _PortScanPageState extends State final List _tabs = [ const Tab(text: 'Popular Targets'), const Tab(text: 'Custom Ranges'), - const Tab(text: 'Popular Ports') + const Tab(text: 'Popular Ports'), ]; final _formKey = GlobalKey(); @@ -77,7 +78,7 @@ class _PortScanPageState extends State _openPorts.clear(); }); if (_type == ScanType.single) { - PortScanner.isOpen( + PortScannerFlutter.isOpen( _targetIPEditingController.text, int.parse(_singlePortEditingController.text), ).then((value) { @@ -85,14 +86,14 @@ class _PortScanPageState extends State _handleOnDone(); }); } else if (_type == ScanType.top) { - _streamSubscription = PortScanner.customDiscover( + _streamSubscription = PortScannerFlutter.customDiscover( _targetIPEditingController.text, timeout: Duration(milliseconds: appSettings.socketTimeout), progressCallback: _handleProgress, ).listen(_handleEvent, onDone: _handleOnDone); } else { //TODO: uncomment - _streamSubscription = PortScanner.scanPortsForSingleDevice( + _streamSubscription = PortScannerFlutter.scanPortsForSingleDevice( _targetIPEditingController.text, startPort: int.parse(_startPortEditingController.text), endPort: int.parse(_endPortEditingController.text), @@ -187,7 +188,7 @@ class _PortScanPageState extends State decoration: const InputDecoration(filled: true, hintText: 'End Port'), ), - ) + ), ], ); } @@ -360,7 +361,7 @@ class _PortScanPageState extends State _getDomainChip('youtube.com'), _getDomainChip('apple.com'), _getDomainChip('amazon.com'), - _getDomainChip('cloudflare.com') + _getDomainChip('cloudflare.com'), ], ), Wrap( diff --git a/lib/pages/ping_page/ping_page.dart b/lib/pages/ping_page/ping_page.dart index 06f1ec6f..0dac7762 100644 --- a/lib/pages/ping_page/ping_page.dart +++ b/lib/pages/ping_page/ping_page.dart @@ -122,7 +122,7 @@ class _PingPageState extends BasePage { children: [ Text('Sent: ${_pingSummary?.transmitted ?? '--'}'), Text('Received : ${_pingSummary?.transmitted ?? '--'}'), - Text('Total time: ${_getTime(_pingSummary?.time)}') + Text('Total time: ${_getTime(_pingSummary?.time)}'), ], ); } diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index cfe0b220..d7242208 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -190,7 +190,7 @@ class _SettingsPageState extends State { 'Made with ❤️ in India', textAlign: TextAlign.center, ), - ) + ), ], ); }, diff --git a/pubspec.yaml b/pubspec.yaml index 805ba89b..72932555 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.5 - dart_ping: ^8.0.1 + dart_ping: ^9.0.0 flutter: sdk: flutter # Bloc for state management, replace StatefulWidget @@ -34,9 +34,10 @@ dependencies: # Discover network info and configure themselves accordingly network_info_plus: ^3.0.1 # Helps you discover open ports, devices on subnet and more. - network_tools: ^3.2.1 - # network_tools: - # path: ../network_tools/network_tools + network_tools: ^3.2.2 + # path: ../network_tools/network_tools + network_tools_flutter: ^1.0.1 + # path: ../network_tools/network_tools_flutter # Querying information about the application package, such as CFBundleVersion package_info_plus: ^3.0.1 # Allows you to display progress widgets based on percentage. From 88eb8976dd3396c328b89d03db0c37caec768273 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Tue, 5 Sep 2023 22:50:33 +0530 Subject: [PATCH 4/9] Mac address support for desktop added --- README.md | 4 +- android/app/build.gradle | 2 +- .../host_scan_page/device_in_the_network.dart | 9 +++ .../host_scna_bloc/host_scan_bloc.dart | 72 +++++++++---------- .../widgets/host_scan_widget.dart | 4 +- macos/Podfile.lock | 10 +-- macos/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- pubspec.yaml | 2 - 9 files changed, 58 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 1d17c6f0..32bdc5fd 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Vernet - Network Analyzer and Monitoring Tool | Android | iOS | macOS | Linux | Windows | |-----------|-----|-------|-------|---------| -|Get it on F-droidGet it on Google Play| Build Ready |Get it on GitHub Releases|Get it on GitHub Releases| Get it on GitHub Releases| +|Get it on F-droidGet it on Google Play| Works on emulator |Get it on GitHub Releases|Get it on GitHub Releases| Get it on GitHub Releases| ## How to install @@ -48,7 +48,7 @@ Note: macOS build hasn't been notarized yet. ## Contributors Required -1. Windows Tester +1. Linux/Windows Tester 2. Documenter Drop mail at fs0c19ty@protonmail.com diff --git a/android/app/build.gradle b/android/app/build.gradle index d882d72e..6f8019ea 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -40,7 +40,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "org.fsociety.vernet" - minSdkVersion 16 + minSdkVersion 19 targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/lib/pages/host_scan_page/device_in_the_network.dart b/lib/pages/host_scan_page/device_in_the_network.dart index 614be780..c6144ca5 100644 --- a/lib/pages/host_scan_page/device_in_the_network.dart +++ b/lib/pages/host_scan_page/device_in_the_network.dart @@ -13,11 +13,13 @@ class DeviceInTheNetwork { required Future makeVar, required this.pingData, MdnsInfo? mdnsVar, + String? mac, this.iconData = Icons.devices, this.hostId, }) { make = makeVar; _mdns = mdnsVar; + _mac = mac; } /// Create the object from active host with the correct field and icon @@ -25,6 +27,7 @@ class DeviceInTheNetwork { required ActiveHost activeHost, required String currentDeviceIp, required String gatewayIp, + required String? mac, MdnsInfo? mdns, }) { return DeviceInTheNetwork.createWithAllNecessaryFields( @@ -35,6 +38,7 @@ class DeviceInTheNetwork { currentDeviceIp: currentDeviceIp, gatewayIp: gatewayIp, mdns: mdns, + mac: mac, ); } @@ -47,6 +51,7 @@ class DeviceInTheNetwork { required String currentDeviceIp, required String gatewayIp, required MdnsInfo? mdns, + required String? mac, }) { final IconData iconData = getHostIcon( currentDeviceIp: currentDeviceIp, @@ -69,12 +74,14 @@ class DeviceInTheNetwork { hostId: hostId, iconData: iconData, mdnsVar: mdns, + mac: mac, ); } /// Ip of the device final InternetAddress internetAddress; late Future make; + String? _mac; final PingData pingData; final IconData iconData; @@ -84,6 +91,8 @@ class DeviceInTheNetwork { return _mdns; } + String get mac => _mac == null ? '' : '($_mac)'; + set mdns(MdnsInfo? name) { _mdns = name; diff --git a/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart index b8bbe6e3..abc65c0a 100644 --- a/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart @@ -62,28 +62,18 @@ class HostScanBloc extends Bloc { if (index == -1) { deviceInTheNetworkList.add( DeviceInTheNetwork.createFromActiveHost( - activeHost: activeHost, - currentDeviceIp: ip!, - gatewayIp: gatewayIp!, - mdns: mDns, - ), + activeHost: activeHost, + currentDeviceIp: ip!, + gatewayIp: gatewayIp!, + mdns: mDns, + mac: (await activeHost.arpData)?.macAddress), ); } else { deviceInTheNetworkList[index] = deviceInTheNetworkList[index] ..mdns = mDns; } - deviceInTheNetworkList.sort((a, b) { - final int aIp = int.parse( - a.internetAddress.address - .substring(a.internetAddress.address.lastIndexOf('.') + 1), - ); - final int bIp = int.parse( - b.internetAddress.address - .substring(b.internetAddress.address.lastIndexOf('.') + 1), - ); - return aIp.compareTo(bIp); - }); + deviceInTheNetworkList.sort(sort); emit(const HostScanState.loadInProgress()); emit(HostScanState.foundNewDevice(deviceInTheNetworkList)); @@ -101,31 +91,21 @@ class HostScanBloc extends Bloc { if (index == -1) { deviceInTheNetworkList.add( DeviceInTheNetwork.createFromActiveHost( - activeHost: activeHost, - currentDeviceIp: ip!, - gatewayIp: gatewayIp!, - ), + activeHost: activeHost, + currentDeviceIp: ip!, + gatewayIp: gatewayIp!, + mac: (await activeHost.arpData)?.macAddress), ); } else { deviceInTheNetworkList[index] = DeviceInTheNetwork.createFromActiveHost( - activeHost: activeHost, - currentDeviceIp: ip!, - gatewayIp: gatewayIp!, - mdns: deviceInTheNetworkList[index].mdns, - ); + activeHost: activeHost, + currentDeviceIp: ip!, + gatewayIp: gatewayIp!, + mdns: deviceInTheNetworkList[index].mdns, + mac: (await activeHost.arpData)?.macAddress); } - deviceInTheNetworkList.sort((a, b) { - final int aIp = int.parse( - a.internetAddress.address - .substring(a.internetAddress.address.lastIndexOf('.') + 1), - ); - final int bIp = int.parse( - b.internetAddress.address - .substring(b.internetAddress.address.lastIndexOf('.') + 1), - ); - return aIp.compareTo(bIp); - }); + deviceInTheNetworkList.sort(sort); emit(const HostScanState.loadInProgress()); emit(HostScanState.foundNewDevice(deviceInTheNetworkList)); @@ -138,4 +118,24 @@ class HostScanBloc extends Bloc { return deviceInTheNetworkList .indexWhere((element) => element.internetAddress.address == ip); } + + int sort(DeviceInTheNetwork a, DeviceInTheNetwork b) { + final regexA = a.internetAddress.address.contains('.') ? '.' : '::'; + final regexB = b.internetAddress.address.contains('.') ? '.' : '::'; + if (regexA.length == 2 || regexB.length == 2) { + return regexA.length.compareTo(regexB.length); + } + final int aIp = int.parse( + a.internetAddress.address.substring( + a.internetAddress.address.lastIndexOf(regexA) + regexA.length, + ), + ); + final int bIp = int.parse( + b.internetAddress.address.substring( + b.internetAddress.address.lastIndexOf(regexB) + regexB.length, + ), + ); + + return aIp.compareTo(bIp); + } } diff --git a/lib/pages/host_scan_page/widgets/host_scan_widget.dart b/lib/pages/host_scan_page/widgets/host_scan_widget.dart index 714d9bb7..08a38b0a 100644 --- a/lib/pages/host_scan_page/widgets/host_scan_widget.dart +++ b/lib/pages/host_scan_page/widgets/host_scan_widget.dart @@ -56,7 +56,9 @@ class HostScanWidget extends StatelessWidget { }, initialData: 'Generic Device', ), - subtitle: Text(host.internetAddress.address), + subtitle: Text( + '${host.internetAddress.address} ${host.mac}', + ), trailing: IconButton( tooltip: 'Scan open ports for this target', icon: const Icon(Icons.radar), diff --git a/macos/Podfile.lock b/macos/Podfile.lock index b2e7e042..ce4720fb 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -14,7 +14,7 @@ DEPENDENCIES: - FlutterMacOS (from `Flutter/ephemeral`) - network_info_plus (from `Flutter/ephemeral/.symlinks/plugins/network_info_plus/macos`) - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) - - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos`) + - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) EXTERNAL SOURCES: @@ -25,7 +25,7 @@ EXTERNAL SOURCES: package_info_plus: :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos shared_preferences_foundation: - :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos + :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin url_launcher_macos: :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos @@ -33,9 +33,9 @@ SPEC CHECKSUMS: FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 network_info_plus: f4fbc7877ab7b3294500d9441dfa53cd54972d05 package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce - shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472 - url_launcher_macos: 5335912b679c073563f29d89d33d10d459f95451 + shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 + url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95 PODFILE CHECKSUM: 4d1ddd58dcd1dc92dd2b397bbacb622f345603ab -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.0 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index b7159b8f..36107ed8 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -203,7 +203,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 9a7c8f51..3bbcb37d 100644 --- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ Date: Wed, 6 Sep 2023 09:20:20 +0530 Subject: [PATCH 5/9] removed analyzer issues --- .../host_scna_bloc/host_scan_bloc.dart | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart index abc65c0a..4ea1fcf1 100644 --- a/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart @@ -62,11 +62,12 @@ class HostScanBloc extends Bloc { if (index == -1) { deviceInTheNetworkList.add( DeviceInTheNetwork.createFromActiveHost( - activeHost: activeHost, - currentDeviceIp: ip!, - gatewayIp: gatewayIp!, - mdns: mDns, - mac: (await activeHost.arpData)?.macAddress), + activeHost: activeHost, + currentDeviceIp: ip!, + gatewayIp: gatewayIp!, + mdns: mDns, + mac: (await activeHost.arpData)?.macAddress, + ), ); } else { deviceInTheNetworkList[index] = deviceInTheNetworkList[index] @@ -91,18 +92,20 @@ class HostScanBloc extends Bloc { if (index == -1) { deviceInTheNetworkList.add( DeviceInTheNetwork.createFromActiveHost( - activeHost: activeHost, - currentDeviceIp: ip!, - gatewayIp: gatewayIp!, - mac: (await activeHost.arpData)?.macAddress), - ); - } else { - deviceInTheNetworkList[index] = DeviceInTheNetwork.createFromActiveHost( activeHost: activeHost, currentDeviceIp: ip!, gatewayIp: gatewayIp!, - mdns: deviceInTheNetworkList[index].mdns, - mac: (await activeHost.arpData)?.macAddress); + mac: (await activeHost.arpData)?.macAddress, + ), + ); + } else { + deviceInTheNetworkList[index] = DeviceInTheNetwork.createFromActiveHost( + activeHost: activeHost, + currentDeviceIp: ip!, + gatewayIp: gatewayIp!, + mdns: deviceInTheNetworkList[index].mdns, + mac: (await activeHost.arpData)?.macAddress, + ); } deviceInTheNetworkList.sort(sort); From 564b32896bb5c9c1022f7bb2633805a1ed0bbff1 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Wed, 6 Sep 2023 11:50:03 +0530 Subject: [PATCH 6/9] kotlin version updated --- android/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 4d7a7a82..c228417f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.9.10' repositories { google() jcenter() @@ -24,6 +24,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } From 4b4eb85adf620ff889a7ec442798591ba9c7d56c Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 24 Sep 2023 23:42:53 +0530 Subject: [PATCH 7/9] Upgraded network_tools and isolate works on iOS --- lib/main.dart | 4 ++++ lib/pages/host_scan_page/device_in_the_network.dart | 2 +- .../host_scan_page/host_scna_bloc/host_scan_bloc.dart | 1 - lib/pages/network_troubleshoot/port_scan_page.dart | 1 - .../port_scan_page/port_scan_bloc/port_scan_bloc.dart | 2 +- macos/Flutter/GeneratedPluginRegistrant.swift | 2 ++ macos/Podfile.lock | 7 +++++++ pubspec.yaml | 8 ++++---- 8 files changed, 19 insertions(+), 8 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 3d699e1a..91eacbc4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:network_tools_flutter/network_tools_flutter.dart'; +import 'package:path_provider/path_provider.dart'; import 'package:provider/provider.dart'; import 'package:vernet/api/update_checker.dart'; import 'package:vernet/helper/app_settings.dart'; @@ -13,6 +15,8 @@ late AppSettings appSettings; Future main() async { configureDependencies(Env.prod); WidgetsFlutterBinding.ensureInitialized(); + final appDocDirectory = await getApplicationDocumentsDirectory(); + await configureNetworkTools(appDocDirectory.path, enableDebugging: true); final bool allowed = await ConsentLoader.isConsentPageShown(); appSettings = AppSettings.instance..load(); diff --git a/lib/pages/host_scan_page/device_in_the_network.dart b/lib/pages/host_scan_page/device_in_the_network.dart index c6144ca5..7e9c61c5 100644 --- a/lib/pages/host_scan_page/device_in_the_network.dart +++ b/lib/pages/host_scan_page/device_in_the_network.dart @@ -2,7 +2,7 @@ import 'dart:io'; import 'package:dart_ping/dart_ping.dart'; import 'package:flutter/material.dart'; -import 'package:network_tools/network_tools.dart'; +import 'package:network_tools_flutter/network_tools_flutter.dart'; /// Contains all the information of a device in the network including /// icon, open ports and in the future host name and mDNS name diff --git a/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart index 4ea1fcf1..c410bcb7 100644 --- a/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scna_bloc/host_scan_bloc.dart @@ -4,7 +4,6 @@ import 'package:bloc/bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:injectable/injectable.dart'; import 'package:network_info_plus/network_info_plus.dart'; -import 'package:network_tools/network_tools.dart'; import 'package:network_tools_flutter/network_tools_flutter.dart'; import 'package:vernet/main.dart'; import 'package:vernet/pages/host_scan_page/device_in_the_network.dart'; diff --git a/lib/pages/network_troubleshoot/port_scan_page.dart b/lib/pages/network_troubleshoot/port_scan_page.dart index 14402c2a..c0a7ef2e 100644 --- a/lib/pages/network_troubleshoot/port_scan_page.dart +++ b/lib/pages/network_troubleshoot/port_scan_page.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:network_tools/network_tools.dart'; import 'package:network_tools_flutter/network_tools_flutter.dart'; import 'package:percent_indicator/percent_indicator.dart'; import 'package:vernet/helper/port_desc_loader.dart'; diff --git a/lib/pages/port_scan_page/port_scan_bloc/port_scan_bloc.dart b/lib/pages/port_scan_page/port_scan_bloc/port_scan_bloc.dart index 051fc21c..ef58f809 100644 --- a/lib/pages/port_scan_page/port_scan_bloc/port_scan_bloc.dart +++ b/lib/pages/port_scan_page/port_scan_bloc/port_scan_bloc.dart @@ -1,7 +1,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:injectable/injectable.dart'; -import 'package:network_tools/network_tools.dart'; +import 'package:network_tools_flutter/network_tools_flutter.dart'; part 'port_scan_bloc.freezed.dart'; part 'port_scan_event.dart'; diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index fc531dc2..8d91c82a 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,12 +7,14 @@ import Foundation import network_info_plus import package_info_plus +import path_provider_foundation import shared_preferences_foundation import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { NetworkInfoPlusPlugin.register(with: registry.registrar(forPlugin: "NetworkInfoPlusPlugin")) FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/macos/Podfile.lock b/macos/Podfile.lock index ce4720fb..54066a3e 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -4,6 +4,9 @@ PODS: - FlutterMacOS - package_info_plus (0.0.1): - FlutterMacOS + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS @@ -14,6 +17,7 @@ DEPENDENCIES: - FlutterMacOS (from `Flutter/ephemeral`) - network_info_plus (from `Flutter/ephemeral/.symlinks/plugins/network_info_plus/macos`) - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) + - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) @@ -24,6 +28,8 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/network_info_plus/macos package_info_plus: :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos + path_provider_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin shared_preferences_foundation: :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin url_launcher_macos: @@ -33,6 +39,7 @@ SPEC CHECKSUMS: FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 network_info_plus: f4fbc7877ab7b3294500d9441dfa53cd54972d05 package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce + path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95 diff --git a/pubspec.yaml b/pubspec.yaml index d106698b..df41b580 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,7 +26,7 @@ dependencies: # Service locator get_it: ^7.2.0 # A composable, multi-platform, Future-based API for HTTP requests. - http: ^0.13.5 + http: ^1.1.0 # Convenient code generator for get_it injectable: ^2.1.0 # An easy way to create a new isolate, keep it running and communicate with it. @@ -34,10 +34,10 @@ dependencies: # Discover network info and configure themselves accordingly network_info_plus: ^3.0.1 # Helps you discover open ports, devices on subnet and more. - network_tools: ^3.2.2 - network_tools_flutter: ^1.0.1 + network_tools_flutter: ^1.0.4 # Querying information about the application package, such as CFBundleVersion - package_info_plus: ^3.0.1 + package_info_plus: ^4.1.0 + path_provider: ^2.1.1 # Allows you to display progress widgets based on percentage. percent_indicator: ^4.2.2 # Popup that ask for the requested permission From 07dc45b7beaa695f8a25a6836afa83df0ecf816d Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 24 Sep 2023 23:44:15 +0530 Subject: [PATCH 8/9] upgrade dependencies --- pubspec.yaml | 4 ++-- windows/flutter/generated_plugin_registrant.cc | 3 --- windows/flutter/generated_plugins.cmake | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index df41b580..d50447a0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,7 +32,7 @@ dependencies: # An easy way to create a new isolate, keep it running and communicate with it. isolate_contactor: ^2.0.0+1 # Discover network info and configure themselves accordingly - network_info_plus: ^3.0.1 + network_info_plus: ^4.0.2 # Helps you discover open ports, devices on subnet and more. network_tools_flutter: ^1.0.4 # Querying information about the application package, such as CFBundleVersion @@ -41,7 +41,7 @@ dependencies: # Allows you to display progress widgets based on percentage. percent_indicator: ^4.2.2 # Popup that ask for the requested permission - permission_handler: ^10.2.0 + permission_handler: ^11.0.0 # A wrapper around InheritedWidget to make them easier to use and more reusable. provider: ^6.0.4 # Reading and writing simple key-value pairs diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index f2a99ad7..a0d0bbeb 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,13 +6,10 @@ #include "generated_plugin_registrant.h" -#include #include #include void RegisterPlugins(flutter::PluginRegistry* registry) { - NetworkInfoPlusWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("NetworkInfoPlusWindowsPlugin")); PermissionHandlerWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); UrlLauncherWindowsRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 13c3c0c9..c20a586d 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - network_info_plus permission_handler_windows url_launcher_windows ) From bc4e9045bff992caa23c71cc0026150dccd803d4 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 24 Sep 2023 23:57:17 +0530 Subject: [PATCH 9/9] Release 1.0.1+16 --- fastlane/metadata/android/en-US/changelogs/16.txt | 2 ++ pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/16.txt diff --git a/fastlane/metadata/android/en-US/changelogs/16.txt b/fastlane/metadata/android/en-US/changelogs/16.txt new file mode 100644 index 00000000..1d117bba --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/16.txt @@ -0,0 +1,2 @@ +Upgraded network_tools to v4.0.1 +Mac address support added for Desktop \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index d50447a0..436c309e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A Network Analyzer publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.0.1+15 +version: 1.0.1+16 environment: sdk: ">=2.17.0 <3.0.0"