From c3808c416d333da131c909e5bf0313d513a04780 Mon Sep 17 00:00:00 2001 From: M Date: Thu, 4 Aug 2022 14:24:28 +0100 Subject: [PATCH 1/2] Update scripts for build monero lib for ios. --- cw_monero/ios/cw_monero.podspec | 7 +++++++ ios/Podfile.lock | 6 +++++- scripts/ios/build_monero.sh | 23 ++++++++++------------- scripts/ios/build_monero_all.sh | 1 + scripts/ios/build_openssl.sh | 2 +- scripts/ios/build_unbound.sh | 27 +++++++++++++++++++++++++++ scripts/ios/setup.sh | 1 + 7 files changed, 52 insertions(+), 15 deletions(-) create mode 100755 scripts/ios/build_unbound.sh diff --git a/cw_monero/ios/cw_monero.podspec b/cw_monero/ios/cw_monero.podspec index 8262427d8..d99bba923 100644 --- a/cw_monero/ios/cw_monero.podspec +++ b/cw_monero/ios/cw_monero.podspec @@ -34,6 +34,13 @@ Pod::Spec.new do |s| sodium.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/include/**" } end + s.subspec 'Unbound' do |unbound| + unbound.preserve_paths = '../../../../../cw_shared_external/ios/External/ios/include/**/*.h' + unbound.vendored_libraries = '../../../../../cw_shared_external/ios/External/ios/lib/libunbound.a' + unbound.libraries = 'unbound' + unbound.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/include/**" } + end + s.subspec 'Boost' do |boost| boost.preserve_paths = '../../../../../cw_shared_external/ios/External/ios/include/**/*.h', boost.vendored_libraries = '../../../../../cw_shared_external/ios/External/ios/lib/libboost.a', diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d527812b2..af603c115 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -32,6 +32,7 @@ PODS: - cw_monero/Monero (= 0.0.2) - cw_monero/OpenSSL (= 0.0.2) - cw_monero/Sodium (= 0.0.2) + - cw_monero/Unbound (= 0.0.2) - cw_shared_external - Flutter - cw_monero/Boost (0.0.2): @@ -46,6 +47,9 @@ PODS: - cw_monero/Sodium (0.0.2): - cw_shared_external - Flutter + - cw_monero/Unbound (0.0.2): + - cw_shared_external + - Flutter - cw_shared_external (0.0.1): - cw_shared_external/Boost (= 0.0.1) - cw_shared_external/OpenSSL (= 0.0.1) @@ -214,7 +218,7 @@ SPEC CHECKSUMS: connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 CryptoSwift: 093499be1a94b0cae36e6c26b70870668cb56060 cw_haven: b3e54e1fbe7b8e6fda57a93206bc38f8e89b898a - cw_monero: 88c5e7aa596c6848330750f5f8bcf05fb9c66375 + cw_monero: 4cf3b96f2da8e95e2ef7d6703dd4d2c509127b7d cw_shared_external: 2972d872b8917603478117c9957dfca611845a92 device_display_brightness: 1510e72c567a1f6ce6ffe393dcd9afd1426034f7 devicelocale: b22617f40038496deffba44747101255cee005b0 diff --git a/scripts/ios/build_monero.sh b/scripts/ios/build_monero.sh index ea29c7131..1e082bfb0 100755 --- a/scripts/ios/build_monero.sh +++ b/scripts/ios/build_monero.sh @@ -4,7 +4,7 @@ MONERO_URL="https://github.com/cake-tech/monero.git" MONERO_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/monero" -MONERO_VERSION=release-v0.17.3.2 +MONERO_VERSION=release-v0.18.0.0 BUILD_TYPE=release PREFIX=${EXTERNAL_IOS_DIR} DEST_LIB_DIR=${EXTERNAL_IOS_LIB_DIR}/monero @@ -18,6 +18,9 @@ git submodule update --init --force mkdir -p build cd .. +mkdir -p $DEST_LIB_DIR +mkdir -p $DEST_INCLUDE_DIR + ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [ -z $INSTALL_PREFIX ]; then INSTALL_PREFIX=${ROOT_DIR}/monero @@ -46,20 +49,14 @@ cmake -D IOS=ON \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DSTATIC=ON \ -DBUILD_GUI_DEPS=ON \ - -DINSTALL_VENDORED_LIBUNBOUND=ON \ + -DUNBOUND_INCLUDE_DIR=${EXTERNAL_IOS_INCLUDE_DIR} \ -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ -DUSE_DEVICE_TREZOR=OFF \ ../.. -make -j4 && make install -cp external/randomx/librandomx.a ${DEST_LIB}/ -cp src/cryptonote_basic/libcryptonote_basic.a ${DEST_LIB}/ -cp src/cryptonote_basic/libcryptonote_format_utils_basic.a ${DEST_LIB}/ +make wallet_api -j4 +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 popd -done - -#only for arm64 -mkdir -p $DEST_LIB_DIR -mkdir -p $DEST_INCLUDE_DIR -cp ${MONERO_DIR_PATH}/lib-armv8-a/* $DEST_LIB_DIR -cp ${MONERO_DIR_PATH}/include/wallet/api/* $DEST_INCLUDE_DIR +done \ No newline at end of file diff --git a/scripts/ios/build_monero_all.sh b/scripts/ios/build_monero_all.sh index 42483323d..2b61f6db0 100755 --- a/scripts/ios/build_monero_all.sh +++ b/scripts/ios/build_monero_all.sh @@ -6,4 +6,5 @@ ./build_boost.sh ./build_sodium.sh ./build_zmq.sh +./build_unbound.sh ./build_monero.sh \ No newline at end of file diff --git a/scripts/ios/build_openssl.sh b/scripts/ios/build_openssl.sh index f6f76c0dd..128ba3a54 100755 --- a/scripts/ios/build_openssl.sh +++ b/scripts/ios/build_openssl.sh @@ -10,7 +10,7 @@ echo "============================ OpenSSL ============================" echo "Cloning Open SSL from - $OPEN_SSL_URL" git clone $OPEN_SSL_URL $OPEN_SSL_DIR_PATH cd $OPEN_SSL_DIR_PATH -./build-libssl.sh --version=1.1.1k --archs="x86_64 arm64 armv7s armv7" --targets="ios64-cross-arm64" --deprecated +./build-libssl.sh --version=1.1.1q --archs="x86_64 arm64 armv7s armv7" --targets="ios64-cross-arm64" --deprecated mv ${OPEN_SSL_DIR_PATH}/include/* $EXTERNAL_IOS_INCLUDE_DIR mv ${OPEN_SSL_DIR_PATH}/lib/* $EXTERNAL_IOS_LIB_DIR \ No newline at end of file diff --git a/scripts/ios/build_unbound.sh b/scripts/ios/build_unbound.sh new file mode 100755 index 000000000..679956a27 --- /dev/null +++ b/scripts/ios/build_unbound.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +. ./config.sh + +UNBOUND_VERSION=1.13.2 +UNBOUND_HASH=0a13b547f3b92a026b5ebd0423f54c991e5718037fd9f72445817f6a040e1a83 +UNBOUND_URL="https://www.nlnetlabs.nl/downloads/unbound/unbound-${UNBOUND_VERSION}.tar.gz" +UNBOUND_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/unbound-${UNBOUND_VERSION}" +UNBOUND_ARCH_PATH=${EXTERNAL_IOS_SOURCE_DIR}/unbound-${UNBOUND_VERSION}.tar.gz + +echo $UNBOUND_DIR_PATH +echo "============================ Unbound ============================" +curl $UNBOUND_URL -L -o $UNBOUND_ARCH_PATH +tar -xzf $UNBOUND_ARCH_PATH -C $EXTERNAL_IOS_SOURCE_DIR +cd $UNBOUND_DIR_PATH + +export IOS_SDK=iPhone +export IOS_CPU=arm64 +export IOS_PREFIX=$EXTERNAL_IOS_DIR +export AUTOTOOLS_HOST=aarch64-apple-ios +export AUTOTOOLS_BUILD="$(./config.guess)" +source ./contrib/ios/setenv_ios.sh +./contrib/ios/install_tools.sh +./contrib/ios/install_expat.sh +./configure --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" --prefix="$IOS_PREFIX" --with-ssl="$IOS_PREFIX" --disable-gost --with-libexpat="$IOS_PREFIX" +make +make install \ No newline at end of file diff --git a/scripts/ios/setup.sh b/scripts/ios/setup.sh index bddfa21ed..abe8435ae 100755 --- a/scripts/ios/setup.sh +++ b/scripts/ios/setup.sh @@ -35,5 +35,6 @@ ln ./libboost.a ${CW_MONERO_EXTERNAL_LIB}/libboost.a ln ./libcrypto.a ${CW_MONERO_EXTERNAL_LIB}/libcrypto.a 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 \ No newline at end of file From aa9ed08648e158d65501656b2e893162c737b2a7 Mon Sep 17 00:00:00 2001 From: mkyq <53115730+mkyq@users.noreply.github.com> Date: Thu, 4 Aug 2022 14:27:28 +0100 Subject: [PATCH 2/2] Release 4.4.4 (#451) * Update build versions for Cake Wallet for ios and android. * Add formatted crypto amount to xmr transaction for anypay transactions. Hide order id and payment id if they are not exists on payment status screen. * Change build number for Cake Wallet ios and android. * Change ionia api to production endpoint. * Update version for monero.com app. * Update build number to cake wallet. * Fix for formatting amount for any_pay_payment totalAmount. --- lib/anypay/any_pay_payment.dart | 10 +++++----- lib/ionia/ionia_api.dart | 2 +- scripts/android/app_env.sh | 6 +++--- scripts/ios/app_env.sh | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/anypay/any_pay_payment.dart b/lib/anypay/any_pay_payment.dart index 295ee2dc4..a2aac1d07 100644 --- a/lib/anypay/any_pay_payment.dart +++ b/lib/anypay/any_pay_payment.dart @@ -1,8 +1,8 @@ import 'package:cake_wallet/anypay/any_pay_chain.dart'; -import 'package:cw_bitcoin/bitcoin_amount_format.dart'; -import 'package:cw_core/monero_amount_format.dart'; import 'package:flutter/foundation.dart'; import 'package:cake_wallet/anypay/any_pay_payment_instruction.dart'; +import 'package:cake_wallet/bitcoin/bitcoin.dart'; +import 'package:cake_wallet/monero/monero.dart'; class AnyPayPayment { AnyPayPayment({ @@ -45,11 +45,11 @@ class AnyPayPayment { .fold(0, (int outAcc, out) => outAcc + out.amount)); switch (chain) { case AnyPayChain.xmr: - return moneroAmountToString(amount: total); + return monero.formatterMoneroAmountToString(amount: total); case AnyPayChain.btc: - return bitcoinAmountToString(amount: total); + return bitcoin.formatterBitcoinAmountToString(amount: total); case AnyPayChain.ltc: - return bitcoinAmountToString(amount: total); + return bitcoin.formatterBitcoinAmountToString(amount: total); default: return null; } diff --git a/lib/ionia/ionia_api.dart b/lib/ionia/ionia_api.dart index 6784e2ba1..ca3eae03d 100644 --- a/lib/ionia/ionia_api.dart +++ b/lib/ionia/ionia_api.dart @@ -9,7 +9,7 @@ import 'package:cake_wallet/ionia/ionia_category.dart'; import 'package:cake_wallet/ionia/ionia_gift_card.dart'; class IoniaApi { - static const baseUri = 'apistaging.ionia.io'; + static const baseUri = 'api.ionia.io'; static const pathPrefix = 'cake'; static final createUserUri = Uri.https(baseUri, '/$pathPrefix/CreateUser'); static final verifyEmailUri = Uri.https(baseUri, '/$pathPrefix/VerifyEmail'); diff --git a/scripts/android/app_env.sh b/scripts/android/app_env.sh index 12388b19d..3c0cb2abd 100755 --- a/scripts/android/app_env.sh +++ b/scripts/android/app_env.sh @@ -14,14 +14,14 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN) APP_ANDROID_TYPE=$1 MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.0.7" -MONERO_COM_BUILD_NUMBER=14 +MONERO_COM_VERSION="1.0.8" +MONERO_COM_BUILD_NUMBER=15 MONERO_COM_BUNDLE_ID="com.monero.app" MONERO_COM_PACKAGE="com.monero.app" CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_VERSION="4.4.4" -CAKEWALLET_BUILD_NUMBER=111 +CAKEWALLET_BUILD_NUMBER=112 CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet" CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet" diff --git a/scripts/ios/app_env.sh b/scripts/ios/app_env.sh index ae9e41779..1c78d8044 100755 --- a/scripts/ios/app_env.sh +++ b/scripts/ios/app_env.sh @@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN) APP_IOS_TYPE=$1 MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.0.7" -MONERO_COM_BUILD_NUMBER=17 +MONERO_COM_VERSION="1.0.8" +MONERO_COM_BUILD_NUMBER=18 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_VERSION="4.4.4" -CAKEWALLET_BUILD_NUMBER=111 +CAKEWALLET_BUILD_NUMBER=112 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" HAVEN_NAME="Haven"