Skip to content
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
18 changes: 16 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,25 @@ jobs:
flutter gen-l10n
- name: Build Android APK
run: flutter build apk --release
- name: Upload APK artifact
- name: Save Google Play APK
run: |
mkdir -p ./apk-artifacts
cp ./build/app/outputs/flutter-apk/app-release.apk ./apk-artifacts/app-release.apk
- name: Prepare F-Droid Build
run: bash scripts/prepare-fdroid-build.sh
- name: Build F-Droid APK
run: |
flutter clean
flutter pub get
flutter build apk --release
- name: Save F-Droid APK
run: |
cp ./build/app/outputs/flutter-apk/app-release.apk ./apk-artifacts/wormhole-android-openSource.apk
- name: Upload APK artifacts
uses: actions/upload-artifact@v5
with:
name: android-apk
path: ./build/app/outputs/flutter-apk/app-release.apk
path: ./apk-artifacts/
- name: Setup Ruby
if: ${{ inputs.release }}
uses: ruby/setup-ruby@v1
Expand Down
7 changes: 7 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ PODS:
- Flutter
- image_picker_ios (0.0.1):
- Flutter
- mobile_scanner (7.0.0):
- Flutter
- FlutterMacOS
- open_filex (0.0.2):
- Flutter
- path_provider_foundation (0.0.1):
Expand Down Expand Up @@ -86,6 +89,7 @@ DEPENDENCIES:
- flutter_zxing (from `.symlinks/plugins/flutter_zxing/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/darwin`)
- open_filex (from `.symlinks/plugins/open_filex/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
Expand Down Expand Up @@ -121,6 +125,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/fluttertoast/ios"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
mobile_scanner:
:path: ".symlinks/plugins/mobile_scanner/darwin"
open_filex:
:path: ".symlinks/plugins/open_filex/ios"
path_provider_foundation:
Expand Down Expand Up @@ -153,6 +159,7 @@ SPEC CHECKSUMS:
flutter_zxing: e8bcc43bd3056c70c271b732ed94e7a16fd62f93
fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1
image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a
mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93
open_filex: 432f3cd11432da3e39f47fcc0df2b1603854eff1
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
Expand Down
33 changes: 27 additions & 6 deletions lib/pages/qr_scanner_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_zxing/flutter_zxing.dart';
import 'package:mobile_scanner/mobile_scanner.dart';
import 'package:provider/provider.dart';
import 'package:vibration/vibration.dart';

Expand Down Expand Up @@ -48,12 +49,32 @@ class QrScannerPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BackPopContext(
child: ReaderWidget(
tryInverted: true,
onScan: (result) async {
_onQrDetect(result.text, context);
},
),
child: _buildMobileScannerWidget(context),
);
}

// ignore: unused_element
Widget _buildFlutterZxingWidget(BuildContext context) {
return ReaderWidget(
tryInverted: true,
onScan: (result) async {
_onQrDetect(result.text, context);
},
);
}

// ignore: unused_element
Widget _buildMobileScannerWidget(BuildContext context) {
return MobileScanner(
onDetect: (capture) {
final List<Barcode> barcodes = capture.barcodes;
for (final barcode in barcodes) {
if (barcode.rawValue != null) {
_onQrDetect(barcode.rawValue, context);
break;
}
}
},
);
}
}
4 changes: 4 additions & 0 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
#include "generated_plugin_registrant.h"

#include <file_selector_linux/file_selector_plugin.h>
#include <gtk/gtk_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) gtk_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
gtk_plugin_register_with_registrar(gtk_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
Expand Down
1 change: 1 addition & 0 deletions linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux
gtk
url_launcher_linux
)

Expand Down
4 changes: 4 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
import FlutterMacOS
import Foundation

import app_links
import device_info_plus
import file_picker
import file_selector_macos
import mobile_scanner
import path_provider_foundation
import share_plus
import shared_preferences_foundation
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
Expand Down
6 changes: 6 additions & 0 deletions macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
PODS:
- app_links (6.4.1):
- FlutterMacOS
- device_info_plus (0.0.1):
- FlutterMacOS
- file_picker (0.0.1):
Expand All @@ -22,6 +24,7 @@ PODS:
- FlutterMacOS

DEPENDENCIES:
- app_links (from `Flutter/ephemeral/.symlinks/plugins/app_links/macos`)
- device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`)
- file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`)
- file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`)
Expand All @@ -34,6 +37,8 @@ DEPENDENCIES:
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)

