diff --git a/.github/workflows/build-win.yml b/.github/workflows/build-win.yml index 2be04c1..cc8996a 100644 --- a/.github/workflows/build-win.yml +++ b/.github/workflows/build-win.yml @@ -17,10 +17,21 @@ jobs: - name: env run: | type build.env >> $env:GITHUB_ENV + echo 'D:\flutter\bin' >> $env:GITHUB_PATH + echo $env:GITHUB_PATH - - name: build + - name: build 1/3 shell: bash - run: ./build-scripts/build-win.sh "${{ env.FLUTTER_VERSION }}" + run: ./build-scripts/build-win1.sh "${{ env.FLUTTER_VERSION }}" + + - name: build 2/3 + run: cargo b -r --features=dart_ffi,sqlcipher + env: + HOME: 'D:\' + + - name: build 3/3 + shell: bash + run: ./build-scripts/build-win2.sh - name: Release uses: softprops/action-gh-release@v1 diff --git a/build-scripts/build-win.sh b/build-scripts/build-win.sh deleted file mode 100755 index dcde84d..0000000 --- a/build-scripts/build-win.sh +++ /dev/null @@ -1,39 +0,0 @@ -echo $1 - -# Download params -mkdir /d/.zcash-params -curl https://download.z.cash/downloads/sapling-output.params --output /d/.zcash-params/sapling-output.params -curl https://download.z.cash/downloads/sapling-spend.params --output /d/.zcash-params/sapling-spend.params -export HOME=/d/ - -git clone -b $1 --depth 1 https://github.com/flutter/flutter.git /d/flutter -export PATH=$PATH:/d/flutter/bin - -flutter doctor -v - -# DLL -sed -e 's/rlib/cdylib/' < native/zcash-sync/Cargo.toml >/tmp/out.toml -mv /tmp/out.toml native/zcash-sync/Cargo.toml -cargo b -r --features=dart_ffi,sqlcipher - -# Codegen -flutter pub get -flutter pub run build_runner build -d -pushd packages/warp_api_ffi -flutter pub get -flutter pub run build_runner build -d -popd - -# Build flutter -flutter build windows -cp runtime/* build/windows/runner/release -cp target/release/warp_api_ffi.dll build/windows/runner/release -flutter pub run msix:create -mv build/windows/runner/Release/YWallet.msix . - -flutter build windows -cp runtime/* build/windows/runner/Release -pushd build/windows/runner -mv Release ywallet -7z a ../../../ywallet.zip ywallet -popd diff --git a/build-scripts/build-win1.sh b/build-scripts/build-win1.sh new file mode 100755 index 0000000..efcfad6 --- /dev/null +++ b/build-scripts/build-win1.sh @@ -0,0 +1,15 @@ +echo $1 + +# Download params +mkdir /d/.zcash-params +curl https://download.z.cash/downloads/sapling-output.params --output /d/.zcash-params/sapling-output.params +curl https://download.z.cash/downloads/sapling-spend.params --output /d/.zcash-params/sapling-spend.params +export HOME=/d/ + +git clone -b $1 --depth 1 https://github.com/flutter/flutter.git /d/flutter + +flutter doctor -v + +# DLL +sed -e 's/rlib/cdylib/' < native/zcash-sync/Cargo.toml >/tmp/out.toml +mv /tmp/out.toml native/zcash-sync/Cargo.toml diff --git a/build-scripts/build-win2.sh b/build-scripts/build-win2.sh new file mode 100755 index 0000000..f408bc0 --- /dev/null +++ b/build-scripts/build-win2.sh @@ -0,0 +1,21 @@ +# Codegen +flutter pub get +flutter pub run build_runner build -d +pushd packages/warp_api_ffi +flutter pub get +flutter pub run build_runner build -d +popd + +# Build flutter +flutter build windows +cp runtime/* build/windows/runner/release +cp target/release/warp_api_ffi.dll build/windows/runner/release +flutter pub run msix:create +mv build/windows/runner/Release/YWallet.msix . + +flutter build windows +cp runtime/* build/windows/runner/Release +pushd build/windows/runner +mv Release ywallet +7z a ../../../ywallet.zip ywallet +popd diff --git a/lib/main.dart b/lib/main.dart index f70a1f2..ac8db33 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -98,6 +98,7 @@ void handleUri(BuildContext context, Uri uri) { } Future registerURLHandler(BuildContext context) async { + if (Platform.isLinux) return; final _appLinks = AppLinks(); final uri = await _appLinks.getInitialAppLink(); @@ -387,7 +388,7 @@ class ZWalletAppState extends State { WarpApi.mempoolRun(unconfirmedBalancePort.sendPort.nativePort); final c = coins.first; - if (!isMobile()) { + if (!isMobile() && File(c.dbFullPath).existsSync()) { if (!WarpApi.decryptDb(c.dbFullPath, '')) { final passwd = await getDbPasswd(context, c.dbFullPath); if (passwd != null) { diff --git a/native/zcash-sync b/native/zcash-sync index 6bbe39c..2940d8f 160000 --- a/native/zcash-sync +++ b/native/zcash-sync @@ -1 +1 @@ -Subproject commit 6bbe39c236a36bd7d7c399af283fe689e6a83b61 +Subproject commit 2940d8f8dac0c365f97e06adaab1c88174cff805 diff --git a/pubspec.yaml b/pubspec.yaml index 92d3f2e..02fa355 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.3.5+395 +version: 1.3.5+396 environment: sdk: ">=2.12.0 <3.0.0" diff --git a/runtime/sqlite3.dll b/runtime/sqlite3.dll deleted file mode 100644 index 401d256..0000000 Binary files a/runtime/sqlite3.dll and /dev/null differ