summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/android.yml172
-rw-r--r--libbridge/src/main/cpp/wallet2_api_c.cpp90
2 files changed, 161 insertions, 101 deletions
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index 25c0b5a..2d0fa0a 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -92,91 +92,91 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@v3
- - name: Download cached build artifacts
- run: |
- ${{ github.workspace }}/download_artifact.sh libsodium "${SODIUM_VERSION}-${{ matrix.host_triplet }}-${SODIUM_HASH}" ${{ github.workspace }}/prefix/lib/libsodium.a
- ${{ github.workspace }}/download_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libcrypto.a
- ${{ github.workspace }}/download_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libssl.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_chrono.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_date_time.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_filesystem.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_program_options.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_regex.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_serialization.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_system.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_thread.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_chrono.a
- ${{ github.workspace }}/download_artifact.sh libunbound "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/prefix/lib/libunbound.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet_api.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_core/libcryptonote_core.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_basic.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/mnemonics/libmnemonics.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/common/libcommon.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/libcncrypto.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct_basic.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blockchain_db/libblockchain_db.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/db_drivers/liblmdb/liblmdb.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/easylogging++/libeasylogging.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/contrib/epee/src/libepee.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blocks/libblocks.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/checkpoints/libcheckpoints.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device/libdevice.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device_trezor/libdevice_trezor.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/multisig/libmultisig.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/libversion.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/net/libnet.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/hardforks/libhardforks.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/randomx/librandomx.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/rpc/librpc_base.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/wallet/libwallet-crypto.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a
- - name: Create skip flag based on cache
- run: |
- if [[ -f "${{ github.workspace }}/prefix/lib/libsodium.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libcrypto.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libssl.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_chrono.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_date_time.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_filesystem.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_program_options.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_regex.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_serialization.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_system.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_thread.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_chrono.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libunbound.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/lib/libwallet_api.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/lib/libwallet.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_core/libcryptonote_core.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_basic.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/mnemonics/libmnemonics.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/common/libcommon.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/crypto/libcncrypto.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/ringct/libringct.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/ringct/libringct_basic.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/blockchain_db/libblockchain_db.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/external/db_drivers/liblmdb/liblmdb.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/external/easylogging++/libeasylogging.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/contrib/epee/src/libepee.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/blocks/libblocks.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/checkpoints/libcheckpoints.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/device/libdevice.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/device_trezor/libdevice_trezor.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/multisig/libmultisig.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/libversion.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/net/libnet.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/hardforks/libhardforks.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/external/randomx/librandomx.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/rpc/librpc_base.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a" ]]; \
- then \
- echo "Cache exist, creating /tmp/skip_deps"; \
- touch /tmp/skip_deps; \
- else \
- echo "Cache missing, this will be a looooong build."; \
- fi
+ # - name: Download cached build artifacts
+ # run: |
+ # ${{ github.workspace }}/download_artifact.sh libsodium "${SODIUM_VERSION}-${{ matrix.host_triplet }}-${SODIUM_HASH}" ${{ github.workspace }}/prefix/lib/libsodium.a
+ # ${{ github.workspace }}/download_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libcrypto.a
+ # ${{ github.workspace }}/download_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libssl.a
+ # ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_chrono.a
+ # ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_date_time.a
+ # ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_filesystem.a
+ # ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_program_options.a
+ # ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_regex.a
+ # ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_serialization.a
+ # ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_system.a
+ # ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_thread.a
+ # ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_wserialization.a
+ # ${{ github.workspace }}/download_artifact.sh libunbound "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/prefix/lib/libunbound.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet_api.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_core/libcryptonote_core.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_basic.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/mnemonics/libmnemonics.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/common/libcommon.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/libcncrypto.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct_basic.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blockchain_db/libblockchain_db.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/db_drivers/liblmdb/liblmdb.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/easylogging++/libeasylogging.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/contrib/epee/src/libepee.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blocks/libblocks.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/checkpoints/libcheckpoints.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device/libdevice.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device_trezor/libdevice_trezor.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/multisig/libmultisig.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/libversion.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/net/libnet.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/hardforks/libhardforks.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/randomx/librandomx.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/rpc/librpc_base.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/wallet/libwallet-crypto.a
+ # ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a
+ # - name: Create skip flag based on cache
+ # run: |
+ # if [[ -f "${{ github.workspace }}/prefix/lib/libsodium.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libcrypto.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libssl.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libboost_chrono.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libboost_date_time.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libboost_filesystem.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libboost_program_options.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libboost_regex.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libboost_serialization.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libboost_system.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libboost_thread.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libboost_wserialization.a" ]] \
+ # && [[ -f "${{ github.workspace }}/prefix/lib/libunbound.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/lib/libwallet_api.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/lib/libwallet.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_core/libcryptonote_core.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_basic.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/mnemonics/libmnemonics.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/common/libcommon.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/crypto/libcncrypto.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/ringct/libringct.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/ringct/libringct_basic.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/blockchain_db/libblockchain_db.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/external/db_drivers/liblmdb/liblmdb.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/external/easylogging++/libeasylogging.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/contrib/epee/src/libepee.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/blocks/libblocks.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/checkpoints/libcheckpoints.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/device/libdevice.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/device_trezor/libdevice_trezor.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/multisig/libmultisig.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/libversion.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/net/libnet.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/hardforks/libhardforks.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/external/randomx/librandomx.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/rpc/librpc_base.a" ]] \
+ # && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a" ]]; \
+ # then \
+ # echo "Cache exist, creating /tmp/skip_deps"; \
+ # touch /tmp/skip_deps; \
+ # else \
+ # echo "Cache missing, this will be a looooong build."; \
+ # fi
- name: Download monero
run: |
[[ -f "/tmp/skip_deps" ]] && exit 0; \
@@ -442,7 +442,7 @@ jobs:
PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_serialization.a
PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_system.a
PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_thread.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_chrono.a
+ PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_wserialization.a
PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh libunbound "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/prefix/lib/libunbound.a
PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet_api.a
PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet.a
diff --git a/libbridge/src/main/cpp/wallet2_api_c.cpp b/libbridge/src/main/cpp/wallet2_api_c.cpp
index 3dcb637..b756342 100644
--- a/libbridge/src/main/cpp/wallet2_api_c.cpp
+++ b/libbridge/src/main/cpp/wallet2_api_c.cpp
@@ -33,7 +33,11 @@ int MONERO_PendingTransaction_status(void* pendingTx_ptr) {
}
const char* MONERO_PendingTransaction_errorString(void* pendingTx_ptr) {
Monero::PendingTransaction *pendingTx = reinterpret_cast<Monero::PendingTransaction*>(pendingTx_ptr);
- return pendingTx->errorString().c_str();
+ std::string str = pendingTx->errorString();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
bool MONERO_PendingTransaction_commit(void* pendingTx_ptr, const char* filename, bool overwrite) {
Monero::PendingTransaction *pendingTx = reinterpret_cast<Monero::PendingTransaction*>(pendingTx_ptr);
@@ -87,7 +91,11 @@ uint64_t MONERO_TransactionInfo_blockHeight(void* txInfo_ptr) {
}
const char* MONERO_TransactionInfo_description(void* txInfo_ptr) {
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
- return txInfo->description().c_str();
+ std::string str = txInfo->description();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
uint32_t MONERO_TransactionInfo_subaddrAccount(void* txInfo_ptr) {
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
@@ -95,7 +103,11 @@ uint32_t MONERO_TransactionInfo_subaddrAccount(void* txInfo_ptr) {
}
const char* MONERO_TransactionInfo_label(void* txInfo_ptr) {
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
- return txInfo->label().c_str();
+ std::string str = txInfo->label();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
uint64_t MONERO_TransactionInfo_confirmations(void* txInfo_ptr) {
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
@@ -107,7 +119,11 @@ uint64_t MONERO_TransactionInfo_unlockTime(void* txInfo_ptr) {
}
const char* MONERO_TransactionInfo_hash(void* txInfo_ptr) {
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
- return txInfo->hash().c_str();
+ std::string str = txInfo->hash();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
uint64_t MONERO_TransactionInfo_timestamp(void* txInfo_ptr) {
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
@@ -115,7 +131,11 @@ uint64_t MONERO_TransactionInfo_timestamp(void* txInfo_ptr) {
}
const char* MONERO_TransactionInfo_paymentId(void* txInfo_ptr) {
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
- return txInfo->paymentId().c_str();
+ std::string str = txInfo->paymentId();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
// TransactionHistory
@@ -141,7 +161,11 @@ void MONERO_TransactionHistory_setTxNote(void* txHistory_ptr, const char* txid,
const char* MONERO_Wallet_seed(void* wallet_ptr) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
- return wallet->seed().c_str();
+ std::string str = wallet->seed();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
int MONERO_Wallet_status(void* wallet_ptr) {
@@ -151,32 +175,56 @@ int MONERO_Wallet_status(void* wallet_ptr) {
const char* MONERO_Wallet_errorString(void* wallet_ptr) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
- return wallet->errorString().c_str();
+ std::string str = wallet->errorString();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
const char* MONERO_Wallet_address(void* wallet_ptr, uint64_t accountIndex, uint64_t addressIndex) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
- return wallet->address(accountIndex, addressIndex).c_str();
+ std::string str = wallet->address(accountIndex, addressIndex);
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
const char* MONERO_Wallet_secretViewKey(void* wallet_ptr) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
- return wallet->secretViewKey().c_str();
+ std::string str = wallet->secretViewKey();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
const char* MONERO_Wallet_publicViewKey(void* wallet_ptr) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
- return wallet->publicViewKey().c_str();
+ std::string str = wallet->publicViewKey();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
const char* MONERO_Wallet_secretSpendKey(void* wallet_ptr) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
- return wallet->secretSpendKey().c_str();
+ std::string str = wallet->secretSpendKey();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
const char* MONERO_Wallet_publicSpendKey(void* wallet_ptr) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
- return wallet->publicSpendKey().c_str();
+ std::string str = wallet->publicSpendKey();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
void MONERO_Wallet_stop(void* wallet_ptr) {
@@ -262,7 +310,11 @@ bool MONERO_Wallet_synchronized(void* wallet_ptr) {
}
const char* MONERO_Wallet_displayAmount(uint64_t amount) {
// Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
- return Monero::Wallet::displayAmount(amount).c_str();
+ std::string str = Monero::Wallet::displayAmount(amount);
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
bool MONERO_Wallet_addressValid(const char* str, int nettype) {
// Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
@@ -322,7 +374,11 @@ void MONERO_Wallet_addSubaddress(void* wallet_ptr, uint32_t accountIndex, const
}
const char* MONERO_Wallet_getSubaddressLabel(void* wallet_ptr, uint32_t accountIndex, uint32_t addressIndex) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
- return wallet->getSubaddressLabel(accountIndex, addressIndex).c_str();
+ std::string str = wallet->getSubaddressLabel(accountIndex, addressIndex);
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
void MONERO_Wallet_setSubaddressLabel(void* wallet_ptr, uint32_t accountIndex, uint32_t addressIndex, const char* label) {
@@ -428,7 +484,11 @@ bool MONERO_WalletManager_walletExists(const char* path) {
return Monero::WalletManagerFactory::getWalletManager()->walletExists(std::string(path));
}
const char* MONERO_WalletManager_errorString() {
- return Monero::WalletManagerFactory::getWalletManager()->errorString().c_str();
+ std::string str = Monero::WalletManagerFactory::getWalletManager()->errorString();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
}
void MONERO_WalletManager_setDaemonAddress(const char* address) {