Zano with passphrase (#1971)

* CW-685 Add passphrase restore for xmr/wow (#1552)

* CW-685 Add passphrase restore for xmr/wow

* add support for polyseed passphrase

* disable 14 word seed passphrase (not supported in wownero-seed)
fix: Getting grayed screen on latest passphrase build after having restored a 14-word wownero seed (+passphrase) and attempting to restore a XMR seed, legacy or otherwise.

* fix pointer when restoring depracated wownero seed

* Fix polyseed encryption

* changes from review

* remove unused code

* add passphrase back to the screen
add passphrase to qr code backup export

* fix settings leaking through currencies on seed restore

* fix monero.com builds, make passphrase a getter on WalletBase

* add support for weird polyseed

* store passphrase for weird polyseed

* show encrypted seed only when passphrase is not empty

* force set restore height

* fix build issues

* fix build errors

* fix configure script

* print -> printV

* Update lib/view_model/wallet_keys_view_model.dart [skip ci]

* Update lib/view_model/wallet_keys_view_model.dart [skip ci]

* Update tool/configure.dart [skip ci]

* Update lib/view_model/wallet_new_vm.dart

* reuse existing passphrase field

* remove unused passphrase field

* make workflow run on pullrequests only [skip ci] [skip slack]

---------

Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>

* Zano (#1793)

* my experiments

* Inital code for Zano integration

* Added missing android log lib

* added dummy wallet & some zano implementation

* fixing api for zano

* fixed zano build script

* attempt tp fix namespace problem

* added copy script for Zano files

* changes for zano wallet

* last updates

* zano.dart test app

* wallet recovery

* added pending transfer, some cleanup of unused

* some cleanup

* send + receive qr code

* last upd

* updated build_zano.sh

* updated zano ApiCalls, removed dummy

* updated zano ApiCalls, removed dummy

* added logging for get status/get info

* restored old wallet.dart

* restoring original versions of files

* restoring original versions of files

* restored get_height_by_date.dart, removed unnecessary calls for zano get height

* restoring original versions

* added multiple destinations, send all flag; some refactoring

* logging

* removed the duplicate

* fixed syncing sync status, decimal division, safe null json parsing

* some fixes after merge

* added multibalance/asset support for zano (ui)

* adding/removing from whitelist

* transfers in different assets

* transfers for multiple destinations and send all, some refactoring

* whitelists, some refactoring

* added different digits (decimal points) for formatters, some refactoring

* open, create, restore wallet refactoring; whitelists

* whitelists

* getting and updating transaction list; restoring a wallet from QR code

* several attempts to close wallet

* some refactoring

* added seed phrase

* changed fields to BigInt, some fixes

* modified build scripts for android

* build scripts

* restored accidently removed cw_haven.dart

* inital ios integration(zano libs built)

* update in script

* latest changes

* Applied a patch for iOS build (Boost and Zano scripts)

* Removed zano.dart (script-generated) and some unnecessary files

* Revert "Removed zano.dart (script-generated) and some unnecessary files"

This reverts commit 367c86398e.

* Removed zano.dart (generated by scripts), some files restored to initial versions

* added timer library

* changed paths in build_zano.sh

* build_zano.sh

* edit_token_page.dart - removed flag skipZanoAddressValidation

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>

* lib/core/address_validator.dart - updated zano address regex
lib/src/screens/dashboard/edit_token_page.dart - using AddressValidator().call

* fix zano build issues on android

* remove contrib/depends to save space

* move async call to a synchronouse one

* call sync call in isolate to make it async
generate framework for iOS as well
fix UR issues

* zano changes from monero_c repo

* update monero_c hash

* fix invalid zano imports, add support for linux, speed up CI builds

* update monero_c hash

* bump monero_c commit (yes, again, I know)

* fix wallet resttore, fix hardcoded IP

* fix regex, don't throw error when opening wallet, fix tx history, fix async calls, move stuff to isolate

* fix api calls in async transaction creation

* update build scripts

* fix some build issues

* update dependencies

* fix dependencies

* update ci scripts

* Improve multithread use of zano api

* Fix build issue

* fix zano node selection, move other zano calls to separate isolate

* update moneroc hash
WIP fixes for zano

* update monero_c

* fix monero.com builds

* sync wallet after connecting

* update monero_c

* Fix windows builds

* update monero_c

* update monero_c

* unshallow submodule

* cherry pick CW-867 Wownero fixes (#1881)

* fix wownero syntax error

* remove print statements in zano

* update zano node URL

* [PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)

* drop env -i to fix cmake build errors on newer system

* [skip ci] Revert "[PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)"

This reverts commit 5acb5bfe57.

* [run tests] [skip slack] Fix env in build

* Dynamically detect number of cores used to build monero_c, since it appears that zano requires more memory to link (and it reliably fails for first couple builds due to OOM on CI/VM with memory constrains).
Drop unshallowing of all modules
[run tests]

* Changes from review [run tests]

* drop zano on linux (missing symbols)
fix wownero on linux
add aarch64-linux-gnu
[run tests]

* - remove duplicate entry in addToken()
- use walletPassword in createZanoNewWalletCredentials
- remove createZanoRestoreWalletFromKeysCredentials
[run tests]

* [skip ci] update dockerfile

* fix parameter issue

---------

Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>

* - Add Zano Aliases
- Enable simpleswap [skip ci]
- Fix settings migration versions

* push missing file [skip ci]

* Zano pr with CW-685 passphrase (#1969)

* my experiments

* Inital code for Zano integration

* Added missing android log lib

* added dummy wallet & some zano implementation

* fixing api for zano

* fixed zano build script

* attempt tp fix namespace problem

* added copy script for Zano files

* changes for zano wallet

* last updates

* zano.dart test app

* wallet recovery

* added pending transfer, some cleanup of unused

* some cleanup

* send + receive qr code

* last upd

* updated build_zano.sh

* updated zano ApiCalls, removed dummy

* updated zano ApiCalls, removed dummy

* added logging for get status/get info

* restored old wallet.dart

* restoring original versions of files

* restoring original versions of files

* restored get_height_by_date.dart, removed unnecessary calls for zano get height

* restoring original versions

* added multiple destinations, send all flag; some refactoring

* logging

* removed the duplicate

* fixed syncing sync status, decimal division, safe null json parsing

* some fixes after merge

* added multibalance/asset support for zano (ui)

* adding/removing from whitelist

* transfers in different assets

* transfers for multiple destinations and send all, some refactoring

* whitelists, some refactoring

* added different digits (decimal points) for formatters, some refactoring

* open, create, restore wallet refactoring; whitelists

* whitelists

* getting and updating transaction list; restoring a wallet from QR code

* several attempts to close wallet

* some refactoring

* added seed phrase

* CW-685 Add passphrase restore for xmr/wow

* add support for polyseed passphrase

* disable 14 word seed passphrase (not supported in wownero-seed)
fix: Getting grayed screen on latest passphrase build after having restored a 14-word wownero seed (+passphrase) and attempting to restore a XMR seed, legacy or otherwise.

* fix pointer when restoring depracated wownero seed

* Fix polyseed encryption

* changed fields to BigInt, some fixes

* modified build scripts for android

* build scripts

* restored accidently removed cw_haven.dart

* inital ios integration(zano libs built)

* update in script

* latest changes

* changes from review

* remove unused code

* add passphrase back to the screen
add passphrase to qr code backup export

* fix settings leaking through currencies on seed restore

* fix monero.com builds, make passphrase a getter on WalletBase

* add support for weird polyseed

* store passphrase for weird polyseed

* show encrypted seed only when passphrase is not empty

* force set restore height

* Applied a patch for iOS build (Boost and Zano scripts)

* Removed zano.dart (script-generated) and some unnecessary files

* Revert "Removed zano.dart (script-generated) and some unnecessary files"

This reverts commit 367c86398e.

* Removed zano.dart (generated by scripts), some files restored to initial versions

* fix build issues

* fix build errors

* added timer library

* changed paths in build_zano.sh

* build_zano.sh

* edit_token_page.dart - removed flag skipZanoAddressValidation

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>

* lib/core/address_validator.dart - updated zano address regex
lib/src/screens/dashboard/edit_token_page.dart - using AddressValidator().call

* fix zano build issues on android

* remove contrib/depends to save space

* move async call to a synchronouse one

* call sync call in isolate to make it async
generate framework for iOS as well
fix UR issues

* zano changes from monero_c repo

* update monero_c hash

* fix invalid zano imports, add support for linux, speed up CI builds

* update monero_c hash

* bump monero_c commit (yes, again, I know)

* fix wallet resttore, fix hardcoded IP

* fix regex, don't throw error when opening wallet, fix tx history, fix async calls, move stuff to isolate

* fix api calls in async transaction creation

* fix configure script

* update build scripts

* fix some build issues

* update dependencies

* fix dependencies

* update ci scripts

* Improve multithread use of zano api

* Fix build issue

* fix zano node selection, move other zano calls to separate isolate

* update moneroc hash
WIP fixes for zano

* update monero_c

* fix monero.com builds

* sync wallet after connecting

* update monero_c

* Fix windows builds

* update monero_c

* print -> printV

* update monero_c

* unshallow submodule

* cherry pick CW-867 Wownero fixes (#1881)

* fix wownero syntax error

* remove print statements in zano

* update zano node URL

* [PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)

* drop env -i to fix cmake build errors on newer system

* Update lib/view_model/wallet_keys_view_model.dart [skip ci]

* Update lib/view_model/wallet_keys_view_model.dart [skip ci]

* Update tool/configure.dart [skip ci]

* Update lib/view_model/wallet_new_vm.dart

* [skip ci] Revert "[PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)"

This reverts commit 5acb5bfe57.

* [run tests] [skip slack] Fix env in build

* Dynamically detect number of cores used to build monero_c, since it appears that zano requires more memory to link (and it reliably fails for first couple builds due to OOM on CI/VM with memory constrains).
Drop unshallowing of all modules
[run tests]

* Changes from review [run tests]

* drop zano on linux (missing symbols)
fix wownero on linux
add aarch64-linux-gnu
[run tests]

* - remove duplicate entry in addToken()
- use walletPassword in createZanoNewWalletCredentials
- remove createZanoRestoreWalletFromKeysCredentials
[run tests]

* [skip ci] update dockerfile

* reuse existing passphrase field

* add passphrase support for zano

* Drop aarch64-linux-gnu for now.

* fix passphrase display, fix gray screen

* catch errors in polyseed encryption, encrypt only polyseed, fix coin in wownero

* update monero_c
update wownero to 0.11.3.0

* Show passphrase only when non-empty, fix passphrase being displayed as view key private.

* fix NanoAccountListPage showing up instead of MoneroAccountListPage for wownero

* build zano dependencies on android

* fix parameter issue

* minor merge leftover [skip ci]

* minor cleanup [skip ci]

* fix zano alias
update eth url for ens lookup
change $MAKE_JOB_COUNT to $NPROC

* minor cleanup [skip ci]

* fix zano alias

* Disable passphrase for creation of xmr/wow/zano
minor fixes

* fix zano on iOS

* - Fix get token data
- Enable unavailable balance
- Enable confirmations count
- Adjust explorer link

---------

Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>

---------

Co-authored-by: cyan <cyjan@mrcyjanek.net>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
This commit is contained in:
Omar Hatem 2025-01-24 20:33:24 +02:00 committed by GitHub
parent 9cda2c99e7
commit df3a26dc15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
169 changed files with 6113 additions and 212 deletions

View file

@ -1,4 +1,5 @@
#!/bin/bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/functions.sh"
# Usage: env USE_DOCKER= ./build_all.sh
@ -6,11 +7,9 @@ set -x -e
cd "$(dirname "$0")"
NPROC="-j$(nproc)"
../prepare_moneroc.sh
for COIN in monero wownero;
for COIN in monero wownero zano;
do
pushd ../monero_c
for target in {x86_64,aarch64}-linux-android armv7a-linux-androideabi
@ -19,9 +18,9 @@ do
then
echo "file exist, not building monero_c for ${COIN}/$target.";
else
env -i ./build_single.sh ${COIN} $target $NPROC
./build_single.sh ${COIN} $target -j$MAKE_JOB_COUNT
unxz -f ../monero_c/release/${COIN}/${target}_libwallet2_api_c.so.xz
fi
done
popd
done
done

View file

@ -5,6 +5,7 @@ CW_DIR=${WORKDIR}/cake_wallet
CW_EXRTERNAL_DIR=${CW_DIR}/cw_shared_external/ios/External/android
CW_HAVEN_EXTERNAL_DIR=${CW_DIR}/cw_haven/ios/External/android
CW_MONERO_EXTERNAL_DIR=${CW_DIR}/cw_monero/ios/External/android
CW_ZANO_EXTERNAL_DIR=${CW_DIR}/cw_zano/ios/External/android
for arch in "aarch" "aarch64" "i686" "x86_64"
do
@ -40,5 +41,6 @@ done
mkdir -p ${CW_HAVEN_EXTERNAL_DIR}/include
mkdir -p ${CW_MONERO_EXTERNAL_DIR}/include
mkdir -p ${CW_ZANO_EXTERNAL_DIR}/include
cp $CW_EXRTERNAL_DIR/x86/include/haven/wallet2_api.h ${CW_HAVEN_EXTERNAL_DIR}/include

View file

@ -5,5 +5,5 @@ PREFIX=$2
BOOST_SRC_DIR=$3
cd $BOOST_SRC_DIR
./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale --build-dir=android --stagedir=android toolset=clang threading=multi threadapi=pthread target-os=android -sICONV_PATH=${PREFIX} -j$THREADS install
echo "Building boost"
./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-timer --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale --with-log --build-dir=android --stagedir=android toolset=clang threading=multi threadapi=pthread target-os=android -sICONV_PATH=${PREFIX} -j$THREADS install

View file

@ -1,5 +1,5 @@
#!/bin/bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/universal_sed.sh"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/functions.sh"
if [ -z "$APP_ANDROID_TYPE" ]; then
echo "Please set APP_ANDROID_TYPE"
exit 1

View file

@ -10,7 +10,7 @@ case $APP_ANDROID_TYPE in
CONFIG_ARGS="--monero"
;;
$CAKEWALLET)
CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero"
CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --zano"
if [ "$CW_WITH_HAVEN" = true ];then
CONFIG_ARGS="$CONFIG_ARGS --haven"
fi

33
scripts/functions.sh Normal file
View file

@ -0,0 +1,33 @@
#!/bin/bash
detect_sed() {
if sed --version 2>/dev/null | grep -q "GNU"; then
SED_TYPE="GNU"
else
SED_TYPE="BSD"
fi
}
universal_sed() {
local expression=$1
local file=$2
if [[ "$SED_TYPE" == "GNU" ]]; then
sed -i "$expression" "$file"
else
sed -i '' "$expression" "$file"
fi
}
detect_sed
if [[ "$(uname)" == "Linux" ]];
then
export MAKE_JOB_COUNT="$(expr $(printf '%s\n%s' $(( $(grep MemTotal: /proc/meminfo | cut -d: -f2 | cut -dk -f1) * 4 / (1048576 * 9) )) $(nproc) | sort -n | head -n1) '|' 1)"
elif [[ "$(uname)" == "Darwin" ]];
then
export MAKE_JOB_COUNT="(expr $(printf '%s\n%s' $(( $(sysctl -n hw.memsize) * 4 / (1073741824 * 9) )) $(sysctl -n hw.logicalcpu) | sort -n | head -n1) '|' 1)"
else
# Assume windows eh?
export MAKE_JOB_COUNT="$(expr $(printf '%s\n%s' $(( $(grep MemTotal: /proc/meminfo | cut -d: -f2 | cut -dk -f1) * 4 / (1048576 * 9) )) $(nproc) | sort -n | head -n1) '|' 1)"
fi

View file

@ -1,5 +1,5 @@
#!/bin/bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/universal_sed.sh"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/functions.sh"
set -x -e
MONERO_COM="monero.com"
CAKEWALLET="cakewallet"
@ -32,7 +32,7 @@ case $APP_IOS_TYPE in
CONFIG_ARGS="--monero"
;;
$CAKEWALLET)
CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero"
CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --zano"
if [ "$CW_WITH_HAVEN" = true ];then
CONFIG_ARGS="$CONFIG_ARGS --haven"
fi

View file

@ -1,23 +1,42 @@
#!/bin/sh
#!/bin/bash
set -e
. ./config.sh
MIN_IOS_VERSION=10.0
BOOST_URL="https://github.com/cake-tech/Apple-Boost-BuildScript.git"
BOOST_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/Apple-Boost-BuildScript"
BOOST_VERSION=1.72.0
BOOST_VERSION=1.84.0
BOOST_LIBS="random regex graph random chrono thread filesystem system date_time locale serialization program_options"
echo "============================ Boost ============================"
echo "Cloning Apple-Boost-BuildScript from - $BOOST_URL"
git clone -b build $BOOST_URL $BOOST_DIR_PATH
cd $BOOST_DIR_PATH
# Check if the directory already exists.
if [ -d "$BOOST_DIR_PATH" ]; then
echo "Boost directory already exists."
else
echo "Cloning Boost from $BOOST_URL"
git clone -b build $BOOST_URL $BOOST_DIR_PATH
fi
# Verify if the repository was cloned successfully.
if [ -d "$BOOST_DIR_PATH/.git" ]; then
echo "Boost repository cloned successfully."
cd $BOOST_DIR_PATH
git checkout build
else
echo "Failed to clone Boost repository. Exiting."
exit 1
fi
./boost.sh -ios \
--min-ios-version ${MIN_IOS_VERSION} \
--boost-libs "${BOOST_LIBS}" \
--boost-version ${BOOST_VERSION} \
--no-framework
mv ${BOOST_DIR_PATH}/build/boost/${BOOST_VERSION}/ios/release/prefix/include/* $EXTERNAL_IOS_INCLUDE_DIR
mv ${BOOST_DIR_PATH}/build/boost/${BOOST_VERSION}/ios/release/prefix/lib/* $EXTERNAL_IOS_LIB_DIR
mv -f ${BOOST_DIR_PATH}/build/boost/${BOOST_VERSION}/ios/release/prefix/include/* $EXTERNAL_IOS_INCLUDE_DIR
mv -f ${BOOST_DIR_PATH}/build/boost/${BOOST_VERSION}/ios/release/prefix/lib/* $EXTERNAL_IOS_LIB_DIR

View file

@ -1,4 +1,5 @@
#!/bin/sh
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/functions.sh"
. ./config.sh
# ./install_missing_headers.sh
@ -12,17 +13,16 @@ set -x -e
cd "$(dirname "$0")"
NPROC="-j$(sysctl -n hw.logicalcpu)"
../prepare_moneroc.sh
for COIN in monero wownero;
for COIN in monero wownero zano;
do
pushd ../monero_c
rm -rf external/ios/build
./build_single.sh ${COIN} host-apple-ios $NPROC
./build_single.sh ${COIN} aarch64-apple-ios -j$NPROC
popd
done
unxz -f ../monero_c/release/monero/host-apple-ios_libwallet2_api_c.dylib.xz
unxz -f ../monero_c/release/wownero/host-apple-ios_libwallet2_api_c.dylib.xz
unxz -f ../monero_c/release/monero/aarch64-apple-ios_libwallet2_api_c.dylib.xz
unxz -f ../monero_c/release/wownero/aarch64-apple-ios_libwallet2_api_c.dylib.xz
unxz -f ../monero_c/release/zano/aarch64-apple-ios_libwallet2_api_c.dylib.xz

106
scripts/ios/build_zano.sh Executable file
View file

@ -0,0 +1,106 @@
#!/bin/sh
. ./config.sh
ZANO_URL="https://github.com/hyle-team/zano.git"
ZANO_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/zano"
ZANO_VERSION=fde28efdc5d7efe8741dcb0e62ea0aebc805a373
IOS_TOOLCHAIN_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/ios_toolchain"
IOS_TOOLCHAIN_URL="https://github.com/leetal/ios-cmake.git"
IOS_TOOLCHAIN_VERSION=06465b27698424cf4a04a5ca4904d50a3c966c45
export NO_DEFAULT_PATH
BUILD_TYPE=release
PREFIX=${EXTERNAL_IOS_DIR}
DEST_LIB_DIR=${EXTERNAL_IOS_LIB_DIR}/zano
DEST_INCLUDE_DIR=${EXTERNAL_IOS_INCLUDE_DIR}/zano
ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64="${ZANO_DIR_PATH}/build"
ZANO_MOBILE_IOS_INSTALL_FOLDER_ARM64="${ZANO_DIR_PATH}/install"
echo "ZANO_URL: $ZANO_URL"
echo "IOS_TOOLCHAIN_DIR_PATH: $IOS_TOOLCHAIN_DIR_PATH"
echo "ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64: $ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64"
echo "ZANO_MOBILE_IOS_INSTALL_FOLDER_ARM64: $ZANO_MOBILE_IOS_INSTALL_FOLDER_ARM64"
echo "PREFIX: $PREFIX"
echo "DEST_LIB_DIR: $DEST_LIB_DIR"
echo "DEST_INCLUDE_DIR: $DEST_INCLUDE_DIR"
echo "ZANO_DIR_PATH: $ZANO_DIR_PATH"
echo "Cloning ios_toolchain from - $IOS_TOOLCHAIN_URL to - $IOS_TOOLCHAIN_DIR_PATH"
git clone $IOS_TOOLCHAIN_URL $IOS_TOOLCHAIN_DIR_PATH
cd $IOS_TOOLCHAIN_DIR_PATH
git checkout $IOS_TOOLCHAIN_VERSION
git submodule update --init --force
cd ..
echo "Cloning zano from - $ZANO_URL to - $ZANO_DIR_PATH"
git clone $ZANO_URL $ZANO_DIR_PATH
cd $ZANO_DIR_PATH
git fetch origin
if [ $? -ne 0 ]; then
echo "Failed to perform command"
exit 1
fi
git checkout $ZANO_VERSION
if [ $? -ne 0 ]; then
echo "Failed to perform command"
exit 1
fi
git submodule update --init --force
if [ $? -ne 0 ]; then
echo "Failed to perform command"
exit 1
fi
mkdir -p build
cd ..
export CMAKE_INCLUDE_PATH="${PREFIX}/include"
export CMAKE_LIBRARY_PATH="${PREFIX}/lib"
rm -rf ${ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64} > /dev/null
rm -rf ${ZANO_MOBILE_IOS_INSTALL_FOLDER_ARM64} > /dev/null
echo "CMAKE_INCLUDE_PATH: $CMAKE_INCLUDE_PATH"
echo "CMAKE_LIBRARY_PATH: $CMAKE_LIBRARY_PATH"
echo "ROOT_DIR: $ROOT_DIR"
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_TOOLCHAIN_FILE="${IOS_TOOLCHAIN_DIR_PATH}/ios.toolchain.cmake" \
-DPLATFORM=OS64 \
-S"${ZANO_DIR_PATH}" \
-B"${ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64}" \
-GXcode \
-DCAKEWALLET=TRUE \
-DSKIP_BOOST_FATLIB_LIB=TRUE \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_INSTALL_PREFIX="${ZANO_MOBILE_IOS_INSTALL_FOLDER_ARM64}" \
-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \
-DCMAKE_CXX_FLAGS="-Wno-enum-constexpr-conversion" \
-DDISABLE_TOR=TRUE
# -DCMAKE_OSX_ARCHITECTURES="arm64"
# -DCMAKE_IOS_INSTALL_COMBINED=YES
if [ $? -ne 0 ]; then
echo "Failed to perform command"
exit 1
fi
cmake --build "${ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64}" --config $BUILD_TYPE --target install -- -j 4
if [ $? -ne 0 ]; then
echo "Failed to perform command"
exit 1
fi
mkdir -p $DEST_LIB_DIR
mkdir -p $DEST_INCLUDE_DIR
cp ${ZANO_MOBILE_IOS_INSTALL_FOLDER_ARM64}/lib/* $DEST_LIB_DIR
cp ${ZANO_DIR_PATH}/src/wallet/plain_wallet_api.h $DEST_INCLUDE_DIR

7
scripts/ios/build_zano_all.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
. ./config.sh
./install_missing_headers.sh
./build_openssl.sh
./build_boost.sh
./build_zano.sh

View file

@ -29,3 +29,19 @@ cd $FRWK_DIR # go to iOS framework dir
lipo -create $DYLIB_LINK_PATH -output WowneroWallet
echo "Generated ${FRWK_DIR}"
# also generate for zano
IOS_DIR="$(pwd)/../../ios"
DYLIB_NAME="zano_libwallet2_api_c.dylib"
DYLIB_LINK_PATH="${IOS_DIR}/${DYLIB_NAME}"
FRWK_DIR="${IOS_DIR}/ZanoWallet.framework"
if [ ! -f $DYLIB_LINK_PATH ]; then
echo "Dylib is not found by the link: ${DYLIB_LINK_PATH}"
exit 0
fi
cd $FRWK_DIR # go to iOS framework dir
lipo -create $DYLIB_LINK_PATH -output ZanoWallet
echo "Generated ${FRWK_DIR}"

View file

@ -13,16 +13,21 @@ fi
libtool -static -o libboost.a ./libboost_*.a
libtool -static -o libhaven.a ./haven/*.a
libtool -static -o libmonero.a ./monero/*.a
libtool -static -o libzano.a ./zano/*.a
CW_HAVEN_EXTERNAL_LIB=../../../../../cw_haven/ios/External/ios/lib
CW_HAVEN_EXTERNAL_INCLUDE=../../../../../cw_haven/ios/External/ios/include
CW_MONERO_EXTERNAL_LIB=../../../../../cw_monero/ios/External/ios/lib
CW_MONERO_EXTERNAL_INCLUDE=../../../../../cw_monero/ios/External/ios/include
CW_ZANO_EXTERNAL_LIB=../../../../../cw_zano/ios/External/ios/lib
CW_ZANO_EXTERNAL_INCLUDE=../../../../../cw_zano/ios/External/ios/include
mkdir -p $CW_HAVEN_EXTERNAL_INCLUDE
mkdir -p $CW_MONERO_EXTERNAL_INCLUDE
mkdir -p $CW_ZANO_EXTERNAL_INCLUDE
mkdir -p $CW_HAVEN_EXTERNAL_LIB
mkdir -p $CW_MONERO_EXTERNAL_LIB
mkdir -p $CW_ZANO_EXTERNAL_LIB
ln ./libboost.a ${CW_HAVEN_EXTERNAL_LIB}/libboost.a
ln ./libcrypto.a ${CW_HAVEN_EXTERNAL_LIB}/libcrypto.a
@ -37,4 +42,10 @@ ln ./libssl.a ${CW_MONERO_EXTERNAL_LIB}/libssl.a
ln ./libsodium.a ${CW_MONERO_EXTERNAL_LIB}/libsodium.a
ln ./libunbound.a ${CW_MONERO_EXTERNAL_LIB}/libunbound.a
cp ./libmonero.a $CW_MONERO_EXTERNAL_LIB
cp ../include/monero/* $CW_MONERO_EXTERNAL_INCLUDE
cp ../include/monero/* $CW_MONERO_EXTERNAL_INCLUDE
ln ./libboost.a ${CW_ZANO_EXTERNAL_LIB}/libboost.a
ln ./libcrypto.a ${CW_ZANO_EXTERNAL_LIB}/libcrypto.a
ln ./libssl.a ${CW_ZANO_EXTERNAL_LIB}/libssl.a
cp ./libzano.a $CW_ZANO_EXTERNAL_LIB
cp ../include/zano/* $CW_ZANO_EXTERNAL_INCLUDE

3
scripts/linux/.fvmrc Normal file
View file

@ -0,0 +1,3 @@
{
"flutter": "3.24.0"
}

3
scripts/linux/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
# FVM Version Cache
.fvm/

View file

@ -53,6 +53,8 @@ RUN set -o xtrace \
&& apt-get install -y udev qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils \
# for linux tests
&& apt-get install -y xvfb network-manager ffmpeg x11-utils \
# for aarch64-linux-gnu
&& apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
&& rm -rf /var/lib/apt/lists/* \
&& sh -c 'echo "en_US.UTF-8 UTF-8" > /etc/locale.gen' \
&& locale-gen \

View file

@ -1,5 +1,5 @@
#!/bin/bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/universal_sed.sh"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/functions.sh"
CAKEWALLET="cakewallet"
DIR=`pwd`

View file

@ -1,23 +1,22 @@
#!/bin/bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/functions.sh"
set -x -e
cd "$(dirname "$0")"
NPROC="-j$(nproc)"
../prepare_moneroc.sh
for COIN in monero wownero;
for COIN in monero wownero zano;
do
pushd ../monero_c
for target in x86_64-linux-gnu
for target in x86_64-linux-gnu # aarch64-linux-gnu
do
if [[ -f "release/${COIN}/${target}_libwallet2_api_c.so" ]];
then
echo "file exist, not building monero_c for ${COIN}/$target.";
else
./build_single.sh ${COIN} $target $NPROC
./build_single.sh ${COIN} $target -j$MAKE_JOB_COUNT
unxz -f ../monero_c/release/${COIN}/${target}_libwallet2_api_c.so.xz
fi
done

View file

@ -1,5 +1,5 @@
#!/bin/bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/universal_sed.sh"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/functions.sh"
MONERO_COM="monero.com"
CAKEWALLET="cakewallet"
@ -36,7 +36,7 @@ case $APP_MACOS_TYPE in
$MONERO_COM)
CONFIG_ARGS="--monero";;
$CAKEWALLET)
CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero";; #--haven
CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --zano";; #--haven
esac
cp -rf pubspec_description.yaml pubspec.yaml

View file

@ -22,11 +22,7 @@ then
popd
done
else
if [[ "x$1" == "xuniversal" ]]; then
ARCHS=(x86_64 arm64)
else
ARCHS=$(uname -m)
fi
for COIN in monero wownero;
do
MONERO_LIBS=""
@ -34,24 +30,16 @@ else
for ARCH in "${ARCHS[@]}";
do
if [[ "$ARCH" == "arm64" ]]; then
export HOMEBREW_PREFIX=/opt/homebrew
HOST="aarch64-host-apple-darwin"
HOST="aarch64-apple-darwin"
else
export HOMEBREW_PREFIX=/usr/local
HOST="${ARCH}-host-apple-darwin"
HOST="x86_64-apple-darwin"
fi
MONERO_LIBS="$MONERO_LIBS -arch ${ARCH} ${MONEROC_RELEASE_DIR}/${HOST}_libwallet2_api_c.dylib"
WOWNERO_LIBS="$WOWNERO_LIBS -arch ${ARCH} ${WOWNEROC_RELEASE_DIR}/${HOST}_libwallet2_api_c.dylib"
if [[ ! $(uname -m) == $ARCH ]]; then
PRC="arch -${ARCH}"
else
PRC=""
fi
pushd ../monero_c
$PRC ./build_single.sh ${COIN} ${HOST} $NPROC
./build_single.sh ${COIN} ${HOST} $NPROC
unxz -f ./release/${COIN}/${HOST}_libwallet2_api_c.dylib.xz
popd
done

View file

@ -1,5 +1,5 @@
#!/bin/sh
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/universal_sed.sh"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/functions.sh"
gen_podspec() {
ARCH=$1
CW_PLUGIN_DIR="`pwd`/../../cw_monero/macos"

View file

@ -8,24 +8,23 @@ if [[ ! -d "monero_c/.git" ]];
then
git clone https://github.com/mrcyjanek/monero_c --branch master monero_c
cd monero_c
git checkout af5277f96073917185864d3596e82b67bee54e78
git checkout 9526921acb774b523a2e1d9ba9a7b389acfc6b70
git reset --hard
git submodule update --init --force --recursive
./apply_patches.sh monero
./apply_patches.sh wownero
./apply_patches.sh zano
else
cd monero_c
fi
if [[ ! -f "monero/.patch-applied" ]];
then
./apply_patches.sh monero
fi
if [[ ! -f "wownero/.patch-applied" ]];
then
./apply_patches.sh wownero
fi
for coin in monero wownero zano;
do
if [[ ! -f "$coin/.patch-applied" ]];
then
./apply_patches.sh $coin
fi
done
cd ..
echo "monero_c source prepared".

View file

@ -1,22 +0,0 @@
#!/bin/bash
detect_sed() {
if sed --version 2>/dev/null | grep -q "GNU"; then
SED_TYPE="GNU"
else
SED_TYPE="BSD"
fi
}
universal_sed() {
local expression=$1
local file=$2
if [[ "$SED_TYPE" == "GNU" ]]; then
sed -i "$expression" "$file"
else
sed -i '' "$expression" "$file"
fi
}
detect_sed

View file

@ -1,4 +1,6 @@
#!/bin/bash
set -x -e
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/functions.sh"
cd "$(dirname "$0")"
@ -16,19 +18,18 @@ pushd ../monero_c
set +e
command -v sudo && export SUDO=sudo
set -e
NPROC="-j$(nproc)"
if [[ ! "x$USE_DOCKER" == "x" ]];
then
for COIN in monero wownero;
do
$SUDO docker run --platform linux/amd64 -v$HOME/.cache/ccache:/root/.ccache -v$PWD:$PWD -w $PWD --rm -it git.mrcyjanek.net/mrcyjanek/debian:buster bash -c "git config --global --add safe.directory '*'; apt update; apt install -y ccache gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 gperf libtinfo5; ./build_single.sh ${COIN} x86_64-w64-mingw32 $NPROC"
# $SUDO docker run --platform linux/amd64 -v$HOME/.cache/ccache:/root/.ccache -v$PWD:$PWD -w $PWD --rm -it git.mrcyjanek.net/mrcyjanek/debian:buster bash -c "git config --global --add safe.directory '*'; apt update; apt install -y ccache gcc-mingw-w64-i686 g++-mingw-w64-i686 gperf libtinfo5; ./build_single.sh ${COIN} i686-w64-mingw32 $NPROC"
$SUDO docker run --platform linux/amd64 -v$HOME/.cache/ccache:/root/.ccache -v$PWD:$PWD -w $PWD --rm -it git.mrcyjanek.net/mrcyjanek/debian:buster bash -c "git config --global --add safe.directory '*'; apt update; apt install -y ccache gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 gperf libtinfo5; ./build_single.sh ${COIN} x86_64-w64-mingw32 -j$MAKE_JOB_COUNT"
# $SUDO docker run --platform linux/amd64 -v$HOME/.cache/ccache:/root/.ccache -v$PWD:$PWD -w $PWD --rm -it git.mrcyjanek.net/mrcyjanek/debian:buster bash -c "git config --global --add safe.directory '*'; apt update; apt install -y ccache gcc-mingw-w64-i686 g++-mingw-w64-i686 gperf libtinfo5; ./build_single.sh ${COIN} i686-w64-mingw32 -j$MAKE_JOB_COUNT"
done
else
for COIN in monero wownero;
do
$SUDO ./build_single.sh ${COIN} x86_64-w64-mingw32 $NPROC
# $SUDO ./build_single.sh ${COIN} i686-w64-mingw32 $NPROC
$SUDO ./build_single.sh ${COIN} x86_64-w64-mingw32 -j$MAKE_JOB_COUNT
# $SUDO ./build_single.sh ${COIN} i686-w64-mingw32 -j$MAKE_JOB_COUNT
done
fi
popd