EXTERNAL SOURCES:
app_links:
:path: Flutter/ephemeral/.symlinks/plugins/app_links/macos
device_info_plus:
:path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos
file_picker:
Expand All @@ -56,6 +61,7 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos

SPEC CHECKSUMS:
app_links: 05a6ec2341985eb05e9f97dc63f5837c39895c3f
device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76
file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a
file_selector_macos: 6280b52b459ae6c590af5d78fc35c7267a3c4b31
Expand Down
28 changes: 18 additions & 10 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -640,26 +640,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
url: "https://pub.dev"
source: hosted
version: "10.0.9"
version: "11.0.2"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
version: "3.0.9"
version: "3.0.10"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.0.2"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -724,6 +724,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.0"
mobile_scanner:
dependency: "direct main"
description:
name: mobile_scanner
sha256: "023a71afb4d7cfb5529d0f2636aa8b43db66257905b9486d702085989769c5f2"
url: "https://pub.dev"
source: hosted
version: "7.1.3"
msix:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -1148,10 +1156,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.4"
version: "0.7.6"
toggle_switch:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1244,10 +1252,10 @@ packages:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.2.0"
vibration:
dependency: "direct main"
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ dependencies:
flutter_close_app:
path: packages/flutter_close_app
flutter_zxing: ^2.2.1
mobile_scanner: ^7.1.3
device_info_plus: ^12.1.0
rust_lib_wormhole:
path: rust_builder
Expand Down
27 changes: 27 additions & 0 deletions scripts/prepare-fdroid-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
# This script prepares the codebase for F-Droid build by replacing the QR scanner
# implementation to use only flutter_zxing instead of mobile_scanner

set -e

SCANNER_FILE="lib/pages/qr_scanner_page.dart"
PUBSPEC_FILE="pubspec.yaml"

# Replace the conditional logic to use flutter_zxing on all platforms
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's/_buildMobileScannerWidget(context)/_buildFlutterZxingWidget(context)/g' "$SCANNER_FILE"
sed -i '' '/mobile_scanner:/d' "$PUBSPEC_FILE"
sed -i '' "/import 'package:mobile_scanner\/mobile_scanner.dart';/d" "$SCANNER_FILE"
sed -i '' '/Widget _buildMobileScannerWidget/,/^ }/d' "$SCANNER_FILE"
else
sed -i 's/_buildMobileScannerWidget(context)/_buildFlutterZxingWidget(context)/g' "$SCANNER_FILE"
sed -i '/mobile_scanner:/d' "$PUBSPEC_FILE"
sed -i "/import 'package:mobile_scanner\/mobile_scanner.dart';/d" "$SCANNER_FILE"
sed -i '/Widget _buildMobileScannerWidget/,/^ }/d' "$SCANNER_FILE"
fi

echo "F-Droid build preparation complete:"
echo " - Replaced _buildMobileScannerWidget with _buildFlutterZxingWidget"
echo " - Removed _buildMobileScannerWidget method from qr_scanner_page.dart"
echo " - Removed mobile_scanner import from qr_scanner_page.dart"
echo " - Removed mobile_scanner dependency from pubspec.yaml"
3 changes: 3 additions & 0 deletions windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@

#include "generated_plugin_registrant.h"

#include <app_links/app_links_plugin_c_api.h>
#include <file_selector_windows/file_selector_windows.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <share_plus/share_plus_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
AppLinksPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("AppLinksPluginCApi"));
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
Expand Down
1 change: 1 addition & 0 deletions windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
app_links
file_selector_windows
permission_handler_windows
share_plus
Expand Down
Loading