Bundle OpenSSL & SQLCipher

This commit is contained in:
Hanh 2023-03-07 16:09:06 +10:00
parent 42d9a92eb0
commit 3c83035623
8 changed files with 53 additions and 44 deletions

View File

@ -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

View File

@ -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

15
build-scripts/build-win1.sh Executable file
View File

@ -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

21
build-scripts/build-win2.sh Executable file
View File

@ -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

View File

@ -98,6 +98,7 @@ void handleUri(BuildContext context, Uri uri) {
}
Future<void> registerURLHandler(BuildContext context) async {
if (Platform.isLinux) return;
final _appLinks = AppLinks();
final uri = await _appLinks.getInitialAppLink();
@ -387,7 +388,7 @@ class ZWalletAppState extends State<ZWalletApp> {
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) {

@ -1 +1 @@
Subproject commit 6bbe39c236a36bd7d7c399af283fe689e6a83b61
Subproject commit 2940d8f8dac0c365f97e06adaab1c88174cff805

View File

@ -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"

Binary file not shown.