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 #213

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
75f4b28
Archive full windows Release folder
git-elliot Nov 16, 2024
98790a9
archive full macos
git-elliot Nov 16, 2024
8aa972d
Pre-release 1.1.0+30
git-elliot Nov 16, 2024
16103ae
Merge pull request #209 from osociety/archive-full-windows
git-elliot Nov 16, 2024
f4d0cac
Fix for windows and beta lane
git-elliot Nov 16, 2024
5f8aef9
Merge branch 'dev' into archive-full-windows
git-elliot Nov 16, 2024
f306cf3
Prepare v1.1.0+31
git-elliot Nov 16, 2024
d563cd9
Merge branch 'archive-full-windows' of https://github.com/osociety/ve…
git-elliot Nov 16, 2024
cb44803
Merge pull request #210 from osociety/archive-full-windows
git-elliot Nov 16, 2024
bda3e83
updated readme
git-elliot Nov 16, 2024
783b22b
Merge branch 'dev' of https://github.com/osociety/vernet into update-…
git-elliot Nov 16, 2024
48962f3
Merge pull request #211 from osociety/update-readme
git-elliot Nov 16, 2024
8db98e8
bug fix for windows
git-elliot Nov 16, 2024
a09f752
Upgrade dependencies
git-elliot Nov 17, 2024
c3d33f7
removed listener
git-elliot Nov 17, 2024
960c855
Run tests on matrix
git-elliot Nov 17, 2024
85906fa
conditional run
git-elliot Nov 17, 2024
0d33794
shorten workflow file
git-elliot Nov 17, 2024
15956b5
shrink workflow
git-elliot Nov 17, 2024
038bdbf
Merge pull request #212 from osociety/fix-analyzer
git-elliot Nov 17, 2024
33657c6
Merge branch 'main' into dev
git-elliot Nov 17, 2024
d5d1453
output branch properly
git-elliot Nov 17, 2024
31a154c
shorten expression
git-elliot Nov 17, 2024
1c66610
Merge branch 'dev' into fix-analyzer
git-elliot Nov 17, 2024
2683e16
Merge pull request #214 from osociety/fix-analyzer
git-elliot Nov 17, 2024
0ef609a
corrected output for branch
git-elliot Nov 17, 2024
324b7dd
added delay
git-elliot Nov 17, 2024
4748ecf
increase delay
git-elliot Nov 18, 2024
06b88a1
return in case of error
git-elliot Nov 18, 2024
ed7f827
fix tests
git-elliot Nov 18, 2024
78763b4
print logs
git-elliot Nov 18, 2024
26615e0
fix analyzer
git-elliot Nov 18, 2024
85ada08
localInterface added
git-elliot Nov 18, 2024
e8a5cc7
localInterface added
git-elliot Nov 18, 2024
03733cf
fix for tests
git-elliot Nov 20, 2024
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
2 changes: 0 additions & 2 deletions .github/workflows/flutter_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ jobs:
type: 'zip'
filename: ${{ env.MACOS_ZIP }}
directory: ${{ env.MACOS_BUILD_PATH }}
path: vernet.app

- name: Install Node 18
uses: actions/setup-node@v4
Expand Down Expand Up @@ -210,7 +209,6 @@ jobs:
type: 'zip'
filename: ${{ env.WINDOWS_ZIP }}
directory: ${{ env.WINDOWS_BUILD_PATH }}
path: vernet.exe

- name: Publish Windows Release
uses: softprops/action-gh-release@v1
Expand Down
147 changes: 43 additions & 104 deletions .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ jobs:
pull-requests: read
# Set job outputs to values from filter step
outputs:
lib: ${{ steps.filter.outputs.lib }}
test: ${{ steps.filter.outputs.test }}
android: ${{ steps.filter.outputs.android }}
linux: ${{ steps.filter.outputs.linux }}
macos: ${{ steps.filter.outputs.macos }}
yaml: ${{ steps.filter.outputs.yaml }}
windows: ${{ steps.filter.outputs.windows }}
lib: ${{ steps.filter.outputs.lib == 'true' }}
test: ${{ steps.filter.outputs.test == 'true' }}
android: ${{ steps.filter.outputs.android == 'true' }}
linux: ${{ steps.filter.outputs.linux == 'true' }}
macos: ${{ steps.filter.outputs.macos == 'true' }}
yaml: ${{ steps.filter.outputs.yaml == 'true' }}
windows: ${{ steps.filter.outputs.windows == 'true' }}
branch: ${{steps.extract_branch.outputs.branch}}
steps:
# For pull requests it's not necessary to checkout the code
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- uses: dorny/paths-filter@v3
id: filter
with:
Expand All @@ -49,16 +54,15 @@ jobs:

