diff --git a/cw_mweb/ios/.gitignore b/cw_mweb/ios/.gitignore index 0c885071e..7912ef55a 100644 --- a/cw_mweb/ios/.gitignore +++ b/cw_mweb/ios/.gitignore @@ -35,4 +35,6 @@ Icon? /Flutter/Generated.xcconfig /Flutter/ephemeral/ -/Flutter/flutter_export_environment.sh \ No newline at end of file +/Flutter/flutter_export_environment.sh + +Mwebd.xcframework \ No newline at end of file diff --git a/cw_mweb/ios/cw_mweb.podspec b/cw_mweb/ios/cw_mweb.podspec index 4a1903bae..19857c5ee 100644 --- a/cw_mweb/ios/cw_mweb.podspec +++ b/cw_mweb/ios/cw_mweb.podspec @@ -16,11 +16,12 @@ A new Flutter plugin project. s.source_files = 'Classes/**/*' s.dependency 'Flutter' s.platform = :ios, '11.0' + s.libraries = 'resolv' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' - s.ios.vendored_frameworks = 'Mwebd.xcframework' + s.vendored_frameworks = 'Mwebd.xcframework' s.preserve_paths = 'Mwebd.xcframework/**/*' end diff --git a/ios/.gitignore b/ios/.gitignore index 4f85acc8d..87057e358 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -32,3 +32,4 @@ Runner/GeneratedPluginRegistrant.* !default.perspectivev3 Mwebd.xcframework +*Wallet.xcframework \ No newline at end of file diff --git a/ios/MoneroWallet.framework/Info.plist b/ios/MoneroWallet.framework/Info.plist deleted file mode 100644 index 8858589f7..000000000 Binary files a/ios/MoneroWallet.framework/Info.plist and /dev/null differ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index f47a2c1ab..864d6c420 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 0C44A71A2518EF8000B570ED /* decrypt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C44A7192518EF8000B570ED /* decrypt.swift */; }; - 0C50DFB92BF3CB56002B0EB3 /* MoneroWallet.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0C50DFB82BF3CB56002B0EB3 /* MoneroWallet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 0C9D68C9264854B60011B691 /* secRandom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C9D68C8264854B60011B691 /* secRandom.swift */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 2193F104374FA2746CE8945B /* ResourceHelper.swift in Resources */ = {isa = PBXBuildFile; fileRef = 78D25C60B94E9D9E48D52E5E /* ResourceHelper.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; }; @@ -27,8 +26,9 @@ A1B4A70C9CFA13AB71662216 /* LnurlPay.swift in Resources */ = {isa = PBXBuildFile; fileRef = 7D3364C03978A8A74B6D586E /* LnurlPay.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; }; A3D5E17CC53DF13FA740DEFA /* RedeemSwap.swift in Resources */ = {isa = PBXBuildFile; fileRef = 9D2F2C9F2555316C95EE7EA3 /* RedeemSwap.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; }; B6C6E59403ACDE44724C12F4 /* ServiceConfig.swift in Resources */ = {isa = PBXBuildFile; fileRef = B3D5E78267F5F18D882FDC3B /* ServiceConfig.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; }; - CE291CFE2C15DB9A00B9F709 /* WowneroWallet.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE291CFD2C15DB9A00B9F709 /* WowneroWallet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - CEA883682D43BE4500278CD3 /* ZanoWallet.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CEB6D62E2D43BB78002C6DBC /* ZanoWallet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + CE918BF82D533ECE007F186E /* MoneroWallet.xcframework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE918BF72D533ECE007F186E /* MoneroWallet.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + CE918BFA2D533ED4007F186E /* WowneroWallet.xcframework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE918BF92D533ED4007F186E /* WowneroWallet.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + CE918BFC2D533ED8007F186E /* ZanoWallet.xcframework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE918BFB2D533ED8007F186E /* ZanoWallet.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; CEAFE4A02C53926F009FF3AD /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = C58D93382C00FAC6004BCF69 /* libresolv.tbd */; }; CFEFC24F82F78FE747DF1D22 /* LnurlPayInfo.swift in Resources */ = {isa = PBXBuildFile; fileRef = 58C22CBD8C22B9D6023D59F8 /* LnurlPayInfo.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; }; D0D7A0D4E13F31C4E02E235B /* ReceivePayment.swift in Resources */ = {isa = PBXBuildFile; fileRef = 91C524F800843E0A3F17E004 /* ReceivePayment.swift */; settings = {ASSET_TAGS = (BreezSDK, ); }; }; @@ -43,9 +43,9 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - CE291CFE2C15DB9A00B9F709 /* WowneroWallet.framework in CopyFiles */, - 0C50DFB92BF3CB56002B0EB3 /* MoneroWallet.framework in CopyFiles */, - CEA883682D43BE4500278CD3 /* ZanoWallet.framework in CopyFiles */, + CE918BF82D533ECE007F186E /* MoneroWallet.xcframework in CopyFiles */, + CE918BFA2D533ED4007F186E /* WowneroWallet.xcframework in CopyFiles */, + CE918BFC2D533ED8007F186E /* ZanoWallet.xcframework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -55,7 +55,6 @@ 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 = ""; }; 0C400E0F25B21ABB0025E469 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; 0C44A7192518EF8000B570ED /* decrypt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = decrypt.swift; sourceTree = ""; }; - 0C50DFB82BF3CB56002B0EB3 /* MoneroWallet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = MoneroWallet.framework; sourceTree = ""; }; 0C9986A3251A932F00D566FD /* CryptoSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CryptoSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0C9D68C8264854B60011B691 /* secRandom.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = secRandom.swift; sourceTree = ""; }; 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 = ""; }; @@ -86,9 +85,9 @@ 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 = ""; }; 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 = ""; }; C58D93382C00FAC6004BCF69 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; - CE291CFD2C15DB9A00B9F709 /* WowneroWallet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WowneroWallet.framework; sourceTree = ""; }; - CEAFE49D2C539250009FF3AD /* Mwebd.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = Mwebd.xcframework; sourceTree = ""; }; - CEB6D62E2D43BB78002C6DBC /* ZanoWallet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ZanoWallet.framework; sourceTree = ""; }; + CE918BF72D533ECE007F186E /* MoneroWallet.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = MoneroWallet.xcframework; sourceTree = ""; }; + CE918BF92D533ED4007F186E /* WowneroWallet.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = WowneroWallet.xcframework; sourceTree = ""; }; + CE918BFB2D533ED8007F186E /* ZanoWallet.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = ZanoWallet.xcframework; sourceTree = ""; }; 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 = ""; }; D7CD6B6020744E8FA471915D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 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 = ""; }; @@ -100,8 +99,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CEAFE4A02C53926F009FF3AD /* libresolv.tbd in Frameworks */, 8B1F4FCAA5EB9F3A83D32D5F /* Pods_Runner.framework in Frameworks */, + CEAFE4A02C53926F009FF3AD /* libresolv.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -111,7 +110,9 @@ 06957875428D0F5AAE053765 /* Frameworks */ = { isa = PBXGroup; children = ( - CEAFE49D2C539250009FF3AD /* Mwebd.xcframework */, + CE918BFB2D533ED8007F186E /* ZanoWallet.xcframework */, + CE918BF92D533ED4007F186E /* WowneroWallet.xcframework */, + CE918BF72D533ECE007F186E /* MoneroWallet.xcframework */, C58D93382C00FAC6004BCF69 /* libresolv.tbd */, 0C9986A3251A932F00D566FD /* CryptoSwift.framework */, D7CD6B6020744E8FA471915D /* Pods_Runner.framework */, @@ -162,9 +163,6 @@ 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( - CE291CFD2C15DB9A00B9F709 /* WowneroWallet.framework */, - 0C50DFB82BF3CB56002B0EB3 /* MoneroWallet.framework */, - CEB6D62E2D43BB78002C6DBC /* ZanoWallet.framework */, 0C44A7182518EF4A00B570ED /* CakeWallet */, 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, diff --git a/ios/WowneroWallet.framework/Info.plist b/ios/WowneroWallet.framework/Info.plist deleted file mode 100644 index 61ab961f4..000000000 Binary files a/ios/WowneroWallet.framework/Info.plist and /dev/null differ diff --git a/ios/ZanoWallet.framework/Info.plist b/ios/ZanoWallet.framework/Info.plist deleted file mode 100644 index c430c096e..000000000 Binary files a/ios/ZanoWallet.framework/Info.plist and /dev/null differ diff --git a/ios/monero_libwallet2_api_c.dylib b/ios/monero_libwallet2_api_c.dylib deleted file mode 120000 index 528ecd4a3..000000000 --- a/ios/monero_libwallet2_api_c.dylib +++ /dev/null @@ -1 +0,0 @@ -../scripts/monero_c/release/monero/aarch64-apple-ios_libwallet2_api_c.dylib \ No newline at end of file diff --git a/ios/wownero_libwallet2_api_c.dylib b/ios/wownero_libwallet2_api_c.dylib deleted file mode 120000 index 35e4e98e9..000000000 --- a/ios/wownero_libwallet2_api_c.dylib +++ /dev/null @@ -1 +0,0 @@ -../scripts/monero_c/release/wownero/aarch64-apple-ios_libwallet2_api_c.dylib \ No newline at end of file diff --git a/ios/zano_libwallet2_api_c.dylib b/ios/zano_libwallet2_api_c.dylib deleted file mode 120000 index 767071f7d..000000000 --- a/ios/zano_libwallet2_api_c.dylib +++ /dev/null @@ -1 +0,0 @@ -../scripts/monero_c/release/zano/aarch64-apple-ios_libwallet2_api_c.dylib \ No newline at end of file diff --git a/model_generator.sh b/model_generator.sh index c43f60a31..f3950e2b1 100755 --- a/model_generator.sh +++ b/model_generator.sh @@ -10,7 +10,7 @@ do bash -c "cd $cwcoin; flutter pub get; dart run build_runner build --delete-conflicting-outputs; cd .." fi done -for cwcoin in cw_{polygon,ethereum,mwebd}; +for cwcoin in cw_{polygon,ethereum,mweb}; do if [[ "x$1" == "xasync" ]]; then diff --git a/scripts/ios/app_config.sh b/scripts/ios/app_config.sh index 35bbe7b74..d118370b5 100755 --- a/scripts/ios/app_config.sh +++ b/scripts/ios/app_config.sh @@ -10,8 +10,7 @@ if [ -z "$APP_IOS_TYPE" ]; then echo "Please set APP_IOS_TYPE" exit 1 fi -./gen_framework.sh -cd .. # go to scipts +cd .. ./gen_android_manifest.sh cd .. # go to root cp -rf ./ios/Runner/InfoBase.plist ./ios/Runner/Info.plist diff --git a/scripts/ios/app_env.sh b/scripts/ios/app_env.sh index 0e6ed285e..304b95b5b 100644 --- a/scripts/ios/app_env.sh +++ b/scripts/ios/app_env.sh @@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN) APP_IOS_TYPE=$1 MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.20.0" -MONERO_COM_BUILD_NUMBER=110 +MONERO_COM_VERSION="1.20.1" +MONERO_COM_BUILD_NUMBER=111 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.23.0" -CAKEWALLET_BUILD_NUMBER=293 +CAKEWALLET_VERSION="4.23.1" +CAKEWALLET_BUILD_NUMBER=295 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" HAVEN_NAME="Haven" diff --git a/scripts/ios/build_monero_all.sh b/scripts/ios/build_monero_all.sh index 79a3c61f8..69d4f006b 100755 --- a/scripts/ios/build_monero_all.sh +++ b/scripts/ios/build_monero_all.sh @@ -18,11 +18,17 @@ cd "$(dirname "$0")" for COIN in monero wownero zano; do pushd ../monero_c - rm -rf external/ios/build ./build_single.sh ${COIN} aarch64-apple-ios -j$MAKE_JOB_COUNT + ./build_single.sh ${COIN} aarch64-apple-iossimulator -j$MAKE_JOB_COUNT popd done -unxz -f ../monero_c/release/monero/aarch64-apple-ios_libwallet2_api_c.dylib.xz -unxz -f ../monero_c/release/wownero/aarch64-apple-ios_libwallet2_api_c.dylib.xz -unxz -f ../monero_c/release/zano/aarch64-apple-ios_libwallet2_api_c.dylib.xz +unxz -fk ../monero_c/release/monero/aarch64-apple-ios_libwallet2_api_c.dylib.xz +unxz -fk ../monero_c/release/wownero/aarch64-apple-ios_libwallet2_api_c.dylib.xz +unxz -fk ../monero_c/release/zano/aarch64-apple-ios_libwallet2_api_c.dylib.xz + +unxz -fk ../monero_c/release/monero/aarch64-apple-iossimulator_libwallet2_api_c.dylib.xz +unxz -fk ../monero_c/release/wownero/aarch64-apple-iossimulator_libwallet2_api_c.dylib.xz +unxz -fk ../monero_c/release/zano/aarch64-apple-iossimulator_libwallet2_api_c.dylib.xz + +./gen_framework.sh \ No newline at end of file diff --git a/scripts/ios/build_mwebd.sh b/scripts/ios/build_mwebd.sh index e13c4931c..5bdd32e15 100755 --- a/scripts/ios/build_mwebd.sh +++ b/scripts/ios/build_mwebd.sh @@ -14,7 +14,7 @@ git clone https://github.com/ltcmweb/mwebd cd mwebd git reset --hard 555349415f76a42ec5c76152b64c4ab9aabc448f gomobile bind -target=ios . -mv -fn ./Mwebd.xcframework ../../../ios/ +mv -fn ./Mwebd.xcframework ../../../cw_mweb/ios/ # cleanup: cd .. rm -rf mwebd \ No newline at end of file diff --git a/scripts/ios/gen_framework.sh b/scripts/ios/gen_framework.sh index e9cc44801..e1c237f87 100755 --- a/scripts/ios/gen_framework.sh +++ b/scripts/ios/gen_framework.sh @@ -1,47 +1,159 @@ #!/bin/sh -# Assume we are in scripts/ios +set -e + IOS_DIR="$(pwd)/../../ios" -DYLIB_NAME="monero_libwallet2_api_c.dylib" -DYLIB_LINK_PATH="${IOS_DIR}/${DYLIB_NAME}" -FRWK_DIR="${IOS_DIR}/MoneroWallet.framework" +DYLIB_PATH="$(pwd)/../../scripts/monero_c/release" +TMP_DIR="${IOS_DIR}/tmp" -if [ ! -f $DYLIB_LINK_PATH ]; then - echo "Dylib is not found by the link: ${DYLIB_LINK_PATH}" - exit 0 -fi +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" -cd $FRWK_DIR # go to iOS framework dir -lipo -create $DYLIB_LINK_PATH -output MoneroWallet +write_info_plist() { + framework_bundle="$1" + framework_name="$2" + target="$3" + plist_path="${framework_bundle}/Info.plist" -echo "Generated ${FRWK_DIR}" -# also generate for wownero -IOS_DIR="$(pwd)/../../ios" -DYLIB_NAME="wownero_libwallet2_api_c.dylib" -DYLIB_LINK_PATH="${IOS_DIR}/${DYLIB_NAME}" -FRWK_DIR="${IOS_DIR}/WowneroWallet.framework" + if [[ "x$target" = "xiossimulator" ]]; then + platform="iPhoneSimulator" + dtplatformname="iphonesimulator" + dtsdkname="iphonesimulator17.4" + else + platform="iPhoneOS" + dtplatformname="iphoneos" + dtsdkname="iphoneos17.4" + fi -if [ ! -f $DYLIB_LINK_PATH ]; then - echo "Dylib is not found by the link: ${DYLIB_LINK_PATH}" - exit 0 -fi + cat > "$plist_path" < + + + + BuildMachineOSBuild + 23E224 + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${framework_name} + CFBundleIdentifier + com.fotolockr.${framework_name} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${framework_name} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ??? + CFBundleSupportedPlatforms + + ${platform} + + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 21E210 + DTPlatformName + ${dtplatformname} + DTPlatformVersion + 17.4 + DTSDKBuild + 21E210 + DTSDKName + ${dtsdkname} + DTXcode + 1530 + DTXcodeBuild + 15E204a + MinimumOSVersion + 16.0 + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + + +EOF + plutil -convert binary1 "$plist_path" +} -cd $FRWK_DIR # go to iOS framework dir -lipo -create $DYLIB_LINK_PATH -output WowneroWallet +create_framework() { + wallet="$1" + framework_name="$2" + target="$3" + out_dir="$4" -echo "Generated ${FRWK_DIR}" + echo "Creating ${framework_name}.framework for target ${target} in ${out_dir}..." -# also generate for zano -IOS_DIR="$(pwd)/../../ios" -DYLIB_NAME="zano_libwallet2_api_c.dylib" -DYLIB_LINK_PATH="${IOS_DIR}/${DYLIB_NAME}" -FRWK_DIR="${IOS_DIR}/ZanoWallet.framework" + framework_bundle="${out_dir}/${framework_name}.framework" + + rm -rf "$framework_bundle" + mkdir -p "$framework_bundle" -if [ ! -f $DYLIB_LINK_PATH ]; then - echo "Dylib is not found by the link: ${DYLIB_LINK_PATH}" - exit 0 -fi + input_dylib="${DYLIB_PATH}/${wallet}/aarch64-apple-${target}_libwallet2_api_c.dylib" + if [[ ! -f "$input_dylib" ]]; then + echo "Error: Input dylib not found: $input_dylib" + exit 1 + fi -cd $FRWK_DIR # go to iOS framework dir -lipo -create $DYLIB_LINK_PATH -output ZanoWallet + lipo -create "$input_dylib" -output "${framework_bundle}/${framework_name}" + echo "Created binary: ${framework_bundle}/${framework_name}" -echo "Generated ${FRWK_DIR}" + 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" "zano") +framework_names=("MoneroWallet" "WowneroWallet" "ZanoWallet") + +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" "iossimulator" "$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" diff --git a/tool/download_moneroc_prebuilds.dart b/tool/download_moneroc_prebuilds.dart index 22384e84a..394f2edbc 100644 --- a/tool/download_moneroc_prebuilds.dart +++ b/tool/download_moneroc_prebuilds.dart @@ -24,6 +24,7 @@ final List triplets = [ // "x86_64-host-apple-darwin", // not available on CI (yet) "aarch64-host-apple-darwin", // apple silicon macbooks (local builds) "aarch64-apple-ios", + "aarch64-apple-iossimulator", ]; Future main() async {