detectNetwork #670

Merged
sarah merged 7 commits from detectNetwork into trunk 2023-05-15 16:06:25 +00:00
Owner
  • import connecivity_plus and nm plugins and hack nm plugin from 2700 lines to ~400
  • add listener in main app for network comming back up and reboot tor
- import connecivity_plus and nm plugins and hack nm plugin from 2700 lines to ~400 - add listener in main app for network comming back up and reboot tor
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/305
sarah requested changes 2023-05-02 17:53:13 +00:00
@ -0,0 +1,27 @@
Copyright 2017 The Chromium Authors. All rights reserved.
Owner

Licenses needs to be added to licenses.dart

Licenses needs to be added to licenses.dart
dan marked this conversation as resolved
@ -0,0 +1,27 @@
Copyright 2017 The Chromium Authors. All rights reserved.
Owner

Licenses needs to be added to licenses.dart

Licenses needs to be added to licenses.dart
dan marked this conversation as resolved
@ -0,0 +1,106 @@
# connectivity_plus
Owner

document changes

document changes
dan marked this conversation as resolved
@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
Owner

align gradle versions android/gradle/wrapper/gradle-wrapper.properties currently depends on gradle-6.5-bin.zip

align gradle versions android/gradle/wrapper/gradle-wrapper.properties currently depends on `gradle-6.5-bin.zip`
dan marked this conversation as resolved
@ -0,0 +15,4 @@
static final String CONNECTIVITY_WIFI = "wifi";
static final String CONNECTIVITY_MOBILE = "mobile";
static final String CONNECTIVITY_ETHERNET = "ethernet";
static final String CONNECTIVITY_BLUETOOTH = "bluetooth";
Owner

remove

