diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index 7d9ad274..00000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,214 +0,0 @@
-name: Build and Release
-
-on:
- push:
- tags:
- - 'v[0-9]+.[0-9]+.[0-9]+'
- workflow_dispatch:
-
-jobs:
-
- build-linux:
- runs-on: ubuntu-24.04
- container:
- image: stackwallet/stackwallet-ci:latest
- strategy:
- matrix:
- include:
- - target: x86_64-unknown-linux-gnu
- asset: libmwc_wallet-linux-x86_64.so
- - target: aarch64-unknown-linux-gnu
- asset: libmwc_wallet-linux-aarch64.so
- steps:
- - uses: actions/checkout@v6
-
- - name: Add Rust target
- run: rustup target add ${{ matrix.target }}
-
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: rust
- key: linux-${{ matrix.target }}
-
- - name: Build
- env:
- CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
- run: |
- cd rust
- cargo build --target ${{ matrix.target }} --release --lib
- cp target/${{ matrix.target }}/release/libmwc_wallet.so ${{ matrix.asset }}
-
- - uses: actions/upload-artifact@v4
- with:
- name: ${{ matrix.asset }}
- path: rust/${{ matrix.asset }}
-
- build-android:
- runs-on: ubuntu-24.04
- container:
- image: stackwallet/stackwallet-ci:latest
- strategy:
- matrix:
- include:
- - target: aarch64-linux-android
- abi: arm64-v8a
- - target: armv7-linux-androideabi
- abi: armeabi-v7a
- - target: x86_64-linux-android
- abi: x86_64
- steps:
- - uses: actions/checkout@v6
-
- - name: Add Rust target
- run: rustup target add ${{ matrix.target }}
-
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: rust
- key: android-${{ matrix.abi }}
-
- - name: Build
- env:
- ANDROID_NDK_ROOT: /opt/android-ndk-r28
- run: |
- cd rust
- cargo ndk --target ${{ matrix.target }} --platform 21 build --release
- cp target/${{ matrix.target }}/release/libmwc_wallet.so \
- libmwc_wallet-android-${{ matrix.abi }}.so
-
- - uses: actions/upload-artifact@v4
- with:
- name: libmwc_wallet-android-${{ matrix.abi }}.so
- path: rust/libmwc_wallet-android-${{ matrix.abi }}.so
-
- build-ios:
- runs-on: macos-latest
- steps:
- - uses: actions/checkout@v6
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: '1.85.1'
- targets: aarch64-apple-ios
-
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: rust
-
- - name: Install cbindgen
- run: cargo install cbindgen --version 0.24.3
-
- - name: Build
- run: |
- cd rust
- export IPHONEOS_DEPLOYMENT_TARGET=15.0
- export RUSTFLAGS="-C link-arg=-mios-version-min=15.0"
- cargo build --release --target aarch64-apple-ios --lib
- cp target/aarch64-apple-ios/release/libmwc_wallet.a libmwc_wallet-ios-aarch64.a
- cbindgen src/lib.rs -l c > libmwc_wallet.h
-
- - uses: actions/upload-artifact@v4
- with:
- name: libmwc_wallet-ios-aarch64.a
- path: rust/libmwc_wallet-ios-aarch64.a
-
- - uses: actions/upload-artifact@v4
- with:
- name: libmwc_wallet.h
- path: rust/libmwc_wallet.h
-
- build-macos:
- runs-on: macos-latest
- steps:
- - uses: actions/checkout@v6
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: '1.85.1'
- targets: aarch64-apple-darwin
-
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: rust
-
- - name: Install cbindgen
- run: cargo install cbindgen --version 0.24.3
-
- - name: Build
- run: |
- cd rust
- cbindgen src/lib.rs -l c > libmwc_wallet.h
- cargo build --target aarch64-apple-darwin --release --lib
-
- mkdir -p Headers
- cp libmwc_wallet.h Headers/
-
- xcodebuild -create-xcframework \
- -library target/aarch64-apple-darwin/release/libmwc_wallet.a \
- -headers Headers/libmwc_wallet.h \
- -output MWCWallet.xcframework
- zip -r MWCWallet.xcframework.zip MWCWallet.xcframework
-
- - uses: actions/upload-artifact@v4
- with:
- name: MWCWallet.xcframework.zip
- path: rust/MWCWallet.xcframework.zip
-
- build-windows:
- runs-on: ubuntu-24.04
- container:
- image: stackwallet/stackwallet-ci:latest
- steps:
- - uses: actions/checkout@v6
-
- - name: Add Rust target
- run: rustup target add x86_64-pc-windows-gnu
-
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: rust
-
- - name: Build
- run: |
- cd rust
- cargo build --target x86_64-pc-windows-gnu --release --lib
- cp target/x86_64-pc-windows-gnu/release/mwc_wallet.dll \
- libmwc_wallet-windows-x86_64.dll
- cp "$(x86_64-w64-mingw32-gcc -print-file-name=libstdc++-6.dll)" libstdc++-6.dll
- cp "$(x86_64-w64-mingw32-gcc -print-file-name=libgcc_s_seh-1.dll)" libgcc_s_seh-1.dll
-
- - uses: actions/upload-artifact@v4
- with:
- name: libmwc_wallet-windows-x86_64.dll
- path: rust/libmwc_wallet-windows-x86_64.dll
-
- - uses: actions/upload-artifact@v4
- with:
- name: libstdc++-6.dll
- path: rust/libstdc++-6.dll
-
- - uses: actions/upload-artifact@v4
- with:
- name: libgcc_s_seh-1.dll
- path: rust/libgcc_s_seh-1.dll
-
- release:
- needs: [build-linux, build-android, build-ios, build-macos, build-windows]
- runs-on: ubuntu-latest
- permissions:
- contents: write
- steps:
- - uses: actions/download-artifact@v4
- with:
- path: artifacts
- merge-multiple: true
-
- - name: Generate checksums
- run: |
- cd artifacts
- sha256sum * > checksums.txt
-
- - uses: softprops/action-gh-release@v2
- with:
- generate_release_notes: true
- files: artifacts/*
diff --git a/.gitignore b/.gitignore
index 8d1914e6..96486fd9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,23 +28,3 @@ migrate_working_dir/
.dart_tool/
.packages
build/
-rust/src/bin
-android/src/main/jniLibs/
-rust/default/
-ios/include/
-ios/libs/
-macos/framework/
-rust/libepic_cash_wallet.h
-lib/git_versions.dart
-
-scripts/windows/vcpkg/
-scripts/linux/flutter_libmwc_bins/
-scripts/ios/flutter_libmwc_bins/
-scripts/android/flutter_libmwc_bins/
-scripts/windows/flutter_libmwc_bins/
-scripts/macos/flutter_libmwc_bins/
-scripts/android/cache/
-scripts/android/build/openssl/
-
-linux/bin/
-
diff --git a/.metadata b/.metadata
deleted file mode 100644
index 542e116a..00000000
--- a/.metadata
+++ /dev/null
@@ -1,42 +0,0 @@
-# This file tracks properties of this Flutter project.
-# Used by Flutter tool to assess capabilities and perform upgrades etc.
-#
-# This file should be version controlled.
-
-version:
- revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- channel: beta
-
-project_type: plugin
-
-# Tracks metadata for the flutter migrate command
-migration:
- platforms:
- - platform: root
- create_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- base_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- - platform: android
- create_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- base_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- - platform: ios
- create_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- base_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- - platform: linux
- create_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- base_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- - platform: macos
- create_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- base_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- - platform: windows
- create_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
- base_revision: bcea432bce54a83306b3c00a7ad0ed98f777348d
-
- # User provided section
-
- # List of Local paths (relative to this file) that should be
- # ignored by the migrate tool.
- #
- # Files that are not part of the templates will be ignored by default.
- unmanaged_files:
- - 'lib/main.dart'
- - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/README.md b/README.md
index 0a9f24be..1a31294b 100644
--- a/README.md
+++ b/README.md
@@ -1,78 +1,28 @@
# `flutter_libmwc`
-## Dependencies
-### Rust
-Install Rust: https://www.rust-lang.org/tools/install
-### `cargo-ndk`
-```sh
-cargo install cargo-ndk
-```
-
-# Android
-## Add targets to rust
-```sh
-rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android
-```
+Requires Dart 3.13+, Flutter 3.47+, and Rust 1.90.0 (pinned in
+`rust/rust-toolchain.toml`). Install Rust with [rustup](https://rustup.rs/)
+and make sure `rustup`, `cargo`, and `rustc` are on `PATH`.
-## Install dependencies
-```sh
-# https://github.com/mwcproject/mwc-node/blob/master/doc/build.md#requirements
-sudo apt install build-essential \
- cmake \
- git \
- libgit2-dev \
- clang \
- debhelper \
- libclang-dev \
- libncurses5-dev \
- libncursesw5-dev \
- zlib1g-dev \
- pkg-config \
- llvm \
- cargo \
- rustc \
- opencl-headers \
- libssl-dev \
- ocl-icd-opencl-dev \
- libc6-dev-i386
-```
+The [build hook](https://dart.dev/tools/hooks) compiles `rust/` with
+[native_toolchain_rust](https://pub.dev/packages/native_toolchain_rust).
+Flutter bundles the resulting native asset, and `lib/mwc.dart` resolves its
+symbols using `@Native`. No manual library copying or build scripts are needed.
-## Build
-```sh
-cd scripts/android
-./install_ndk.sh
-./build_all.sh
-```
+Install the native build tools required by the Rust dependencies: a C/C++
+compiler, CMake, libclang, pkg-config, Perl (for vendored OpenSSL), and `protoc`.
+Use Xcode for Apple targets, Android SDK/NDK r27+ for Android, and Visual Studio's
+Desktop development with C++ workload for Windows (MSVC).
-# iOS
-## Add targets to rust
```sh
-rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
+flutter pub get
+cd example
+flutter run
```
-## Install dependencies
-```sh
-cargo install cargo-lipo
-cargo install cbindgen
-```
-
-## Build
-```sh
-cd scripts/ios
-./build_all
-```
-
-# Windows
-## Dependencies
-Run `scripts/windows/deps.sh` (may need to alter permissions like with `chmod +x *.sh`) to install x86_64-w64-mingw32-gcc and clang or run
-```sh
-sudo apt-get install clang gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64
-```
-
-## Building for Windows
-Run `scripts/windows/build_all.sh`
-
-Libraries will be output to `scripts/windows/build`
+The first build downloads Rust targets and Cargo dependencies. Later builds
+reuse the build cache. `flutter test` also runs the hook and needs the native
+build tools.
-## Building on Windows
-`build_all.ps1` is not confirmed working and may need work eg. may need some missing dependencies added but has been included as a starting point or example for Windows users
+Wallet APIs remain in `lib/lib.dart` and `lib/mwc.dart`. The generated
+`FlutterLibmwc.getPlatformVersion()` API and platform plugin scaffolding are removed.
diff --git a/analysis_options.yaml b/analysis_options.yaml
index a5744c1c..e46654b9 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1,3 +1,6 @@
+analyzer:
+ exclude:
+ - build/**
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
diff --git a/android/.gitignore b/android/.gitignore
deleted file mode 100644
index 161bdcda..00000000
--- a/android/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
-.cxx
diff --git a/android/build.gradle b/android/build.gradle
deleted file mode 100644
index d6404015..00000000
--- a/android/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-group 'com.example.flutter_libmwc'
-version = "1.0-SNAPSHOT"
-
-buildscript {
- ext.kotlin_version = "1.8.22"
- repositories {
- google()
- mavenCentral()
- }
-
- dependencies {
- classpath("com.android.tools.build:gradle:8.7.0")
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
- }
-}
-
-allprojects {
- repositories {
- google()
- mavenCentral()
- }
-}
-
-apply plugin: "com.android.library"
-apply plugin: "kotlin-android"
-
-android {
- namespace = "com.example.flutter_libmwc"
-
- compileSdk = 34
-
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
- }
-
- kotlinOptions {
- jvmTarget = JavaVersion.VERSION_11
- }
-
- sourceSets {
- main.java.srcDirs += "src/main/kotlin"
- test.java.srcDirs += "src/test/kotlin"
- }
-
- defaultConfig {
- minSdk = 21
- }
-
- dependencies {
- testImplementation("org.jetbrains.kotlin:kotlin-test")
- testImplementation("org.mockito:mockito-core:5.0.0")
- }
-
- testOptions {
- unitTests.all {
- useJUnitPlatform()
-
- testLogging {
- events "passed", "skipped", "failed", "standardOut", "standardError"
- outputs.upToDateWhen {false}
- showStandardStreams = true
- }
- }
- }
-}
\ No newline at end of file
diff --git a/android/settings.gradle b/android/settings.gradle
deleted file mode 100644
index 65e853c7..00000000
--- a/android/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-rootProject.name = 'flutter_libmwc'
diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml
deleted file mode 100644
index 72973a0f..00000000
--- a/android/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
diff --git a/android/src/main/kotlin/com/example/flutter_libmwc/FlutterLibmwcPlugin.kt b/android/src/main/kotlin/com/example/flutter_libmwc/FlutterLibmwcPlugin.kt
deleted file mode 100644
index 3d84eed0..00000000
--- a/android/src/main/kotlin/com/example/flutter_libmwc/FlutterLibmwcPlugin.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.example.flutter_libmwc
-
-import androidx.annotation.NonNull
-
-import io.flutter.embedding.engine.plugins.FlutterPlugin
-import io.flutter.plugin.common.MethodCall
-import io.flutter.plugin.common.MethodChannel
-import io.flutter.plugin.common.MethodChannel.MethodCallHandler
-import io.flutter.plugin.common.MethodChannel.Result
-
-/** FlutterLibmwcPlugin */
-class FlutterLibmwcPlugin: FlutterPlugin, MethodCallHandler {
- /// The MethodChannel that will the communication between Flutter and native Android
- ///
- /// This local reference serves to register the plugin with the Flutter Engine and unregister it
- /// when the Flutter Engine is detached from the Activity
- private lateinit var channel : MethodChannel
-
- override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
- channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flutter_libmwc")
- channel.setMethodCallHandler(this)
- }
-
- override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
- if (call.method == "getPlatformVersion") {
- result.success("Android ${android.os.Build.VERSION.RELEASE}")
- } else {
- result.notImplemented()
- }
- }
-
- override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
- channel.setMethodCallHandler(null)
- }
-}
diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml
index 61b6c4de..641939dc 100644
--- a/example/analysis_options.yaml
+++ b/example/analysis_options.yaml
@@ -7,6 +7,14 @@
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
+analyzer:
+ exclude:
+ - build/**
+ - android/**
+ - ios/**
+ - windows/**
+ - macos/**
+ - linux/**
include: package:flutter_lints/flutter.yaml
linter:
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
index afb47436..a225b37e 100644
--- a/example/android/app/build.gradle
+++ b/example/android/app/build.gradle
@@ -7,7 +7,7 @@ plugins {
android {
namespace = "com.example.flutter_libmwc_example"
compileSdkVersion flutter.compileSdkVersion
- ndkVersion = "28.0.13004108"
+ ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
diff --git a/example/android/gradle.properties b/example/android/gradle.properties
index 24863d21..475a6280 100644
--- a/example/android/gradle.properties
+++ b/example/android/gradle.properties
@@ -1,3 +1,7 @@
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
-android.enableJetifier=true
\ No newline at end of file
+android.enableJetifier=true
+# This builtInKotlin flag was added automatically by Flutter migrator
+android.builtInKotlin=false
+# This newDsl flag was added automatically by Flutter migrator
+android.newDsl=false
diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties
index afa1e8eb..a20f2c46 100644
--- a/example/android/gradle/wrapper/gradle-wrapper.properties
+++ b/example/android/gradle/wrapper/gradle-wrapper.properties
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-all.zip
diff --git a/example/android/settings.gradle.kts b/example/android/settings.gradle.kts
index a439442c..9d5a6fef 100644
--- a/example/android/settings.gradle.kts
+++ b/example/android/settings.gradle.kts
@@ -18,8 +18,8 @@ pluginManagement {
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
- id("com.android.application") version "8.7.0" apply false
- id("org.jetbrains.kotlin.android") version "1.8.22" apply false
+ id("com.android.application") version "9.1.0" apply false
+ id("org.jetbrains.kotlin.android") version "2.4.0" apply false
}
include(":app")
diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist
index 7c569640..391a902b 100644
--- a/example/ios/Flutter/AppFrameworkInfo.plist
+++ b/example/ios/Flutter/AppFrameworkInfo.plist
@@ -20,7 +20,5 @@
????
CFBundleVersion
1.0
- MinimumOSVersion
- 12.0
diff --git a/example/ios/Podfile b/example/ios/Podfile
deleted file mode 100644
index 279576f3..00000000
--- a/example/ios/Podfile
+++ /dev/null
@@ -1,41 +0,0 @@
-# Uncomment this line to define a global platform for your project
-# platform :ios, '12.0'
-
-# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
-ENV['COCOAPODS_DISABLE_STATS'] = 'true'
-
-project 'Runner', {
- 'Debug' => :debug,
- 'Profile' => :release,
- 'Release' => :release,
-}
-
-def flutter_root
- generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
- unless File.exist?(generated_xcode_build_settings_path)
- raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
- end
-
- File.foreach(generated_xcode_build_settings_path) do |line|
- matches = line.match(/FLUTTER_ROOT\=(.*)/)
- return matches[1].strip if matches
- end
- raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
-end
-
-require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
-
-flutter_ios_podfile_setup
-
-target 'Runner' do
- use_frameworks!
- use_modular_headers!
-
- flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
-end
-
-post_install do |installer|
- installer.pods_project.targets.each do |target|
- flutter_additional_ios_build_settings(target)
- end
-end
diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock
deleted file mode 100644
index 7d59cd16..00000000
--- a/example/ios/Podfile.lock
+++ /dev/null
@@ -1,35 +0,0 @@
-PODS:
- - Flutter (1.0.0)
- - flutter_libmwc (0.0.1):
- - Flutter
- - flutter_secure_storage (6.0.0):
- - Flutter
- - path_provider_foundation (0.0.1):
- - Flutter
- - FlutterMacOS
-
-DEPENDENCIES:
- - Flutter (from `Flutter`)
- - flutter_libmwc (from `.symlinks/plugins/flutter_libmwc/ios`)
- - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
-
-EXTERNAL SOURCES:
- Flutter:
- :path: Flutter
- flutter_libmwc:
- :path: ".symlinks/plugins/flutter_libmwc/ios"
- flutter_secure_storage:
- :path: ".symlinks/plugins/flutter_secure_storage/ios"
- path_provider_foundation:
- :path: ".symlinks/plugins/path_provider_foundation/darwin"
-
-SPEC CHECKSUMS:
- Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
- flutter_libmwc: f4da999f066aca84a1cf36ee7a07783d6fd60bd0
- flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
- path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
-
-PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011
-
-COCOAPODS: 1.16.2
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index 5984781e..3c022a2a 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -3,15 +3,15 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 54;
+ objectVersion = 60;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
- 691380758CC22DC9D3F277D6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5122E5E8914BCA0A2C2F4799 /* Pods_Runner.framework */; };
+ 691380758CC22DC9D3F277D6 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
- 7E21C418286CCA2000AAD51C /* libmwc_wallet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E21C417286CC9D300AAD51C /* libmwc_wallet.a */; };
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -31,16 +31,13 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
- 00CFD668A28E7015400EB5AB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
- 5122E5E8914BCA0A2C2F4799 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- 695833138848C959BF0519F2 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
- 7E21C417286CC9D300AAD51C /* libmwc_wallet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmwc_wallet.a; path = ../../ios/libs/libmwc_wallet.a; sourceTree = ""; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -48,7 +45,6 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- AED36B0C7C730D9CD7248626 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -56,26 +52,18 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 7E21C418286CCA2000AAD51C /* libmwc_wallet.a in Frameworks */,
- 691380758CC22DC9D3F277D6 /* Pods_Runner.framework in Frameworks */,
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
+ 691380758CC22DC9D3F277D6 /* BuildFile in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
- 7E21C416286CC9D300AAD51C /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 7E21C417286CC9D300AAD51C /* libmwc_wallet.a */,
- 5122E5E8914BCA0A2C2F4799 /* Pods_Runner.framework */,
- );
- name = Frameworks;
- sourceTree = "";
- };
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
+ 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@@ -90,7 +78,6 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
- 7E21C416286CC9D300AAD51C /* Frameworks */,
F34876B28F009223BCE9EE80 /* Pods */,
);
sourceTree = "";
@@ -121,9 +108,6 @@
F34876B28F009223BCE9EE80 /* Pods */ = {
isa = PBXGroup;
children = (
- AED36B0C7C730D9CD7248626 /* Pods-Runner.debug.xcconfig */,
- 695833138848C959BF0519F2 /* Pods-Runner.release.xcconfig */,
- 00CFD668A28E7015400EB5AB /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "";
@@ -135,20 +119,21 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
- 52B17A7EEF2E0D2A36E64159 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
- E41D75C4B591BFB514DD6999 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
+ packageProductDependencies = (
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
+ );
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
@@ -177,6 +162,9 @@
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
+ packageReferences = (
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
+ );
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -217,28 +205,6 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
- 52B17A7EEF2E0D2A36E64159 /* [CP] Check Pods Manifest.lock */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- );
- inputPaths = (
- "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
- "${PODS_ROOT}/Manifest.lock",
- );
- name = "[CP] Check Pods Manifest.lock";
- outputFileListPaths = (
- );
- outputPaths = (
- "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
- showEnvVarsInLog = 0;
- };
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
@@ -254,23 +220,6 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
- E41D75C4B591BFB514DD6999 /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
- );
- name = "[CP] Embed Pods Frameworks";
- outputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -346,7 +295,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -364,14 +313,11 @@
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 4DQKUWSG6C;
ENABLE_BITCODE = NO;
- HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../../ios/include/";
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
- LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/../../ios/libs/";
- ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibmwcExample;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_INSTALLED_PRODUCT = NO;
@@ -429,7 +375,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -478,7 +424,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -498,14 +444,11 @@
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 4DQKUWSG6C;
ENABLE_BITCODE = NO;
- HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../../ios/include/";
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
- LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/../../ios/libs/";
- ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibmwcExample;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_INSTALLED_PRODUCT = NO;
@@ -526,14 +469,11 @@
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 4DQKUWSG6C;
ENABLE_BITCODE = NO;
- HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../../ios/include/";
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
- LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/../../ios/libs/";
- ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibmwcExample;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_INSTALLED_PRODUCT = NO;
@@ -568,6 +508,20 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
+
+/* Begin XCLocalSwiftPackageReference section */
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
+ isa = XCLocalSwiftPackageReference;
+ relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCLocalSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
+ isa = XCSwiftPackageProductDependency;
+ productName = FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index c53e2b31..5db441f5 100644
--- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -5,6 +5,24 @@
+
+
+
+
+
+
+
+
+
+
Bool {
- let dummy = get_mnemonic()
- print(dummy)
- GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
+
+ func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
+ GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
+ }
}
diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist
index 9f02d664..c1ff03ef 100644
--- a/example/ios/Runner/Info.plist
+++ b/example/ios/Runner/Info.plist
@@ -4,6 +4,8 @@
+ CADisableMinimumFrameDurationOnPhone
+
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleDisplayName
@@ -26,6 +28,29 @@
$(FLUTTER_BUILD_NUMBER)
LSRequiresIPhoneOS
+ UIApplicationSceneManifest
+
+ UIApplicationSupportsMultipleScenes
+
+ UISceneConfigurations
+
+ UIWindowSceneSessionRoleApplication
+
+
+ UISceneClassName
+ UIWindowScene
+ UISceneConfigurationName
+ flutter
+ UISceneDelegateClassName
+ FlutterSceneDelegate
+ UISceneStoryboardFile
+ Main
+
+
+
+
+ UIApplicationSupportsIndirectInputEvents
+
UILaunchStoryboardName
LaunchScreen
UIMainStoryboardFile
@@ -45,9 +70,5 @@
UIViewControllerBasedStatusBarAppearance
- CADisableMinimumFrameDurationOnPhone
-
- UIApplicationSupportsIndirectInputEvents
-
diff --git a/example/ios/Runner/Runner-Bridging-Header.h b/example/ios/Runner/Runner-Bridging-Header.h
index f606b6c1..308a2a56 100644
--- a/example/ios/Runner/Runner-Bridging-Header.h
+++ b/example/ios/Runner/Runner-Bridging-Header.h
@@ -1,2 +1 @@
#import "GeneratedPluginRegistrant.h"
-#import "libmwc_wallet.h"
\ No newline at end of file
diff --git a/example/linux/CMakeLists.txt b/example/linux/CMakeLists.txt
index 882b6676..3963d8b9 100644
--- a/example/linux/CMakeLists.txt
+++ b/example/linux/CMakeLists.txt
@@ -116,13 +116,11 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
- install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../linux/bin/aarch64-unknown-linux-gnu/release/libmwc_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
- COMPONENT Runtime)
-else()
- install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../linux/bin/x86_64-unknown-linux-gnu/release/libmwc_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
- COMPONENT Runtime)
-endif()
+# Copy the native assets provided by build hooks.
+set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/")
+install(DIRECTORY "${NATIVE_ASSETS_DIR}"
+ DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
+ COMPONENT Runtime)
foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
install(FILES "${bundled_library}"
diff --git a/example/linux/flutter/generated_plugin_registrant.cc b/example/linux/flutter/generated_plugin_registrant.cc
index 7d5778bc..e71a16d2 100644
--- a/example/linux/flutter/generated_plugin_registrant.cc
+++ b/example/linux/flutter/generated_plugin_registrant.cc
@@ -6,14 +6,6 @@
#include "generated_plugin_registrant.h"
-#include
-#include
void fl_register_plugins(FlPluginRegistry* registry) {
- g_autoptr(FlPluginRegistrar) flutter_libmwc_registrar =
- fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLibmwcPlugin");
- flutter_libmwc_plugin_register_with_registrar(flutter_libmwc_registrar);
- g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
- fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
- flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
}
diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake
index d783b01e..2e1de87a 100644
--- a/example/linux/flutter/generated_plugins.cmake
+++ b/example/linux/flutter/generated_plugins.cmake
@@ -3,8 +3,6 @@
#
list(APPEND FLUTTER_PLUGIN_LIST
- flutter_libmwc
- flutter_secure_storage_linux
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift
index a751210f..e777c67d 100644
--- a/example/macos/Flutter/GeneratedPluginRegistrant.swift
+++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift
@@ -5,12 +5,8 @@
import FlutterMacOS
import Foundation
-import flutter_libmwc
-import flutter_secure_storage_macos
import path_provider_foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
- FlutterLibmwcPlugin.register(with: registry.registrar(forPlugin: "FlutterLibmwcPlugin"))
- FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}
diff --git a/example/macos/Podfile b/example/macos/Podfile
deleted file mode 100644
index b52666a1..00000000
--- a/example/macos/Podfile
+++ /dev/null
@@ -1,43 +0,0 @@
-platform :osx, '10.15'
-
-# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
-ENV['COCOAPODS_DISABLE_STATS'] = 'true'
-
-project 'Runner', {
- 'Debug' => :debug,
- 'Profile' => :release,
- 'Release' => :release,
-}
-
-def flutter_root
- generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
- unless File.exist?(generated_xcode_build_settings_path)
- raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
- end
-
- File.foreach(generated_xcode_build_settings_path) do |line|
- matches = line.match(/FLUTTER_ROOT\=(.*)/)
- return matches[1].strip if matches
- end
- raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
-end
-
-require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
-
-flutter_macos_podfile_setup
-
-target 'Runner' do
- use_frameworks!
- use_modular_headers!
-
- flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
- target 'RunnerTests' do
- inherit! :search_paths
- end
-end
-
-post_install do |installer|
- installer.pods_project.targets.each do |target|
- flutter_additional_macos_build_settings(target)
- end
-end
diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock
deleted file mode 100644
index 70e7e365..00000000
--- a/example/macos/Podfile.lock
+++ /dev/null
@@ -1,35 +0,0 @@
-PODS:
- - flutter_libmwc (0.0.1):
- - FlutterMacOS
- - flutter_secure_storage_macos (6.1.1):
- - FlutterMacOS
- - FlutterMacOS (1.0.0)
- - path_provider_foundation (0.0.1):
- - Flutter
- - FlutterMacOS
-
-DEPENDENCIES:
- - flutter_libmwc (from `Flutter/ephemeral/.symlinks/plugins/flutter_libmwc/macos`)
- - flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`)
- - FlutterMacOS (from `Flutter/ephemeral`)
- - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
-
-EXTERNAL SOURCES:
- flutter_libmwc:
- :path: Flutter/ephemeral/.symlinks/plugins/flutter_libmwc/macos
- flutter_secure_storage_macos:
- :path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos
- FlutterMacOS:
- :path: Flutter/ephemeral
- path_provider_foundation:
- :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
-
-SPEC CHECKSUMS:
- flutter_libmwc: 4b7ab10c2a3f56427321c59522f4510077e9ce80
- flutter_secure_storage_macos: 59459653abe1adb92abbc8ea747d79f8d19866c9
- FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
- path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
-
-PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3
-
-COCOAPODS: 1.16.2
diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj
index 1d5ce6ec..2b441c76 100644
--- a/example/macos/Runner.xcodeproj/project.pbxproj
+++ b/example/macos/Runner.xcodeproj/project.pbxproj
@@ -21,15 +21,14 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
- 15FC616BF051A40AB25C1736 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B90493CF6A8F2641DAD6133 /* Pods_RunnerTests.framework */; };
331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; };
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
- 45F7B46D4DA546C53EA3E564 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68D9B63D1C14310DFEF4C3E8 /* Pods_Runner.framework */; };
597997492A66C4E9005C8118 /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 597997482A66C4E9005C8118 /* libsqlite3.0.tbd */; };
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -63,9 +62,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
- 0B600740C319EDC7F276DA34 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
- 2E01FB27E01C30C56C0F95FF /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; };
- 2EC423808221639C81EDCF81 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; };
331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; };
@@ -82,14 +78,10 @@
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; };
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; };
- 3B90493CF6A8F2641DAD6133 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
597997482A66C4E9005C8118 /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; };
- 68D9B63D1C14310DFEF4C3E8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; };
- 84C178BB559C075464A94ADD /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; };
- 9A1902DBCC9F3E0F13C4DF3E /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
- A9D4558C220FA10BA9691490 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -97,7 +89,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 15FC616BF051A40AB25C1736 /* Pods_RunnerTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -105,8 +96,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
597997492A66C4E9005C8118 /* libsqlite3.0.tbd in Frameworks */,
- 45F7B46D4DA546C53EA3E564 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -167,6 +158,7 @@
33CEB47122A05771004F2AC0 /* Flutter */ = {
isa = PBXGroup;
children = (
+ 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */,
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
@@ -191,12 +183,6 @@
99B0AC85F8162C4683418BEB /* Pods */ = {
isa = PBXGroup;
children = (
- 0B600740C319EDC7F276DA34 /* Pods-Runner.debug.xcconfig */,
- A9D4558C220FA10BA9691490 /* Pods-Runner.release.xcconfig */,
- 9A1902DBCC9F3E0F13C4DF3E /* Pods-Runner.profile.xcconfig */,
- 84C178BB559C075464A94ADD /* Pods-RunnerTests.debug.xcconfig */,
- 2E01FB27E01C30C56C0F95FF /* Pods-RunnerTests.release.xcconfig */,
- 2EC423808221639C81EDCF81 /* Pods-RunnerTests.profile.xcconfig */,
);
path = Pods;
sourceTree = "";
@@ -205,8 +191,6 @@
isa = PBXGroup;
children = (
597997482A66C4E9005C8118 /* libsqlite3.0.tbd */,
- 68D9B63D1C14310DFEF4C3E8 /* Pods_Runner.framework */,
- 3B90493CF6A8F2641DAD6133 /* Pods_RunnerTests.framework */,
);
name = Frameworks;
sourceTree = "";
@@ -218,7 +202,6 @@
isa = PBXNativeTarget;
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = (
- FD91C6B4D07B03B7FF77F8FD /* [CP] Check Pods Manifest.lock */,
331C80D1294CF70F00263BE5 /* Sources */,
331C80D2294CF70F00263BE5 /* Frameworks */,
331C80D3294CF70F00263BE5 /* Resources */,
@@ -237,13 +220,11 @@
isa = PBXNativeTarget;
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
- 67A4BDB3DFF1B24C53725CE4 /* [CP] Check Pods Manifest.lock */,
33CC10E92044A3C60003C045 /* Sources */,
33CC10EA2044A3C60003C045 /* Frameworks */,
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
- 823272A914EAD7788A8EB6B2 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -251,6 +232,9 @@
33CC11202044C79F0003C045 /* PBXTargetDependency */,
);
name = Runner;
+ packageProductDependencies = (
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
+ );
productName = Runner;
productReference = 33CC10ED2044A3C60003C045 /* example.app */;
productType = "com.apple.product-type.application";
@@ -294,6 +278,9 @@
Base,
);
mainGroup = 33CC10E42044A3C60003C045;
+ packageReferences = (
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
+ );
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -363,67 +350,6 @@
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
};
- 67A4BDB3DFF1B24C53725CE4 /* [CP] Check Pods Manifest.lock */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- );
- inputPaths = (
- "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
- "${PODS_ROOT}/Manifest.lock",
- );
- name = "[CP] Check Pods Manifest.lock";
- outputFileListPaths = (
- );
- outputPaths = (
- "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
- showEnvVarsInLog = 0;
- };
- 823272A914EAD7788A8EB6B2 /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
- );
- name = "[CP] Embed Pods Frameworks";
- outputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
- FD91C6B4D07B03B7FF77F8FD /* [CP] Check Pods Manifest.lock */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- );
- inputPaths = (
- "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
- "${PODS_ROOT}/Manifest.lock",
- );
- name = "[CP] Check Pods Manifest.lock";
- outputFileListPaths = (
- );
- outputPaths = (
- "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
- showEnvVarsInLog = 0;
- };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -475,7 +401,6 @@
/* Begin XCBuildConfiguration section */
331C80DB294CF71000263BE5 /* Debug */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 84C178BB559C075464A94ADD /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
@@ -490,7 +415,6 @@
};
331C80DC294CF71000263BE5 /* Release */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 2E01FB27E01C30C56C0F95FF /* Pods-RunnerTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
@@ -505,7 +429,6 @@
};
331C80DD294CF71000263BE5 /* Profile */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 2EC423808221639C81EDCF81 /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
@@ -556,7 +479,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.15;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
@@ -635,7 +558,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.15;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
@@ -682,7 +605,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.15;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
@@ -789,6 +712,20 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
+
+/* Begin XCLocalSwiftPackageReference section */
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
+ isa = XCLocalSwiftPackageReference;
+ relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCLocalSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
+ isa = XCSwiftPackageProductDependency;
+ productName = FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCSwiftPackageProductDependency section */
};
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
}
diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index ac78810c..ee5d00fc 100644
--- a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -5,6 +5,24 @@
+
+
+
+
+
+
+
+
+
+
=3.8.0-0 <4.0.0"
- flutter: ">=3.24.0"
+ dart: ">=3.13.0 <4.0.0"
+ flutter: ">=3.47.0"
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index 495a3a83..5b7ccc2f 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -1,12 +1,13 @@
name: flutter_libmwc_example
description: Demonstrates how to use the flutter_libmwc plugin.
+version: 1.0.0
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
environment:
- sdk: ">=3.0.0 <4.0.0"
+ sdk: ">=3.13.0 <4.0.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
@@ -17,7 +18,7 @@ environment:
dependencies:
flutter:
sdk: flutter
- path_provider: ^2.0.15
+ path_provider: ^2.1.6
flutter_libmwc:
# When depending on this package from a real application you should use:
@@ -29,7 +30,6 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
- flutter_secure_storage: ^8.0.0
numeric_keyboard: ^1.1.0
dev_dependencies:
diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart
index 89937fe4..02a1f273 100644
--- a/example/test/widget_test.dart
+++ b/example/test/widget_test.dart
@@ -1,19 +1,9 @@
-import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import '../lib/main.dart';
void main() {
testWidgets('FFI Test App starts up', (WidgetTester tester) async {
- // Mock the MethodChannel for the test
- TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(
- const MethodChannel('flutter_libmwc'),
- (MethodCall methodCall) async {
- // Return empty string for any method call during testing
- return '';
- },
- );
-
// Build our app and trigger a frame.
await tester.pumpWidget(const FFITestApp());
diff --git a/example/windows/CMakeLists.txt b/example/windows/CMakeLists.txt
index 1153d978..4ab092af 100644
--- a/example/windows/CMakeLists.txt
+++ b/example/windows/CMakeLists.txt
@@ -80,8 +80,11 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/windows/build/libmwc_wallet.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
- COMPONENT Runtime)
+# Copy the native assets provided by build hooks.
+set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/")
+install(DIRECTORY "${NATIVE_ASSETS_DIR}"
+ DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
+ COMPONENT Runtime)
if(PLUGIN_BUNDLED_LIBRARIES)
install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc
index 76ddde48..8b6d4680 100644
--- a/example/windows/flutter/generated_plugin_registrant.cc
+++ b/example/windows/flutter/generated_plugin_registrant.cc
@@ -6,12 +6,6 @@
#include "generated_plugin_registrant.h"
-#include
-#include
void RegisterPlugins(flutter::PluginRegistry* registry) {
- FlutterLibmwcPluginCApiRegisterWithRegistrar(
- registry->GetRegistrarForPlugin("FlutterLibmwcPluginCApi"));
- FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
- registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
}
diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake
index 37d3f3f8..b93c4c30 100644
--- a/example/windows/flutter/generated_plugins.cmake
+++ b/example/windows/flutter/generated_plugins.cmake
@@ -3,8 +3,6 @@
#
list(APPEND FLUTTER_PLUGIN_LIST
- flutter_libmwc
- flutter_secure_storage_windows
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
diff --git a/hook/build.dart b/hook/build.dart
new file mode 100644
index 00000000..e365d1d2
--- /dev/null
+++ b/hook/build.dart
@@ -0,0 +1,72 @@
+import 'dart:io';
+
+import 'package:code_assets/code_assets.dart';
+import 'package:hooks/hooks.dart';
+import 'package:native_toolchain_rust/native_toolchain_rust.dart';
+
+void main(List args) async {
+ await build(args, (input, output) async {
+ if (!input.config.buildCodeAssets) return;
+
+ final code = input.config.code;
+
+ // OpenSSL refuses to build for a non-Windows target using Windows' perl.
+ if (Platform.isWindows && code.targetOS != OS.windows) {
+ throw UnsupportedError(
+ 'Cannot build ${code.targetOS} from Windows; use Linux, macOS, or WSL.',
+ );
+ }
+
+ final environment = {
+ if (code.targetOS == OS.iOS)
+ 'IPHONEOS_DEPLOYMENT_TARGET': '${code.iOS.targetVersion}.0',
+ if (code.targetOS == OS.macOS)
+ 'MACOSX_DEPLOYMENT_TARGET': '${code.macOS.targetVersion}.0',
+ };
+ if (code.targetOS == OS.android) {
+ // native_toolchain_rust 1.0.6 defaults to API 35. Honor Flutter's minimum.
+ final (rustTarget, clangTarget) = switch (code.targetArchitecture) {
+ Architecture.arm => (
+ 'armv7-linux-androideabi',
+ 'armv7a-linux-androideabi',
+ ),
+ Architecture.arm64 => (
+ 'aarch64-linux-android',
+ 'aarch64-linux-android',
+ ),
+ Architecture.x64 => ('x86_64-linux-android', 'x86_64-linux-android'),
+ _ => throw UnsupportedError('Unsupported Android architecture'),
+ };
+ final bin = code.cCompiler!.compiler.resolve('.');
+ final suffix = Platform.isWindows ? '.cmd' : '';
+ final ndkTarget = '$clangTarget${code.android.targetNdkApi}';
+ final compiler = '$ndkTarget-clang';
+ final cc = bin.resolve('$compiler$suffix').toFilePath();
+ final target = rustTarget.replaceAll('-', '_');
+ environment.addAll({
+ 'CC_$target': cc,
+ 'CXX_$target': bin.resolve('$compiler++$suffix').toFilePath(),
+ // cc also supplies --target; keep the API level on the final argument.
+ 'CFLAGS_$target': '--target=$ndkTarget',
+ 'CXXFLAGS_$target': '--target=$ndkTarget',
+ // The NDK's libc++.a linker script includes libc++abi as well.
+ // Defer it to the final link instead of bundling the script in an rlib.
+ 'CXXSTDLIB_$target': 'static:-bundle=c++',
+ 'CARGO_TARGET_${target.toUpperCase()}_LINKER': cc,
+ });
+ }
+
+ await RustBuilder(
+ assetName: 'mwc.dart',
+ extraCargoBuildArgs: ['--lib'],
+ extraCargoEnvironmentVariables: environment,
+ ).run(input: input, output: output);
+ output.dependencies.addAll(
+ [
+ 'rust/Cargo.toml',
+ 'rust/Cargo.lock',
+ 'rust/rust-toolchain.toml',
+ ].map(input.packageRoot.resolve),
+ );
+ });
+}
diff --git a/ios/.gitignore b/ios/.gitignore
deleted file mode 100644
index 0c885071..00000000
--- a/ios/.gitignore
+++ /dev/null
@@ -1,38 +0,0 @@
-.idea/
-.vagrant/
-.sconsign.dblite
-.svn/
-
-.DS_Store
-*.swp
-profile
-
-DerivedData/
-build/
-GeneratedPluginRegistrant.h
-GeneratedPluginRegistrant.m
-
-.generated/
-
-*.pbxuser
-*.mode1v3
-*.mode2v3
-*.perspectivev3
-
-!default.pbxuser
-!default.mode1v3
-!default.mode2v3
-!default.perspectivev3
-
-xcuserdata
-
-*.moved-aside
-
-*.pyc
-*sync/
-Icon?
-.tags*
-
-/Flutter/Generated.xcconfig
-/Flutter/ephemeral/
-/Flutter/flutter_export_environment.sh
\ No newline at end of file
diff --git a/ios/Assets/.gitkeep b/ios/Assets/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/ios/Classes/FlutterLibmwcPlugin.h b/ios/Classes/FlutterLibmwcPlugin.h
deleted file mode 100644
index d65124b2..00000000
--- a/ios/Classes/FlutterLibmwcPlugin.h
+++ /dev/null
@@ -1,95 +0,0 @@
-#import
-#include
-#include
-#include
-#include
-
-
-@interface FlutterLibmwcPlugin : NSObject
-@end
-
-// NOTE: put the lines from the include here whenever new api functions are added.
-
-const char *mwc_wallet_init(const char *config,
- const char *mnemonic,
- const char *password,
- const char *name);
-
-const char *mwc_get_mnemonic(void);
-
-const char *mwc_rust_open_wallet(const char *config,
- const char *password);
-
-const char *mwc_rust_wallet_balances(const char *wallet,
- const char *refresh,
- const char *min_confirmations);
-
-const char *mwc_rust_recover_from_mnemonic(const char *config,
- const char *password,
- const char *mnemonic,
- const char *name);
-
-const char *mwc_rust_wallet_scan_outputs(const char *wallet,
- const char *start_height,
- const char *number_of_blocks);
-
-const char *mwc_rust_create_tx(const char *wallet,
- const char *amount,
- const char *to_address,
- const char *secret_key_index,
- const char *mwcmqs_config,
- const char *minimum_confirmations,
- const char *note);
-
-const char *mwc_rust_txs_get(const char *wallet, const char *refresh_from_node);
-
-const char *mwc_rust_tx_cancel(const char *wallet, const char *tx_id);
-
-const char *mwc_rust_get_chain_height(const char *config);
-
-const char *mwc_rust_delete_wallet(const char *wallet,
- const char *mwcmqs_config);
-
-const char *mwc_rust_get_wallet_address(const char *wallet,
- const char *index,
- const char *mwcmqs_config);
-
-const char *mwc_rust_validate_address(const char *address);
-
-const char *mwc_rust_get_tx_fees(const char *wallet,
- const char *c_amount,
- const char *min_confirmations);
-
-const char *mwc_rust_tx_send_http(const char *wallet,
- const char *selection_strategy_is_use_all,
- const char *minimum_confirmations,
- const char *message,
- const char *amount,
- const char *address);
-
-const char *mwc_rust_init_logs(const char *config);
-
-const char *mwc_rust_encode_slatepack(const char *slate_json, const char *recipient_address);
-
-const char *mwc_rust_encode_slatepack_enhanced(const char *wallet,
- const char *slate_json,
- const char *recipient_address);
-
-const char *mwc_rust_decode_slatepack(const char *slatepack_str);
-
-const char *mwc_rust_decode_slatepack_enhanced(const char *wallet, const char *slatepack_str);
-
-const char *mwc_rust_tx_receive(const char *wallet, const char *slate_json);
-
-const char *mwc_rust_tx_finalize(const char *wallet, const char *slate_json);
-
-const char *mwc_rust_tx_init(const char *wallet,
- const char *selection_strategy_is_use_all,
- const char *minimum_confirmations,
- const char *message,
- const char *amount);
-
-void *mwc_rust_mwcmqs_listener_start(const char *wallet,
- const char *mwcmqs_config);
-
-const char *mwc_listener_cancel(const char *handler);
diff --git a/ios/Classes/FlutterLibmwcPlugin.m b/ios/Classes/FlutterLibmwcPlugin.m
deleted file mode 100644
index 2e7f1c5a..00000000
--- a/ios/Classes/FlutterLibmwcPlugin.m
+++ /dev/null
@@ -1,15 +0,0 @@
-#import "FlutterLibmwcPlugin.h"
-#if __has_include()
-#import
-#else
-// Support project import fallback if the generated compatibility header
-// is not copied when this plugin is created as a library.
-// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
-#import "flutter_libmwc-Swift.h"
-#endif
-
-@implementation FlutterLibmwcPlugin
-+ (void)registerWithRegistrar:(NSObject*)registrar {
- [SwiftFlutterLibmwcPlugin registerWithRegistrar:registrar];
-}
-@end
diff --git a/ios/Classes/SwiftFlutterLibmwcPlugin.swift b/ios/Classes/SwiftFlutterLibmwcPlugin.swift
deleted file mode 100644
index a6a22080..00000000
--- a/ios/Classes/SwiftFlutterLibmwcPlugin.swift
+++ /dev/null
@@ -1,61 +0,0 @@
-import Flutter
-import UIKit
-
-public class SwiftFlutterLibmwcPlugin: NSObject, FlutterPlugin {
- public static func register(with registrar: FlutterPluginRegistrar) {
- let channel = FlutterMethodChannel(name: "flutter_libmwc", binaryMessenger: registrar.messenger())
- let instance = SwiftFlutterLibmwcPlugin()
- registrar.addMethodCallDelegate(instance, channel: channel)
- }
-
- public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
- result("iOS " + UIDevice.current.systemVersion)
- }
-
-// TODO whenever mwc is updated with new functions, they need to be dummy called here.
- public func dummyMethodToEnforceBundling() {
- mwc_wallet_init("const char *config",
- "const char *mnemonic",
- "const char *password",
- "const char *name");
- mwc_get_mnemonic();
- mwc_rust_open_wallet("const char *config",
- "const char *password");
- mwc_rust_wallet_balances("const char *wallet", "const char *refresh", "const char *min_confirmations");
- mwc_rust_recover_from_mnemonic("const char *config",
- "const char *password",
- "const char *mnemonic",
- "const char *name");
-
- mwc_rust_wallet_scan_outputs("const char *wallet",
- "const char *start_height", "onst char *number_of_blocks");
-
- mwc_rust_create_tx("const char *wallet",
- "const char *amount",
- "const char *to_address",
- "const char *secret_key_index", "const char *mwcmqs_config",
- "const char *minimum_confirmations", "const char *note");
- mwc_rust_txs_get("const char *wallet",
- "const char *refresh_from_node");
- mwc_rust_tx_cancel("const char *wallet", "const char *tx_id");
-
- mwc_rust_get_chain_height("const char *config");
- mwc_rust_delete_wallet("const char *wallet",
- "const char *mwcmqs_config");
- mwc_rust_get_wallet_address("const char *wallet", "const char *index", "const char *mwcmqs_config");
- mwc_rust_validate_address("const char *address");
- mwc_rust_get_tx_fees("const char *wallet", "const char *c_amount", "const char *min_confirmations");
-
- mwc_rust_tx_send_http("const char *wallet", "const char *selection_strategy_is_use_all","const char *minimum_confirmations",
- "const char *message",
- "const char *amount",
- "const char *address");
-
- mwc_rust_mwcmqs_listener_start("const char *wallet",
- "const char *mwcmqs_config");
-
- mwc_listener_cancel("const char *handler");
- // ...
- // This code will force the bundler to use these functions, but will never be called
- }
-}
diff --git a/ios/flutter_libmwc.podspec b/ios/flutter_libmwc.podspec
deleted file mode 100644
index 383294b6..00000000
--- a/ios/flutter_libmwc.podspec
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint flutter_libmwc.podspec` to validate before publishing.
-#
-Pod::Spec.new do |s|
- s.name = 'flutter_libmwc'
- s.version = '0.0.1'
- s.summary = 'A new Flutter plugin project.'
- s.description = <<-DESC
-A new Flutter plugin project.
- DESC
- s.homepage = 'http://example.com'
- s.license = { :file => '../LICENSE' }
- s.author = { 'Your Company' => 'email@example.com' }
- s.source = { :path => '.' }
- s.public_header_files = 'Classes**/*.h'
- s.source_files = 'Classes/**/*'
- s.static_framework = true
- s.vendored_libraries = "**/*.a"
- s.dependency 'Flutter'
- s.platform = :ios, '9.0'
-
- # Flutter.framework does not contain a i386 slice.
- s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
- s.swift_version = '5.0'
- s.libraries = 'resolv'
-end
diff --git a/lib/flutter_libmwc.dart b/lib/flutter_libmwc.dart
deleted file mode 100644
index 8847b132..00000000
--- a/lib/flutter_libmwc.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-
-import 'flutter_libmwc_platform_interface.dart';
-
-class FlutterLibmwc {
- Future getPlatformVersion() {
- return FlutterLibmwcPlatform.instance.getPlatformVersion();
- }
-}
diff --git a/lib/flutter_libmwc_method_channel.dart b/lib/flutter_libmwc_method_channel.dart
deleted file mode 100644
index 0508660c..00000000
--- a/lib/flutter_libmwc_method_channel.dart
+++ /dev/null
@@ -1,17 +0,0 @@
-import 'package:flutter/foundation.dart';
-import 'package:flutter/services.dart';
-
-import 'flutter_libmwc_platform_interface.dart';
-
-/// An implementation of [FlutterLibmwcPlatform] that uses method channels.
-class MethodChannelFlutterLibmwc extends FlutterLibmwcPlatform {
- /// The method channel used to interact with the native platform.
- @visibleForTesting
- final methodChannel = const MethodChannel('flutter_libmwc');
-
- @override
- Future getPlatformVersion() async {
- final version = await methodChannel.invokeMethod('getPlatformVersion');
- return version;
- }
-}
diff --git a/lib/flutter_libmwc_platform_interface.dart b/lib/flutter_libmwc_platform_interface.dart
deleted file mode 100644
index f1d072af..00000000
--- a/lib/flutter_libmwc_platform_interface.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-import 'package:plugin_platform_interface/plugin_platform_interface.dart';
-
-import 'flutter_libmwc_method_channel.dart';
-
-abstract class FlutterLibmwcPlatform extends PlatformInterface {
- /// Constructs a FlutterLibmwcPlatform.
- FlutterLibmwcPlatform() : super(token: _token);
-
- static final Object _token = Object();
-
- static FlutterLibmwcPlatform _instance = MethodChannelFlutterLibmwc();
-
- /// The default instance of [FlutterLibmwcPlatform] to use.
- ///
- /// Defaults to [MethodChannelFlutterLibmwc].
- static FlutterLibmwcPlatform get instance => _instance;
-
- /// Platform-specific implementations should set this with their own
- /// platform-specific class that extends [FlutterLibmwcPlatform] when
- /// they register themselves.
- static set instance(FlutterLibmwcPlatform instance) {
- PlatformInterface.verifyToken(instance, _token);
- _instance = instance;
- }
-
- Future getPlatformVersion() {
- throw UnimplementedError('platformVersion() has not been implemented.');
- }
-}
diff --git a/lib/git_versions_example.dart b/lib/git_versions_example.dart
deleted file mode 100644
index f94e3773..00000000
--- a/lib/git_versions_example.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-import 'dart:io';
-
-/*ANDROID_VERSION*/ const ANDROID_VERSION = "";
-/*IOS_VERSION*/ const IOS_VERSION = "";
-/*MACOS_VERSION*/ const MACOS_VERSION = "";
-/*LINUX_VERSION*/ const LINUX_VERSION = "";
-/*WINDOWS_VERSION*/ const WINDOWS_VERSION = "";
-
-String getPluginVersion() {
- if (Platform.isAndroid) {
- return ANDROID_VERSION;
- } else if (Platform.isIOS) {
- return IOS_VERSION;
- } else if (Platform.isMacOS) {
- return MACOS_VERSION;
- } else if (Platform.isLinux) {
- return LINUX_VERSION;
- } else if (Platform.isWindows) {
- return WINDOWS_VERSION;
- } else {
- return "Unknown version";
- }
-}
diff --git a/lib/lib.dart b/lib/lib.dart
index 1893a0ba..ceaca44e 100644
--- a/lib/lib.dart
+++ b/lib/lib.dart
@@ -714,11 +714,6 @@ abstract class Libmwc {
return await m.protect(() async {
try {
final String result = lib_mwc.txReceive(wallet, slateJson);
- // Debug logging for shape inspection
- // ignore: avoid_print
- final _rlen = result.length;
- final _rprefix = result.substring(0, _rlen > 512 ? 512 : _rlen);
- print('[WALLET][DEBUG] txReceive raw result: ' + _rprefix + (_rlen > 512 ? '…' : ''));
if (result.toUpperCase().contains("ERROR")) {
throw Exception("Error receiving transaction $result");
}
@@ -726,27 +721,17 @@ abstract class Libmwc {
// Robustly extract the updated slate JSON from the nested tuple.
final outer = jsonDecode(result);
if (outer is! List || outer.isEmpty) {
- // ignore: avoid_print
- print('[WALLET][DEBUG] Unexpected receive result shape: ' + result);
throw Exception('Unexpected receive result shape');
}
final first = outer[0];
if (first == null || first is! String) {
- // ignore: avoid_print
- print('[WALLET][DEBUG] Unexpected inner type: ' + first.toString());
throw Exception('Unexpected receive tuple inner type');
}
final inner = jsonDecode(first);
if (inner is! List || inner.length < 2 || inner[1] == null || inner[1] is! String) {
- // ignore: avoid_print
- print('[WALLET][DEBUG] Unexpected inner pair: ' + inner.toString());
throw Exception('Unexpected receive inner pair shape');
}
final updatedSlateJson = inner[1] as String;
- // ignore: avoid_print
- final _ulen = updatedSlateJson.length;
- final _uprefix = updatedSlateJson.substring(0, _ulen > 256 ? 256 : _ulen);
- print('[WALLET][DEBUG] Updated slate json (prefix): ' + _uprefix + (_ulen > 256 ? '…' : ''));
final updatedSlate = jsonDecode(updatedSlateJson);
final List outputs =
@@ -775,10 +760,6 @@ abstract class Libmwc {
return await m.protect(() async {
try {
final String result = lib_mwc.txReceive(wallet, slateJson);
- // ignore: avoid_print
- final _r2len = result.length;
- final _r2prefix = result.substring(0, _r2len > 512 ? 512 : _r2len);
- print('[WALLET][DEBUG] txReceiveDetailed raw result: ' + _r2prefix + (_r2len > 512 ? '…' : ''));
if (result.toUpperCase().contains("ERROR")) {
throw Exception("Error receiving transaction $result");
}
@@ -787,17 +768,9 @@ abstract class Libmwc {
// where json_pair is a JSON-encoded array: [ txs_json, updated_slate_json ]
final outer = jsonDecode(result);
final jsonPairEncoded = outer[0] as String;
- // ignore: avoid_print
- final _jlen = jsonPairEncoded.length;
- final _jprefix = jsonPairEncoded.substring(0, _jlen > 256 ? 256 : _jlen);
- print('[WALLET][DEBUG] jsonPairEncoded (prefix): ' + _jprefix + (_jlen > 256 ? '…' : ''));
final pair = jsonDecode(jsonPairEncoded);
// Extract updated slate JSON (second element)
final updatedSlateJson = pair[1] as String;
- // ignore: avoid_print
- final _ul2 = updatedSlateJson.length;
- final _up2 = updatedSlateJson.substring(0, _ul2 > 256 ? 256 : _ul2);
- print('[WALLET][DEBUG] updatedSlateJson (prefix): ' + _up2 + (_ul2 > 256 ? '…' : ''));
// Parse to fetch ids for convenience from the updated slate
final updatedSlate = jsonDecode(updatedSlateJson);
diff --git a/lib/mwc.dart b/lib/mwc.dart
index 70324e49..49abbef0 100644
--- a/lib/mwc.dart
+++ b/lib/mwc.dart
@@ -1,21 +1,10 @@
import 'dart:ffi';
-import 'dart:io' as io;
import 'package:ffi/ffi.dart';
-final DynamicLibrary mwcNative = io.Platform.isWindows
- ? DynamicLibrary.open("libmwc_wallet.dll")
- : io.Platform.environment.containsKey('FLUTTER_TEST')
- ? DynamicLibrary.open(
- 'crypto_plugins/flutter_libmwc/scripts/linux/build/libmwc_wallet.so')
- : io.Platform.isAndroid || io.Platform.isLinux
- ? DynamicLibrary.open('libmwc_wallet.so')
- : DynamicLibrary.process();
-
typedef WalletMnemonic = Pointer Function();
typedef WalletMnemonicFFI = Pointer Function();
-
typedef InitLogs = Pointer Function(Pointer);
typedef InitLogsFFI = Pointer Function(Pointer);
@@ -44,8 +33,13 @@ typedef ScanOutPutsFFI = Pointer Function(
typedef CreateTransaction = Pointer Function(Pointer, Pointer,
Pointer, Pointer, Pointer, Pointer, Pointer);
-typedef CreateTransactionFFI = Pointer Function(Pointer,
- Pointer, Pointer, Pointer, Pointer, Pointer,
+typedef CreateTransactionFFI = Pointer Function(
+ Pointer,
+ Pointer,
+ Pointer,
+ Pointer,
+ Pointer,
+ Pointer,
Pointer);
typedef MwcMqsListenerStart = Pointer Function(
@@ -68,10 +62,8 @@ typedef CancelTransactionFFI = Pointer Function(
typedef GetChainHeight = Pointer Function(Pointer);
typedef GetChainHeightFFI = Pointer Function(Pointer);
-typedef AddressInfo = Pointer Function(
- Pointer, Pointer);
-typedef AddressInfoFFI = Pointer Function(
- Pointer, Pointer);
+typedef AddressInfo = Pointer Function(Pointer, Pointer);
+typedef AddressInfoFFI = Pointer Function(Pointer, Pointer);
typedef ValidateAddress = Pointer Function(Pointer);
typedef ValidateAddressFFI = Pointer Function(Pointer);
@@ -93,7 +85,8 @@ typedef TxHttpSendFFI = Pointer Function(Pointer, Pointer,
Pointer, Pointer, Pointer, Pointer);
typedef EncodeSlatepack = Pointer Function(Pointer, Pointer);
-typedef EncodeSlatepackFFI = Pointer Function(Pointer, Pointer);
+typedef EncodeSlatepackFFI = Pointer Function(
+ Pointer, Pointer);
typedef EncodeSlatepackEnhanced = Pointer Function(
Pointer, Pointer, Pointer);
@@ -103,8 +96,10 @@ typedef EncodeSlatepackEnhancedFFI = Pointer Function(
typedef DecodeSlatepack = Pointer Function(Pointer);
typedef DecodeSlatepackFFI = Pointer Function(Pointer);
-typedef DecodeSlatepackEnhanced = Pointer Function(Pointer, Pointer);
-typedef DecodeSlatepackEnhancedFFI = Pointer Function(Pointer, Pointer);
+typedef DecodeSlatepackEnhanced = Pointer Function(
+ Pointer, Pointer);
+typedef DecodeSlatepackEnhancedFFI = Pointer Function(
+ Pointer, Pointer);
typedef TxReceive = Pointer Function(Pointer, Pointer);
typedef TxReceiveFFI = Pointer Function(Pointer, Pointer);
@@ -117,62 +112,72 @@ typedef TxInit = Pointer Function(
typedef TxInitFFI = Pointer Function(
Pointer, Pointer, Pointer, Pointer, Pointer);
-final WalletMnemonic _walletMnemonic = mwcNative
- .lookup>("mwc_get_mnemonic")
- .asFunction();
+@Native(symbol: 'mwc_get_mnemonic')
+external Pointer _walletMnemonic();
String walletMnemonic() {
return _walletMnemonic().toDartString();
}
+@Native(symbol: 'mwc_rust_init_logs')
+external Pointer _initLogs(Pointer config);
-final InitLogs _initLogs = mwcNative
- .lookup>("mwc_rust_init_logs")
- .asFunction();
-
-String initLogs( String config) {
- return _initLogs(config.toNativeUtf8())
- .toDartString();
+String initLogs(String config) {
+ return _initLogs(config.toNativeUtf8()).toDartString();
}
-final WalletInit _initWallet = mwcNative
- .lookup>("mwc_wallet_init")
- .asFunction();
+@Native(symbol: 'mwc_wallet_init')
+external Pointer _initWallet(
+ Pointer config,
+ Pointer mnemonic,
+ Pointer password,
+ Pointer name,
+);
String initWallet(
String config, String mnemonic, String password, String name) {
return _initWallet(config.toNativeUtf8(), mnemonic.toNativeUtf8(),
- password.toNativeUtf8(), name.toNativeUtf8())
+ password.toNativeUtf8(), name.toNativeUtf8())
.toDartString();
}
-final WalletInfo _walletInfo = mwcNative
- .lookup>("mwc_rust_wallet_balances")
- .asFunction();
+@Native(symbol: 'mwc_rust_wallet_balances')
+external Pointer _walletInfo(
+ Pointer wallet,
+ Pointer refresh,
+ Pointer min_confirmations,
+);
Future getWalletInfo(
String wallet, int refreshFromNode, int min_confirmations) async {
return _walletInfo(
- wallet.toNativeUtf8(),
- refreshFromNode.toString().toNativeUtf8().cast(),
- min_confirmations.toString().toNativeUtf8().cast())
+ wallet.toNativeUtf8(),
+ refreshFromNode.toString().toNativeUtf8().cast(),
+ min_confirmations.toString().toNativeUtf8().cast())
.toDartString();
}
-final RecoverWallet _recoverWallet = mwcNative
- .lookup>("mwc_rust_recover_from_mnemonic")
- .asFunction();
+@Native(symbol: 'mwc_rust_recover_from_mnemonic')
+external Pointer _recoverWallet(
+ Pointer config,
+ Pointer password,
+ Pointer mnemonic,
+ Pointer name,
+);
String recoverWallet(
String config, String password, String mnemonic, String name) {
return _recoverWallet(config.toNativeUtf8(), password.toNativeUtf8(),
- mnemonic.toNativeUtf8(), name.toNativeUtf8())
+ mnemonic.toNativeUtf8(), name.toNativeUtf8())
.toDartString();
}
-final ScanOutPuts _scanOutPuts = mwcNative
- .lookup>("mwc_rust_wallet_scan_outputs")
- .asFunction();
+@Native(symbol: 'mwc_rust_wallet_scan_outputs')
+external Pointer _scanOutPuts(
+ Pointer wallet,
+ Pointer start_height,
+ Pointer number_of_blocks,
+);
Future scanOutPuts(
String wallet, int startHeight, int numberOfBlocks) async {
@@ -183,10 +188,11 @@ Future scanOutPuts(
).toDartString();
}
-final MwcMqsListenerStart _MwcMqsListenerStart = mwcNative
- .lookup>(
- "mwc_rust_mwcmqs_listener_start")
- .asFunction();
+@Native(symbol: 'mwc_rust_mwcmqs_listener_start')
+external Pointer _MwcMqsListenerStart(
+ Pointer wallet,
+ Pointer mwcmqs_config,
+);
Pointer mwcMqsListenerStart(String wallet, String MWCMQSConfig) {
return _MwcMqsListenerStart(
@@ -195,9 +201,8 @@ Pointer mwcMqsListenerStart(String wallet, String MWCMQSConfig) {
);
}
-final MwcMqsListenerStop _MwcMqsListenerStop = mwcNative
- .lookup>("mwc_listener_cancel")
- .asFunction();
+@Native(symbol: 'mwc_listener_cancel')
+external Pointer _MwcMqsListenerStop(Pointer handler);
String mwcMqsListenerStop(Pointer handler) {
return _MwcMqsListenerStop(
@@ -205,12 +210,25 @@ String mwcMqsListenerStop(Pointer handler) {
).toDartString();
}
-final CreateTransaction _createTransaction = mwcNative
- .lookup>("mwc_rust_create_tx")
- .asFunction();
-
-Future createTransaction(String wallet, int amount, String address,
- int secretKey, String MWCMQSConfig, int minimumConfirmations, String note) async {
+@Native(symbol: 'mwc_rust_create_tx')
+external Pointer _createTransaction(
+ Pointer wallet,
+ Pointer amount,
+ Pointer to_address,
+ Pointer secret_key_index,
+ Pointer mwcmqs_config,
+ Pointer confirmations,
+ Pointer note,
+);
+
+Future createTransaction(
+ String wallet,
+ int amount,
+ String address,
+ int secretKey,
+ String MWCMQSConfig,
+ int minimumConfirmations,
+ String note) async {
return _createTransaction(
wallet.toNativeUtf8(),
amount.toString().toNativeUtf8().cast(),
@@ -222,93 +240,104 @@ Future createTransaction(String wallet, int amount, String address,
).toDartString();
}
-final GetTransactions _getTransactions = mwcNative
- .lookup>("mwc_rust_txs_get")
- .asFunction();
+@Native(symbol: 'mwc_rust_txs_get')
+external Pointer _getTransactions(
+ Pointer wallet,
+ Pointer refresh_from_node,
+);
Future getTransactions(String wallet, int refreshFromNode) async {
return _getTransactions(wallet.toNativeUtf8(),
- refreshFromNode.toString().toNativeUtf8().cast())
+ refreshFromNode.toString().toNativeUtf8().cast())
.toDartString();
}
-final CancelTransaction _cancelTransaction = mwcNative
- .lookup>("mwc_rust_tx_cancel")
- .asFunction();
+@Native(symbol: 'mwc_rust_tx_cancel')
+external Pointer _cancelTransaction(
+ Pointer wallet,
+ Pointer tx_id,
+);
String cancelTransaction(String wallet, String transactionId) {
return _cancelTransaction(wallet.toNativeUtf8(), transactionId.toNativeUtf8())
.toDartString();
}
-final GetChainHeight _getChainHeight = mwcNative
- .lookup>("mwc_rust_get_chain_height")
- .asFunction();
+@Native(symbol: 'mwc_rust_get_chain_height')
+external Pointer _getChainHeight(Pointer config);
int getChainHeight(String config) {
String latestHeight = _getChainHeight(config.toNativeUtf8()).toDartString();
return int.parse(latestHeight);
}
-final AddressInfo _addressInfo = mwcNative
- .lookup>("mwc_rust_get_wallet_address")
- .asFunction();
+@Native(symbol: 'mwc_rust_get_wallet_address')
+external Pointer _addressInfo(Pointer wallet, Pointer index);
String getAddressInfo(String wallet, int index) {
return _addressInfo(
- wallet.toNativeUtf8(),
- index.toString().toNativeUtf8().cast