Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev -> Main #90

Merged
merged 14 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Vernet - Network Analyzer and Monitoring Tool

| Android | iOS | macOS | Linux | Windows |
|-----------|-----|-------|-------|---------|
|<a href='https://f-droid.org/packages/org.fsociety.vernet'><img alt='Get it on F-droid' src='https://fdroid.gitlab.io/artwork/badge/get-it-on.png' width="100" /></a><a href='https://play.google.com/store/apps/details?id=org.fsociety.vernet.store'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' width="100" /></a>| Build Ready |<a href='https://github.com/git-elliot/vernet/releases/latest'><img alt='Get it on GitHub Releases' src='https://i.ibb.co/q0mdc4Z/get-it-on-github.png' width="100" />|<a href='https://github.com/git-elliot/vernet/releases/latest'><img alt='Get it on GitHub Releases' src='https://i.ibb.co/q0mdc4Z/get-it-on-github.png' width="100" />| <a href='https://github.com/git-elliot/vernet/releases/latest'><img alt='Get it on GitHub Releases' src='https://i.ibb.co/q0mdc4Z/get-it-on-github.png' width="100" />|
|<a href='https://f-droid.org/packages/org.fsociety.vernet'><img alt='Get it on F-droid' src='https://fdroid.gitlab.io/artwork/badge/get-it-on.png' width="100" /></a><a href='https://play.google.com/store/apps/details?id=org.fsociety.vernet.store'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' width="100" /></a>| Works on emulator |<a href='https://github.com/git-elliot/vernet/releases/latest'><img alt='Get it on GitHub Releases' src='https://i.ibb.co/q0mdc4Z/get-it-on-github.png' width="100" />|<a href='https://github.com/git-elliot/vernet/releases/latest'><img alt='Get it on GitHub Releases' src='https://i.ibb.co/q0mdc4Z/get-it-on-github.png' width="100" />| <a href='https://github.com/git-elliot/vernet/releases/latest'><img alt='Get it on GitHub Releases' src='https://i.ibb.co/q0mdc4Z/get-it-on-github.png' width="100" />|

## How to install

Expand All @@ -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 [email protected]
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.9.10'
repositories {
google()
jcenter()
Expand All @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 2 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/16.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Upgraded network_tools to v4.0.1
Mac address support added for Desktop
31 changes: 22 additions & 9 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -161,7 +161,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -222,10 +222,12 @@
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand All @@ -236,6 +238,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@
<false/>
<key>com.apple.developer.networking.wifi-info</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
4 changes: 4 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -13,6 +15,8 @@ late AppSettings appSettings;
Future<void> 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();
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/base_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class BasePage<T extends StatefulWidget> extends State<T> {
_getDomainChip('youtube.com'),
_getDomainChip('apple.com'),
_getDomainChip('amazon.com'),
_getDomainChip('cloudflare.com')
_getDomainChip('cloudflare.com'),
],
),
),
Expand Down Expand Up @@ -95,7 +95,7 @@ abstract class BasePage<T extends StatefulWidget> extends State<T> {
buildPopularChips(),
Expanded(
child: buildResults(context),
)
),
],
),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class _WifiDetailState extends State<HomePage> {
},
icon: const Icon(Icons.radar),
label: const Text('Scan open ports'),
)
),
],
),
],
Expand Down Expand Up @@ -180,7 +180,7 @@ class _WifiDetailState extends State<HomePage> {
},
icon: const Icon(Icons.find_replace),
label: const Text('Reverse Lookup'),
)
),
],
),
],
Expand Down Expand Up @@ -226,7 +226,7 @@ class _WifiDetailState extends State<HomePage> {
child: Text(snapshot.data!.location.address),
),
const SizedBox(height: 5),
const Divider(height: 3)
const Divider(height: 3),
],
);
}
Expand Down
52 changes: 47 additions & 5 deletions lib/pages/host_scan_page/device_in_the_network.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,33 @@ 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
class DeviceInTheNetwork {
/// Create basic device with default (not the correct) icon
DeviceInTheNetwork({
required this.internetAddress,
required this.make,
required Future<String?> 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
factory DeviceInTheNetwork.createFromActiveHost({
required ActiveHost activeHost,
required String currentDeviceIp,
required String gatewayIp,
required String? mac,
MdnsInfo? mdns,
}) {
return DeviceInTheNetwork.createWithAllNecessaryFields(
internetAddress: activeHost.internetAddress,
Expand All @@ -29,6 +37,8 @@ class DeviceInTheNetwork {
pingData: activeHost.pingData,
currentDeviceIp: currentDeviceIp,
gatewayIp: gatewayIp,
mdns: mdns,
mac: mac,
);
}

Expand All @@ -40,6 +50,8 @@ class DeviceInTheNetwork {
required PingData pingData,
required String currentDeviceIp,
required String gatewayIp,
required MdnsInfo? mdns,
required String? mac,
}) {
final IconData iconData = getHostIcon(
currentDeviceIp: currentDeviceIp,
Expand All @@ -52,34 +64,64 @@ 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,
mac: mac,
);
}

/// Ip of the device
final InternetAddress internetAddress;
final Future<String?> make;
late Future<String?> make;
String? _mac;

final PingData pingData;
final IconData iconData;
MdnsInfo? _mdns;

MdnsInfo? get mdns {
return _mdns;
}

String get mac => _mac == null ? '' : '($_mac)';

set mdns(MdnsInfo? name) {
_mdns = name;

final Future<String?> deviceMake = getDeviceMake(
currentDeviceIp: '',
hostIp: internetAddress.address,
gatewayIp: '',
hostMake: make,
mdns: _mdns,
);
make = deviceMake;
}

/// Some name to show the user
String? hostId;

static Future<String?> getDeviceMake({
required String currentDeviceIp,
required String hostIp,
required String gatewayIp,
required Future<String?> 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;
}
Expand Down
Loading
Loading