remove
dan marked this conversation as resolved
@ -0,0 +43,4 @@
return CONNECTIVITY_MOBILE;
}
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_BLUETOOTH)) {
return CONNECTIVITY_BLUETOOTH;
Owner

remove

remove
dan marked this conversation as resolved
@ -0,0 +59,4 @@
}
int type = info.getType();
switch (type) {
case ConnectivityManager.TYPE_BLUETOOTH:
Owner

remove

remove
dan marked this conversation as resolved
@ -0,0 +38,4 @@
switch (type) {
case 'none':
return ConnectivityResult.none;
case 'bluetooth':
Owner

remove

remove
dan marked this conversation as resolved
@ -0,0 +2,4 @@
// https://github.com/PurpleI2P/i2pd/blob/master/Win32/Win32NetState.cpp
/*
* Copyright (c) 2013-2020, The PurpleI2P Project
Owner

another license that needs to be in licenses.dart.

Also appears that the original code is violating this license by distributing a separate license that doesn't contain this copyright information...

another license that needs to be in licenses.dart. Also appears that the original code is violating this license by distributing a separate license that doesn't contain this copyright information...
dan marked this conversation as resolved
@ -0,0 +1,94 @@
## 1.2.4
Owner

should probably update this files to document the specific changes made.

should probably update this files to document the specific changes made.
dan marked this conversation as resolved
@ -0,0 +1,27 @@
Copyright 2020 The Chromium Authors. All rights reserved.
Owner

license needs to also be in license.dart

license needs to also be in license.dart
dan marked this conversation as resolved
@ -0,0 +1,27 @@
/// Connection status check result.
enum ConnectivityResult {
/// Bluetooth: Device connected via bluetooth
bluetooth,
Owner

remove

remove
dan marked this conversation as resolved
@ -0,0 +20,4 @@
/// Note for iOS and macOS:
/// There is no separate network interface type for [vpn].
/// It returns [other] on any device (also simulator).
vpn,
Owner

see note on vpn

see note on vpn
dan marked this conversation as resolved
@ -0,0 +4,4 @@
ConnectivityResult parseConnectivityResult(String state) {
switch (state) {
case 'bluetooth':
return ConnectivityResult.bluetooth;
Owner

remove

remove
dan marked this conversation as resolved
@ -0,0 +12,4 @@
case 'mobile':
return ConnectivityResult.mobile;
case 'vpn':
return ConnectivityResult.vpn;
Owner

tor over vpn is a terrible idea...we should probably by-default restrict this.

tor over vpn is a terrible idea...we should probably by-default restrict this.
Author
Owner

all we're doing is detecting if the network is up or not to reboot the ACN, i'm not sure what the logic for this would even look like, an excemption in main.lib listener to jsut not resetTor if the type is vpn? but since we dont want this system to know to much we're deleting knowledge of this specificity (like bluetooth) so that doesn't work anyways

all we're doing is detecting if the network is up or not to reboot the ACN, i'm not sure what the logic for this would even look like, an excemption in main.lib listener to jsut not resetTor if the type is vpn? but since we dont want this system to know to much we're deleting knowledge of this specificity (like bluetooth) so that doesn't work anyways
dan marked this conversation as resolved
@ -0,0 +14,4 @@
case 'vpn':
return ConnectivityResult.vpn;
case 'other':
return ConnectivityResult.other;
Owner

remove

remove
dan marked this conversation as resolved
@ -0,0 +1,373 @@
Mozilla Public License Version 2.0
Owner

Another...License....

Another...License....
dan marked this conversation as resolved
pubspec.lock Outdated
@ -9,3 +9,3 @@
url: "https://pub.dev"
source: hosted
version: "47.0.0"
version: "31.0.0"
Owner

...

...
dan marked this conversation as resolved
pubspec.lock Outdated
@ -339,3 +354,3 @@
url: "https://pub.dev"
source: hosted
version: "3.2.0"
version: "2.1.3"
Owner

massive downgrade?

massive downgrade?
dan marked this conversation as resolved
pubspec.lock Outdated
@ -738,3 +761,3 @@
url: "https://pub.dev"
source: hosted
version: "1.2.6"
version: "1.2.2"
Owner

why the downgrade?

why the downgrade?
dan marked this conversation as resolved
pubspec.yaml Outdated
@ -47,2 +47,4 @@
flutter_local_notifications: ^9.6.1
desktop_notifications: ^0.6.3
# network management plugins
dbus: ^0.7.0
Owner

specify a concrete version.

specify a concrete version.
dan marked this conversation as resolved
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/307
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/308
dan force-pushed detectNetwork from 8ccbc7a042 to f0140c7a8a 2023-05-03 16:37:53 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/309
dan force-pushed detectNetwork from f0140c7a8a to daf0496cf2 2023-05-03 16:59:04 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/310
dan force-pushed detectNetwork from daf0496cf2 to b5d643c5a8 2023-05-05 19:22:44 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/311
dan force-pushed detectNetwork from b5d643c5a8 to 66e3f0a1c2 2023-05-06 14:32:42 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/312
dan force-pushed detectNetwork from 66e3f0a1c2 to 130fe5fa3c 2023-05-06 14:38:04 +00:00 Compare
dan force-pushed detectNetwork from 130fe5fa3c to ba1fa59eb1 2023-05-06 14:45:34 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/314
dan force-pushed detectNetwork from ba1fa59eb1 to f6f9e597b3 2023-05-06 15:04:12 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/315
dan force-pushed detectNetwork from f6f9e597b3 to f80d828050 2023-05-06 18:57:42 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/316
dan force-pushed detectNetwork from f80d828050 to bb48adc9d6 2023-05-06 19:29:17 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/317
dan force-pushed detectNetwork from bb48adc9d6 to 0d4276b0f8 2023-05-06 19:49:28 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/318
dan force-pushed detectNetwork from 0d4276b0f8 to 522069def9 2023-05-06 20:36:22 +00:00 Compare
dan force-pushed detectNetwork from 522069def9 to c49e89f536 2023-05-06 20:39:04 +00:00 Compare
dan force-pushed detectNetwork from c49e89f536 to b21fb62593 2023-05-06 20:39:38 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/321
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch-ui/322
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/323
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch-ui/324
sarah reviewed 2023-05-08 18:15:16 +00:00
@ -15,3 +15,3 @@
import 'package:path/path.dart' as path;
import 'config.dart';
import '../../config.dart';
Owner

?

?
dan marked this conversation as resolved
@ -0,0 +11,4 @@
show ConnectivityResult;
export 'src/connectivity_plus_linux.dart'
if (dart.library.html) 'src/connectivity_plus_web.dart';
Owner

delete this.

delete this.
dan marked this conversation as resolved
@ -0,0 +1,27 @@
import 'package:connectivity_plus_platform_interface/connectivity_plus_platform_interface.dart';
Owner

I think this whole file can be deleted. We will never ship Cwtch for web targets due to the insecurity of the platform itself.

I think this whole file can be deleted. We will never ship Cwtch for web targets due to the insecurity of the platform itself.
dan marked this conversation as resolved
@ -0,0 +1,35 @@
import 'dart:async';
Owner

delete as above

delete as above
dan marked this conversation as resolved
@ -0,0 +1,92 @@
import 'dart:async';
Owner

delete as above

delete as above
dan marked this conversation as resolved
@ -0,0 +1,50 @@
import 'dart:html' as html show NetworkInformation;
Owner

delete as above

delete as above
dan marked this conversation as resolved
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch-ui/328
sarah force-pushed detectNetwork from 6228dcb1fc to 2aa01a25de 2023-05-12 19:24:00 +00:00 Compare
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch-ui/330
dan force-pushed detectNetwork from 2aa01a25de to 9e879d560f 2023-05-12 23:44:44 +00:00 Compare
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch-ui/334
sarah merged commit 0b0a5095f1 into trunk 2023-05-15 16:06:25 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/cwtch-ui#670
No description provided.