mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-22 19:39:22 +00:00
Merge remote-tracking branch 'origin_SW/staging' into flutter_upgrade
# Conflicts: # crypto_plugins/flutter_libmonero
This commit is contained in:
commit
a353ab341a
15 changed files with 274 additions and 98 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 594ab89bc665a15a810ba7476ed2ad255fa8b5ac
|
||||
Subproject commit 01bad9471c4b41392cd2aa98f5655dc14dedc997
|
125
docs/building.md
125
docs/building.md
|
@ -4,42 +4,37 @@ Here you will find instructions on how to install the necessary tools for buildi
|
|||
|
||||
## Prerequisites
|
||||
|
||||
- The only OS supported for building is Ubuntu 20.04. Advanced users may also be able to build on other Debian-based distributions like Linux Mint.
|
||||
- The only OS supported for building Android and Linux desktop is Ubuntu 20.04. Windows build are completed using Ubuntu 20.04 on WSL2. Advanced users may also be able to build on other Debian-based distributions like Linux Mint.
|
||||
- Android setup ([Android Studio](https://developer.android.com/studio) and subsequent dependencies)
|
||||
- 100 GB of storage
|
||||
|
||||
Install Android Studio following the instructions below before proceeding, then the following prerequisites can be installed with the setup script [`scripts/setup.sh`](./../scripts/setup.sh) or manually as described below:
|
||||
|
||||
- Flutter 3.7.12 [(install manually or with git, do not install with snap)](https://docs.flutter.dev/get-started/install)
|
||||
- Dart SDK Requirement (>=2.19.0, up until <3.0.0) (normally included with a flutter install)
|
||||
## Linux host
|
||||
The following instructions are for building and running on a Linux host. Alternatively, see the [Windows](#Windows host) section.
|
||||
|
||||
### Android Studio
|
||||
Android Studio is the recommended IDE for development, not just for launching on Android devices and emulators but also for Linux desktop development.
|
||||
|
||||
Follow instructions here [https://developer.android.com/studio/install#linux](https://developer.android.com/studio/install#linux) or install via snap:
|
||||
Install Android Studio. Follow instructions here [https://developer.android.com/studio/install#linux](https://developer.android.com/studio/install#linux) or install via snap:
|
||||
```
|
||||
# setup android studio
|
||||
sudo apt install -y openjdk-11-jdk
|
||||
sudo snap install android-studio --classic
|
||||
```
|
||||
|
||||
Use Tools > SDK Manager to install:
|
||||
- SDK Tools > Android SDK (API 30)
|
||||
- SDK Tools > NDK
|
||||
- SDK Tools > Android SDK command line tools
|
||||
- SDK Tools > CMake
|
||||
Use `Tools > SDK Manager` to install:
|
||||
- `SDK Tools > Android SDK (API 30)`
|
||||
- `SDK Tools > NDK`
|
||||
- `SDK Tools > Android SDK command line tools`
|
||||
- `SDK Tools > CMake`
|
||||
|
||||
Then in File > Settings > Plugins, install the Flutter plugin and restart the IDE. In File > Settings > Languages & Frameworks > Flutter > Editor, enable auto format on save to match the project's code style. If you have problems with the Dart SDK, make sure to run `flutter` in a terminal to download it (use `source ~/.bashrc` to update your environment variables if you're still using the same terminal from which you ran `setup.sh`)
|
||||
Then in `File > Settings > Plugins`, install the **Flutter** and **Dart** plugins and restart the IDE. In `File > Settings > Languages & Frameworks > Flutter > Editor`, enable auto format on save to match the project's code style. If you have problems with the Dart SDK, make sure to run `flutter` in a terminal to download it (use `source ~/.bashrc` to update your environment variables if you're still using the same terminal from which you ran `setup.sh`). Run `flutter doctor` to install any missing dependencies and review and agree to any license agreements.
|
||||
|
||||
Make a Pixel 4 (API 30) x86_64 emulator with 2GB of storage space for emulation
|
||||
|
||||
### Scripted setup
|
||||
|
||||
[`scripts/setup.sh`](./../scripts/setup.sh) is provided as a tool to set up installation for building: download the script and run it anywhere. This script should skip the entire [Manual setup](#manual-setup) section below and prepare you for [running](#running). It will set up the stack_wallet repository in `~/projects/stack_wallet` and build it there.
|
||||
[`scripts/setup.sh`](./../scripts/setup.sh) is provided as a tool to set up installation for building: download the script and run it anywhere. This script should skip the entire [Manual setup](#manual-setup) section below and prepare you for [running](#Running).
|
||||
|
||||
### Manual setup
|
||||
|
||||
> If you used the `setup.sh` script, skip to [running](#running)
|
||||
> If you used the `setup.sh` script, skip to [running](#Running)
|
||||
|
||||
Install basic dependencies
|
||||
```
|
||||
|
@ -82,15 +77,6 @@ git submodule update --init --recursive
|
|||
|
||||
```
|
||||
|
||||
Run prebuild script
|
||||
|
||||
```
|
||||
cd scripts
|
||||
./prebuild.sh
|
||||
// when finished go back to the root directory
|
||||
cd ..
|
||||
```
|
||||
|
||||
Remove pre-installed system libraries for the following packages built by cryptography plugins in the crypto_plugins folder: `boost iconv libjson-dev libsecret openssl sodium unbound zmq`. You can use
|
||||
```
|
||||
sudo apt list --installed | grep boost
|
||||
|
@ -101,26 +87,39 @@ sudo apt-get remove '^libboost.*-dev.*'
|
|||
```
|
||||
<!-- TODO: configure compiler to prefer built over system libraries. Should already use them? -->
|
||||
|
||||
Building plugins for Android
|
||||
### Run prebuild script
|
||||
|
||||
Certain test wallet parameter and API key template files must be created in order to run Stack Wallet. These can be created by script as in
|
||||
```
|
||||
cd scripts
|
||||
./prebuild.sh
|
||||
// when finished go back to the root directory
|
||||
cd ..
|
||||
```
|
||||
or manually by creating the files referenced in that script with the specified content.
|
||||
|
||||
### Building plugins for Android
|
||||
> Warning: This will take a long time, please be patient
|
||||
```
|
||||
cd scripts/android/
|
||||
cd scripts/android
|
||||
./build_all.sh
|
||||
// when finished go back to the root directory
|
||||
cd ../..
|
||||
```
|
||||
|
||||
Building plugins for Linux
|
||||
|
||||
### Building plugins for Linux
|
||||
```
|
||||
cd scripts/linux/
|
||||
cd scripts/linux
|
||||
./build_all.sh
|
||||
// when finished go back to the root directory
|
||||
cd ../..
|
||||
```
|
||||
|
||||
## Running
|
||||
### Android
|
||||
### Building plugins for Windows
|
||||
```
|
||||
cd scripts/windows
|
||||
./deps.sh
|
||||
./build_all.sh
|
||||
```
|
||||
|
||||
### Running
|
||||
#### Android
|
||||
Plug in your android device or use the emulator available via Android Studio and then run the following commands:
|
||||
```
|
||||
flutter pub get
|
||||
|
@ -129,9 +128,57 @@ flutter run android
|
|||
|
||||
Note on Emulators: Only x86_64 emulators are supported, x86 emulators will not work
|
||||
|
||||
### Linux
|
||||
#### Linux
|
||||
Plug in your android device or use the emulator available via Android Studio and then run the following commands:
|
||||
```
|
||||
flutter pub get Linux
|
||||
flutter pub get
|
||||
flutter run linux
|
||||
```
|
||||
|
||||
## Windows host
|
||||
### Visual Studio
|
||||
Visual Studio is required for Windows development with the Flutter SDK. Download it at https://visualstudio.microsoft.com/downloads/ and install the "Desktop development with C++" workload, including all of its default components.
|
||||
|
||||
### Building libraries in WSL2
|
||||
Set up Ubuntu 20.04 in WSL2. Follow the entire Linux host section to get set up and build windows `dll` libraries. Copy the resulting `dll`s to their respective positions on the Windows host:
|
||||
|
||||
- `stack_wallet/crypto_plugins/flutter_libepiccash/scripts/windows/build/libepic_cash_wallet.dll`
|
||||
- `stack_wallet/crypto_plugins/flutter_liblelantus/scripts/windows/build/libmobileliblelantus.dll`
|
||||
<!-- TODO: script this -->
|
||||
|
||||
### Install Flutter on Windows host
|
||||
Install Flutter 3.7.12 on your Windows host (not in WSL2) by following these instructions: https://docs.flutter.dev/get-started/install/windows or by running `scripts/windows/deps.ps1`. You may still have to add `C:\development\flutter\bin` to PATH before proceeding, even if you ran `deps.ps1`. Run `flutter doctor` in PowerShell to confirm its installation.
|
||||
|
||||
### Dependencies
|
||||
Install the Windows SDK: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ You may need to install the [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/), which can be installed [by Visual Studio](https://stackoverflow.com/a/73923899) (`Tools > Get Tools and Features... > Modify > Individual Components > Windows 10 SDK`)
|
||||
|
||||
Enable Developer Mode for symlink support,
|
||||
```
|
||||
start ms-settings:developers
|
||||
```
|
||||
|
||||
You may need to install NuGet and CppWinRT / C++/WinRT SDKs version `2.0.210806.1`:
|
||||
```
|
||||
winget install 9WZDNCRDMDM3 # NuGet, can also use Microsoft.NuGet
|
||||
winget install Microsoft.Windows.CppWinRT -Version 2.0.210806.1
|
||||
```
|
||||
or [download the package](https://www.nuget.org/packages/Microsoft.Windows.CppWinRT/2.0.210806.1) and [manually install it](https://github.com/Baseflow/flutter-permission-handler/issues/1025#issuecomment-1518576722).
|
||||
|
||||
### Run prebuild script
|
||||
|
||||
Certain test wallet parameter and API key template files must be created in order to run Stack Wallet. These can be created by script as in
|
||||
```
|
||||
cd scripts
|
||||
./prebuild.ps1
|
||||
// when finished go back to the root directory
|
||||
cd ..
|
||||
```
|
||||
or manually by creating the files referenced in that script with the specified content.
|
||||
|
||||
### Running
|
||||
|
||||
Run the following commands:
|
||||
```
|
||||
flutter pub get
|
||||
flutter run windows
|
||||
```
|
||||
|
|
|
@ -188,7 +188,9 @@ void main() async {
|
|||
}
|
||||
}
|
||||
|
||||
if (!Platform.isWindows) {
|
||||
monero.onStartup();
|
||||
}
|
||||
if (!Platform.isLinux && !Platform.isWindows) {
|
||||
wownero.onStartup();
|
||||
}
|
||||
|
|
|
@ -12,11 +12,11 @@ import 'dart:convert';
|
|||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_libepiccash/git_versions.dart' as EPIC_VERSIONS;
|
||||
import 'package:flutter_libmonero/git_versions.dart' as MONERO_VERSIONS;
|
||||
// import 'package:flutter_libepiccash/git_versions.dart' as EPIC_VERSIONS;
|
||||
// import 'package:flutter_libmonero/git_versions.dart' as MONERO_VERSIONS;
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:lelantus/git_versions.dart' as FIRO_VERSIONS;
|
||||
// import 'package:lelantus/git_versions.dart' as FIRO_VERSIONS;
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/logger.dart';
|
||||
|
@ -115,9 +115,12 @@ class AboutView extends ConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
String firoCommit = FIRO_VERSIONS.getPluginVersion();
|
||||
String epicCashCommit = EPIC_VERSIONS.getPluginVersion();
|
||||
String moneroCommit = MONERO_VERSIONS.getPluginVersion();
|
||||
String firoCommit =
|
||||
"Unable to fetch version"; //FIRO_VERSIONS.getPluginVersion();
|
||||
String epicCashCommit =
|
||||
"Unable to fetch version"; // EPIC_VERSIONS.getPluginVersion();
|
||||
String moneroCommit =
|
||||
"Unable to fetch version"; // MONERO_VERSIONS.getPluginVersion();
|
||||
List<Future> futureFiroList = [
|
||||
doesCommitExist("cypherstack", "flutter_liblelantus", firoCommit),
|
||||
isHeadCommit("cypherstack", "flutter_liblelantus", "main", firoCommit),
|
||||
|
@ -171,14 +174,14 @@ class AboutView extends ConsumerWidget {
|
|||
String appName = "";
|
||||
String build = "";
|
||||
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
version = snapshot.data!.version;
|
||||
build = snapshot.data!.buildNumber;
|
||||
signature = snapshot.data!.buildSignature;
|
||||
appName = snapshot.data!.appName;
|
||||
}
|
||||
// if (snapshot.connectionState ==
|
||||
// ConnectionState.done &&
|
||||
// snapshot.hasData) {
|
||||
// version = snapshot.data!.version;
|
||||
// build = snapshot.data!.buildNumber;
|
||||
// signature = snapshot.data!.buildSignature;
|
||||
// appName = snapshot.data!.appName;
|
||||
// }
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
|
|
|
@ -17,11 +17,11 @@ import 'package:event_bus/event_bus.dart';
|
|||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_libepiccash/git_versions.dart' as EPIC_VERSIONS;
|
||||
import 'package:flutter_libmonero/git_versions.dart' as MONERO_VERSIONS;
|
||||
// import 'package:flutter_libepiccash/git_versions.dart' as EPIC_VERSIONS;
|
||||
// import 'package:flutter_libmonero/git_versions.dart' as MONERO_VERSIONS;
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:lelantus/git_versions.dart' as FIRO_VERSIONS;
|
||||
// import 'package:lelantus/git_versions.dart' as FIRO_VERSIONS;
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:stackwallet/models/isar/models/log.dart';
|
||||
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||
|
@ -302,11 +302,11 @@ class _DebugViewState extends ConsumerState<DebugView> {
|
|||
packageInfo.buildSignature;
|
||||
final appName = packageInfo.appName;
|
||||
String firoCommit =
|
||||
FIRO_VERSIONS.getPluginVersion();
|
||||
"Unable to fetch version"; //FIRO_VERSIONS.getPluginVersion();
|
||||
String epicCashCommit =
|
||||
EPIC_VERSIONS.getPluginVersion();
|
||||
"Unable to fetch version"; //EPIC_VERSIONS.getPluginVersion();
|
||||
String moneroCommit =
|
||||
MONERO_VERSIONS.getPluginVersion();
|
||||
"Unable to fetch version"; // MONERO_VERSIONS.getPluginVersion();
|
||||
DeviceInfoPlugin deviceInfoPlugin =
|
||||
DeviceInfoPlugin();
|
||||
final deviceInfo =
|
||||
|
|
|
@ -15,6 +15,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:stackwallet/db/hive/db.dart';
|
||||
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||
import 'package:stackwallet/pages/intro_view.dart';
|
||||
|
@ -52,7 +53,21 @@ class _ForgotPasswordDesktopViewState
|
|||
|
||||
try {
|
||||
await Hive.close();
|
||||
if (Platform.isWindows || Platform.isLinux) {
|
||||
if (Platform.isWindows) {
|
||||
final xmrDir = Directory("${appRoot.path}/wallets");
|
||||
if (xmrDir.existsSync()) {
|
||||
await xmrDir.delete(recursive: true);
|
||||
}
|
||||
final epicDir = Directory("${appRoot.path}/epiccash");
|
||||
if (epicDir.existsSync()) {
|
||||
await epicDir.delete(recursive: true);
|
||||
}
|
||||
|
||||
await Isar.getInstance("desktopStore")?.close(deleteFromDisk: true);
|
||||
|
||||
await (await StackFileSystem.applicationHiveDirectory())
|
||||
.delete(recursive: true);
|
||||
} else if (Platform.isLinux) {
|
||||
await appRoot.delete(recursive: true);
|
||||
} else {
|
||||
// macos in ipad mode
|
||||
|
|
|
@ -12,11 +12,11 @@ import 'dart:convert';
|
|||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_libepiccash/git_versions.dart' as EPIC_VERSIONS;
|
||||
import 'package:flutter_libmonero/git_versions.dart' as MONERO_VERSIONS;
|
||||
// import 'package:flutter_libepiccash/git_versions.dart' as EPIC_VERSIONS;
|
||||
// import 'package:flutter_libmonero/git_versions.dart' as MONERO_VERSIONS;
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:lelantus/git_versions.dart' as FIRO_VERSIONS;
|
||||
// import 'package:lelantus/git_versions.dart' as FIRO_VERSIONS;
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/logger.dart';
|
||||
|
@ -108,9 +108,12 @@ class DesktopAboutView extends ConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
String firoCommit = FIRO_VERSIONS.getPluginVersion();
|
||||
String epicCashCommit = EPIC_VERSIONS.getPluginVersion();
|
||||
String moneroCommit = MONERO_VERSIONS.getPluginVersion();
|
||||
String firoCommit =
|
||||
"Unable to fetch version"; // FIRO_VERSIONS.getPluginVersion();
|
||||
String epicCashCommit =
|
||||
"Unable to fetch version"; // EPIC_VERSIONS.getPluginVersion();
|
||||
String moneroCommit =
|
||||
"Unable to fetch version"; //MONERO_VERSIONS.getPluginVersion();
|
||||
List<Future> futureFiroList = [
|
||||
doesCommitExist("cypherstack", "flutter_liblelantus", firoCommit),
|
||||
isHeadCommit("cypherstack", "flutter_liblelantus", "main", firoCommit),
|
||||
|
@ -247,13 +250,13 @@ class DesktopAboutView extends ConsumerWidget {
|
|||
String signature = "";
|
||||
String build = "";
|
||||
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
version = snapshot.data!.version;
|
||||
build = snapshot.data!.buildNumber;
|
||||
signature = snapshot.data!.buildSignature;
|
||||
}
|
||||
// if (snapshot.connectionState ==
|
||||
// ConnectionState.done &&
|
||||
// snapshot.hasData) {
|
||||
// version = snapshot.data!.version;
|
||||
// build = snapshot.data!.buildNumber;
|
||||
// signature = snapshot.data!.buildSignature;
|
||||
// }
|
||||
|
||||
return Column(
|
||||
mainAxisAlignment:
|
||||
|
|
|
@ -44,7 +44,7 @@ class DebugService extends ChangeNotifier {
|
|||
// });
|
||||
}
|
||||
|
||||
List<Log> get recentLogs => isar.logs.where().limit(200).findAllSync();
|
||||
List<Log> get recentLogs => isar.logs.where().sortByTimestampInMillisUTCDesc().limit(100).findAllSync();
|
||||
|
||||
// Future<void> updateRecentLogs() async {
|
||||
// int totalCount = await isar.logs.count();
|
||||
|
|
|
@ -11,7 +11,7 @@ description: Stack Wallet
|
|||
# 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.7.11+176
|
||||
version: 1.7.12+177
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.2 <4.0.0"
|
||||
|
|
17
scripts/prebuild.ps1
Normal file
17
scripts/prebuild.ps1
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Create template lib/external_api_keys.dart file if it doesn't already exist
|
||||
$KEYS = "..\lib\external_api_keys.dart"
|
||||
if (-not (Test-Path $KEYS)) {
|
||||
Write-Host "prebuild.ps1: creating template lib/external_api_keys.dart file"
|
||||
"const kChangeNowApiKey = '';" + "`nconst kSimpleSwapApiKey = '';" | Out-File $KEYS -Encoding UTF8
|
||||
}
|
||||
|
||||
# Create template wallet test parameter files if they don't already exist
|
||||
$coins = @("bitcoin", "bitcoincash", "dogecoin", "namecoin", "firo", "particl") # TODO add monero and wownero when those tests are updated to use the .gitignored test wallet setup: when doing that, make sure to update the test vectors for a new, private development seed
|
||||
|
||||
foreach ($coin in $coins) {
|
||||
$WALLETTESTPARAMFILE = "..\test\services\coins\$coin\${coin}_wallet_test_parameters.dart"
|
||||
if (-not (Test-Path $WALLETTESTPARAMFILE)) {
|
||||
Write-Host "prebuild.ps1: creating template test/services/coins/$coin/${coin}_wallet_test_parameters.dart file"
|
||||
"const TEST_MNEMONIC = "";" + "`nconst ROOT_WIF = "";" + "`nconst NODE_WIF_84 = "";" | Out-File -FilePath $WALLETTESTPARAMFILE -Encoding UTF8
|
||||
}
|
||||
}
|
|
@ -18,20 +18,6 @@ echo 'export PATH="$PATH:'${FLUTTER_DIR}'"' >> ~/.bashrc
|
|||
source ~/.bashrc
|
||||
flutter doctor
|
||||
|
||||
# setup stack_wallet github
|
||||
cd $PROJECTS
|
||||
git clone https://github.com/cypherstack/stack_wallet.git
|
||||
cd stack_wallet
|
||||
export STACK_WALLET=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
|
||||
# create template lib/external_api_keys.dart file if it doesn't already exist
|
||||
KEYS="$HOME/projects/stack_wallet/lib/external_api_keys.dart"
|
||||
if ! test -f "$KEYS"; then
|
||||
echo 'prebuild.sh: creating template lib/external_api_keys.dart file'
|
||||
printf 'const kChangeNowApiKey = "";\nconst kSimpleSwapApiKey = "";' > $KEYS
|
||||
fi
|
||||
|
||||
# install stack wallet dependencies
|
||||
sudo apt-get install -y unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake openjdk-8-jre-headless libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm
|
||||
|
||||
|
@ -46,9 +32,23 @@ source "$HOME/.cargo/env"
|
|||
cargo install cargo-ndk
|
||||
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
|
||||
|
||||
# build stack wallet plugins
|
||||
cd $STACK_WALLET
|
||||
cd scripts/android
|
||||
./build_all.sh
|
||||
cd ../linux
|
||||
./build_all.sh
|
||||
# # setup stack_wallet github
|
||||
# cd $PROJECTS
|
||||
# git clone https://github.com/cypherstack/stack_wallet.git
|
||||
# cd stack_wallet
|
||||
# export STACK_WALLET=$(pwd)
|
||||
# git submodule update --init --recursive
|
||||
|
||||
# # create template lib/external_api_keys.dart file if it doesn't already exist
|
||||
# KEYS="$HOME/projects/stack_wallet/lib/external_api_keys.dart"
|
||||
# if ! test -f "$KEYS"; then
|
||||
# echo 'prebuild.sh: creating template lib/external_api_keys.dart file'
|
||||
# printf 'const kChangeNowApiKey = "";\nconst kSimpleSwapApiKey = "";' > $KEYS
|
||||
# fi
|
||||
|
||||
# # build stack wallet plugins
|
||||
# cd $STACK_WALLET
|
||||
# cd scripts/android
|
||||
# ./build_all.sh
|
||||
# cd ../linux
|
||||
# ./build_all.sh
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
mkdir -p build
|
||||
(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) &
|
||||
(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) &
|
||||
(cd ../../crypto_plugins/flutter_libmonero/scripts/windows && ./build_all.sh) &
|
||||
# (cd ../../crypto_plugins/flutter_libmonero/scripts/windows && ./build_all.sh) &
|
||||
|
||||
wait
|
||||
echo "Done building"
|
||||
|
|
75
scripts/windows/deps.ps1
Normal file
75
scripts/windows/deps.ps1
Normal file
|
@ -0,0 +1,75 @@
|
|||
# Create C:\development
|
||||
New-Item -Path 'C:\development' -ItemType Directory -ErrorAction Ignore
|
||||
|
||||
# $wc = [System.Net.WebClient]::new()
|
||||
# $publishedHash = '8E28E54D601F0751922DE24632C1E716B4684876255CF82304A9B19E89A9CCAC'
|
||||
# $FileHash = Get-FileHash -InputStream ($wc.OpenRead("C:\development\flutter_windows_3.7.12-stable.zip"))
|
||||
|
||||
# if (-Not [System.IO.File]::Exists("C:\development\flutter_windows_3.7.12-stable.zip") or -Not ($FileHash.Hash -eq $publishedHash)) {
|
||||
# } else {
|
||||
# Download flutter_windows_3.7.12-stable.zip
|
||||
# Write-Output "Downloading flutter_windows_3.7.12-stable.zip"
|
||||
# $ProgressPreference = 'SilentlyContinue' # Speed up download process, see https://stackoverflow.com/questions/28682642/powershell-why-is-using-invoke-webrequest-much-slower-than-a-browser-download
|
||||
# Invoke-WebRequest "https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.7.12-stable.zip" -OutFile "C:\development\flutter_windows_3.7.12-stable.zip"
|
||||
# }
|
||||
|
||||
# Extract Flutter SDK
|
||||
Write-Output "Extracting flutter_windows_3.7.12-stable.zip"
|
||||
$progressPreference = 'SilentlyContinue' # Speed up extraction process, see https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/32#issuecomment-642582179
|
||||
# Add-MpPreference -ExclusionPath C:\development
|
||||
# Expand-Archive "C:\development\flutter_windows_3.7.12-stable.zip" -DestinationPath "C:\development"
|
||||
Add-Type -Assembly "System.IO.Compression.Filesystem"
|
||||
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\development\flutter_windows_3.7.12-stable.zip", "C:\development")
|
||||
|
||||
# See https://stackoverflow.com/a/69239861
|
||||
function Add-Path {
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory, Position=0)]
|
||||
[string] $LiteralPath,
|
||||
[ValidateSet('User', 'CurrentUser', 'Machine', 'LocalMachine')]
|
||||
[string] $Scope
|
||||
)
|
||||
|
||||
Set-StrictMode -Version 1; $ErrorActionPreference = 'Stop'
|
||||
|
||||
$isMachineLevel = $Scope -in 'Machine', 'LocalMachine'
|
||||
if ($isMachineLevel -and -not $($ErrorActionPreference = 'Continue'; net session 2>$null)) { throw "You must run AS ADMIN to update the machine-level Path environment variable." }
|
||||
|
||||
$regPath = 'registry::' + ('HKEY_CURRENT_USER\Environment', 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment')[$isMachineLevel]
|
||||
|
||||
# Note the use of the .GetValue() method to ensure that the *unexpanded* value is returned.
|
||||
$currDirs = (Get-Item -LiteralPath $regPath).GetValue('Path', '', 'DoNotExpandEnvironmentNames') -split ';' -ne ''
|
||||
|
||||
if ($LiteralPath -in $currDirs) {
|
||||
Write-Verbose "Already present in the persistent $(('user', 'machine')[$isMachineLevel])-level Path: $LiteralPath"
|
||||
return
|
||||
}
|
||||
|
||||
$newValue = ($currDirs + $LiteralPath) -join ';'
|
||||
|
||||
# Update the registry.
|
||||
Set-ItemProperty -Type ExpandString -LiteralPath $regPath Path $newValue
|
||||
|
||||
# Broadcast WM_SETTINGCHANGE to get the Windows shell to reload the
|
||||
# updated environment, via a dummy [Environment]::SetEnvironmentVariable() operation.
|
||||
$dummyName = [guid]::NewGuid().ToString()
|
||||
[Environment]::SetEnvironmentVariable($dummyName, 'foo', 'User')
|
||||
[Environment]::SetEnvironmentVariable($dummyName, [NullString]::value, 'User')
|
||||
|
||||
# Finally, also update the current session's `$env:Path` definition.
|
||||
# Note: For simplicity, we always append to the in-process *composite* value,
|
||||
# even though for a -Scope Machine update this isn't strictly the same.
|
||||
$env:Path = ($env:Path -replace ';$') + ';' + $LiteralPath
|
||||
|
||||
Write-Verbose "`"$LiteralPath`" successfully appended to the persistent $(('user', 'machine')[$isMachineLevel])-level Path and also the current-process value."
|
||||
|
||||
}
|
||||
|
||||
# Add Flutter SDK to PATH if it's not there already
|
||||
if ($Env:Path -split ";" -contains 'C:\development\flutter\bin') {
|
||||
Write-Output "Flutter SDK in PATH, done"
|
||||
} else {
|
||||
Write-Output "Attempting to add Flutter SDK to PATH"
|
||||
Add-Path("C:\development\flutter\bin")
|
||||
}
|
8
scripts/windows/deps.sh
Normal file
8
scripts/windows/deps.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./deps.sh ) &
|
||||
(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./mxedeps.sh ) &
|
||||
# (cd ../../crypto_plugins/flutter_libmonero/scripts/windows && ./monerodeps.sh && ./mxedeps.sh) &
|
||||
|
||||
wait
|
||||
echo "Done building"
|
|
@ -80,6 +80,12 @@ 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}/../crypto_plugins/flutter_libepiccash/scripts/windows/build/libepic_cash_wallet.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||
COMPONENT Runtime)
|
||||
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_liblelantus/scripts/windows/build/libmobileliblelantus.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||
COMPONENT Runtime)
|
||||
|
||||
if(PLUGIN_BUNDLED_LIBRARIES)
|
||||
install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
|
||||
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||
|
|
Loading…
Reference in a new issue