diff --git a/scripts/android/build_all_campfire.sh b/scripts/android/build_all_campfire.sh new file mode 100755 index 000000000..7cb2e083d --- /dev/null +++ b/scripts/android/build_all_campfire.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -x -e + +# libepiccash requires old rust +source ../rust_version.sh +set_rust_to_1671 + +mkdir -p build +. ./config.sh +./install_ndk.sh + +PLUGINS_DIR=../../crypto_plugins + +(cd "${PLUGINS_DIR}"/flutter_liblelantus/scripts/android && ./build_all.sh ) +(cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./build_all.sh ) +(cd "${PLUGINS_DIR}"/flutter_libmonero/scripts/android/ && ./build_all.sh ) +set_rust_to_1720 +(cd "${PLUGINS_DIR}"/frostdart/scripts/android && ./build_all.sh ) + +wait +echo "Done building" diff --git a/scripts/app_config/configure_campfire.sh b/scripts/app_config/configure_campfire.sh new file mode 100755 index 000000000..03135118e --- /dev/null +++ b/scripts/app_config/configure_campfire.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +set -x -e + +# Configure files for Duo. +APP_BUILD_PLATFORM=$1 + +export NEW_NAME="Campfire" +if [[ "$APP_BUILD_PLATFORM" != "ios" ]]; then + export NEW_APP_ID="com.cypherstack.campfire" +else + # for some reason this was different in the old campfire code for ios + export NEW_APP_ID="com.cypherstack.campfirefirowallet" +fi +export NEW_APP_ID_CAMEL="com.cypherstack.campfire" +export NEW_APP_ID_SNAKE="com.cypherstack.campfire" +export NEW_BASIC_NAME="campfire" + +NEW_PUBSPEC_NAME="paymint" # paymint used in original pubspec for some reason +PUBSPEC_FILE="${APP_PROJECT_ROOT_DIR}/pubspec.yaml" + +# String replacements. +if [[ "$(uname)" == 'Darwin' ]]; then + # macos specific sed + sed -i '' "s/name: PLACEHOLDER/name: ${NEW_PUBSPEC_NAME}/g" "${PUBSPEC_FILE}" + sed -i '' "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}" +else + sed -i "s/name: PLACEHOLDER/name: ${NEW_PUBSPEC_NAME}/g" "${PUBSPEC_FILE}" + sed -i "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}" +fi + +pushd "${APP_PROJECT_ROOT_DIR}" +BUILT_COMMIT_HASH=$(git log -1 --pretty=format:"%H") +popd + +APP_CONFIG_DART_FILE="${APP_PROJECT_ROOT_DIR}/lib/app_config.g.dart" +rm -f "$APP_CONFIG_DART_FILE" +cat << EOF > "$APP_CONFIG_DART_FILE" +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'app_config.dart'; + +const _prefix = "Campfire"; +const _separator = ""; +const _suffix = ""; +const _appDataDirName = "campfire"; +const _commitHash = "$BUILT_COMMIT_HASH"; + +const ({String light, String dark})? _appIconAsset = ( + light: "assets/in_app_logo_icons/stack-duo-icon_light.svg", + dark: "assets/in_app_logo_icons/stack-duo-icon_dark.svg", +); + +final List _supportedCoins = List.unmodifiable([ + Firo(CryptoCurrencyNetwork.main), + Firo(CryptoCurrencyNetwork.test), +]); + +EOF \ No newline at end of file diff --git a/scripts/app_config/templates/configure_template_files.sh b/scripts/app_config/templates/configure_template_files.sh index 9acf5b6f4..35cb26219 100755 --- a/scripts/app_config/templates/configure_template_files.sh +++ b/scripts/app_config/templates/configure_template_files.sh @@ -54,13 +54,15 @@ TEMPLATE_FILES=( "${WIN_TF_2}" ) -if [ ! -f "${ACTUAL_PUBSPEC}" ]; then - cp "${T_PUBSPEC}" "${ACTUAL_PUBSPEC}" +if [ -f "${ACTUAL_PUBSPEC}" ]; then + rm "${ACTUAL_PUBSPEC}" fi +cp "${T_PUBSPEC}" "${ACTUAL_PUBSPEC}" for TF in "${TEMPLATE_FILES[@]}"; do FILE="${APP_PROJECT_ROOT_DIR}/${TF}" - if [ ! -f "${FILE}" ]; then - cp -rp "${TEMPLATES_DIR}/${TF}" "${FILE}" + if [ -f "${FILE}" ]; then + rm "${FILE}" fi + cp -rp "${TEMPLATES_DIR}/${TF}" "${FILE}" done \ No newline at end of file diff --git a/scripts/build_app.sh b/scripts/build_app.sh index aa569226a..612c4097f 100755 --- a/scripts/build_app.sh +++ b/scripts/build_app.sh @@ -94,7 +94,7 @@ if printf '%s\0' "${APP_NAMED_IDS[@]}" | grep -Fxqz -- "${APP_NAMED_ID}"; then "${APP_PROJECT_ROOT_DIR}/scripts/app_config/shared/update_version.sh" -v "${APP_VERSION_STRING}" -b "${APP_BUILD_NUMBER}" "${APP_PROJECT_ROOT_DIR}/scripts/app_config/shared/link_assets.sh" "${APP_NAMED_ID}" "${APP_BUILD_PLATFORM}" # shellcheck disable=SC1090 - source "${APP_PROJECT_ROOT_DIR}/scripts/app_config/configure_${APP_NAMED_ID}.sh" + source "${APP_PROJECT_ROOT_DIR}/scripts/app_config/configure_${APP_NAMED_ID}.sh" "${APP_BUILD_PLATFORM}" "${APP_PROJECT_ROOT_DIR}/scripts/app_config/platforms/${APP_BUILD_PLATFORM}/platform_config.sh" if [[ "$APP_BUILD_PLATFORM" != "linux" ]]; then @@ -111,6 +111,8 @@ if [ "$BUILD_CRYPTO_PLUGINS" -eq 0 ]; then ./build_all.sh elif [[ "$APP_NAMED_ID" = "stack_duo" ]]; then ./build_all_duo.sh + elif [[ "$APP_NAMED_ID" = "campfire" ]]; then + ./build_all_campfire.sh else echo "Invalid app id: ${APP_NAMED_ID}" exit 1 diff --git a/scripts/ios/build_all_campfire.sh b/scripts/ios/build_all_campfire.sh new file mode 100755 index 000000000..b34724561 --- /dev/null +++ b/scripts/ios/build_all_campfire.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -x -e + +# libepiccash requires old rust +source ../rust_version.sh +set_rust_to_1671 + +# ensure ios rust triples are there +rustup target add aarch64-apple-ios +rustup target add x86_64-apple-ios + +# ensure ios rust triples are there +rustup target add aarch64-apple-ios +rustup target add x86_64-apple-ios + +(cd ../../crypto_plugins/flutter_liblelantus/scripts/ios && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libmonero/scripts/ios/ && ./build_all.sh ) +set_rust_to_1720 +(cd ../../crypto_plugins/frostdart/scripts/ios && ./build_all.sh ) + +wait +echo "Done building" + +# ensure ios rust triples are there +rustup target add aarch64-apple-ios +rustup target add x86_64-apple-ios diff --git a/scripts/linux/build_all_campfire.sh b/scripts/linux/build_all_campfire.sh new file mode 100755 index 000000000..c9542798e --- /dev/null +++ b/scripts/linux/build_all_campfire.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -x -e + +# libepiccash requires old rust +source ../rust_version.sh +set_rust_to_1671 + +# for arm +# flutter-elinux clean +# flutter-elinux pub get +# flutter-elinux build linux --dart-define="IS_ARM=true" +mkdir -p build +./build_secure_storage_deps.sh +(cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libmonero/scripts/linux && ./build_all.sh ) +set_rust_to_1720 +(cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh ) + +./build_secp256k1.sh + +wait +echo "Done building" diff --git a/scripts/macos/build_all_campfire.sh b/scripts/macos/build_all_campfire.sh new file mode 100755 index 000000000..e3a58b45f --- /dev/null +++ b/scripts/macos/build_all_campfire.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -x -e + +# libepiccash requires old rust +source ../rust_version.sh +set_rust_to_1671 + +(cd ../../crypto_plugins/flutter_liblelantus/scripts/macos && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libmonero/scripts/macos/ && ./build_all.sh ) +set_rust_to_1720 +(cd ../../crypto_plugins/frostdart/scripts/macos && ./build_all.sh ) + +wait +echo "Done building" + +# set rust (back) to a more recent stable release to allow stack wallet to build tor +set_rust_to_1720 diff --git a/scripts/windows/build_all_campfire.sh b/scripts/windows/build_all_campfire.sh new file mode 100755 index 000000000..fc6ac37b1 --- /dev/null +++ b/scripts/windows/build_all_campfire.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -x -e + +# libepiccash requires old rust +source ../rust_version.sh +set_rust_to_1671 + +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) +set_rust_to_1720 +(cd ../../crypto_plugins/frostdart/scripts/windows && ./build_all.sh ) + +./build_secp256k1_wsl.sh + +wait +echo "Done building"