flutter-test:
name: 'Flutter Analyze + Test'
strategy:
matrix:
os: [macos, ubuntu, windows]
needs: changes
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.yaml == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' }}
runs-on: macos-latest
if: ${{ needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.yaml || needs.changes.outputs.android || needs.changes.outputs.linux || needs.changes.outputs.macos || needs.changes.outputs.windows }}
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Setup Java JDK
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -97,21 +101,27 @@ jobs:
run: flutter pub global activate coverage
- name: Run tests
run: flutter test
- name: Install Linux dependencies
if: ${{ (matrix.os == 'ubuntu') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.linux || needs.changes.outputs.yaml ) }}
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
- name: Run integration tests
if: ${{ steps.extract_branch.outputs.branch == 'dev' }}
run: flutter test integration_test --coverage -d macos
if: needs.changes.outputs.branch == 'dev'
run: flutter test integration_test --coverage -d ${{ matrix.os == 'ubuntu' && 'linux' || matrix.os }}
- name: Upload Coverage to CodeCov
if: ${{ steps.extract_branch.outputs.branch == 'dev' }}
if: needs.changes.outputs.branch == 'dev'
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage/lcov.info

android-linux-build:
name: 'Build Android + Linux'
flutter_build:
name: 'Build flutter'
strategy:
matrix:
os: [macos, windows, ubuntu]
needs: [changes, flutter-test]
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true' }}
runs-on: ubuntu-latest
if: ${{ (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.android || needs.changes.outputs.linux || needs.changes.outputs.macos || needs.changes.outputs.windows || needs.changes.outputs.yaml ) && (needs.changes.outputs.branch == 'dev') }}
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -141,53 +151,8 @@ jobs:
restore-keys: |
build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
build-runner-
- name: Download pub dependencies
run: flutter pub get
- name: Run build_runner
run: flutter pub run build_runner build
- name: Build Android
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.yaml == 'true' }}
run: |
flutter build apk --debug --flavor dev

# Run only if test, lib, and linux folder is changed
- name: Install Linux dependencies
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true' }}
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
- name: Build Linux
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true' }}
run: flutter build linux

