Skip to content

Commit

Permalink
Merge pull request #165 from osociety/dev
Browse files Browse the repository at this point in the history
Dev -> Main
  • Loading branch information
git-elliot authored Apr 9, 2024
2 parents f39e7cb + a8900aa commit 84c13c1
Show file tree
Hide file tree
Showing 128 changed files with 786 additions and 192 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ open_collective: # Replace with a single Open Collective username
ko_fi: fs0c13ty # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
liberapay: OpenSociety
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
41 changes: 28 additions & 13 deletions .github/workflows/flutter_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
LINUX_BUILD_PATH: ${{ vars.LINUX_BUILD_PATH }}
MACOS_BUILD_PATH: ${{ vars.MACOS_BUILD_PATH }}
WINDOWS_BUILD_PATH: ${{ vars.WINDOWS_BUILD_PATH }}
MACOS_DMG_PATH: installers/dmg_creator

jobs:
release-android-and-linux:
Expand Down Expand Up @@ -92,7 +93,7 @@ jobs:
SUPPLY_PACKAGE_NAME: '${{ secrets.ANDROID_PACKAGE_NAME }}'
SUPPLY_JSON_KEY_DATA: '${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}'
working-directory: android/
run: bundle exec fastlane android deploy
run: bundle exec fastlane android ${{ github.event.release.prerelease && 'beta' || 'deploy' }}

- name: Build Android App and Linux Bundle
# Use signing keys for release instead of debug
Expand All @@ -102,16 +103,16 @@ jobs:
- name: Rename ANDROID APKs
run: |
mv ${{vars.ANDROID_BUILD_PATH}}/${{env.ANDROID_APK_ARM_V7A}} ${{vars.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V7A}}
mv ${{vars.ANDROID_BUILD_PATH}}/${{env.ANDROID_APK_ARM_V8A}} ${{vars.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V8A}}
mv ${{vars.ANDROID_BUILD_PATH}}/${{env.ANDROID_APK_x86_64}} ${{vars.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_x86_64}}
mv ${{ env.ANDROID_BUILD_PATH}}/${{env.ANDROID_APK_ARM_V7A}} ${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V7A}}
mv ${{ env.ANDROID_BUILD_PATH}}/${{env.ANDROID_APK_ARM_V8A}} ${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V8A}}
mv ${{ env.ANDROID_BUILD_PATH}}/${{env.ANDROID_APK_x86_64}} ${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_x86_64}}
- name: Linux Archive
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: ${{ env.LINUX_ZIP }}
directory: ${{ vars.LINUX_BUILD_PATH }}
directory: ${{ env.LINUX_BUILD_PATH }}

- name: Publish Android Release
uses: softprops/action-gh-release@v1
Expand All @@ -120,22 +121,23 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
${{vars.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V7A}}
${{vars.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V8A}}
${{vars.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_x86_64}}
${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V7A}}
${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_ARM_V8A}}
${{ env.ANDROID_BUILD_PATH}}/Vernet-${{github.ref_name}}-${{env.ANDROID_APK_x86_64}}
- name: Publish Linux Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ vars.LINUX_BUILD_PATH }}/${{ env.LINUX_ZIP }}
files: ${{ env.LINUX_BUILD_PATH }}/${{ env.LINUX_ZIP }}

release-macos:
runs-on: macos-latest
env:
MACOS_ZIP: Vernet-${{github.ref_name}}-macos.zip
MACOS_DMG: Vernet-${{github.ref_name}}-macos.dmg
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -162,16 +164,29 @@ jobs:
with:
type: 'zip'
filename: ${{ env.MACOS_ZIP }}
directory: ${{ vars.MACOS_BUILD_PATH }}
directory: ${{ env.MACOS_BUILD_PATH }}
path: vernet.app

- name: Install Node 18
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install Appdmg and Create dmg
working-directory: ${{ env.MACOS_DMG_PATH }}
run: |
npm install -g appdmg
appdmg ./config.json ./${{ env.MACOS_DMG }}
- name: Publish macOS Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ vars.MACOS_BUILD_PATH }}/${{ env.MACOS_ZIP }}
files: |
${{ env.MACOS_BUILD_PATH }}/${{ env.MACOS_ZIP }}
${{ env.MACOS_DMG_PATH }}/${{ env.MACOS_DMG }}
release-windows:
runs-on: windows-latest
Expand Down Expand Up @@ -203,7 +218,7 @@ jobs:
with:
type: 'zip'
filename: ${{ env.WINDOWS_ZIP }}
directory: ${{ vars.WINDOWS_BUILD_PATH }}
directory: ${{ env.WINDOWS_BUILD_PATH }}
path: vernet.exe

