Files
hash-wallet/scripts/prepare_moneroc.sh
T
jwinterm dd449f2594 Merge upstream Cake Wallet v6.5.0
Catches up from the May 12 fork point (v6.1.2+23) through v6.5.0: 535
upstream commits, including the Monero silent-open fix, Monero on Trezor,
Ledger/Trezor BLE fixes, the new seed and history screens, quick Bitcoin
sync, git-pinned dependencies (pubspec_overrides.yaml), frozen Hive
adapters (*.part.dart), monero_c v0.18.4.6-RC2 and Flutter 3.41.9.

Merged with both sides normalized first (import rename, 100-column
format), which took the conflict count from 614 paths to 322. The
procedure is now scripts/upstream_sync.sh.

Kept from Hash Bags:
- WalletType enum order and Hive IDs. SQLite stores WalletType.index and
  our order differs from upstream's; taking theirs would reread saved
  wallets as other chains. Our frozen adapter keeps the shipped IDs.
- The 1.0.2 legacy PIN and wallet-password decode and self-heal.
- Removed chains (Solana, Tron, Zano, Zcash, Decred, Haven) and the new
  Robinhood chain stay out; Cake Pay and non-Trocador swaps stay out.
- Default nodes (node.wownero.org, sethforprivacy, Blockstream, bysh.me),
  converted to upstream's isDefault node-list key; Wownero is back in the
  node reset list.
- Privacy: address resolvers limited to domain-anchored sources again;
  prices.neroswap.com for fiat; upstream's charts tab, which reads
  prices.cakewallet.com, sits behind FeatureFlag.isChartsEnabled = false.
- Lightning stays behind FeatureFlag.isLightningEnabled, including
  upstream's new post-seed Lightning username step.
- Our icon pipeline, branding and bundle identifiers.

Twelve new upstream widget tests are skipped: test and code are unchanged
from v6.5.0 apart from renames (not rerun on a pristine upstream checkout;
upstream's top_bar_test does not compile against its own TopBar).
flutter analyze lib: 0 errors; flutter test: 345 passed, 12 skipped;
flutter build bundle compiles. Built with Flutter 3.41.9.
2026-10-24 23:49:29 -04:00

78 lines
3.2 KiB
Bash
Executable File

#!/bin/bash
set -x -e
cd "$(dirname "$0")"
if [[ ! -d "monero_c/.git" ]];
then
rm -rf monero_c
git clone https://github.com/mrcyjanek/monero_c --branch master monero_c
cd monero_c
else
cd monero_c
fi
# NOTE: Make sure to update monero_c prebuilds link in workflow files
# https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC2/release-bundle.zip
git fetch -a
git checkout 33671871de3d51696b66ffb3bd94f744e26974f6
git reset --hard
# Hash Bags: every CI workflow (android/ios-sim/ios-testflight/linux/windows)
# consumes PREBUILT .so/.a files from monero_c's release-bundle.zip. None of
# them compile monero_c from source. The only thing they need out of this
# checkout is `git describe --tags`, which resolves the release/<tag>/ path.
#
# So by default we do NOT init the monero/wownero submodules. Besides saving
# ~1GB of source plus deep transitive submodules per CI run, this decouples us
# from where Wownero is hosted:
#
# Wownero left Codeberg in July 2026 (Codeberg announced it would ban crypto
# projects) and remigrated to https://github.com/wownero/wownero. monero_c's
# .gitmodules still points at the dead Codeberg URLs, which now fail with
# "remote: Bye" / HTTP 403. That is what broke the iOS TestFlight build on
# 2026-07-31 — at a step that never needed the source in the first place.
#
# Set MONERO_C_BUILD_FROM_SOURCE=1 only if you genuinely intend to compile
# monero_c yourself. See the caveat below before you do.
if [[ "${MONERO_C_BUILD_FROM_SOURCE:-0}" == "1" ]];
then
# zano is a sibling submodule we never ship — skip it (its Qt UI tree alone
# is ~100MB).
git submodule deinit -f zano 2>/dev/null || true
rm -rf zano
# Redirect the dead Codeberg URLs to where the code actually lives now.
# Safe despite being a host swap: both submodules are pinned to exact
# commit SHAs, and git verifies the object hash on fetch, so a different
# host cannot substitute different content under the same SHA.
#
# wownero -> github.com/wownero/wownero (canonical since the July 2026
# remigration off Codeberg)
# randomwow -> github.com/mrcyjanek/randomwow, which is what monero_c
# itself switches the remote to in apply_patches.sh. Note
# this is NOT github.com/wownero/RandomWOW — that one is a
# fork of tevador/RandomX on a different lineage and does
# not contain the pinned commit. The redirect has to happen
# here because apply_patches.sh only runs AFTER the clone
# that would otherwise fail against Codeberg.
git \
-c url."https://github.com/wownero/wownero".insteadOf="https://codeberg.org/wownero/wownero" \
-c url."https://github.com/mrcyjanek/randomwow".insteadOf="https://codeberg.org/wownero/RandomWOW" \
submodule update --init --recursive --depth 1 --jobs 8 monero wownero
for coin in monero wownero;
do
if [[ ! -f "$coin/.patch-applied" ]];
then
./apply_patches.sh $coin
fi
done
cd ..
echo "monero_c source prepared (full source checkout)."
else
cd ..
echo "monero_c prepared (prebuilt mode — submodules intentionally skipped)."
fi