macos-build:
name: 'Build Macos'
needs: [changes, flutter-test]
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.yaml == 'true' }}
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Flutter action
uses: subosito/[email protected]
with:
channel: stable
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
pub-cache-key: "flutter-pub-:os:-:channel:-:version:-:arch:-:hash:"
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Cache build runner
uses: actions/[email protected]
with:
path: |
**/.dart_tool
**/*.g.dart
**/*.mocks.dart
**/*.config.dart
key: build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
restore-keys: |
build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
build-runner-
- name: Cache pods
if: ${{ (matrix.os == 'macos') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.macos || needs.changes.outputs.yaml ) }}
uses: actions/cache@v3
with:
path: macos/Pods
Expand All @@ -199,41 +164,15 @@ jobs:
run: flutter pub get
- name: Run build_runner
run: flutter pub run build_runner build
- name: Build macos
run: flutter build macos

windows-build:
name: 'Build Windows'
needs: [changes, flutter-test]
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true' }}
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Flutter action
uses: subosito/[email protected]
with:
channel: stable
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
pub-cache-key: "flutter-pub-:os:-:channel:-:version:-:arch:-:hash:"
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Cache build runner
uses: actions/[email protected]
with:
path: |
**/.dart_tool
**/*.g.dart
**/*.mocks.dart
**/*.config.dart
key: build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
restore-keys: |
build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
build-runner-
- name: Download pub dependencies
run: flutter pub get
- name: Run build_runner
run: flutter pub run build_runner build
- name: Build windows
run: flutter build windows
- name: Build Android
if: ${{ (matrix.os == 'ubuntu') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.android || needs.changes.outputs.yaml )}}
run: |
flutter build apk --debug --flavor dev

# Run only if test, lib, and linux folder is changed
- name: Install Linux dependencies
if: ${{ (matrix.os == 'ubuntu') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.linux || needs.changes.outputs.yaml ) }}
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
- name: Build Linux
if: ${{ (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.linux || needs.changes.outputs.macos || needs.changes.outputs.windows || needs.changes.outputs.yaml ) }}
run: flutter build ${{ matrix.os == 'ubuntu' && 'linux' || matrix.os }}
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,19 @@ Note: macOS build hasn't been notarized yet.
4. Extract downloaded zip file.
5. Go to bundle folder and double click vernet file.

### Instruction for Windows
1. Star this repository.
2. Download vernet-windows.zip from [releases](https://github.com/git-elliot/vernet/releases/latest)
3. Extract downloaded zip file.
4. Run vernet.exe
5. Click on more info, tap on 'Run anyway'.
5. Give permission if asked.

## Contributors Required

1. Linux/Windows Tester
2. Documenter
1. Technical writer

Drop mail at [email protected]
Write us at [email protected]

## Publishing to F-droid
You can follow this guide to publish your app to f-droid - https://op3nsoc13ty.blogspot.com/2021/06/publish-your-first-flutter-app-to-fdroid.html
Expand Down
12 changes: 12 additions & 0 deletions android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ platform :android do

desc "Submit a new Beta Build to Crashlytics Beta"
lane :beta do
upload_to_play_store(skip_upload_metadata: true,
skip_upload_changelogs: true,
skip_upload_images: true,
skip_upload_screenshots: true,
track: 'beta', aab: '../build/app/outputs/bundle/storeRelease/app-store-release.aab')

# sh "your_script.sh"
# You can also use other beta testing services here
end

desc "Submit a new Beta Build to Crashlytics Beta"
lane :beta_full do
upload_to_play_store(track: 'beta', aab: '../build/app/outputs/bundle/storeRelease/app-store-release.aab')

# sh "your_script.sh"
Expand Down
1 change: 1 addition & 0 deletions android/fastlane/metadata/android/en-US/changelogs/30.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed dll files missing when running app on Windows
2 changes: 2 additions & 0 deletions android/fastlane/metadata/android/en-US/changelogs/31.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Compatibility issues fixed for windows
Scan slowness improved
2 changes: 2 additions & 0 deletions android/fastlane/metadata/android/en-US/changelogs/32.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Compatibility issues fixed for windows
Scan slowness improved
2 changes: 1 addition & 1 deletion integration_test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void main() {
await tester.tap(devicesButton);
await tester.pump();
expect(find.byType(AdaptiveListTile), findsAny);
await tester.pumpAndSettle();
await tester.pumpAndSettle(const Duration(seconds: 10));
await tester.pump();
expect(find.byType(AdaptiveListTile), findsAtLeast(2));

Expand Down
8 changes: 4 additions & 4 deletions lib/models/wifi_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
static const String noWifiName = 'Wi-Fi';

String get name {
if (_name == null || _name!.isEmpty) return noWifiName;
if (_name!.startsWith('"') && _name!.endsWith('"')) {
final array = _name!.split('"');
if (_name == null || _name.isEmpty) return noWifiName;
if (_name.startsWith('"') && _name.endsWith('"')) {
final array = _name.split('"');

Check warning on line 27 in lib/models/wifi_info.dart

View check run for this annotation

Codecov / codecov/patch

lib/models/wifi_info.dart#L26-L27

Added lines #L26 - L27 were not covered by tests
if (array.length > 1) {
final wifiName = array[1];
return wifiName.isEmpty ? noWifiName : wifiName;
}
}
return _name!;
return _name;

Check warning on line 33 in lib/models/wifi_info.dart

View check run for this annotation

Codecov / codecov/patch

lib/models/wifi_info.dart#L33

Added line #L33 was not covered by tests
}

String get bssid => _bssid ?? defaultBSSID.first;
Expand Down
8 changes: 7 additions & 1 deletion lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@
final wifiIP = await NetworkInfo().getWifiIP();
final wifiBSSID = await NetworkInfo().getWifiBSSID();
final wifiName = await NetworkInfo().getWifiName();
String? wifiGatewayIP;
try {
wifiGatewayIP = await NetworkInfo().getWifiGatewayIP();
} catch (e) {
debugPrint('Unimplemented error $e');

Check warning on line 52 in lib/pages/home_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/home_page.dart#L52

Added line #L52 was not covered by tests
}
final gatewayIp = appSettings.customSubnet.isNotEmpty
? appSettings.customSubnet
: await NetworkInfo().getWifiGatewayIP() ?? '';
: (wifiGatewayIP ?? wifiIP) ?? '';
final bool isLocationOn = (Platform.isAndroid || Platform.isIOS) &&
await Permission.location.serviceStatus.isEnabled;
_wifiInfo = WifiInfo(
Expand Down
40 changes: 29 additions & 11 deletions lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,51 @@
Initialized event,
Emitter<HostScanState> emit,
) async {
final info = NetworkInfo();
devicesSet.clear();
mDnsDevices.clear();
emit(const HostScanState.loadInProgress());
await initializeWifiParameters(emit);
if (appSettings.runScanOnStartup) {
add(const HostScanEvent.loadScan());
} else {
add(const HostScanEvent.startNewScan());
String? wifiGatewayIP;
try {
wifiGatewayIP = await info.getWifiGatewayIP();
} catch (e) {
debugPrint('Unimplemented error $e');

Check warning on line 57 in lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart#L57

Added line #L57 was not covered by tests
}
}

Future<void> initializeWifiParameters(Emitter<HostScanState> emit) async {
final wifiGatewayIP = await NetworkInfo().getWifiGatewayIP();
ip = await NetworkInfo().getWifiIP();
ip = await info.getWifiIP();
final interface = await NetInterface.localInterface();
if (appSettings.customSubnet.isNotEmpty) {
gatewayIp = appSettings.customSubnet;
debugPrint('Taking gatewayIp from appSettings: $gatewayIp');

Check warning on line 63 in lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart#L63

Added line #L63 was not covered by tests
} else if (wifiGatewayIP != null) {
gatewayIp = wifiGatewayIP;
} else {
debugPrint(
'Taking gatewayIp from NetworkInfo().getWifiGatewayIP(): $gatewayIp',
);
} else if (ip != null) {

Check warning on line 69 in lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart#L69

Added line #L69 was not covered by tests
// NetworkInfo().getWifiGatewayIP() is null on android 35, so fail-safe
// to NetworkInfo().getWifiIP()
gatewayIp = ip;
debugPrint('Taking gatewayIp from NetworkInfo().getWifiIP(): $gatewayIp');

Check warning on line 73 in lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart#L73

Added line #L73 was not covered by tests
} else if (interface != null) {
gatewayIp = interface.ipAddress;
debugPrint(
'Taking gatewayIp from NetInterface.localInterface(): $gatewayIp',

Check warning on line 77 in lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart#L75-L77

Added lines #L75 - L77 were not covered by tests
);
}
if (gatewayIp == null) {
emit(const HostScanState.error());
return Future.error('Can not get wifi details');

Check warning on line 82 in lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart#L82

Added line #L82 was not covered by tests
}
subnet = gatewayIp!.substring(0, gatewayIp!.lastIndexOf('.'));
if (subnet == null) {
emit(const HostScanState.error());
return Future.error('Can not get wifi details');

Check warning on line 87 in lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart#L86-L87

Added lines #L86 - L87 were not covered by tests
}
if (appSettings.runScanOnStartup) {
add(const HostScanEvent.loadScan());

Check warning on line 90 in lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart#L90

Added line #L90 was not covered by tests
} else {
add(const HostScanEvent.startNewScan());
}
}

Future<void> _startNewScanBuiltInIsolate(
Expand Down
Loading
Loading