mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-04-14 12:41:55 +00:00
update build scripts
fix polyseed
This commit is contained in:
parent
5b42130e85
commit
78f801ed9d
17 changed files with 112 additions and 161 deletions
Makefile
android/app/src/debug
cw_monero
pubspec_base.yamlrun-android.shscripts/docker
63
Makefile
63
Makefile
|
@ -1,70 +1,9 @@
|
|||
# TODO(mrcyjanek): Cleanup, this is borrowed from unnamed_monero_wallet repo.
|
||||
|
||||
MONERO_C_TAG=v0.18.3.3-RC31
|
||||
MONERO_C_TAG=v0.18.3.3-RC35
|
||||
LIBCPP_SHARED_SO_TAG=latest-RC1
|
||||
LIBCPP_SHARED_SO_NDKVERSION=r17c
|
||||
|
||||
.PHONY: android
|
||||
android:
|
||||
./build_changelog.sh
|
||||
flutter build apk --split-per-abi --flavor calc --dart-define=libstealth_calculator=true
|
||||
flutter build apk --split-per-abi --flavor clean --dart-define=libstealth_calculator=false
|
||||
|
||||
.PHONY: linux
|
||||
linux:
|
||||
./build_changelog.sh
|
||||
flutter build linux
|
||||
echo https://static.mrcyjanek.net/monero_c/${MONERO_C_TAG}/${TARGET_TRIPLET}_libwallet2_api_c.so.xz
|
||||
wget https://static.mrcyjanek.net/monero_c/${MONERO_C_TAG}/${TARGET_TRIPLET}_libwallet2_api_c.so.xz \
|
||||
-O build/linux/${FLUTTER_ARCH}/release/bundle/lib/libwallet2_api_c.so.xz
|
||||
-rm build/linux/${FLUTTER_ARCH}/release/bundle/lib/libwallet2_api_c.so
|
||||
unxz build/linux/${FLUTTER_ARCH}/release/bundle/lib/libwallet2_api_c.so.xz
|
||||
-rm build/linux/${FLUTTER_ARCH}/release/xmruw-linux-${DEBIAN_ARCH}.tar*
|
||||
(cd build/linux/${FLUTTER_ARCH}/release && cp -a bundle xmruw && tar -cvf xmruw-linux-${DEBIAN_ARCH}.tar xmruw && xz -e xmruw-linux-${DEBIAN_ARCH}.tar)
|
||||
|
||||
|
||||
.PHONY: linux_debug_lib
|
||||
linux_debug_lib:
|
||||
wget https://static.mrcyjanek.net/monero_c/${MONERO_C_TAG}/${shell gcc -dumpmachine}_libwallet2_api_c.so.xz \
|
||||
-O build/linux/${FLUTTER_ARCH}/debug/bundle/lib/libwallet2_api_c.so.xz
|
||||
-rm build/linux/${FLUTTER_ARCH}/debug/bundle/lib/libwallet2_api_c.so
|
||||
unxz build/linux/${FLUTTER_ARCH}/debug/bundle/lib/libwallet2_api_c.so.xz
|
||||
|
||||
deb:
|
||||
dart pub global activate --source git https://github.com/tomekit/flutter_to_debian.git
|
||||
cat debian/debian.yaml.txt | sed 's/x64/${FLUTTER_ARCH}/g' | sed 's/amd64/${DEBIAN_ARCH}/g' > debian/debian.yaml
|
||||
${HOME}/.pub-cache/bin/flutter_to_debian
|
||||
|
||||
.PHONY: dev
|
||||
dev: libs
|
||||
|
||||
dev:
|
||||
lib/const/resource.g.dart:
|
||||
dart pub global activate flutter_asset_generator
|
||||
timeout 15 ${HOME}/.pub-cache/bin/fgen || true
|
||||
mv lib/const/resource.dart lib/const/resource.g.dart
|
||||
.PHONY: lib/const/resource.g.dart
|
||||
|
||||
.PHONY: sailfishos
|
||||
sailfishos:
|
||||
./build_changelog.sh
|
||||
bash ./elinux/sailfish_build.sh
|
||||
|
||||
.PHONY: version
|
||||
version:
|
||||
sed -i "s/^version: .*/version: 1.0.0+$(shell git rev-list --count HEAD)/" "pubspec.yaml"
|
||||
sed -i "s/^ Version: .*/ Version: 1.0.0+$(shell git rev-list --count HEAD)/" "debian/debian.yaml.txt"
|
||||
sed -i "s/^Version=.*/Version=1.0.0+$(shell git rev-list --count HEAD)/" "debian/gui/xmruw.desktop"
|
||||
sed -i "s/^Version=.*/Version=1.0.0+$(shell git rev-list --count HEAD)/" "elinux/unnamed-monero-wallet.desktop"
|
||||
sed -i "s/^Version: .*/Version: 1.0.0+$(shell git rev-list --count HEAD)/" "elinux/sailfishos.spec"
|
||||
sed -i "s/^Release: .*/Release: $(shell git rev-list --count HEAD)/" "elinux/sailfishos.spec"
|
||||
sed -i "s/^Version: .*/Version: 1.0.0+$(shell git rev-list --count HEAD)/" "elinux/sailfishos.spec"
|
||||
sed -i "s/^const xmruwVersion = .*/const xmruwVersion = '$(shell git describe --tags)';/" "lib/helpers/licenses_extra.dart"
|
||||
|
||||
.PHONY: lib/helpers/licenses.g.dart
|
||||
lib/helpers/licenses.g.dart:
|
||||
dart pub run flutter_oss_licenses:generate.dart -o lib/helpers/licenses.g.dart
|
||||
|
||||
libs: android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so
|
||||
.PHONY: android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so
|
||||
android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.monero.app">
|
||||
package="com.cakewallet.cake_wallet">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
|
|
|
@ -245,8 +245,8 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
path: "."
|
||||
ref: e2149153ecbaa6cc4d7d3970d8fa8ce1099b63af
|
||||
resolved-ref: e2149153ecbaa6cc4d7d3970d8fa8ce1099b63af
|
||||
ref: "57e075ee67d16aa0f3f75fba67d79529fbc73a6c"
|
||||
resolved-ref: "57e075ee67d16aa0f3f75fba67d79529fbc73a6c"
|
||||
url: "https://git.mrcyjanek.net/mrcyjanek/monero.dart"
|
||||
source: git
|
||||
version: "0.0.0"
|
||||
|
|
|
@ -134,10 +134,9 @@ void commitTransactionFromPointerAddress({required int address}) =>
|
|||
void commitTransaction({required monero.PendingTransaction transactionPointer}) {
|
||||
|
||||
final txCommit = monero.PendingTransaction_commit(transactionPointer, filename: '', overwrite: false);
|
||||
final status = monero.PendingTransaction_status(transactionPointer.cast());
|
||||
|
||||
final String? error = (() {
|
||||
final status = monero.Wallet_status(wptr!);
|
||||
final status = monero.PendingTransaction_status(transactionPointer.cast());
|
||||
if (status == 0) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -23,14 +23,18 @@ bool isNewTransactionExist() {
|
|||
}
|
||||
String getFilename() => monero.Wallet_filename(wptr!);
|
||||
|
||||
// TODO(mrcyjanek): Cake polyseed support
|
||||
String getSeed() {
|
||||
final legacy = monero.Wallet_seed(wptr!, seedOffset: '');
|
||||
final polyseed = monero.Wallet_getPolyseed(wptr!, passphrase: '');
|
||||
if (polyseed == "") {
|
||||
return legacy;
|
||||
// monero.Wallet_setCacheAttribute(wptr!, key: "cakewallet.seed", value: seed);
|
||||
final cakepolyseed = monero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.seed");
|
||||
if (cakepolyseed != "") {
|
||||
return cakepolyseed;
|
||||
}
|
||||
return polyseed;
|
||||
final polyseed = monero.Wallet_getPolyseed(wptr!, passphrase: '');
|
||||
if (polyseed != "") {
|
||||
return polyseed;
|
||||
}
|
||||
final legacy = monero.Wallet_seed(wptr!, seedOffset: '');
|
||||
return legacy;
|
||||
}
|
||||
|
||||
String getAddress({int accountIndex = 0, int addressIndex = 1}) => monero.Wallet_address(wptr!, accountIndex: accountIndex, addressIndex: addressIndex);
|
||||
|
|
|
@ -114,15 +114,14 @@ void restoreWalletFromSpendKeySync(
|
|||
// nettype: 0,
|
||||
// );
|
||||
|
||||
wptr = monero.WalletManager_createWalletFromPolyseed(
|
||||
wptr = monero.WalletManager_createDeterministicWalletFromSpendKey(
|
||||
wmPtr,
|
||||
path: path,
|
||||
password: password,
|
||||
mnemonic: seed,
|
||||
seedOffset: '',
|
||||
newWallet: false,
|
||||
language: language,
|
||||
spendKeyString: spendKey,
|
||||
newWallet: true, // TODO(mrcyjanek): safe to remove
|
||||
restoreHeight: restoreHeight,
|
||||
kdfRounds: 1,
|
||||
);
|
||||
|
||||
final status = monero.Wallet_status(wptr!);
|
||||
|
@ -133,6 +132,8 @@ void restoreWalletFromSpendKeySync(
|
|||
throw WalletRestoreFromKeysException(message: err);
|
||||
}
|
||||
|
||||
monero.Wallet_setCacheAttribute(wptr!, key: "cakewallet.seed", value: seed);
|
||||
|
||||
storeSync();
|
||||
}
|
||||
|
||||
|
|
|
@ -414,8 +414,8 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: e2149153ecbaa6cc4d7d3970d8fa8ce1099b63af
|
||||
resolved-ref: e2149153ecbaa6cc4d7d3970d8fa8ce1099b63af
|
||||
ref: "57e075ee67d16aa0f3f75fba67d79529fbc73a6c"
|
||||
resolved-ref: "57e075ee67d16aa0f3f75fba67d79529fbc73a6c"
|
||||
url: "https://git.mrcyjanek.net/mrcyjanek/monero.dart"
|
||||
source: git
|
||||
version: "0.0.0"
|
||||
|
|
|
@ -25,7 +25,7 @@ dependencies:
|
|||
monero:
|
||||
git:
|
||||
url: https://git.mrcyjanek.net/mrcyjanek/monero.dart
|
||||
ref: e2149153ecbaa6cc4d7d3970d8fa8ce1099b63af
|
||||
ref: 57e075ee67d16aa0f3f75fba67d79529fbc73a6c
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
|
@ -111,10 +111,7 @@ dependencies:
|
|||
git:
|
||||
url: https://github.com/cake-tech/bitcoin_base.git
|
||||
ref: cake-update-v2
|
||||
monero:
|
||||
git:
|
||||
url: https://git.mrcyjanek.net/mrcyjanek/monero.dart
|
||||
ref: master
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
get_current_branch() {
|
||||
if git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
echo "$branch"
|
||||
echo "$branch" | tr '-' '_'
|
||||
else
|
||||
echo "Error: Not a git repository."
|
||||
return 1
|
||||
|
@ -27,4 +27,4 @@ if [[ $? -eq 0 ]]; then
|
|||
fi
|
||||
|
||||
# run the app
|
||||
flutter run
|
||||
flutter run
|
||||
|
|
1
scripts/docker/.gitignore
vendored
1
scripts/docker/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
output/
|
||||
cache/
|
|
@ -4,7 +4,7 @@ LABEL authors="konsti"
|
|||
ENV MONERO_BRANCH=release-v0.18.2.2-android
|
||||
RUN apt-get update && \
|
||||
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
|
||||
apt-get install -y dialog apt-utils curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake clang bison
|
||||
apt-get install -y dialog apt-utils curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake clang bison ccache
|
||||
|
||||
RUN mkdir /opt/android/
|
||||
|
||||
|
@ -56,5 +56,7 @@ RUN ./build_zmq.sh
|
|||
COPY entrypoint.sh /opt/android/cakewallet/
|
||||
COPY build_monero.sh /opt/android/cakewallet/
|
||||
COPY copy_monero_deps.sh /opt/android/cakewallet/
|
||||
COPY build_haven.sh /opt/android/cakewallet/
|
||||
COPY copy_haven_deps.sh /opt/android/cakewallet/
|
||||
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
|
|
|
@ -1,71 +1,71 @@
|
|||
#!/bin/sh
|
||||
set -x -e
|
||||
|
||||
. ./config.sh
|
||||
HAVEN_VERSION=tags/v3.0.7
|
||||
HAVEN_SRC_DIR=${WORKDIR}/haven
|
||||
|
||||
git clone https://github.com/haven-protocol-org/haven-main.git ${HAVEN_SRC_DIR}
|
||||
git checkout ${HAVEN_VERSION}
|
||||
cd $HAVEN_SRC_DIR
|
||||
git submodule init
|
||||
git submodule update
|
||||
|
||||
for arch in "aarch" "aarch64" "i686" "x86_64"
|
||||
do
|
||||
FLAGS=""
|
||||
PREFIX=${WORKDIR}/prefix_${arch}
|
||||
DEST_LIB_DIR=${PREFIX}/lib/haven
|
||||
DEST_INCLUDE_DIR=${PREFIX}/include/haven
|
||||
export CMAKE_INCLUDE_PATH="${PREFIX}/include"
|
||||
export CMAKE_LIBRARY_PATH="${PREFIX}/lib"
|
||||
ANDROID_STANDALONE_TOOLCHAIN_PATH="${TOOLCHAIN_BASE_DIR}_${arch}"
|
||||
PATH="${ANDROID_STANDALONE_TOOLCHAIN_PATH}/bin:${ORIGINAL_PATH}"
|
||||
|
||||
mkdir -p $DEST_LIB_DIR
|
||||
mkdir -p $DEST_INCLUDE_DIR
|
||||
|
||||
case $arch in
|
||||
"aarch" )
|
||||
CLANG=arm-linux-androideabi-clang
|
||||
CXXLANG=arm-linux-androideabi-clang++
|
||||
BUILD_64=OFF
|
||||
TAG="android-armv7"
|
||||
ARCH="armv7-a"
|
||||
ARCH_ABI="armeabi-v7a"
|
||||
FLAGS="-D CMAKE_ANDROID_ARM_MODE=ON -D NO_AES=true";;
|
||||
"aarch64" )
|
||||
CLANG=aarch64-linux-androideabi-clang
|
||||
CXXLANG=aarch64-linux-androideabi-clang++
|
||||
BUILD_64=ON
|
||||
TAG="android-armv8"
|
||||
ARCH="armv8-a"
|
||||
ARCH_ABI="arm64-v8a";;
|
||||
"i686" )
|
||||
CLANG=i686-linux-androideabi-clang
|
||||
CXXLANG=i686-linux-androideabi-clang++
|
||||
BUILD_64=OFF
|
||||
TAG="android-x86"
|
||||
ARCH="i686"
|
||||
ARCH_ABI="x86";;
|
||||
"x86_64" )
|
||||
CLANG=x86_64-linux-androideabi-clang
|
||||
CXXLANG=x86_64-linux-androideabi-clang++
|
||||
BUILD_64=ON
|
||||
TAG="android-x86_64"
|
||||
ARCH="x86-64"
|
||||
ARCH_ABI="x86_64";;
|
||||
esac
|
||||
|
||||
cd $HAVEN_SRC_DIR
|
||||
rm -rf ./build/release
|
||||
mkdir -p ./build/release
|
||||
cd ./build/release
|
||||
CC=${CLANG} CXX=${CXXLANG} cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH=${ARCH} -D STATIC=ON -D BUILD_64=${BUILD_64} -D CMAKE_BUILD_TYPE=release -D ANDROID=true -D INSTALL_VENDORED_LIBUNBOUND=ON -D BUILD_TAG=${TAG} -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${ANDROID_STANDALONE_TOOLCHAIN_PATH}" -D CMAKE_ANDROID_ARCH_ABI=${ARCH_ABI} $FLAGS ../..
|
||||
|
||||
make wallet_api -j$THREADS
|
||||
find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \;
|
||||
|
||||
cp -r ./lib/* $DEST_LIB_DIR
|
||||
cp ../../src/wallet/api/wallet2_api.h $DEST_INCLUDE_DIR
|
||||
done
|
||||
#!/bin/sh
|
||||
set -x -e
|
||||
|
||||
. ./config.sh
|
||||
HAVEN_VERSION=tags/v3.0.7
|
||||
HAVEN_SRC_DIR=${WORKDIR}/haven
|
||||
|
||||
git clone https://github.com/haven-protocol-org/haven-main.git ${HAVEN_SRC_DIR}
|
||||
cd $HAVEN_SRC_DIR
|
||||
git checkout ${HAVEN_VERSION}
|
||||
git submodule init
|
||||
git submodule update
|
||||
|
||||
for arch in "aarch" "aarch64" "i686" "x86_64"
|
||||
do
|
||||
FLAGS=""
|
||||
PREFIX=${WORKDIR}/prefix_${arch}
|
||||
DEST_LIB_DIR=${PREFIX}/lib/haven
|
||||
DEST_INCLUDE_DIR=${PREFIX}/include/haven
|
||||
export CMAKE_INCLUDE_PATH="${PREFIX}/include"
|
||||
export CMAKE_LIBRARY_PATH="${PREFIX}/lib"
|
||||
ANDROID_STANDALONE_TOOLCHAIN_PATH="${TOOLCHAIN_BASE_DIR}_${arch}"
|
||||
PATH="${ANDROID_STANDALONE_TOOLCHAIN_PATH}/bin:${ORIGINAL_PATH}"
|
||||
|
||||
mkdir -p $DEST_LIB_DIR
|
||||
mkdir -p $DEST_INCLUDE_DIR
|
||||
|
||||
case $arch in
|
||||
"aarch" )
|
||||
CLANG=arm-linux-androideabi-clang
|
||||
CXXLANG=arm-linux-androideabi-clang++
|
||||
BUILD_64=OFF
|
||||
TAG="android-armv7"
|
||||
ARCH="armv7-a"
|
||||
ARCH_ABI="armeabi-v7a"
|
||||
FLAGS="-D CMAKE_ANDROID_ARM_MODE=ON -D NO_AES=true";;
|
||||
"aarch64" )
|
||||
CLANG=aarch64-linux-androideabi-clang
|
||||
CXXLANG=aarch64-linux-androideabi-clang++
|
||||
BUILD_64=ON
|
||||
TAG="android-armv8"
|
||||
ARCH="armv8-a"
|
||||
ARCH_ABI="arm64-v8a";;
|
||||
"i686" )
|
||||
CLANG=i686-linux-androideabi-clang
|
||||
CXXLANG=i686-linux-androideabi-clang++
|
||||
BUILD_64=OFF
|
||||
TAG="android-x86"
|
||||
ARCH="i686"
|
||||
ARCH_ABI="x86";;
|
||||
"x86_64" )
|
||||
CLANG=x86_64-linux-androideabi-clang
|
||||
CXXLANG=x86_64-linux-androideabi-clang++
|
||||
BUILD_64=ON
|
||||
TAG="android-x86_64"
|
||||
ARCH="x86-64"
|
||||
ARCH_ABI="x86_64";;
|
||||
esac
|
||||
|
||||
cd $HAVEN_SRC_DIR
|
||||
rm -rf ./build/release
|
||||
mkdir -p ./build/release
|
||||
cd ./build/release
|
||||
CC=${CLANG} CXX=${CXXLANG} cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH=${ARCH} -D STATIC=ON -D BUILD_64=${BUILD_64} -D CMAKE_BUILD_TYPE=release -D ANDROID=true -D INSTALL_VENDORED_LIBUNBOUND=ON -D BUILD_TAG=${TAG} -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${ANDROID_STANDALONE_TOOLCHAIN_PATH}" -D CMAKE_ANDROID_ARCH_ABI=${ARCH_ABI} $FLAGS ../..
|
||||
|
||||
make wallet_api -j$THREADS
|
||||
find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \;
|
||||
|
||||
cp -r ./lib/* $DEST_LIB_DIR
|
||||
cp ../../src/wallet/api/wallet2_api.h $DEST_INCLUDE_DIR
|
||||
done
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
set -x -e
|
||||
set -x
|
||||
|
||||
WORKDIR=/opt/android
|
||||
CW_DIR=${WORKDIR}/cake_wallet
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
set -x -e
|
||||
set -x
|
||||
|
||||
WORKDIR=/opt/android
|
||||
CW_EXRTERNAL_DIR=${WORKDIR}/output/android
|
||||
|
|
|
@ -7,3 +7,5 @@ services:
|
|||
MONERO_BRANCH: release-v0.18.2.2-android
|
||||
volumes:
|
||||
- ./output:/opt/android/output
|
||||
- ./cache/dotcache:/root/.cache
|
||||
- ./cache/dotccache:/root/.ccache
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
#!/bin/bash
|
||||
set -x -e
|
||||
|
||||
ls /opt/android
|
||||
|
||||
rm -rf monero haven
|
||||
|
||||
./build_monero.sh
|
||||
./build_haven.sh
|
||||
./copy_monero_deps.sh
|
||||
./copy_haven_deps.sh
|
||||
|
|
Loading…
Reference in a new issue