a mirror of DefinedNet/mobile_nebula
Go to file
Ian VanSchooten 78640437f1
Update Gradle, replace QR code reader library (#162)
I ran the Gradle Upgrade Assistant to get us on the latest version of gradle, but two of our dependencies didn't support it.

- https://pub.dev/documentation/package_info/latest/
- https://github.com/AmolGangadhare/flutter_barcode_scanner

`pacakge_info` is officially deprecated and replaced by `package_info_plus`, which is what I've swapped to here.

A bigger change was switching to https://github.com/juliansteenbakker/mobile_scanner.  It does seem to work a bit better than the other one, and does not throw an error now when cancelling the QR code collection, as it did before.  I've tested on android in the simulator, and iOS with an actual device.  

To test adding a cert:
1. Create a CA on your computer with `nebula-cert ca -name test-mobile`.  This will create a `ca.crt` and `ca.key`
2. Tap the + button in the mobile app to add a site
3. Tap the "Certificate" row
4. Copy the public key to a file on your computer like `test.pub`
5. Create a signed cert with `nebula-cert sign -name test-mobile -ip 192.168.0.20/24 -in-pub test.pub`
6. Create a QR code for it: `nebula-cert print -out-qr "qr.png" -path ./test-mobile.crt`
7. In Android studio, in the "Running devices" tab, open the simulator's extended controls:  
<img width="509" alt="Android Studio 2024-09-23 13 08 08" src="https://github.com/user-attachments/assets/c1f8288e-374c-457c-942a-4109240102ab">

8. Choose the Camera option, and add the qr code image to the wall of the virtual scene
<img width="679" alt="image" src="https://github.com/user-attachments/assets/bafaa9af-72e4-4444-9704-9876c53c883c">

9. Back in the app, when you choose QR Code and "Scan a QR code`, the virtual scene should open.  Hold shift, then move your mouse to look around.  Turn around 180 degrees, and walk forward into the other room (can go through the walls) using the `w` key.  When you get the QR code into the white border, the scanner should close and apply the certificate settings.  If you use a nonsense QR code, or a QR code with a non-matching key, or a CA QR code, you should get an error message when it scans.

The process for scanning a CA qr code is similar.  

1. Run `nebula-cert print -out-qr "qr-ca.png" -path ./ca.crt`
2. Replace the QR in the extended controls
3. Tap CA when adding a site
4. The rest of the process is the same as above.

iOS is similar, except you'll need to use a real device, as the simulator does not include a virtual scene like Android does.
2024-09-24 07:25:09 -04:00
.github/workflows Update Flutter, target android SDK 34 (#160) 2024-09-20 14:19:23 -04:00
android Update Gradle, replace QR code reader library (#162) 2024-09-24 07:25:09 -04:00
fonts Initial commit 2020-07-27 15:43:58 -05:00
images Support DN host enrollment (#86) 2022-11-17 16:43:16 -05:00
ios Update Gradle, replace QR code reader library (#162) 2024-09-24 07:25:09 -04:00
lib Update Gradle, replace QR code reader library (#162) 2024-09-24 07:25:09 -04:00
nebula Update Gradle, replace QR code reader library (#162) 2024-09-24 07:25:09 -04:00
.git-blame-ignore-revs git blame ignore that the format merge (#39) 2021-05-03 17:00:29 -05:00
.gitignore Rebind against nebula 1.6 for relays, modernize build (#63) 2022-08-04 19:39:46 -05:00
.metadata Initial commit 2020-07-27 15:43:58 -05:00
CHANGELOG.md Fix date 2021-06-09 20:31:00 -05:00
README.md Update Flutter, target android SDK 34 (#160) 2024-09-20 14:19:23 -04:00
env.sh.example Initial commit 2020-07-27 15:43:58 -05:00
gen-artifacts.sh Upgrade to flutter 3 (#70) 2022-09-21 15:27:35 -05:00
pubspec.lock Update Gradle, replace QR code reader library (#162) 2024-09-24 07:25:09 -04:00
pubspec.yaml Update Gradle, replace QR code reader library (#162) 2024-09-24 07:25:09 -04:00

README.md

Mobile Nebula

Play Store | App Store

Setting up dev environment

Install all of the following things:

Ensure your path is set up correctly to execute flutter

Run flutter doctor and fix everything it complains before proceeding

NOTE on iOS, always open Runner.xcworkspace and NOT the Runner.xccodeproj

Before first compile

  • Copy env.sh.example and set it up for your machine
  • Ensure you have run gomobile init
  • In Android Studio, make sure you have the current ndk installed by going to Tools -> SDK Manager, go to the SDK Tools tab, check the Show package details box, expand the NDK section and select 21.1.6352462 version.
  • Ensure you have downloaded an ndk via android studio, this is likely not the default one and you need to check the Show package details box to select the correct version. The correct version comes from the error when you try and compile
  • Make sure you have gem installed with sudo gem install
  • If on MacOS arm, sudo gem install ffi -- --enable-libffi-alloc

If you are having issues with iOS pods, try blowing it all away! cd ios && rm -rf Pods/ Podfile.lock && pod install --repo-update

Formatting

flutter format can be used to format the code in lib and test but it's default is 80 char line limit, it's 2020

Use:

flutter format lib/ test/ -l 120

Release

Update version in pubspec.yaml to reflect this release, then

Android

flutter build appbundle

This will create an android app bundle at build/app/outputs/bundle/release/

Upload the android bundle to the google play store https://play.google.com/apps/publish

iOS

In xcode, Release -> Archive then follow the directions to upload to the app store. If you have issues, https://flutter.dev/docs/deployment/ios#create-a-build-archive