diff --git a/BUILDING.md b/BUILDING.md index 2ccfc4123..fbf425c00 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -30,7 +30,15 @@ You can then add the Session repo to sync with upstream changes: git remote add upstream https://github.com/oxen-io/session-ios ``` -## 2. Pods +## 2. Submodules + +Session requires a number of submodules to build, these can be retrieved by navigating to the project directory and running: + +``` +git submodule update --init --recursive +``` + +## 3. Pods To build and configure the libraries Session uses, just run: @@ -38,7 +46,7 @@ To build and configure the libraries Session uses, just run: pod install ``` -## 3. Xcode +## 4. Xcode Open the `Session.xcworkspace` in Xcode. diff --git a/Scripts/build_libSession_util.sh b/Scripts/build_libSession_util.sh index f562a7af8..7e46f7e2d 100755 --- a/Scripts/build_libSession_util.sh +++ b/Scripts/build_libSession_util.sh @@ -33,32 +33,19 @@ exec 3>&1 # Save original stdout # Ensure the build directory exists (in case we need it before XCode creates it) mkdir -p "${TARGET_BUILD_DIR}/libSessionUtil" -# Remove any old build errors -rm -rf "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_output.log" - -# Restore stdout and stderr and redirect it to the 'libsession_util_output.log' file -exec &> "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_output.log" - -# Define a function to echo a message. -function echo_message() { - exec 1>&3 # Restore stdout - echo "$1" - exec >> "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_output.log" # Redirect all output to the log file -} - -echo_message "info: Validating build requirements" +echo "Validating build requirements" # Ensure the build directory exists (in case we need it before XCode creates it) mkdir -p "${TARGET_BUILD_DIR}" if ! which cmake > /dev/null; then - echo_message "error: cmake is required to build, please install (can install via homebrew with 'brew install cmake')." + echo "error: cmake is required to build, please install (can install via homebrew with 'brew install cmake')." exit 0 fi # Check if we have the `LibSession-Util` submodule checked out and if not (depending on the 'SHOULD_AUTO_INIT_SUBMODULES' argument) perform the checkout if [ ! -d "${SRCROOT}/LibSession-Util" ] || [ ! -d "${SRCROOT}/LibSession-Util/src" ] || [ ! "$(ls -A "${SRCROOT}/LibSession-Util")" ]; then - echo_message "error: Need to fetch LibSession-Util submodule (git submodule update --init --recursive)." + echo "error: Need to fetch LibSession-Util submodule (git submodule update --init --recursive)." exit 0 else are_submodules_valid() { @@ -84,7 +71,7 @@ else # If the child path doesn't exist then it's invalid if [ ! -d "${PARENT_PATH}/${CHILD_PATH}" ]; then - echo_message "info: Submodule '${RELATIVE_PATH}/${CHILD_PATH}' doesn't exist." + echo "Submodule '${RELATIVE_PATH}/${CHILD_PATH}' doesn't exist." return 1 fi @@ -92,7 +79,7 @@ else local RESULT=$? if [ "${RESULT}" -eq 1 ]; then - echo_message "info: Submodule '${RELATIVE_PATH}/${CHILD_PATH}' is in an invalid state." + echo "Submodule '${RELATIVE_PATH}/${CHILD_PATH}' is in an invalid state." return 1 fi done @@ -106,13 +93,13 @@ else HAS_INVALID_SUBMODULE=$? if [ "${HAS_INVALID_SUBMODULE}" -eq 1 ]; then - echo_message "error: Submodules are in an invalid state, please delete 'LibSession-Util' and run 'git submodule update --init --recursive'." + echo "error: Submodules are in an invalid state, please delete 'LibSession-Util' and run 'git submodule update --init --recursive'." exit 0 fi fi # Generate a hash of the libSession-util source files and check if they differ from the last hash -echo "info: Checking for changes to source" +echo "Checking for changes to source" NEW_SOURCE_HASH=$(find "${SRCROOT}/LibSession-Util/src" -type f -exec md5 {} + | awk '{print $NF}' | sort | md5 | awk '{print $NF}') NEW_HEADER_HASH=$(find "${SRCROOT}/LibSession-Util/include" -type f -exec md5 {} + | awk '{print $NF}' | sort | md5 | awk '{print $NF}') @@ -131,12 +118,12 @@ fi # If all of the hashes match, the archs match and there is a library file then we can just stop here if [ "${NEW_SOURCE_HASH}" == "${OLD_SOURCE_HASH}" ] && [ "${NEW_HEADER_HASH}" == "${OLD_HEADER_HASH}" ] && [ "${ARCHS[*]}" == "${OLD_ARCHS}" ] && [ -f "${TARGET_BUILD_DIR}/libSessionUtil/libSessionUtil.a" ]; then - echo_message "info: Build is up-to-date" + echo "Build is up-to-date" exit 0 fi # If any of the above differ then we need to rebuild -echo_message "info: Build is not up-to-date - creating new build" +echo "Build is not up-to-date - creating new build" # Import settings from XCode (defaulting values if not present) VALID_SIM_ARCHS=(arm64 x86_64) @@ -180,11 +167,17 @@ if [ -z $PLATFORM_NAME ] || [ $PLATFORM_NAME = "iphoneos" ]; then done fi +# Remove any old build logs (since we are doing a new build) +rm -rf "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_output.log" + # Build the individual architectures for i in "${!TARGET_ARCHS[@]}"; do build="${TARGET_BUILD_DIR}/libSessionUtil/${TARGET_ARCHS[$i]}" platform="${TARGET_PLATFORMS[$i]}" - echo_message "Building ${TARGET_ARCHS[$i]} for $platform in $build" + echo "Building ${TARGET_ARCHS[$i]} for $platform in $build" + + # Redirect the build output to a log file and only include the progress lines in the XCode output + exec > >(tee "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_output.log" | grep --line-buffered '^\[.*%\]') 2>&1 cd "${SRCROOT}/LibSession-Util" env -i PATH="$PATH" SDKROOT="$(xcrun --sdk macosx --show-sdk-path)" \ @@ -195,8 +188,16 @@ for i in "${!TARGET_ARCHS[@]}"; do -DENABLE_BITCODE=$ENABLE_BITCODE \ -DBUILD_TESTS=OFF \ -DBUILD_STATIC_DEPS=ON - - if [ $? -ne 0 ]; then + + # Capture the exit status of the ./utils/static-bundle.sh command + EXIT_STATUS=$? + + # Flush the tee buffer (ensure any errors have been properly written to the log before continuing) and + # restore stdout + echo "" + exec 1>&3 + + if [ $EXIT_STATUS -ne 0 ]; then ALL_ERROR_LINES=($(grep -n "error:" "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_output.log" | cut -d ":" -f 1)) for e in "${!ALL_ERROR_LINES[@]}"; do @@ -211,7 +212,7 @@ for i in "${!TARGET_ARCHS[@]}"; do # Exclude the 'ALL_ERROR_LINES' line and the 'grep' line if [[ ! $error == *'grep -n "error'* ]] && [[ ! $error == *'grep -n error'* ]]; then - echo_message "error: $error" + echo "error: $error" fi done exit 1 @@ -228,7 +229,7 @@ if [ "${#TARGET_SIM_ARCHS[@]}" -eq "1" ]; then cp "${TARGET_BUILD_DIR}/libSessionUtil/${TARGET_SIM_ARCHS[0]}/libsession-util.a" "${TARGET_BUILD_DIR}/libSessionUtil/libSessionUtil.a" elif [ "${#TARGET_SIM_ARCHS[@]}" -gt "1" ]; then # Combine multiple device builds into a multi-arch lib - echo_message "info: Built multiple architectures, merging into single static library" + echo "Built multiple architectures, merging into single static library" lipo -create "${TARGET_BUILD_DIR}/libSessionUtil"/sim-*/libsession-util.a -output "${TARGET_BUILD_DIR}/libSessionUtil/libSessionUtil.a" fi @@ -237,7 +238,7 @@ if [ "${#TARGET_DEVICE_ARCHS[@]}" -eq "1" ]; then cp "${TARGET_BUILD_DIR}/libSessionUtil/${TARGET_DEVICE_ARCHS[0]}/libsession-util.a" "${TARGET_BUILD_DIR}/libSessionUtil/libSessionUtil.a" elif [ "${#TARGET_DEVICE_ARCHS[@]}" -gt "1" ]; then # Combine multiple device builds into a multi-arch lib - echo_message "info: Built multiple architectures, merging into single static library" + echo "Built multiple architectures, merging into single static library" lipo -create "${TARGET_BUILD_DIR}/libSessionUtil"/ios-*/libsession-util.a -output "${TARGET_BUILD_DIR}/libSessionUtil/libSessionUtil.a" fi @@ -245,10 +246,10 @@ fi echo "${NEW_SOURCE_HASH}" > "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_source_hash.log" echo "${NEW_HEADER_HASH}" > "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_header_hash.log" echo "${ARCHS[*]}" > "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_archs.log" -echo_message "info: Build complete" +echo "Build complete" # Copy the headers across -echo_message "info: Copy headers and prepare modulemap" +echo "Copy headers and prepare modulemap" mkdir -p "${TARGET_BUILD_DIR}/libSessionUtil/Headers" cp -r "${SRCROOT}/LibSession-Util/include/session" "${TARGET_BUILD_DIR}/libSessionUtil/Headers" @@ -263,4 +264,4 @@ echo -e " export *\n }" >>"$modmap" echo "}" >>"$modmap" # Output to XCode just so the output is good -echo_message "info: libSessionUtil Ready" +echo "libSession is Ready" diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index b85a2198e..ee75ab000 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -776,6 +776,9 @@ FD848B9828422F1A000E298B /* Date+Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD848B9728422F1A000E298B /* Date+Utilities.swift */; }; FD848B9A28442CE6000E298B /* StorageError.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD848B9928442CE6000E298B /* StorageError.swift */; }; FD848B9C284435D7000E298B /* AppSetup.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD848B9B284435D7000E298B /* AppSetup.swift */; }; + FD86FDA32BC5020600EC251B /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = FD86FDA22BC5020600EC251B /* PrivacyInfo.xcprivacy */; }; + FD86FDA42BC51C5400EC251B /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = FD86FDA22BC5020600EC251B /* PrivacyInfo.xcprivacy */; }; + FD86FDA52BC51C5500EC251B /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = FD86FDA22BC5020600EC251B /* PrivacyInfo.xcprivacy */; }; FD87DCFA28B74DB300AF0F98 /* ConversationSettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD87DCF928B74DB300AF0F98 /* ConversationSettingsViewModel.swift */; }; FD87DCFE28B7582C00AF0F98 /* BlockedContactsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD87DCFD28B7582C00AF0F98 /* BlockedContactsViewModel.swift */; }; FD87DD0428B8727D00AF0F98 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD87DD0328B8727D00AF0F98 /* Configuration.swift */; }; @@ -1937,6 +1940,7 @@ FD859EEF27BF207700510D0C /* SessionProtos.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = SessionProtos.proto; sourceTree = "<group>"; }; FD859EF027BF207C00510D0C /* WebSocketResources.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = WebSocketResources.proto; sourceTree = "<group>"; }; FD859EF127BF6BA200510D0C /* Data+Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Data+Utilities.swift"; sourceTree = "<group>"; }; + FD86FDA22BC5020600EC251B /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; }; FD87DCF928B74DB300AF0F98 /* ConversationSettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConversationSettingsViewModel.swift; sourceTree = "<group>"; }; FD87DCFD28B7582C00AF0F98 /* BlockedContactsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockedContactsViewModel.swift; sourceTree = "<group>"; }; FD87DD0328B8727D00AF0F98 /* Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = "<group>"; }; @@ -3572,6 +3576,7 @@ 45CB2FA71CB7146C00E1B343 /* Launch Screen.storyboard */, FDE125222A837E4E002DA685 /* MainAppContext.swift */, C3CA3AA0255CDA7000F4C6D4 /* Mnemonic */, + FD86FDA22BC5020600EC251B /* PrivacyInfo.xcprivacy */, B67EBF5C19194AC60084CCFD /* Settings.bundle */, B657DDC91911A40500F45B0C /* Signal.entitlements */, FDF2220A2818F38D000A4995 /* SessionApp.swift */, @@ -5193,6 +5198,7 @@ 4535186E1FC635DD00210559 /* MainInterface.storyboard in Resources */, FDC498C22AC17BFC00EDD897 /* Localizable.strings in Resources */, B8D07406265C683A00F77E07 /* ElegantIcons.ttf in Resources */, + FD86FDA42BC51C5400EC251B /* PrivacyInfo.xcprivacy in Resources */, 3478504C1FD7496D007B8332 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -5201,6 +5207,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + FD86FDA52BC51C5500EC251B /* PrivacyInfo.xcprivacy in Resources */, FDC498BE2AC1732E00EDD897 /* Localizable.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -5246,6 +5253,7 @@ files = ( 4C63CC00210A620B003AE45C /* SignalTSan.supp in Resources */, 4C6F527C20FFE8400097DEEE /* SignalUBSan.supp in Resources */, + FD86FDA32BC5020600EC251B /* PrivacyInfo.xcprivacy in Resources */, 34CF078A203E6B78005C4D61 /* end_call_tone_cept.caf in Resources */, C3CA3AA2255CDADA00F4C6D4 /* english.txt in Resources */, B66DBF4A19D5BBC8006EA940 /* Images.xcassets in Resources */, diff --git a/Session/Meta/PrivacyInfo.xcprivacy b/Session/Meta/PrivacyInfo.xcprivacy new file mode 100644 index 000000000..4e5e2bcba --- /dev/null +++ b/Session/Meta/PrivacyInfo.xcprivacy @@ -0,0 +1,31 @@ +<?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>NSPrivacyTracking</key> + <false/> + <key>NSPrivacyTrackingDomains</key> + <array/> + <key>NSPrivacyCollectedDataTypes</key> + <array/> + <key>NSPrivacyAccessedAPITypes</key> + <array> + <dict> + <key>NSPrivacyAccessedAPIType</key> + <string>NSPrivacyAccessedAPICategoryUserDefaults</string> + <key>NSPrivacyAccessedAPITypeReasons</key> + <array> + <string>1C8F.1</string> + </array> + </dict> + <dict> + <key>NSPrivacyAccessedAPIType</key> + <string>NSPrivacyAccessedAPICategoryFileTimestamp</string> + <key>NSPrivacyAccessedAPITypeReasons</key> + <array> + <string>C617.1</string> + </array> + </dict> + </array> +</dict> +</plist> diff --git a/Session/Meta/Translations/pl.lproj/Localizable.strings b/Session/Meta/Translations/pl.lproj/Localizable.strings index 7393ee1ff..fe8721496 100644 --- a/Session/Meta/Translations/pl.lproj/Localizable.strings +++ b/Session/Meta/Translations/pl.lproj/Localizable.strings @@ -788,7 +788,7 @@ po zatwierdzeniu przez odbiorcę tego żądania wiadomości"; "DISAPPERING_MESSAGES_SUBTITLE_GROUPS" = "Wiadomości kasują się po ich przeczytaniu."; /* A record that appears within the message history to indicate that the current user turned on disappearing messages */ -"YOU_DISAPPEARING_MESSAGES_INFO_ENABLE" = "%@ ustawił(a) znikające wiadomości na %@ po tym, jak były na %@"; +"YOU_DISAPPEARING_MESSAGES_INFO_ENABLE" = "Ty ustawił(a) znikające wiadomości na %@ po tym, jak były na %@"; /* A record that appears within the message history to indicate that the current user update the disappearing messages setting */ "YOU_DISAPPEARING_MESSAGES_INFO_UPDATE" = "%@ ustawił(a) znikające wiadomości na %@ po tym, jak były na %@";