mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
These chains were already disabled in availableWalletTypes (none of them
were getting created), but the source dirs and the codegen scaffolding
for them still lived in tree (~20K lines of dead Dart).
Surgery:
- Delete cw_decred/ cw_solana/ cw_tron/ cw_zano/ source trees
- Strip 5 generate*() function bodies from tool/configure.dart
(generateSolana, generateTron, generateZano, generateDecred,
generateZcash) plus their top-level imports, args, calls,
signatures, and conditional pubspec/walletTypes injection blocks.
configure.dart shrinks from 2134 to 1561 lines and dart analyze
is clean.
- Strip solana/tron secrets config + output paths from
tool/import_secrets_config.dart
- Delete scripts/{android,ios,macos}/build_decred.sh,
scripts/ios/build_zano{,_all}.sh
- Patch scripts/{android,ios,macos}/build_all.sh,
scripts/android/copy_monero_deps.sh, scripts/ios/setup.sh,
scripts/ios/gen_framework.sh to drop decred/zano steps
- Patch scripts/android/docker/build.sh + Dockerfile.final to drop the
decred Docker stage; delete scripts/android/docker/Dockerfile.decred
- Update .github/workflows/build-linux.yml comments to reflect the
remaining cw_* module list (evm, nano, bitcoin)
Note: WalletType.{solana,tron,zano,decred,zcash} enum values still live
in cw_core/lib/wallet_type.dart and there are dead switch cases in
lib/di.dart and lib/new-ui/pages/*.dart that reference them. Those
paths are unreachable (the enum values never get assigned to any wallet)
but cleaning them up is a separate hygiene pass.
161 lines
4.7 KiB
Bash
Executable File
161 lines
4.7 KiB
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
IOS_DIR="$(pwd)/../../ios"
|
|
monero_c_tag=$(cd $(pwd)/../../scripts/monero_c/; git describe --tags)
|
|
DYLIB_PATH="$(pwd)/../../scripts/monero_c/release/${monero_c_tag}/"
|
|
TMP_DIR="${IOS_DIR}/tmp"
|
|
|
|
rm -rf "${IOS_DIR:?}/MoneroWallet.xcframework" "${IOS_DIR:?}/WowneroWallet.xcframework" "${IOS_DIR:?}/ZanoWallet.xcframework"
|
|
rm -rf "${IOS_DIR:?}/MoneroWallet.framework" "${IOS_DIR:?}/WowneroWallet.framework" "${IOS_DIR:?}/ZanoWallet.framework"
|
|
rm -rf "$TMP_DIR"
|
|
mkdir -p "$TMP_DIR"
|
|
|
|
write_info_plist() {
|
|
framework_bundle="$1"
|
|
framework_name="$2"
|
|
target="$3"
|
|
plist_path="${framework_bundle}/Info.plist"
|
|
|
|
if [[ "x$target" = "xios-simulator" ]]; then
|
|
platform="iPhoneSimulator"
|
|
dtplatformname="iphonesimulator"
|
|
dtsdkname="iphonesimulator17.4"
|
|
else
|
|
platform="iPhoneOS"
|
|
dtplatformname="iphoneos"
|
|
dtsdkname="iphoneos17.4"
|
|
fi
|
|
|
|
cat > "$plist_path" <<EOF
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>BuildMachineOSBuild</key>
|
|
<string>23E224</string>
|
|
<key>CFBundleDevelopmentRegion</key>
|
|
<string>en</string>
|
|
<key>CFBundleExecutable</key>
|
|
<string>${framework_name}</string>
|
|
<key>CFBundleIdentifier</key>
|
|
<string>com.fotolockr.${framework_name}</string>
|
|
<key>CFBundleInfoDictionaryVersion</key>
|
|
<string>6.0</string>
|
|
<key>CFBundleName</key>
|
|
<string>${framework_name}</string>
|
|
<key>CFBundlePackageType</key>
|
|
<string>FMWK</string>
|
|
<key>CFBundleShortVersionString</key>
|
|
<string>1.0</string>
|
|
<key>CFBundleSignature</key>
|
|
<string>???</string>
|
|
<key>CFBundleSupportedPlatforms</key>
|
|
<array>
|
|
<string>${platform}</string>
|
|
</array>
|
|
<key>CFBundleVersion</key>
|
|
<string>1</string>
|
|
<key>DTCompiler</key>
|
|
<string>com.apple.compilers.llvm.clang.1_0</string>
|
|
<key>DTPlatformBuild</key>
|
|
<string>21E210</string>
|
|
<key>DTPlatformName</key>
|
|
<string>${dtplatformname}</string>
|
|
<key>DTPlatformVersion</key>
|
|
<string>17.4</string>
|
|
<key>DTSDKBuild</key>
|
|
<string>21E210</string>
|
|
<key>DTSDKName</key>
|
|
<string>${dtsdkname}</string>
|
|
<key>DTXcode</key>
|
|
<string>1530</string>
|
|
<key>DTXcodeBuild</key>
|
|
<string>15E204a</string>
|
|
<key>MinimumOSVersion</key>
|
|
<string>16.0</string>
|
|
<key>UIDeviceFamily</key>
|
|
<array>
|
|
<integer>1</integer>
|
|
<integer>2</integer>
|
|
</array>
|
|
<key>UIRequiredDeviceCapabilities</key>
|
|
<array>
|
|
<string>arm64</string>
|
|
</array>
|
|
</dict>
|
|
</plist>
|
|
EOF
|
|
plutil -convert binary1 "$plist_path"
|
|
}
|
|
|
|
create_framework() {
|
|
wallet="$1"
|
|
framework_name="$2"
|
|
target="$3"
|
|
out_dir="$4"
|
|
|
|
echo "Creating ${framework_name}.framework for target ${target} in ${out_dir}..."
|
|
|
|
framework_bundle="${out_dir}/${framework_name}.framework"
|
|
|
|
rm -rf "$framework_bundle"
|
|
mkdir -p "$framework_bundle"
|
|
|
|
input_dylib="${DYLIB_PATH}/aarch64-apple-${target}/lib${wallet}_wallet2_api_c.dylib"
|
|
if [[ ! -f "$input_dylib" ]]; then
|
|
echo "Error: Input dylib not found: $input_dylib"
|
|
exit 1
|
|
fi
|
|
|
|
lipo -create "$input_dylib" -output "${framework_bundle}/${framework_name}"
|
|
echo "Created binary: ${framework_bundle}/${framework_name}"
|
|
|
|
write_info_plist "$framework_bundle" "$framework_name" "$target"
|
|
}
|
|
|
|
create_xcframework() {
|
|
framework_name="$1"
|
|
device_framework="$2"
|
|
simulator_framework="$3"
|
|
xcframework_output="$4"
|
|
|
|
echo "Creating ${xcframework_output} by bundling:"
|
|
echo " Device framework: ${device_framework}"
|
|
echo " Simulator framework: ${simulator_framework}"
|
|
|
|
xcodebuild -create-xcframework \
|
|
-framework "$device_framework" \
|
|
-framework "$simulator_framework" \
|
|
-output "$xcframework_output"
|
|
|
|
echo "Created XCFramework: ${xcframework_output}"
|
|
}
|
|
|
|
wallets=("monero" "wownero")
|
|
framework_names=("MoneroWallet" "WowneroWallet")
|
|
|
|
for i in "${!wallets[@]}"; do
|
|
wallet="${wallets[$i]}"
|
|
framework_name="${framework_names[$i]}"
|
|
|
|
device_out="${TMP_DIR}/${framework_name}_device"
|
|
simulator_out="${TMP_DIR}/${framework_name}_simulator"
|
|
rm -rf "$device_out" "$simulator_out"
|
|
mkdir -p "$device_out" "$simulator_out"
|
|
|
|
create_framework "$wallet" "$framework_name" "ios" "$device_out"
|
|
create_framework "$wallet" "$framework_name" "ios-simulator" "$simulator_out"
|
|
|
|
device_framework="${device_out}/${framework_name}.framework"
|
|
simulator_framework="${simulator_out}/${framework_name}.framework"
|
|
xcframework_output="${IOS_DIR}/${framework_name}.xcframework"
|
|
rm -rf "$xcframework_output"
|
|
|
|
create_xcframework "$framework_name" "$device_framework" "$simulator_framework" "$xcframework_output"
|
|
done
|
|
|
|
echo "All XCFrameworks created successfully."
|
|
|
|
rm -rf "$TMP_DIR"
|