Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ffi/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ dependencies {
// The `:android-aarch64` etc. variants aren't needed because we ship
// the JNI libs directly via `jniLibs.srcDirs` above; consumers only
// need the JVM-side JNA jar.
api("net.java.dev.jna:jna:5.14.0@aar")
// >= 5.15 required: 5.14's x86_64 libjnidispatch.so is 4KB-aligned and
// crashes on 16KB-page devices/emulators (Play compliance).
api("net.java.dev.jna:jna:5.17.0@aar")
// Required for the `suspend fn` wrappers uniffi generates for async Rust.
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
}
4 changes: 2 additions & 2 deletions ffi/kotlin/AntFfi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ repositories {
}

dependencies {
// JNA for UniFFI native bindings
implementation("net.java.dev.jna:jna:5.14.0")
// JNA for UniFFI native bindings (kept in lockstep with ffi/android)
implementation("net.java.dev.jna:jna:5.17.0")

// Kotlin coroutines (for async UniFFI bindings)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
Expand Down
45 changes: 45 additions & 0 deletions ffi/scripts/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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">
<!--
Privacy manifest embedded into every AntFfi.xcframework slice by
build-swift.sh. Required because the Rust binary links required-reason
APIs (nm shows stat/fstat + statvfs) - without this, App Store uploads of
consumer apps are rejected with ITMS-91053.

Declared categories, matched to what the SDK actually does:
- FileTimestamp (C617.1): stat/fstat on files inside the app container
(upload sources, self-encryption spill files, bootstrap cache).
- DiskSpace (85F4.1): statvfs to check sufficient disk space before the
self-encryption spill (the InsufficientDiskSpace pre-flight).

The SDK collects no data and does no tracking.
-->
<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>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>85F4.1</string>
</array>
</dict>
</array>
</dict>
</plist>
13 changes: 12 additions & 1 deletion ffi/scripts/build-swift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ RUST_DIR="$FFI_DIR/rust"
BUILD_DIR="$FFI_DIR/build"
XCF_DIR="$BUILD_DIR/AntFfi.xcframework"

# Framework version string comes from the crate version (which tracks the
# released SDK version) instead of a hardcoded value drifting out of date.
ANT_FFI_VERSION="$(sed -n 's/^version = "\(.*\)"/\1/p' "$RUST_DIR/ant-ffi/Cargo.toml" | head -1)"
[ -n "$ANT_FFI_VERSION" ] || { echo "failed to read version from ant-ffi/Cargo.toml" >&2; exit 1; }

# Deployment targets — must match Package.swift's .iOS(.v16) / .macOS(.v13)
# declarations in ant-swift. Setting these silences "built for newer X version"
# warnings at consumer link time. iOS<13 also fails to link due to missing
Expand Down Expand Up @@ -108,7 +113,7 @@ write_plist() {
<key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
<key>CFBundleName</key><string>$FW_NAME</string>
<key>CFBundlePackageType</key><string>FMWK</string>
<key>CFBundleShortVersionString</key><string>0.2.0</string>
<key>CFBundleShortVersionString</key><string>$ANT_FFI_VERSION</string>
<key>CFBundleVersion</key><string>1</string>
<key>$minkey</key><string>$minver</string>
</dict></plist>
Expand All @@ -129,6 +134,9 @@ prepare_framework() {
cp "$GEN_DIR/$FW_NAME.h" "$V/Headers/"
write_modulemap "$V/Modules/module.modulemap"
write_plist "$V/Resources/Info.plist" "$platform"
# Required-reason-API privacy manifest (ITMS-91053); macOS bundles
# keep resources under Versions/A/Resources.
cp "$SCRIPT_DIR/PrivacyInfo.xcprivacy" "$V/Resources/PrivacyInfo.xcprivacy"
ln -s "A" "$fw/Versions/Current"
ln -s "Versions/Current/$FW_NAME" "$fw/$FW_NAME"
ln -s "Versions/Current/Headers" "$fw/Headers"
Expand All @@ -142,6 +150,9 @@ prepare_framework() {
cp "$GEN_DIR/$FW_NAME.h" "$fw/Headers/"
write_modulemap "$fw/Modules/module.modulemap"
write_plist "$fw/Info.plist" "$platform"
# Required-reason-API privacy manifest (ITMS-91053); flat frameworks
# carry it at the bundle root.
cp "$SCRIPT_DIR/PrivacyInfo.xcprivacy" "$fw/PrivacyInfo.xcprivacy"
fi
}

Expand Down