From f0f0a68ec602713493335e2785a820afd31af4eb Mon Sep 17 00:00:00 2001 From: dijunkun Date: Wed, 11 Nov 2026 01:38:26 +0800 Subject: [PATCH] [fix] prevent connection crashes on older iOS versions --- apps/ios/CrossDeskMobile.xcodeproj/project.pbxproj | 4 ++-- apps/ios/scripts/build_minirtc_ios.sh | 13 ++++++++++--- deps/submodules/minirtc | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/apps/ios/CrossDeskMobile.xcodeproj/project.pbxproj b/apps/ios/CrossDeskMobile.xcodeproj/project.pbxproj index d578a1ef..e1830445 100644 --- a/apps/ios/CrossDeskMobile.xcodeproj/project.pbxproj +++ b/apps/ios/CrossDeskMobile.xcodeproj/project.pbxproj @@ -515,7 +515,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; ENABLE_BITCODE = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -567,7 +567,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; ENABLE_BITCODE = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/apps/ios/scripts/build_minirtc_ios.sh b/apps/ios/scripts/build_minirtc_ios.sh index 8ff8ef27..17cca48f 100755 --- a/apps/ios/scripts/build_minirtc_ios.sh +++ b/apps/ios/scripts/build_minirtc_ios.sh @@ -282,7 +282,7 @@ TEMP_MANIFEST="${MERGE_MANIFEST}.tmp" trap 'rm -f "${TEMP_LIBRARY}" "${TEMP_MANIFEST}"' EXIT # Check the actual archive, including when reusing cached build products. -verify_no_openh264() { +verify_native_symbols() { local symbols symbols="$(DEVELOPER_DIR="${XMAKE_DEVELOPER_DIR}" xcrun nm -g "$1")" if [[ "${symbols}" == *WelsCreateDecoder* || \ @@ -291,6 +291,13 @@ verify_no_openh264() { print -u2 "OpenH264 symbols must not be present in the iOS native archive: $1" exit 65 fi + # New Apple SDKs export pipe2 as a weak import for older deployment targets. + # GLib must use pipe + fcntl; an unconditional pipe2 call crashes during ICE + # setup on iOS versions that do not provide it. Check cached archives too. + if print -r -- "${symbols}" | /usr/bin/awk '$NF == "_pipe2" { found = 1 } END { exit !found }'; then + print -u2 "pipe2 must not be present in the iOS native archive; rebuild GLib with the iOS compatibility recipe: $1" + exit 65 + fi } # Hash contents as well as paths so same-size archives replaced within the same @@ -299,7 +306,7 @@ verify_no_openh264() { shasum -a 256 "${SCRIPT_DIR}/build_minirtc_ios.sh" "${MINIRTC_LIBRARY}" \ "${DEPENDENCY_ARCHIVES[@]}" "${WIRE_LIBRARY}" > "${TEMP_MANIFEST}" if [[ -f "${OUTPUT_LIBRARY}" ]] && cmp -s "${TEMP_MANIFEST}" "${MERGE_MANIFEST}"; then - verify_no_openh264 "${OUTPUT_LIBRARY}" + verify_native_symbols "${OUTPUT_LIBRARY}" print "Up to date: ${OUTPUT_LIBRARY}" exit 0 fi @@ -309,7 +316,7 @@ fi /usr/bin/libtool -static -no_warning_for_no_symbols -o "${TEMP_LIBRARY}" \ "${MINIRTC_LIBRARY}" "${MERGE_ARCHIVES[@]}" \ "${WIRE_LIBRARY}" -verify_no_openh264 "${TEMP_LIBRARY}" +verify_native_symbols "${TEMP_LIBRARY}" mv -f "${TEMP_LIBRARY}" "${OUTPUT_LIBRARY}" mv -f "${TEMP_MANIFEST}" "${MERGE_MANIFEST}" diff --git a/deps/submodules/minirtc b/deps/submodules/minirtc index 15c41351..a42d4ee6 160000 --- a/deps/submodules/minirtc +++ b/deps/submodules/minirtc @@ -1 +1 @@ -Subproject commit 15c4135127ab5560e8cbdfe49e074ed234879577 +Subproject commit a42d4ee62e916923c52fd919e98310a56f8a7c09