- name: Publish Windows Release
Expand All @@ -212,4 +227,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ vars.WINDOWS_BUILD_PATH }}/${{ env.WINDOWS_ZIP }}
files: ${{ env.WINDOWS_BUILD_PATH }}/${{ env.WINDOWS_ZIP }}
107 changes: 102 additions & 5 deletions .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
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 }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v3
Expand All @@ -39,11 +41,15 @@ jobs:
- 'linux/**'
macos:
- 'macos/**'
yaml:
- '*.yaml'
windows:
- 'windows/**'
android-linux-build:
name: 'Android / Linux Build'
needs: changes
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' }}
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
steps:
- name: Checkout
Expand Down Expand Up @@ -93,14 +99,105 @@ jobs:
- name: Run tests
run: flutter test
- name: Build Android
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true'}}
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'}}
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'}}
run: flutter 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: 'Macos Build'
needs: changes
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/checkout@v3

- name: Flutter action
uses: subosito/[email protected]
with:
channel: stable

- name: Flutter version
run: flutter --version

- name: Cache pubspec dependencies
uses: actions/[email protected]
with:
path: |
${{ env.FLUTTER_HOME }}/.pub-cache
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
build-pubspec-
- name: Cache build runner
uses: actions/cache@v2
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-
- name: Download pub dependencies
run: flutter pub get

- name: Upgrade pub dependencies
run: flutter pub upgrade

- name: Run build_runner
run: flutter pub run build_runner build --delete-conflicting-outputs

- name: Run analyzer
run: flutter analyze

- name: Run tests
run: flutter test

- name: Build macos
run: flutter build macos

windows-build:
name: 'Windows Build'
needs: changes
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/checkout@v3

- name: Flutter action
uses: subosito/[email protected]
with:
channel: stable

- name: Download pub dependencies
run: flutter pub get

- name: Upgrade pub dependencies
run: flutter pub upgrade

- name: Run build_runner
run: flutter pub run build_runner build --delete-conflicting-outputs

- name: Run analyzer
run: flutter analyze

- name: Run tests
run: flutter test

- name: Build windows
run: flutter build windows
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Vernet - Network Analyzer and Monitoring Tool

|Vernet|Home|Devices|Open Ports|Dark Home|Settings|
|-|-|-|-|-|-|
|<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" width = "100">|<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" width = "100">|<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" width = "100">|<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/5.png" width = "100">|<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/7.png" width = "100">|<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/8.png" width = "100">|
|<img src="android/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" width = "100">|<img src="android/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" width = "100">|<img src="android/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" width = "100">|<img src="android/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png" width = "100">|<img src="android/fastlane/metadata/android/en-US/images/phoneScreenshots/7.png" width = "100">|<img src="android/fastlane/metadata/android/en-US/images/phoneScreenshots/8.png" width = "100">|

## Download

Expand Down Expand Up @@ -66,7 +66,7 @@ Drop mail at [email protected]

| Librepay |
|----------|
|<noscript><a href="https://liberapay.com/OpenSociety/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></noscript>|
|[![Librepay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/OpenSociety/donate)

3. Support me on Ko-Fi

Expand Down
1 change: 1 addition & 0 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<!-- Add the block below to your manifest file to configure apps with action.VIEW intent filters as visible to your app -->
<queries>
<intent>
Expand Down
11 changes: 1 addition & 10 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<!-- Add the block below to your manifest file to configure apps with action.VIEW intent filters as visible to your app -->
<queries>
<intent>
Expand Down Expand Up @@ -30,19 +31,9 @@
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable-hdpi/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable-mdpi/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions android/app/src/main/res/drawable-night/launch_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 6 additions & 9 deletions android/app/src/main/res/drawable-v21/launch_background.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 6 additions & 9 deletions android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>
21 changes: 21 additions & 0 deletions android/app/src/main/res/values-night-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#000000</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
Loading

0 comments on commit 84c13c1

Please sign in to comment.