Migrate to .xcframework (#2006)

* add libmd to linked libraries * ios 16 fixes, new moneroc, simulator support * update app version [skip ci] * update monero.com as well [skip ci] * migrate away from {Monero,Wownero,Zano}Wallet.framework Generate .xcframework dynamically Fix mweb requiring manual steps in xcode * fix app_config.sh when .dylib are not yet present * fix typo in model_generator.sh --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>

cyan committed Feb 17, 2025 at 14:53 UTC 2078407608422d80150388b5f8582e8aa931a882
17 files changed +184 -67
cw_mweb/ios/.gitignore
+3 -1
@@ -35,4 +35,6 @@ Icon?
35
36 /Flutter/Generated.xcconfig
37 /Flutter/ephemeral/
38 -/Flutter/flutter_export_environment.sh
\ No newline at end of file
38 +/Flutter/flutter_export_environment.sh
39 +
40 +Mwebd.xcframework
\ No newline at end of file
cw_mweb/ios/cw_mweb.podspec
+2 -1
@@ -16,11 +16,12 @@ A new Flutter plugin project.
16 s.source_files = 'Classes/**/*'
17 s.dependency 'Flutter'
18 s.platform = :ios, '11.0'
19 + s.libraries = 'resolv'
20
21 # Flutter.framework does not contain a i386 slice.
22 s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
23 s.swift_version = '5.0'
23 - s.ios.vendored_frameworks = 'Mwebd.xcframework'
24 + s.vendored_frameworks = 'Mwebd.xcframework'
25 s.preserve_paths = 'Mwebd.xcframework/**/*'
26
27 end
ios/.gitignore
+1
@@ -32,3 +32,4 @@ Runner/GeneratedPluginRegistrant.*
32 !default.perspectivev3
33
34 Mwebd.xcframework
35 +*Wallet.xcframework
\ No newline at end of file
ios/MoneroWallet.framework/Info.plist
Binary files a/ios/MoneroWallet.framework/Info.plist and /dev/null differ
ios/Runner.xcodeproj/project.pbxproj
+13 -15
@@ -8,7 +8,6 @@
8
9 /* Begin PBXBuildFile section */
10 0C44A71A2518EF8000B570ED /* decrypt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C44A7192518EF8000B570ED /* decrypt.swift */; };
11 - 0C50DFB92BF3CB56002B0EB3 /* MoneroWallet.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0C50DFB82BF3CB56002B0EB3 /* MoneroWallet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
11 0C9D68C9264854B60011B691 /* secRandom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C9D68C8264854B60011B691 /* secRandom.swift */; };
12 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
13 2193F104374FA2746CE8945B /* ResourceHelper.swift in Resources */ = {isa = PBXBuildFile; fileRef = 78D25C60B94E9D9E48D52E5E /* ResourceHelper.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; };
@@ -27,8 +26,9 @@
26 A1B4A70C9CFA13AB71662216 /* LnurlPay.swift in Resources */ = {isa = PBXBuildFile; fileRef = 7D3364C03978A8A74B6D586E /* LnurlPay.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; };
27 A3D5E17CC53DF13FA740DEFA /* RedeemSwap.swift in Resources */ = {isa = PBXBuildFile; fileRef = 9D2F2C9F2555316C95EE7EA3 /* RedeemSwap.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; };
28 B6C6E59403ACDE44724C12F4 /* ServiceConfig.swift in Resources */ = {isa = PBXBuildFile; fileRef = B3D5E78267F5F18D882FDC3B /* ServiceConfig.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; };
30 - CE291CFE2C15DB9A00B9F709 /* WowneroWallet.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE291CFD2C15DB9A00B9F709 /* WowneroWallet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
31 - CEA883682D43BE4500278CD3 /* ZanoWallet.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CEB6D62E2D43BB78002C6DBC /* ZanoWallet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
29 + CE918BF82D533ECE007F186E /* MoneroWallet.xcframework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE918BF72D533ECE007F186E /* MoneroWallet.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
30 + CE918BFA2D533ED4007F186E /* WowneroWallet.xcframework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE918BF92D533ED4007F186E /* WowneroWallet.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
31 + CE918BFC2D533ED8007F186E /* ZanoWallet.xcframework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE918BFB2D533ED8007F186E /* ZanoWallet.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
32 CEAFE4A02C53926F009FF3AD /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = C58D93382C00FAC6004BCF69 /* libresolv.tbd */; };
33 CFEFC24F82F78FE747DF1D22 /* LnurlPayInfo.swift in Resources */ = {isa = PBXBuildFile; fileRef = 58C22CBD8C22B9D6023D59F8 /* LnurlPayInfo.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; };
34 D0D7A0D4E13F31C4E02E235B /* ReceivePayment.swift in Resources */ = {isa = PBXBuildFile; fileRef = 91C524F800843E0A3F17E004 /* ReceivePayment.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; };
@@ -43,9 +43,9 @@
43 dstPath = "";
44 dstSubfolderSpec = 10;
45 files = (
46 - CE291CFE2C15DB9A00B9F709 /* WowneroWallet.framework in CopyFiles */,
47 - 0C50DFB92BF3CB56002B0EB3 /* MoneroWallet.framework in CopyFiles */,
48 - CEA883682D43BE4500278CD3 /* ZanoWallet.framework in CopyFiles */,
46 + CE918BF82D533ECE007F186E /* MoneroWallet.xcframework in CopyFiles */,
47 + CE918BFA2D533ED4007F186E /* WowneroWallet.xcframework in CopyFiles */,
48 + CE918BFC2D533ED8007F186E /* ZanoWallet.xcframework in CopyFiles */,
49 );
50 runOnlyForDeploymentPostprocessing = 0;
51 };
@@ -55,7 +55,6 @@
55 014D7E4DBCFD76DDE652A4D9 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
56 0C400E0F25B21ABB0025E469 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
57 0C44A7192518EF8000B570ED /* decrypt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = decrypt.swift; sourceTree = "<group>"; };
58 - 0C50DFB82BF3CB56002B0EB3 /* MoneroWallet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = MoneroWallet.framework; sourceTree = "<group>"; };
58 0C9986A3251A932F00D566FD /* CryptoSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CryptoSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
59 0C9D68C8264854B60011B691 /* secRandom.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = secRandom.swift; sourceTree = "<group>"; };
60 0CCA7ADAD6FF9185EBBB2BCA /* Constants.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Constants.swift; path = "../.symlinks/plugins/breez_sdk/ios/bindings-swift/Sources/BreezSDK/Constants.swift"; sourceTree = "<group>"; };
@@ -86,9 +85,9 @@
85 ABD6FCBB0F4244B090459128 /* BreezSDK.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BreezSDK.swift; path = "../.symlinks/plugins/breez_sdk/ios/bindings-swift/Sources/BreezSDK/BreezSDK.swift"; sourceTree = "<group>"; };
86 B3D5E78267F5F18D882FDC3B /* ServiceConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServiceConfig.swift; path = "../.symlinks/plugins/breez_sdk/ios/bindings-swift/Sources/BreezSDK/ServiceConfig.swift"; sourceTree = "<group>"; };
87 C58D93382C00FAC6004BCF69 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; };
89 - CE291CFD2C15DB9A00B9F709 /* WowneroWallet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WowneroWallet.framework; sourceTree = "<group>"; };
90 - CEAFE49D2C539250009FF3AD /* Mwebd.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = Mwebd.xcframework; sourceTree = "<group>"; };
91 - CEB6D62E2D43BB78002C6DBC /* ZanoWallet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ZanoWallet.framework; sourceTree = "<group>"; };
88 + CE918BF72D533ECE007F186E /* MoneroWallet.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = MoneroWallet.xcframework; sourceTree = "<group>"; };
89 + CE918BF92D533ED4007F186E /* WowneroWallet.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = WowneroWallet.xcframework; sourceTree = "<group>"; };
90 + CE918BFB2D533ED8007F186E /* ZanoWallet.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = ZanoWallet.xcframework; sourceTree = "<group>"; };
91 D139E30AEB36740C21C00A9E /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
92 D7CD6B6020744E8FA471915D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
93 DCEA540E3586164FB47AD13E /* LnurlPayInvoice.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LnurlPayInvoice.swift; path = "../.symlinks/plugins/breez_sdk/ios/bindings-swift/Sources/BreezSDK/Task/LnurlPayInvoice.swift"; sourceTree = "<group>"; };
@@ -100,8 +99,8 @@
99 isa = PBXFrameworksBuildPhase;
100 buildActionMask = 2147483647;
101 files = (
103 - CEAFE4A02C53926F009FF3AD /* libresolv.tbd in Frameworks */,
102 8B1F4FCAA5EB9F3A83D32D5F /* Pods_Runner.framework in Frameworks */,
103 + CEAFE4A02C53926F009FF3AD /* libresolv.tbd in Frameworks */,
104 );
105 runOnlyForDeploymentPostprocessing = 0;
106 };
@@ -111,7 +110,9 @@
110 06957875428D0F5AAE053765 /* Frameworks */ = {
111 isa = PBXGroup;
112 children = (
114 - CEAFE49D2C539250009FF3AD /* Mwebd.xcframework */,
113 + CE918BFB2D533ED8007F186E /* ZanoWallet.xcframework */,
114 + CE918BF92D533ED4007F186E /* WowneroWallet.xcframework */,
115 + CE918BF72D533ECE007F186E /* MoneroWallet.xcframework */,
116 C58D93382C00FAC6004BCF69 /* libresolv.tbd */,
117 0C9986A3251A932F00D566FD /* CryptoSwift.framework */,
118 D7CD6B6020744E8FA471915D /* Pods_Runner.framework */,
@@ -162,9 +163,6 @@
163 97C146E51CF9000F007C117D = {
164 isa = PBXGroup;
165 children = (
165 - CE291CFD2C15DB9A00B9F709 /* WowneroWallet.framework */,
166 - 0C50DFB82BF3CB56002B0EB3 /* MoneroWallet.framework */,
167 - CEB6D62E2D43BB78002C6DBC /* ZanoWallet.framework */,
166 0C44A7182518EF4A00B570ED /* CakeWallet */,
167 9740EEB11CF90186004384FC /* Flutter */,
168 97C146F01CF9000F007C117D /* Runner */,
ios/WowneroWallet.framework/Info.plist
Binary files a/ios/WowneroWallet.framework/Info.plist and /dev/null differ
ios/ZanoWallet.framework/Info.plist
Binary files a/ios/ZanoWallet.framework/Info.plist and /dev/null differ
ios/monero_libwallet2_api_c.dylib deleted
-1
@@ -1 +0,0 @@
1 -../scripts/monero_c/release/monero/aarch64-apple-ios_libwallet2_api_c.dylib
\ No newline at end of file
ios/wownero_libwallet2_api_c.dylib deleted
-1
@@ -1 +0,0 @@
1 -../scripts/monero_c/release/wownero/aarch64-apple-ios_libwallet2_api_c.dylib
\ No newline at end of file
ios/zano_libwallet2_api_c.dylib deleted
-1
@@ -1 +0,0 @@
1 -../scripts/monero_c/release/zano/aarch64-apple-ios_libwallet2_api_c.dylib
\ No newline at end of file
model_generator.sh
+1 -1
@@ -10,7 +10,7 @@ do
10 bash -c "cd $cwcoin; flutter pub get; dart run build_runner build --delete-conflicting-outputs; cd .."
11 fi
12 done
13 -for cwcoin in cw_{polygon,ethereum,mwebd};
13 +for cwcoin in cw_{polygon,ethereum,mweb};
14 do
15 if [[ "x$1" == "xasync" ]];
16 then
scripts/ios/app_config.sh
+1 -2
@@ -10,8 +10,7 @@ if [ -z "$APP_IOS_TYPE" ]; then
10 echo "Please set APP_IOS_TYPE"
11 exit 1
12 fi
13 -./gen_framework.sh
14 -cd .. # go to scipts
13 +cd ..
14 ./gen_android_manifest.sh
15 cd .. # go to root
16 cp -rf ./ios/Runner/InfoBase.plist ./ios/Runner/Info.plist
scripts/ios/app_env.sh
+4 -4
@@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
13 APP_IOS_TYPE=$1
14
15 MONERO_COM_NAME="Monero.com"
16 -MONERO_COM_VERSION="1.20.0"
17 -MONERO_COM_BUILD_NUMBER=110
16 +MONERO_COM_VERSION="1.20.1"
17 +MONERO_COM_BUILD_NUMBER=111
18 MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
19
20 CAKEWALLET_NAME="Cake Wallet"
21 -CAKEWALLET_VERSION="4.23.0"
22 -CAKEWALLET_BUILD_NUMBER=293
21 +CAKEWALLET_VERSION="4.23.1"
22 +CAKEWALLET_BUILD_NUMBER=295
23 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
24
25 HAVEN_NAME="Haven"
scripts/ios/build_monero_all.sh
+10 -4
@@ -18,11 +18,17 @@ cd "$(dirname "$0")"
18 for COIN in monero wownero zano;
19 do
20 pushd ../monero_c
21 - rm -rf external/ios/build
21 ./build_single.sh ${COIN} aarch64-apple-ios -j$MAKE_JOB_COUNT
22 + ./build_single.sh ${COIN} aarch64-apple-iossimulator -j$MAKE_JOB_COUNT
23 popd
24 done
25
26 -unxz -f ../monero_c/release/monero/aarch64-apple-ios_libwallet2_api_c.dylib.xz
27 -unxz -f ../monero_c/release/wownero/aarch64-apple-ios_libwallet2_api_c.dylib.xz
28 -unxz -f ../monero_c/release/zano/aarch64-apple-ios_libwallet2_api_c.dylib.xz
26 +unxz -fk ../monero_c/release/monero/aarch64-apple-ios_libwallet2_api_c.dylib.xz
27 +unxz -fk ../monero_c/release/wownero/aarch64-apple-ios_libwallet2_api_c.dylib.xz
28 +unxz -fk ../monero_c/release/zano/aarch64-apple-ios_libwallet2_api_c.dylib.xz
29 +
30 +unxz -fk ../monero_c/release/monero/aarch64-apple-iossimulator_libwallet2_api_c.dylib.xz
31 +unxz -fk ../monero_c/release/wownero/aarch64-apple-iossimulator_libwallet2_api_c.dylib.xz
32 +unxz -fk ../monero_c/release/zano/aarch64-apple-iossimulator_libwallet2_api_c.dylib.xz
33 +
34 +./gen_framework.sh
\ No newline at end of file
scripts/ios/build_mwebd.sh
+1 -1
@@ -14,7 +14,7 @@ git clone https://github.com/ltcmweb/mwebd
14 cd mwebd
15 git reset --hard 555349415f76a42ec5c76152b64c4ab9aabc448f
16 gomobile bind -target=ios .
17 -mv -fn ./Mwebd.xcframework ../../../ios/
17 +mv -fn ./Mwebd.xcframework ../../../cw_mweb/ios/
18 # cleanup:
19 cd ..
20 rm -rf mwebd
\ No newline at end of file
scripts/ios/gen_framework.sh
+147 -35
@@ -1,47 +1,159 @@
1 #!/bin/sh
2 -# Assume we are in scripts/ios
2 +set -e
3 +
4 IOS_DIR="$(pwd)/../../ios"
4 -DYLIB_NAME="monero_libwallet2_api_c.dylib"
5 -DYLIB_LINK_PATH="${IOS_DIR}/${DYLIB_NAME}"
6 -FRWK_DIR="${IOS_DIR}/MoneroWallet.framework"
5 +DYLIB_PATH="$(pwd)/../../scripts/monero_c/release"
6 +TMP_DIR="${IOS_DIR}/tmp"
7
8 -if [ ! -f $DYLIB_LINK_PATH ]; then
9 - echo "Dylib is not found by the link: ${DYLIB_LINK_PATH}"
10 - exit 0
11 -fi
8 +rm -rf "${IOS_DIR:?}/MoneroWallet.xcframework" "${IOS_DIR:?}/WowneroWallet.xcframework" "${IOS_DIR:?}/ZanoWallet.xcframework"
9 +rm -rf "${IOS_DIR:?}/MoneroWallet.framework" "${IOS_DIR:?}/WowneroWallet.framework" "${IOS_DIR:?}/ZanoWallet.framework"
10 +rm -rf "$TMP_DIR"
11 +mkdir -p "$TMP_DIR"
12
13 -cd $FRWK_DIR # go to iOS framework dir
14 -lipo -create $DYLIB_LINK_PATH -output MoneroWallet
13 +write_info_plist() {
14 + framework_bundle="$1"
15 + framework_name="$2"
16 + target="$3"
17 + plist_path="${framework_bundle}/Info.plist"
18
16 -echo "Generated ${FRWK_DIR}"
17 -# also generate for wownero
18 -IOS_DIR="$(pwd)/../../ios"
19 -DYLIB_NAME="wownero_libwallet2_api_c.dylib"
20 -DYLIB_LINK_PATH="${IOS_DIR}/${DYLIB_NAME}"
21 -FRWK_DIR="${IOS_DIR}/WowneroWallet.framework"
19 + if [[ "x$target" = "xiossimulator" ]]; then
20 + platform="iPhoneSimulator"
21 + dtplatformname="iphonesimulator"
22 + dtsdkname="iphonesimulator17.4"
23 + else
24 + platform="iPhoneOS"
25 + dtplatformname="iphoneos"
26 + dtsdkname="iphoneos17.4"
27 + fi
28
23 -if [ ! -f $DYLIB_LINK_PATH ]; then
24 - echo "Dylib is not found by the link: ${DYLIB_LINK_PATH}"
25 - exit 0
26 -fi
29 + cat > "$plist_path" <<EOF
30 +<?xml version="1.0" encoding="UTF-8"?>
31 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
32 +<plist version="1.0">
33 +<dict>
34 + <key>BuildMachineOSBuild</key>
35 + <string>23E224</string>
36 + <key>CFBundleDevelopmentRegion</key>
37 + <string>en</string>
38 + <key>CFBundleExecutable</key>
39 + <string>${framework_name}</string>
40 + <key>CFBundleIdentifier</key>
41 + <string>com.fotolockr.${framework_name}</string>
42 + <key>CFBundleInfoDictionaryVersion</key>
43 + <string>6.0</string>
44 + <key>CFBundleName</key>
45 + <string>${framework_name}</string>
46 + <key>CFBundlePackageType</key>
47 + <string>FMWK</string>
48 + <key>CFBundleShortVersionString</key>
49 + <string>1.0</string>
50 + <key>CFBundleSignature</key>
51 + <string>???</string>
52 + <key>CFBundleSupportedPlatforms</key>
53 + <array>
54 + <string>${platform}</string>
55 + </array>
56 + <key>CFBundleVersion</key>
57 + <string>1</string>
58 + <key>DTCompiler</key>
59 + <string>com.apple.compilers.llvm.clang.1_0</string>
60 + <key>DTPlatformBuild</key>
61 + <string>21E210</string>
62 + <key>DTPlatformName</key>
63 + <string>${dtplatformname}</string>
64 + <key>DTPlatformVersion</key>
65 + <string>17.4</string>
66 + <key>DTSDKBuild</key>
67 + <string>21E210</string>
68 + <key>DTSDKName</key>
69 + <string>${dtsdkname}</string>
70 + <key>DTXcode</key>
71 + <string>1530</string>
72 + <key>DTXcodeBuild</key>
73 + <string>15E204a</string>
74 + <key>MinimumOSVersion</key>
75 + <string>16.0</string>
76 + <key>UIDeviceFamily</key>
77 + <array>
78 + <integer>1</integer>
79 + <integer>2</integer>
80 + </array>
81 + <key>UIRequiredDeviceCapabilities</key>
82 + <array>
83 + <string>arm64</string>
84 + </array>
85 +</dict>
86 +</plist>
87 +EOF
88 + plutil -convert binary1 "$plist_path"
89 +}
90
28 -cd $FRWK_DIR # go to iOS framework dir
29 -lipo -create $DYLIB_LINK_PATH -output WowneroWallet
91 +create_framework() {
92 + wallet="$1"
93 + framework_name="$2"
94 + target="$3"
95 + out_dir="$4"
96
31 -echo "Generated ${FRWK_DIR}"
97 + echo "Creating ${framework_name}.framework for target ${target} in ${out_dir}..."
98
33 -# also generate for zano
34 -IOS_DIR="$(pwd)/../../ios"
35 -DYLIB_NAME="zano_libwallet2_api_c.dylib"
36 -DYLIB_LINK_PATH="${IOS_DIR}/${DYLIB_NAME}"
37 -FRWK_DIR="${IOS_DIR}/ZanoWallet.framework"
99 + framework_bundle="${out_dir}/${framework_name}.framework"
100 +
101 + rm -rf "$framework_bundle"
102 + mkdir -p "$framework_bundle"
103 +
104 + input_dylib="${DYLIB_PATH}/${wallet}/aarch64-apple-${target}_libwallet2_api_c.dylib"
105 + if [[ ! -f "$input_dylib" ]]; then
106 + echo "Error: Input dylib not found: $input_dylib"
107 + exit 1
108 + fi
109 +
110 + lipo -create "$input_dylib" -output "${framework_bundle}/${framework_name}"
111 + echo "Created binary: ${framework_bundle}/${framework_name}"
112 +
113 + write_info_plist "$framework_bundle" "$framework_name" "$target"
114 +}
115 +
116 +create_xcframework() {
117 + framework_name="$1"
118 + device_framework="$2"
119 + simulator_framework="$3"
120 + xcframework_output="$4"
121 +
122 + echo "Creating ${xcframework_output} by bundling:"
123 + echo " Device framework: ${device_framework}"
124 + echo " Simulator framework: ${simulator_framework}"
125 +
126 + xcodebuild -create-xcframework \
127 + -framework "$device_framework" \
128 + -framework "$simulator_framework" \
129 + -output "$xcframework_output"
130 +
131 + echo "Created XCFramework: ${xcframework_output}"
132 +}
133 +
134 +wallets=("monero" "wownero" "zano")
135 +framework_names=("MoneroWallet" "WowneroWallet" "ZanoWallet")
136 +
137 +for i in "${!wallets[@]}"; do
138 + wallet="${wallets[$i]}"
139 + framework_name="${framework_names[$i]}"
140 +
141 + device_out="${TMP_DIR}/${framework_name}_device"
142 + simulator_out="${TMP_DIR}/${framework_name}_simulator"
143 + rm -rf "$device_out" "$simulator_out"
144 + mkdir -p "$device_out" "$simulator_out"
145 +
146 + create_framework "$wallet" "$framework_name" "ios" "$device_out"
147 + create_framework "$wallet" "$framework_name" "iossimulator" "$simulator_out"
148 +
149 + device_framework="${device_out}/${framework_name}.framework"
150 + simulator_framework="${simulator_out}/${framework_name}.framework"
151 + xcframework_output="${IOS_DIR}/${framework_name}.xcframework"
152 + rm -rf "$xcframework_output"
153
39 -if [ ! -f $DYLIB_LINK_PATH ]; then
40 - echo "Dylib is not found by the link: ${DYLIB_LINK_PATH}"
41 - exit 0
42 -fi
154 + create_xcframework "$framework_name" "$device_framework" "$simulator_framework" "$xcframework_output"
155 +done
156
44 -cd $FRWK_DIR # go to iOS framework dir
45 -lipo -create $DYLIB_LINK_PATH -output ZanoWallet
157 +echo "All XCFrameworks created successfully."
158
47 -echo "Generated ${FRWK_DIR}"
159 +rm -rf "$TMP_DIR"
tool/download_moneroc_prebuilds.dart
+1
@@ -24,6 +24,7 @@ final List<String> triplets = [
24 // "x86_64-host-apple-darwin", // not available on CI (yet)
25 "aarch64-host-apple-darwin", // apple silicon macbooks (local builds)
26 "aarch64-apple-ios",
27 + "aarch64-apple-iossimulator",
28 ];
29
30 Future<void> main() async {