Files
OpenFlux/build_ios_app.sh
T
Alexander4151andClaude Opus 5 e126ea7cf5 Add iOS app + TestFlight distribution pipeline
Build a shippable iOS client for OpenFlux and the tooling to sign and
upload it to App Store Connect / TestFlight.

Go core:
- Add a cgo export bridge (export_ios.go, //go:build ios) exposing a real
  C API — OpenFluxStartClient/Stop/IsRunning/IsConnected/StatsJSON/ReadLog/
  FreeString. Previously the iOS "library" had no exports and shipped a
  hand-written, non-functional header.
- socks5: add SOCKS5Server.Close() so the bridge can stop the listener.
- utils: add SetOutput() to pipe logs into the app UI (replaces debug.go).
- build_ios.sh: drop the fake header; cgo now generates liboflux.h from the
  //export directives.

iOS app (ios-app/, SwiftUI + XcodeGen):
- ContentView / TunnelController / bridging header linking liboflux.a.
- Start/Stop, live status + log, and a Test button that routes a request
  through the local SOCKS5 proxy to verify the tunnel.
- App icon, Info.plist keys (ATS, ITSAppUsesNonExemptEncryption=false),
  automatic signing for team 8GQH8GQ252.

Tooling & docs:
- build_ios_app.sh: one-command build -> archive -> App Store IPA export.
- ExportOptions.plist, README.md, DISTRIBUTION.ru.md (setup, upload steps,
  and App Store distribution constraints for a circumvention tool).
- .gitignore: exclude build artifacts, the generated xcodeproj, and *.p8.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GqZJxeewiSYYTHLG4z5Fdt
2026-09-10 14:44:46 +03:00

55 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# Full OpenFlux iOS pipeline: build Go lib -> generate Xcode project ->
# archive -> export App Store IPA -> (optional) upload to TestFlight.
#
# Requirements: Xcode, xcodegen (brew install xcodegen), Go 1.26+.
# Signing: automatic; your Apple ID must be logged into Xcode
# (Xcode > Settings > Accounts) and belong to team 8GQH8GQ252.
set -e
ROOT="$(cd "$(dirname "$0")" && pwd)"
APP_DIR="$ROOT/ios-app"
TEAM_ID="8GQH8GQ252"
echo "==> [1/5] Building Go static library (arm64, iOS)"
"$ROOT/build_ios.sh"
echo "==> [2/5] Syncing library into the app"
mkdir -p "$APP_DIR/Lib"
cp "$ROOT/output/ios/liboflux.a" "$APP_DIR/Lib/liboflux.a"
cp "$ROOT/output/ios/liboflux.h" "$APP_DIR/Lib/liboflux.h"
echo "==> [3/5] Generating Xcode project"
cd "$APP_DIR"
xcodegen generate
echo "==> [4/5] Archiving (Release)"
rm -rf build/OpenFlux.xcarchive
xcodebuild -project OpenFlux.xcodeproj -scheme OpenFlux -configuration Release \
-destination 'generic/platform=iOS' \
-archivePath build/OpenFlux.xcarchive \
-allowProvisioningUpdates \
clean archive
echo "==> [5/5] Exporting App Store IPA"
rm -rf build/export
xcodebuild -exportArchive \
-archivePath build/OpenFlux.xcarchive \
-exportPath build/export \
-exportOptionsPlist ExportOptions.plist \
-allowProvisioningUpdates
echo ""
echo "IPA ready: $APP_DIR/build/export/OpenFlux.ipa"
echo ""
echo "To upload to TestFlight, first create the app record in App Store Connect"
echo "(My Apps > + > New App, bundle id com.p1neapplexpress-saharev.openflux), then run:"
echo ""
echo " # Option A - app-specific password (appleid.apple.com > App-Specific Passwords):"
echo " xcrun altool --upload-app -f build/export/OpenFlux.ipa -t ios \\"
echo " -u YOUR_APPLE_ID -p xxxx-xxxx-xxxx-xxxx"
echo ""
echo " # Option B - App Store Connect API key (.p8 in ~/.appstoreconnect/private_keys/):"
echo " xcrun altool --upload-app -f build/export/OpenFlux.ipa -t ios \\"
echo " --apiKey KEY_ID --apiIssuer ISSUER_ID"