diff --git a/Front/android/app/src/main/AndroidManifest.xml b/Front/android/app/src/main/AndroidManifest.xml
index 2ab0a0a..969b7f2 100644
--- a/Front/android/app/src/main/AndroidManifest.xml
+++ b/Front/android/app/src/main/AndroidManifest.xml
@@ -22,6 +22,11 @@
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
+
+
+
+
+
+
+
diff --git a/call/android/app/src/main/AndroidManifest.xml b/call/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..60bf473
--- /dev/null
+++ b/call/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/call/android/app/src/main/kotlin/com/example/call/AudioEngine.kt b/call/android/app/src/main/kotlin/com/example/call/AudioEngine.kt
new file mode 100644
index 0000000..3cee2be
--- /dev/null
+++ b/call/android/app/src/main/kotlin/com/example/call/AudioEngine.kt
@@ -0,0 +1,288 @@
+package com.example.call
+
+import android.content.Context
+import android.media.*
+import android.os.Handler
+import android.os.Looper
+import android.util.Log
+import io.flutter.plugin.common.BinaryMessenger
+import io.flutter.plugin.common.EventChannel
+import io.flutter.plugin.common.MethodCall
+import io.flutter.plugin.common.MethodChannel
+import java.nio.ByteBuffer
+import java.util.concurrent.atomic.AtomicBoolean
+
+/**
+ * AudioEngine — Android native layer for low-latency audio I/O.
+ *
+ * MethodChannel "com.example.call/audio_control"
+ * startCapture(sampleRate: Int, source: Int) → "ok"
+ * stopCapture() → "ok"
+ * startPlayback(sampleRate: Int) → "ok"
+ * stopPlayback() → "ok"
+ * writePlayback(samples: ByteArray) → "ok" (Int16 LE samples)
+ * setSpeakerMode(enabled: Boolean) → "ok"
+ * getAudioRouteInfo() → Map
+ *
+ * EventChannel "com.example.call/audio_capture"
+ * Streams ByteArray (Int16 LE) chunks captured from AudioRecord.
+ * Each event is exactly CAPTURE_CHUNK_SAMPLES × 2 bytes.
+ */
+object AudioEngine {
+
+ private const val TAG = "AudioEngine"
+
+ // ── Channel names ────────────────────────────────────────────────
+ const val METHOD_CHANNEL = "com.example.call/audio_control"
+ const val EVENT_CHANNEL = "com.example.call/audio_capture"
+
+ // ── Audio parameters ─────────────────────────────────────────────
+ // Matches the modem sample rate; must be 8000 Hz for cellular compatibility.
+ private const val SAMPLE_RATE = 8000
+
+ // Number of Int16 samples delivered per EventChannel event.
+ // 160 samples = 20 ms at 8 kHz → one LPC subframe.
+ private const val CAPTURE_CHUNK_SAMPLES = 160
+
+ // Internal AudioRecord buffer: 4× chunk size to reduce overruns.
+ private const val RECORD_BUFFER_SAMPLES = CAPTURE_CHUNK_SAMPLES * 4
+
+ // Internal AudioTrack buffer: 80 ms headroom.
+ private const val PLAYBACK_BUFFER_SAMPLES = SAMPLE_RATE / 1000 * 80
+
+ // ── State ────────────────────────────────────────────────────────
+ private var audioRecord: AudioRecord? = null
+ private var audioTrack: AudioTrack? = null
+ private var captureThread: Thread? = null
+ private val capturing = AtomicBoolean(false)
+ private val playing = AtomicBoolean(false)
+
+ private var eventSink: EventChannel.EventSink? = null
+ private val mainHandler = Handler(Looper.getMainLooper())
+
+ private lateinit var appContext: Context
+
+ // ── Registration ─────────────────────────────────────────────────
+ fun register(context: Context, messenger: BinaryMessenger) {
+ appContext = context.applicationContext
+
+ MethodChannel(messenger, METHOD_CHANNEL).setMethodCallHandler { call, result ->
+ handleMethod(call, result)
+ }
+ EventChannel(messenger, EVENT_CHANNEL).setStreamHandler(object : EventChannel.StreamHandler {
+ override fun onListen(args: Any?, sink: EventChannel.EventSink?) {
+ eventSink = sink
+ }
+ override fun onCancel(args: Any?) {
+ eventSink = null
+ }
+ })
+ }
+
+ // ── Method handler ───────────────────────────────────────────────
+ private fun handleMethod(call: MethodCall, result: MethodChannel.Result) {
+ when (call.method) {
+ "startCapture" -> {
+ val rate = call.argument("sampleRate") ?: SAMPLE_RATE
+ val source = call.argument("source") ?: MediaRecorder.AudioSource.UNPROCESSED
+ startCapture(rate, source)
+ result.success("ok")
+ }
+ "stopCapture" -> {
+ stopCapture()
+ result.success("ok")
+ }
+ "startPlayback" -> {
+ val rate = call.argument("sampleRate") ?: SAMPLE_RATE
+ startPlayback(rate)
+ result.success("ok")
+ }
+ "stopPlayback" -> {
+ stopPlayback()
+ result.success("ok")
+ }
+ "writePlayback" -> {
+ val bytes = call.argument("samples")
+ if (bytes != null) writePlayback(bytes)
+ result.success("ok")
+ }
+ "setSpeakerMode" -> {
+ val enabled = call.argument("enabled") ?: true
+ setSpeakerMode(enabled)
+ result.success("ok")
+ }
+ "getAudioRouteInfo" -> {
+ result.success(getAudioRouteInfo())
+ }
+ else -> result.notImplemented()
+ }
+ }
+
+ // ── Capture ──────────────────────────────────────────────────────
+
+ /**
+ * Start capturing audio from the microphone.
+ *
+ * Source priority (best for FSK demodulation):
+ * 1. UNPROCESSED (API 24+) — raw mic, no AEC/NS
+ * 2. VOICE_COMMUNICATION — VoIP-tuned processing
+ * 3. MIC — standard mic
+ *
+ * @param sampleRate Hz
+ * @param preferredSource MediaRecorder.AudioSource constant
+ */
+ private fun startCapture(sampleRate: Int, preferredSource: Int) {
+ if (capturing.get()) {
+ Log.w(TAG, "startCapture called while already capturing")
+ return
+ }
+
+ val sources = listOf(
+ preferredSource,
+ MediaRecorder.AudioSource.UNPROCESSED,
+ MediaRecorder.AudioSource.VOICE_COMMUNICATION,
+ MediaRecorder.AudioSource.MIC
+ ).distinct()
+
+ val bufferBytes = RECORD_BUFFER_SAMPLES * 2 // Int16 → 2 bytes each
+ val format = AudioFormat.Builder()
+ .setSampleRate(sampleRate)
+ .setEncoding(AudioFormat.ENCODING_PCM_16BIT)
+ .setChannelMask(AudioFormat.CHANNEL_IN_MONO)
+ .build()
+
+ var record: AudioRecord? = null
+ for (src in sources) {
+ try {
+ val rec = AudioRecord.Builder()
+ .setAudioSource(src)
+ .setAudioFormat(format)
+ .setBufferSizeInBytes(bufferBytes)
+ .build()
+ if (rec.state == AudioRecord.STATE_INITIALIZED) {
+ record = rec
+ Log.i(TAG, "AudioRecord opened with source=$src")
+ break
+ } else {
+ rec.release()
+ }
+ } catch (e: Exception) {
+ Log.w(TAG, "Source $src failed: ${e.message}")
+ }
+ }
+
+ if (record == null) {
+ Log.e(TAG, "Could not open AudioRecord with any source")
+ return
+ }
+
+ audioRecord = record
+ capturing.set(true)
+
+ captureThread = Thread({
+ android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO)
+ val chunk = ShortArray(CAPTURE_CHUNK_SAMPLES)
+ record.startRecording()
+ while (capturing.get()) {
+ val read = record.read(chunk, 0, chunk.size)
+ if (read > 0) {
+ // Convert ShortArray → ByteArray (Int16 LE) for Dart
+ val bytes = ByteArray(read * 2)
+ val buf = ByteBuffer.wrap(bytes).order(java.nio.ByteOrder.LITTLE_ENDIAN)
+ for (i in 0 until read) buf.putShort(chunk[i])
+ // Dispatch to Dart via EventChannel on main thread
+ val payload = bytes.copyOf()
+ mainHandler.post { eventSink?.success(payload) }
+ }
+ }
+ record.stop()
+ record.release()
+ }, "AudioCapture")
+ captureThread!!.start()
+ }
+
+ private fun stopCapture() {
+ capturing.set(false)
+ captureThread?.join(500)
+ captureThread = null
+ audioRecord = null
+ }
+
+ // ── Playback ─────────────────────────────────────────────────────
+
+ /**
+ * Start the AudioTrack in streaming mode.
+ * Dart pushes PCM chunks via writePlayback().
+ */
+ private fun startPlayback(sampleRate: Int) {
+ if (playing.get()) return
+
+ val bufBytes = PLAYBACK_BUFFER_SAMPLES * 2
+ val track = AudioTrack.Builder()
+ .setAudioAttributes(
+ AudioAttributes.Builder()
+ .setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION)
+ .setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
+ .build()
+ )
+ .setAudioFormat(
+ AudioFormat.Builder()
+ .setSampleRate(sampleRate)
+ .setEncoding(AudioFormat.ENCODING_PCM_16BIT)
+ .setChannelMask(AudioFormat.CHANNEL_OUT_MONO)
+ .build()
+ )
+ .setBufferSizeInBytes(bufBytes)
+ .setTransferMode(AudioTrack.MODE_STREAM)
+ .build()
+
+ track.play()
+ audioTrack = track
+ playing.set(true)
+ Log.i(TAG, "AudioTrack started, sampleRate=$sampleRate")
+ }
+
+ /**
+ * Write Int16 LE PCM bytes to the AudioTrack buffer.
+ * Called from Dart whenever the FSK modulator or LPC decoder produces output.
+ */
+ private fun writePlayback(bytes: ByteArray) {
+ val track = audioTrack ?: return
+ if (!playing.get()) return
+ // Write non-blocking; discard if buffer full (transient)
+ track.write(bytes, 0, bytes.size, AudioTrack.WRITE_NON_BLOCKING)
+ }
+
+ private fun stopPlayback() {
+ playing.set(false)
+ audioTrack?.stop()
+ audioTrack?.release()
+ audioTrack = null
+ }
+
+ // ── Routing ──────────────────────────────────────────────────────
+
+ /**
+ * Switch between speakerphone (loudspeaker mode) and earpiece.
+ *
+ * FSK acoustic coupling requires SPEAKER mode so the phone's bottom mic
+ * can pick up audio coming from the speaker. When receiving decoded voice,
+ * you may optionally switch to earpiece for privacy.
+ */
+ private fun setSpeakerMode(enabled: Boolean) {
+ val am = appContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager
+ am.mode = AudioManager.MODE_IN_COMMUNICATION
+ am.isSpeakerphoneOn = enabled
+ Log.i(TAG, "Speaker mode: $enabled")
+ }
+
+ private fun getAudioRouteInfo(): Map {
+ val am = appContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager
+ return mapOf(
+ "speakerOn" to am.isSpeakerphoneOn,
+ "mode" to am.mode,
+ "sampleRate" to SAMPLE_RATE,
+ "chunkSize" to CAPTURE_CHUNK_SAMPLES
+ )
+ }
+}
diff --git a/call/android/app/src/main/kotlin/com/example/call/MainActivity.kt b/call/android/app/src/main/kotlin/com/example/call/MainActivity.kt
new file mode 100644
index 0000000..d37f110
--- /dev/null
+++ b/call/android/app/src/main/kotlin/com/example/call/MainActivity.kt
@@ -0,0 +1,12 @@
+package com.example.call
+
+import io.flutter.embedding.android.FlutterActivity
+import io.flutter.embedding.engine.FlutterEngine
+
+class MainActivity : FlutterActivity() {
+ override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
+ super.configureFlutterEngine(flutterEngine)
+ // Register the AudioEngine method channel and event channel.
+ AudioEngine.register(this, flutterEngine.dartExecutor.binaryMessenger)
+ }
+}
diff --git a/call/android/app/src/main/res/drawable-v21/launch_background.xml b/call/android/app/src/main/res/drawable-v21/launch_background.xml
new file mode 100644
index 0000000..f74085f
--- /dev/null
+++ b/call/android/app/src/main/res/drawable-v21/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/call/android/app/src/main/res/drawable/launch_background.xml b/call/android/app/src/main/res/drawable/launch_background.xml
new file mode 100644
index 0000000..304732f
--- /dev/null
+++ b/call/android/app/src/main/res/drawable/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/call/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/call/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..db77bb4
Binary files /dev/null and b/call/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/call/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/call/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..17987b7
Binary files /dev/null and b/call/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/call/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/call/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..09d4391
Binary files /dev/null and b/call/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/call/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/call/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..d5f1c8d
Binary files /dev/null and b/call/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/call/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/call/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..4d6372e
Binary files /dev/null and b/call/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/call/android/app/src/main/res/values-night/styles.xml b/call/android/app/src/main/res/values-night/styles.xml
new file mode 100644
index 0000000..06952be
--- /dev/null
+++ b/call/android/app/src/main/res/values-night/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/call/android/app/src/main/res/values/styles.xml b/call/android/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..cb1ef88
--- /dev/null
+++ b/call/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/call/android/app/src/profile/AndroidManifest.xml b/call/android/app/src/profile/AndroidManifest.xml
new file mode 100644
index 0000000..399f698
--- /dev/null
+++ b/call/android/app/src/profile/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/call/android/build.gradle.kts b/call/android/build.gradle.kts
new file mode 100644
index 0000000..dbee657
--- /dev/null
+++ b/call/android/build.gradle.kts
@@ -0,0 +1,24 @@
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+val newBuildDir: Directory =
+ rootProject.layout.buildDirectory
+ .dir("../../build")
+ .get()
+rootProject.layout.buildDirectory.value(newBuildDir)
+
+subprojects {
+ val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
+ project.layout.buildDirectory.value(newSubprojectBuildDir)
+}
+subprojects {
+ project.evaluationDependsOn(":app")
+}
+
+tasks.register("clean") {
+ delete(rootProject.layout.buildDirectory)
+}
diff --git a/call/android/gradle.properties b/call/android/gradle.properties
new file mode 100644
index 0000000..fbee1d8
--- /dev/null
+++ b/call/android/gradle.properties
@@ -0,0 +1,2 @@
+org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
+android.useAndroidX=true
diff --git a/call/android/gradle/wrapper/gradle-wrapper.properties b/call/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..e4ef43f
--- /dev/null
+++ b/call/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
diff --git a/call/android/settings.gradle.kts b/call/android/settings.gradle.kts
new file mode 100644
index 0000000..ca7fe06
--- /dev/null
+++ b/call/android/settings.gradle.kts
@@ -0,0 +1,26 @@
+pluginManagement {
+ val flutterSdkPath =
+ run {
+ val properties = java.util.Properties()
+ file("local.properties").inputStream().use { properties.load(it) }
+ val flutterSdkPath = properties.getProperty("flutter.sdk")
+ require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
+ flutterSdkPath
+ }
+
+ includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
+
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+
+plugins {
+ id("dev.flutter.flutter-plugin-loader") version "1.0.0"
+ id("com.android.application") version "8.11.1" apply false
+ id("org.jetbrains.kotlin.android") version "2.2.20" apply false
+}
+
+include(":app")
diff --git a/call/ios/.gitignore b/call/ios/.gitignore
new file mode 100644
index 0000000..7a7f987
--- /dev/null
+++ b/call/ios/.gitignore
@@ -0,0 +1,34 @@
+**/dgph
+*.mode1v3
+*.mode2v3
+*.moved-aside
+*.pbxuser
+*.perspectivev3
+**/*sync/
+.sconsign.dblite
+.tags*
+**/.vagrant/
+**/DerivedData/
+Icon?
+**/Pods/
+**/.symlinks/
+profile
+xcuserdata
+**/.generated/
+Flutter/App.framework
+Flutter/Flutter.framework
+Flutter/Flutter.podspec
+Flutter/Generated.xcconfig
+Flutter/ephemeral/
+Flutter/app.flx
+Flutter/app.zip
+Flutter/flutter_assets/
+Flutter/flutter_export_environment.sh
+ServiceDefinitions.json
+Runner/GeneratedPluginRegistrant.*
+
+# Exceptions to above rules.
+!default.mode1v3
+!default.mode2v3
+!default.pbxuser
+!default.perspectivev3
diff --git a/call/ios/Flutter/AppFrameworkInfo.plist b/call/ios/Flutter/AppFrameworkInfo.plist
new file mode 100644
index 0000000..391a902
--- /dev/null
+++ b/call/ios/Flutter/AppFrameworkInfo.plist
@@ -0,0 +1,24 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ App
+ CFBundleIdentifier
+ io.flutter.flutter.app
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ App
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1.0
+
+
diff --git a/call/ios/Flutter/Debug.xcconfig b/call/ios/Flutter/Debug.xcconfig
new file mode 100644
index 0000000..592ceee
--- /dev/null
+++ b/call/ios/Flutter/Debug.xcconfig
@@ -0,0 +1 @@
+#include "Generated.xcconfig"
diff --git a/call/ios/Flutter/Release.xcconfig b/call/ios/Flutter/Release.xcconfig
new file mode 100644
index 0000000..592ceee
--- /dev/null
+++ b/call/ios/Flutter/Release.xcconfig
@@ -0,0 +1 @@
+#include "Generated.xcconfig"
diff --git a/call/ios/Runner.xcodeproj/project.pbxproj b/call/ios/Runner.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..4b44901
--- /dev/null
+++ b/call/ios/Runner.xcodeproj/project.pbxproj
@@ -0,0 +1,620 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 54;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
+ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
+ 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; };
+ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
+ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
+ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 97C146E61CF9000F007C117D /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 97C146ED1CF9000F007C117D;
+ remoteInfo = Runner;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ );
+ name = "Embed Frameworks";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
+ 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
+ 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; };
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
+ 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
+ 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
+ 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
+ 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 97C146EB1CF9000F007C117D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 331C8082294A63A400263BE5 /* RunnerTests */ = {
+ isa = PBXGroup;
+ children = (
+ 331C807B294A618700263BE5 /* RunnerTests.swift */,
+ );
+ path = RunnerTests;
+ sourceTree = "";
+ };
+ 9740EEB11CF90186004384FC /* Flutter */ = {
+ isa = PBXGroup;
+ children = (
+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */,
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
+ 9740EEB31CF90195004384FC /* Generated.xcconfig */,
+ );
+ name = Flutter;
+ sourceTree = "";
+ };
+ 97C146E51CF9000F007C117D = {
+ isa = PBXGroup;
+ children = (
+ 9740EEB11CF90186004384FC /* Flutter */,
+ 97C146F01CF9000F007C117D /* Runner */,
+ 97C146EF1CF9000F007C117D /* Products */,
+ 331C8082294A63A400263BE5 /* RunnerTests */,
+ );
+ sourceTree = "";
+ };
+ 97C146EF1CF9000F007C117D /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 97C146EE1CF9000F007C117D /* Runner.app */,
+ 331C8081294A63A400263BE5 /* RunnerTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 97C146F01CF9000F007C117D /* Runner */ = {
+ isa = PBXGroup;
+ children = (
+ 97C146FA1CF9000F007C117D /* Main.storyboard */,
+ 97C146FD1CF9000F007C117D /* Assets.xcassets */,
+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
+ 97C147021CF9000F007C117D /* Info.plist */,
+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
+ 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */,
+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
+ );
+ path = Runner;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 331C8080294A63A400263BE5 /* RunnerTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
+ buildPhases = (
+ 331C807D294A63A400263BE5 /* Sources */,
+ 331C807F294A63A400263BE5 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 331C8086294A63A400263BE5 /* PBXTargetDependency */,
+ );
+ name = RunnerTests;
+ productName = RunnerTests;
+ productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ 97C146ED1CF9000F007C117D /* Runner */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
+ buildPhases = (
+ 9740EEB61CF901F6004384FC /* Run Script */,
+ 97C146EA1CF9000F007C117D /* Sources */,
+ 97C146EB1CF9000F007C117D /* Frameworks */,
+ 97C146EC1CF9000F007C117D /* Resources */,
+ 9705A1C41CF9048500538489 /* Embed Frameworks */,
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Runner;
+ productName = Runner;
+ productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 97C146E61CF9000F007C117D /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 1510;
+ ORGANIZATIONNAME = "";
+ TargetAttributes = {
+ 331C8080294A63A400263BE5 = {
+ CreatedOnToolsVersion = 14.0;
+ TestTargetID = 97C146ED1CF9000F007C117D;
+ };
+ 97C146ED1CF9000F007C117D = {
+ CreatedOnToolsVersion = 7.3.1;
+ LastSwiftMigration = 1100;
+ };
+ };
+ };
+ buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 97C146E51CF9000F007C117D;
+ productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 97C146ED1CF9000F007C117D /* Runner */,
+ 331C8080294A63A400263BE5 /* RunnerTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 331C807F294A63A400263BE5 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 97C146EC1CF9000F007C117D /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
+ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
+ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
+ );
+ name = "Thin Binary";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
+ };
+ 9740EEB61CF901F6004384FC /* Run Script */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Run Script";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 331C807D294A63A400263BE5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 97C146EA1CF9000F007C117D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
+ 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 97C146ED1CF9000F007C117D /* Runner */;
+ targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 97C146FB1CF9000F007C117D /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 97C147001CF9000F007C117D /* Base */,
+ );
+ name = LaunchScreen.storyboard;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 249021D3217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Profile;
+ };
+ 249021D4217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.call;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Profile;
+ };
+ 331C8088294A63A400263BE5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.call.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Debug;
+ };
+ 331C8089294A63A400263BE5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.call.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Release;
+ };
+ 331C808A294A63A400263BE5 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.call.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Profile;
+ };
+ 97C147031CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 97C147041CF9000F007C117D /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 97C147061CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.call;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Debug;
+ };
+ 97C147071CF9000F007C117D /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.call;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 331C8088294A63A400263BE5 /* Debug */,
+ 331C8089294A63A400263BE5 /* Release */,
+ 331C808A294A63A400263BE5 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 97C147031CF9000F007C117D /* Debug */,
+ 97C147041CF9000F007C117D /* Release */,
+ 249021D3217E4FDB00AE95B9 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 97C147061CF9000F007C117D /* Debug */,
+ 97C147071CF9000F007C117D /* Release */,
+ 249021D4217E4FDB00AE95B9 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 97C146E61CF9000F007C117D /* Project object */;
+}
diff --git a/call/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/call/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..919434a
--- /dev/null
+++ b/call/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/call/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/call/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/call/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/call/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/call/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/call/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/call/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/call/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
new file mode 100644
index 0000000..e3773d4
--- /dev/null
+++ b/call/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/call/ios/Runner.xcworkspace/contents.xcworkspacedata b/call/ios/Runner.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..1d526a1
--- /dev/null
+++ b/call/ios/Runner.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/call/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/call/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/call/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/call/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/call/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/call/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/call/ios/Runner/AppDelegate.swift b/call/ios/Runner/AppDelegate.swift
new file mode 100644
index 0000000..c30b367
--- /dev/null
+++ b/call/ios/Runner/AppDelegate.swift
@@ -0,0 +1,16 @@
+import Flutter
+import UIKit
+
+@main
+@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
+ override func application(
+ _ application: UIApplication,
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
+ ) -> Bool {
+ return super.application(application, didFinishLaunchingWithOptions: launchOptions)
+ }
+
+ func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
+ GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
+ }
+}
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..d36b1fa
--- /dev/null
+++ b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,122 @@
+{
+ "images" : [
+ {
+ "size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-20x20@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-20x20@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-40x40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-40x40@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-60x60@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-60x60@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-20x20@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-20x20@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-29x29@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-29x29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-40x40@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-40x40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-76x76@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-76x76@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "83.5x83.5",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-83.5x83.5@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "1024x1024",
+ "idiom" : "ios-marketing",
+ "filename" : "Icon-App-1024x1024@1x.png",
+ "scale" : "1x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
new file mode 100644
index 0000000..dc9ada4
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
new file mode 100644
index 0000000..7353c41
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
new file mode 100644
index 0000000..797d452
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
new file mode 100644
index 0000000..6ed2d93
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
new file mode 100644
index 0000000..4cd7b00
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
new file mode 100644
index 0000000..fe73094
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
new file mode 100644
index 0000000..321773c
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
new file mode 100644
index 0000000..797d452
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
new file mode 100644
index 0000000..502f463
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
new file mode 100644
index 0000000..0ec3034
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
new file mode 100644
index 0000000..0ec3034
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
new file mode 100644
index 0000000..e9f5fea
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
new file mode 100644
index 0000000..84ac32a
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
new file mode 100644
index 0000000..8953cba
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
new file mode 100644
index 0000000..0467bf1
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
new file mode 100644
index 0000000..0bedcf2
--- /dev/null
+++ b/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage@3x.png",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ
diff --git a/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ
diff --git a/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
new file mode 100644
index 0000000..89c2725
--- /dev/null
+++ b/call/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
@@ -0,0 +1,5 @@
+# Launch Screen Assets
+
+You can customize the launch screen with your own desired assets by replacing the image files in this directory.
+
+You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
diff --git a/call/ios/Runner/Base.lproj/LaunchScreen.storyboard b/call/ios/Runner/Base.lproj/LaunchScreen.storyboard
new file mode 100644
index 0000000..f2e259c
--- /dev/null
+++ b/call/ios/Runner/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/call/ios/Runner/Base.lproj/Main.storyboard b/call/ios/Runner/Base.lproj/Main.storyboard
new file mode 100644
index 0000000..f3c2851
--- /dev/null
+++ b/call/ios/Runner/Base.lproj/Main.storyboard
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/call/ios/Runner/Info.plist b/call/ios/Runner/Info.plist
new file mode 100644
index 0000000..d5359b7
--- /dev/null
+++ b/call/ios/Runner/Info.plist
@@ -0,0 +1,70 @@
+
+
+
+
+ CADisableMinimumFrameDurationOnPhone
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleDisplayName
+ Call
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ call
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ $(FLUTTER_BUILD_NAME)
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ $(FLUTTER_BUILD_NUMBER)
+ LSRequiresIPhoneOS
+
+ UIApplicationSceneManifest
+
+ UIApplicationSupportsMultipleScenes
+
+ UISceneConfigurations
+
+ UIWindowSceneSessionRoleApplication
+
+
+ UISceneClassName
+ UIWindowScene
+ UISceneConfigurationName
+ flutter
+ UISceneDelegateClassName
+ $(PRODUCT_MODULE_NAME).SceneDelegate
+ UISceneStoryboardFile
+ Main
+
+
+
+
+ UIApplicationSupportsIndirectInputEvents
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIMainStoryboardFile
+ Main
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+
+
diff --git a/call/ios/Runner/Runner-Bridging-Header.h b/call/ios/Runner/Runner-Bridging-Header.h
new file mode 100644
index 0000000..308a2a5
--- /dev/null
+++ b/call/ios/Runner/Runner-Bridging-Header.h
@@ -0,0 +1 @@
+#import "GeneratedPluginRegistrant.h"
diff --git a/call/ios/Runner/SceneDelegate.swift b/call/ios/Runner/SceneDelegate.swift
new file mode 100644
index 0000000..b9ce8ea
--- /dev/null
+++ b/call/ios/Runner/SceneDelegate.swift
@@ -0,0 +1,6 @@
+import Flutter
+import UIKit
+
+class SceneDelegate: FlutterSceneDelegate {
+
+}
diff --git a/call/ios/RunnerTests/RunnerTests.swift b/call/ios/RunnerTests/RunnerTests.swift
new file mode 100644
index 0000000..86a7c3b
--- /dev/null
+++ b/call/ios/RunnerTests/RunnerTests.swift
@@ -0,0 +1,12 @@
+import Flutter
+import UIKit
+import XCTest
+
+class RunnerTests: XCTestCase {
+
+ func testExample() {
+ // If you add code to the Runner application, consider adding tests here.
+ // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
+ }
+
+}
diff --git a/call/lib/core/codec/lpc_codec.dart b/call/lib/core/codec/lpc_codec.dart
new file mode 100644
index 0000000..3f68da0
--- /dev/null
+++ b/call/lib/core/codec/lpc_codec.dart
@@ -0,0 +1,382 @@
+import 'dart:math' as math;
+import 'dart:typed_data';
+import '../../utils/audio_math.dart';
+import '../../utils/constants.dart';
+
+/// Simplified LPC-10 voice codec operating at ~360 bps.
+///
+/// ── Super-frame structure (200 ms = 10 × 20 ms sub-frames) ─────────────
+///
+/// Bits per super-frame (72 bits = 9 bytes):
+/// 10 PARCOR reflection coefficients (k_1..k_10): 30 bits (3 bits each)
+/// 10 sub-frame gain values (log energy): 20 bits (2 bits each)
+/// 10 voiced/unvoiced flags: 10 bits (1 bit each)
+/// 1 pitch period (shared across voiced sub-frames): 6 bits (0-63 → 20-83 samples)
+/// 1 pitch-valid flag: 1 bit
+/// padding to byte boundary: 5 bits
+/// ────────────────────────────────────────────────────────
+/// Total: 72 bits = 9 bytes
+///
+/// Voice quality is similar to HF digital radio (intelligible, robotic).
+/// All analysis is done at 8 kHz with a 10th-order LPC predictor.
+class LpcCodec {
+ // ── Configuration ─────────────────────────────────────────────────
+ static const int _p = C.lpcOrder; // 10
+ static const int _subN = C.lpcSubframeSamples; // 160 samples = 20 ms
+ static const int _numSubs = C.lpcSubframesPerSuper; // 10
+ static const int _superN = _subN * _numSubs; // 1600 samples = 200 ms
+ static const double _alpha = C.preEmphasis; // 0.97
+
+ // Encoder persistent state
+ double _encPrevSample = 0.0;
+
+ // Decoder persistent state
+ final _synState = Float64List(_p); // IIR filter memory (synthesis filter)
+ double _decPrevOut = 0.0; // de-emphasis state
+
+ // ── Public API ─────────────────────────────────────────────────────
+
+ /// Encode [pcm] (exactly 1600 Int16 LE samples) into 9-byte bitstream.
+ Uint8List encode(Uint8List pcmBytes) {
+ assert(pcmBytes.length == _superN * 2,
+ 'LPC encode: expected ${_superN * 2} bytes, got ${pcmBytes.length}');
+
+ // Convert Int16 PCM → Float64 normalised.
+ final signal = AudioMath.int16BytesToFloat(pcmBytes);
+
+ // Pre-emphasis filter (updates encoder state).
+ _applyPreEmphasis(signal);
+
+ // ── LPC analysis over the whole super-frame ────────────────────
+ // Window the super-frame and compute autocorrelation.
+ final windowed = Float64List(_superN);
+ final win = AudioMath.hammingWindow(_superN);
+ for (int i = 0; i < _superN; i++) {
+ windowed[i] = signal[i] * win[i];
+ }
+ final r = AudioMath.autocorrelation(windowed, _p);
+ final kc = _levinsonDurbin(r); // reflection coefficients [-1,1]
+ final a = _parcorToLpc(kc); // LP filter coefficients
+
+ // ── Pitch detection on the full super-frame residual ──────────
+ final residual = _computeResidual(signal, a);
+ final pitch = AudioMath.amdfPitch(residual, C.pitchMinSamples, C.pitchMaxSamples);
+ final hasVoice = pitch > 0;
+
+ // ── Per-sub-frame gain and voiced/unvoiced ─────────────────────
+ final gains = List.filled(_numSubs, 0);
+ final vuv = List.filled(_numSubs, false);
+
+ for (int s = 0; s < _numSubs; s++) {
+ final start = s * _subN;
+ final sub = Float64List.sublistView(signal, start, start + _subN);
+ final e = AudioMath.energy(sub);
+ gains[s] = _quantiseGain(e);
+ // Voiced if energy is above floor AND overall pitch was detected.
+ vuv[s] = hasVoice && e > 1e-4;
+ }
+
+ // ── Quantise PARCOR coefficients (3 bits each = 8 levels) ────
+ final kQuant = List.filled(_p, 0);
+ for (int i = 0; i < _p; i++) {
+ kQuant[i] = _quantiseParcor(kc[i]);
+ }
+
+ // ── Pack into 72-bit bitstream ─────────────────────────────────
+ return _pack(kQuant, gains, vuv, hasVoice ? pitch : 0, hasVoice);
+ }
+
+ /// Decode a 9-byte bitstream into PCM (returns 3200 bytes = 1600 Int16 LE).
+ Uint8List decode(Uint8List bits) {
+ assert(bits.length == 9, 'LPC decode: expected 9 bytes, got ${bits.length}');
+
+ final unpacked = _unpack(bits);
+ final kc = unpacked.$1; // List PARCOR coefficients
+ final gains = unpacked.$2;
+ final vuv = unpacked.$3;
+ final pitch = unpacked.$4;
+ final hasVoice = unpacked.$5;
+
+ // Convert PARCOR back to LP filter coefficients.
+ final a = _parcorToLpc(kc);
+
+ // Synthesise each sub-frame.
+ final output = Float64List(_superN);
+
+ for (int s = 0; s < _numSubs; s++) {
+ final gainLinear = _dequantiseGain(gains[s]);
+ final voiced = vuv[s] && hasVoice;
+ final excitation = _generateExcitation(_subN, voiced, pitch, gainLinear);
+
+ // IIR synthesis filter: y[n] = e[n] + Σ(a[k]·y[n-k])
+ for (int i = 0; i < _subN; i++) {
+ double acc = excitation[i];
+ for (int k = 0; k < _p; k++) {
+ final idx = i - k - 1;
+ acc += a[k] * (idx >= 0 ? output[s * _subN + idx] : _synState[k]);
+ }
+ output[s * _subN + i] = acc;
+ }
+
+ // Update synthesis state (last P samples of this sub-frame).
+ for (int k = 0; k < _p; k++) {
+ final idx = _subN - 1 - k;
+ _synState[k] = idx >= 0 ? output[s * _subN + idx] : 0.0;
+ }
+ }
+
+ // De-emphasis.
+ _applyDeEmphasis(output);
+
+ // Soft-clip to prevent overflow.
+ for (int i = 0; i < _superN; i++) {
+ output[i] = output[i].clamp(-1.0, 1.0);
+ }
+
+ return AudioMath.floatToInt16Bytes(output);
+ }
+
+ // ── Pre/de-emphasis ────────────────────────────────────────────────
+
+ void _applyPreEmphasis(Float64List s) {
+ double prev = _encPrevSample;
+ for (int i = 0; i < s.length; i++) {
+ final cur = s[i];
+ s[i] = cur - _alpha * prev;
+ prev = cur;
+ }
+ _encPrevSample = s[s.length - 1];
+ }
+
+ void _applyDeEmphasis(Float64List s) {
+ double prev = _decPrevOut;
+ for (int i = 0; i < s.length; i++) {
+ final cur = s[i] + _alpha * prev;
+ s[i] = cur;
+ prev = cur;
+ }
+ _decPrevOut = s[s.length - 1];
+ }
+
+ // ── Levinson-Durbin algorithm ──────────────────────────────────────
+ //
+ // Given autocorrelation r[0..p], returns p reflection (PARCOR) coefficients.
+ // The algorithm computes the LP predictor in O(p^2).
+ static List _levinsonDurbin(Float64List r) {
+ if (r[0] < 1e-10) return List.filled(_p, 0.0);
+
+ final a = List.filled(_p + 1, 0.0);
+ final k = List.filled(_p, 0.0);
+ double e = r[0];
+
+ for (int i = 1; i <= _p; i++) {
+ // Reflection coefficient k_i = -(r[i] + Σ a[j]·r[i-j]) / e
+ double lambda = r[i];
+ for (int j = 1; j < i; j++) {
+ lambda += a[j] * r[i - j];
+ }
+ k[i - 1] = -lambda / e;
+
+ // Clamp to (-1, 1) for stability.
+ k[i - 1] = k[i - 1].clamp(-0.999, 0.999);
+
+ // Update predictor: a_new[j] = a[j] + k_i · a[i-j]
+ final newA = List.from(a);
+ newA[i] = k[i - 1];
+ for (int j = 1; j < i; j++) {
+ newA[j] = a[j] + k[i - 1] * a[i - j];
+ }
+ for (int j = 0; j <= i; j++) {
+ a[j] = newA[j];
+ }
+
+ e *= (1.0 - k[i - 1] * k[i - 1]);
+ if (e < 1e-15) break;
+ }
+
+ return k;
+ }
+
+ // ── PARCOR → LP coefficients ───────────────────────────────────────
+ //
+ // Convert reflection coefficients back to the direct-form LP coefficients
+ // using the step-up recursion (inverse Levinson).
+ static List _parcorToLpc(List k) {
+ final a = List.filled(_p + 1, 0.0);
+ a[0] = 1.0;
+ for (int i = 0; i < _p; i++) {
+ a[i + 1] = k[i];
+ for (int j = 1; j <= i; j++) {
+ final tmp = a[j] + k[i] * a[i + 1 - j];
+ a[j] = tmp;
+ }
+ }
+ // Return a[1..p] (skip a[0]=1)
+ return a.sublist(1);
+ }
+
+ // ── Residual computation ───────────────────────────────────────────
+ //
+ // Apply the analysis (inverse) filter: e[n] = s[n] + Σ a[k]·s[n-k]
+ static Float64List _computeResidual(Float64List s, List a) {
+ final res = Float64List(s.length);
+ for (int n = 0; n < s.length; n++) {
+ double acc = s[n];
+ for (int k = 0; k < _p; k++) {
+ if (n - k - 1 >= 0) {
+ acc += a[k] * s[n - k - 1];
+ }
+ }
+ res[n] = acc;
+ }
+ return res;
+ }
+
+ // ── Gain quantisation (2 bits = 4 levels) ─────────────────────────
+ //
+ // Map log10(energy) to integers 0-3.
+ static int _quantiseGain(double energy) {
+ if (energy < 1e-6) return 0;
+ final logE = math.log(energy + 1e-10) / math.ln10;
+ // Typical speech energy in float normalised to [-1,1]: logE ∈ [-6, 0].
+ // Remap to [0,3].
+ final mapped = ((logE + 6.0) / 6.0 * 3.0).round().clamp(0, 3);
+ return mapped;
+ }
+
+ static double _dequantiseGain(int q) {
+ // Inverse of _quantiseGain.
+ final logE = q / 3.0 * 6.0 - 6.0;
+ return math.pow(10.0, logE).toDouble() * 0.1; // scale for excitation
+ }
+
+ // ── PARCOR quantisation (3 bits = 8 levels, range [-1,1]) ─────────
+ static int _quantiseParcor(double k) {
+ // Map [-1, 1] → [0, 7].
+ final idx = ((k + 1.0) / 2.0 * 7.0).round().clamp(0, 7);
+ return idx;
+ }
+
+ static double _dequantiseParcor(int q) {
+ return (q / 7.0) * 2.0 - 1.0;
+ }
+
+ // ── Excitation generation ──────────────────────────────────────────
+ //
+ // Voiced: periodic impulse train at pitch period with gain amplitude.
+ // Unvoiced: white Gaussian noise with gain amplitude.
+ static Float64List _generateExcitation(
+ int n, bool voiced, int pitch, double gain) {
+ if (!voiced || pitch <= 0) {
+ return AudioMath.whiteNoise(n, gain.clamp(0.0, 1.0));
+ }
+ final ex = Float64List(n);
+ // Impulse at each pitch period boundary.
+ for (int i = 0; i < n; i += pitch) {
+ if (i < n) ex[i] = gain;
+ }
+ return ex;
+ }
+
+ // ── Bit packing ────────────────────────────────────────────────────
+ //
+ // Layout (72 bits, MSB first):
+ // Bits 0-29 : 10 × PARCOR (3 bits each)
+ // Bits 30-49 : 10 × gain (2 bits each)
+ // Bits 50-59 : 10 × V/UV (1 bit each)
+ // Bits 60-65 : pitch period (6 bits, value = pitch-20, range 0-63 → 20-83)
+ // Bit 66 : pitch-valid flag
+ // Bits 67-71 : padding (5 zeros)
+
+ static Uint8List _pack(List kq, List gains, List vuv,
+ int pitch, bool hasVoice) {
+ final bits = List.filled(72, 0);
+ int pos = 0;
+
+ // PARCOR coefficients (3 bits each).
+ for (int i = 0; i < _p; i++) {
+ bits[pos++] = (kq[i] >> 2) & 1;
+ bits[pos++] = (kq[i] >> 1) & 1;
+ bits[pos++] = kq[i] & 1;
+ }
+
+ // Gains (2 bits each).
+ for (int i = 0; i < _numSubs; i++) {
+ bits[pos++] = (gains[i] >> 1) & 1;
+ bits[pos++] = gains[i] & 1;
+ }
+
+ // V/UV flags.
+ for (int i = 0; i < _numSubs; i++) {
+ bits[pos++] = vuv[i] ? 1 : 0;
+ }
+
+ // Pitch (6 bits, offset by 20).
+ final pitchEnc = hasVoice ? (pitch - 20).clamp(0, 63) : 0;
+ for (int b = 5; b >= 0; b--) {
+ bits[pos++] = (pitchEnc >> b) & 1;
+ }
+
+ // Pitch-valid flag.
+ bits[pos++] = hasVoice ? 1 : 0;
+
+ // Remaining bits (padding) are already 0.
+
+ // Pack 72 bits into 9 bytes.
+ final out = Uint8List(9);
+ for (int i = 0; i < 9; i++) {
+ int byte = 0;
+ for (int b = 0; b < 8; b++) {
+ byte = (byte << 1) | bits[i * 8 + b];
+ }
+ out[i] = byte;
+ }
+ return out;
+ }
+
+ static (List, List, List, int, bool) _unpack(
+ Uint8List bytes) {
+ // Unpack 9 bytes into 72 bits.
+ final bits = List.filled(72, 0);
+ for (int i = 0; i < 9; i++) {
+ for (int b = 0; b < 8; b++) {
+ bits[i * 8 + b] = (bytes[i] >> (7 - b)) & 1;
+ }
+ }
+
+ int pos = 0;
+
+ // PARCOR.
+ final kq = List.filled(_p, 0);
+ for (int i = 0; i < _p; i++) {
+ kq[i] = (bits[pos] << 2) | (bits[pos + 1] << 1) | bits[pos + 2];
+ pos += 3;
+ }
+ final kc = kq.map(_dequantiseParcor).toList();
+
+ // Gains.
+ final gains = List.filled(_numSubs, 0);
+ for (int i = 0; i < _numSubs; i++) {
+ gains[i] = (bits[pos] << 1) | bits[pos + 1];
+ pos += 2;
+ }
+
+ // V/UV.
+ final vuv = List.filled(_numSubs, false);
+ for (int i = 0; i < _numSubs; i++) {
+ vuv[i] = bits[pos++] == 1;
+ }
+
+ // Pitch.
+ int pitchEnc = 0;
+ for (int b = 5; b >= 0; b--) {
+ pitchEnc |= bits[pos++] << b;
+ }
+ final pitch = pitchEnc + 20;
+
+ // Pitch-valid.
+ final hasVoice = bits[pos] == 1;
+
+ return (kc, gains, vuv, pitch, hasVoice);
+ }
+}
diff --git a/call/lib/core/crypto/aes_cipher.dart b/call/lib/core/crypto/aes_cipher.dart
new file mode 100644
index 0000000..8acb77d
--- /dev/null
+++ b/call/lib/core/crypto/aes_cipher.dart
@@ -0,0 +1,43 @@
+import 'dart:typed_data';
+import 'package:pointycastle/export.dart';
+
+/// AES-256-CTR symmetric cipher wrapper.
+///
+/// AES-CTR is a stream cipher: encryption and decryption use the same
+/// operation (XOR with key-stream), and there is no padding. The output
+/// length always equals the input length, making it ideal for our fixed-size
+/// 11-byte voice payload.
+///
+/// Security notes:
+/// • Never reuse the same (key, nonce) pair.
+/// • Nonce uniqueness is guaranteed by including the packet sequence
+/// number in the nonce (see [KeyManager.buildNonce]).
+/// • The key is zeroed from memory when the session ends.
+abstract final class AesCipher {
+ // ── Core cipher op (encrypt = decrypt for CTR mode) ───────────────
+
+ /// Encrypt or decrypt [data] with [key] (32 bytes) and [nonce] (16 bytes).
+ ///
+ /// AES-256-CTR: keystream = AES_k(nonce ∥ counter), output = data ⊕ keystream.
+ /// [forEncryption] = true → encrypt; false → decrypt (same operation in CTR).
+ static Uint8List _ctr(Uint8List data, Uint8List key, Uint8List nonce,
+ {required bool forEncryption}) {
+ assert(key.length == 32, 'AES-256 requires a 32-byte key');
+ assert(nonce.length == 16, 'CTR nonce must be 16 bytes (one AES block)');
+
+ final cipher = StreamCipher('AES/CTR')
+ ..init(forEncryption, ParametersWithIV(KeyParameter(key), nonce));
+
+ final out = Uint8List(data.length);
+ cipher.processBytes(data, 0, data.length, out, 0);
+ return out;
+ }
+
+ /// Encrypt [plaintext] → ciphertext (same length as input).
+ static Uint8List encrypt(Uint8List plaintext, Uint8List key, Uint8List nonce) =>
+ _ctr(plaintext, key, nonce, forEncryption: true);
+
+ /// Decrypt [ciphertext] → plaintext (same length as input).
+ static Uint8List decrypt(Uint8List ciphertext, Uint8List key, Uint8List nonce) =>
+ _ctr(ciphertext, key, nonce, forEncryption: false);
+}
diff --git a/call/lib/core/crypto/key_manager.dart b/call/lib/core/crypto/key_manager.dart
new file mode 100644
index 0000000..4053920
--- /dev/null
+++ b/call/lib/core/crypto/key_manager.dart
@@ -0,0 +1,121 @@
+import 'dart:convert';
+import 'dart:typed_data';
+import 'package:pointycastle/export.dart';
+
+/// Derives and stores the 256-bit session key from a user-supplied passphrase.
+///
+/// Key derivation: PBKDF2-HMAC-SHA256 with a random salt.
+/// The salt is kept in memory for the session; both peers must use the SAME
+/// passphrase and DIFFERENT salts are handled by transmitting the salt
+/// in the handshake packet before the session starts.
+class KeyManager {
+ static const int _keyLen = 32; // AES-256
+ static const int _saltLen = 16;
+ static const int _iters = 100000;
+
+ Uint8List? _key;
+ Uint8List? _salt;
+
+ /// True once [deriveKey] has been called successfully.
+ bool get hasKey => _key != null;
+
+ /// The derived 32-byte key (throws if not yet derived).
+ Uint8List get key {
+ final k = _key;
+ if (k == null) throw StateError('Key not derived yet');
+ return k;
+ }
+
+ /// The 16-byte salt used during derivation (for sharing with the peer).
+ Uint8List get salt {
+ final s = _salt;
+ if (s == null) throw StateError('Salt not available');
+ return s;
+ }
+
+ // ── Derivation ─────────────────────────────────────────────────────
+
+ /// Derive a 256-bit key from [passphrase] using PBKDF2-HMAC-SHA256.
+ ///
+ /// If [salt] is provided (received from the peer during handshake),
+ /// it is used directly. Otherwise a fresh random salt is generated.
+ ///
+ /// Throws [ArgumentError] if the passphrase is empty.
+ void deriveKey(String passphrase, {Uint8List? salt}) {
+ if (passphrase.isEmpty) {
+ throw ArgumentError('Passphrase must not be empty');
+ }
+
+ // Use provided salt or generate one.
+ final usedSalt = salt ?? _generateSalt();
+ _salt = usedSalt;
+
+ final passwordBytes = Uint8List.fromList(utf8.encode(passphrase));
+
+ // PBKDF2-HMAC-SHA256 via PointyCastle.
+ final pbkdf2 = PBKDF2KeyDerivator(HMac(SHA256Digest(), 64))
+ ..init(Pbkdf2Parameters(usedSalt, _iters, _keyLen));
+
+ _key = pbkdf2.process(passwordBytes);
+ }
+
+ /// Load a raw 32-byte key directly (for testing or pre-shared key import).
+ void loadRawKey(Uint8List rawKey) {
+ if (rawKey.length != _keyLen) {
+ throw ArgumentError('Raw key must be $_keyLen bytes');
+ }
+ _key = Uint8List.fromList(rawKey);
+ _salt = Uint8List(_saltLen); // zero salt when using raw key
+ }
+
+ /// Clear the key from memory (call on session teardown).
+ void clear() {
+ if (_key != null) {
+ _key!.fillRange(0, _key!.length, 0);
+ _key = null;
+ }
+ _salt = null;
+ }
+
+ // ── Nonce construction ─────────────────────────────────────────────
+
+ /// Build a 16-byte AES-CTR nonce for a given packet sequence number.
+ ///
+ /// Layout: [salt[0..7] ∥ sessionId[0..3] ∥ seqHigh ∥ seqLow ∥ 00 00 00 00]
+ /// (128-bit nonce; the counter part at the end starts at 0 per-block.)
+ ///
+ /// Using the salt's first 8 bytes + session ID + seq ensures that
+ /// each packet has a unique nonce without transmitting the full nonce.
+ Uint8List buildNonce(Uint8List sessionId, int seq) {
+ final nonce = Uint8List(16);
+ // First 8 bytes from salt (or zeros if salt unavailable).
+ final s = _salt;
+ if (s != null) {
+ for (int i = 0; i < 8 && i < s.length; i++) { nonce[i] = s[i]; }
+ }
+ // Next 4 bytes: session ID.
+ for (int i = 0; i < 4 && i < sessionId.length; i++) {
+ nonce[8 + i] = sessionId[i];
+ }
+ // Last 4 bytes: packet sequence number (big-endian).
+ nonce[12] = (seq >> 24) & 0xFF;
+ nonce[13] = (seq >> 16) & 0xFF;
+ nonce[14] = (seq >> 8) & 0xFF;
+ nonce[15] = seq & 0xFF;
+ return nonce;
+ }
+
+ // ── Private helpers ────────────────────────────────────────────────
+
+ static Uint8List _generateSalt() {
+ final rng = FortunaRandom();
+ // Seed Fortuna with timestamp + hash-spread bytes.
+ final seed = Uint8List(32);
+ final ts = DateTime.now().microsecondsSinceEpoch;
+ for (int i = 0; i < 8; i++) {
+ seed[i] = (ts >> (i * 8)) & 0xFF;
+ }
+ rng.seed(KeyParameter(seed));
+ return rng.nextBytes(_saltLen);
+ }
+}
diff --git a/call/lib/core/fec/reed_solomon.dart b/call/lib/core/fec/reed_solomon.dart
new file mode 100644
index 0000000..2e65478
--- /dev/null
+++ b/call/lib/core/fec/reed_solomon.dart
@@ -0,0 +1,294 @@
+import 'dart:typed_data';
+
+/// Reed-Solomon codec RS(15,11) over GF(16).
+///
+/// GF(16) = GF(2^4) with primitive polynomial p(x) = x^4 + x + 1 (0x13).
+/// Primitive element α has order 15 (α^15 = 1).
+///
+/// Parameters:
+/// n = 15 (codeword length in nibbles)
+/// k = 11 (data symbols per codeword)
+/// t = 2 (corrects up to 2 nibble-errors per codeword)
+///
+/// Wire mapping:
+/// 11 data nibbles + 4 parity nibbles = 15 nibbles = 7.5 bytes.
+/// To keep byte alignment the codec works on full-byte streams:
+/// encode(Uint8List data) where data.length must be a multiple of 5.5 B
+/// Callers pack/unpack nibbles via [packNibbles] / [unpackNibbles].
+///
+/// Usage (encode 11-byte block → 15-byte codeword):
+/// final cw = ReedSolomon.encodeBlock(data11Bytes); // Uint8List(15)
+/// final ok = ReedSolomon.decodeBlock(cw); // corrects in-place
+abstract final class ReedSolomon {
+ // ── GF(16) tables ─────────────────────────────────────────────────
+ //
+ // Computed offline for p(x) = x^4 + x + 1 = 0x13.
+ // α^0 = 1 α^1 = 2 α^2 = 4 α^3 = 8
+ // α^4 = 3 α^5 = 6 α^6 = 12 α^7 = 11
+ // α^8 = 5 α^9 = 10 α^10 = 7 α^11 = 14
+ // α^12 = 15 α^13 = 13 α^14 = 9 α^15 = 1 (wrap)
+
+ static const List _exp = [
+ 1, 2, 4, 8, 3, 6, 12, 11, 5, 10, 7, 14, 15, 13, 9,
+ // duplicate for modular index without % 15
+ 1, 2, 4, 8, 3, 6, 12, 11, 5, 10, 7, 14, 15, 13, 9,
+ ];
+
+ static const List _log = [
+ // index 0 → undefined (−∞); we store 0 but never use it for non-zero
+ 0, // log[0] = -∞ (sentinel)
+ 0, // log[1] = 0 (α^0)
+ 1, // log[2] = 1
+ 4, // log[3] = 4
+ 2, // log[4] = 2
+ 8, // log[5] = 8
+ 5, // log[6] = 5
+ 10, // log[7] = 10
+ 3, // log[8] = 3
+ 14, // log[9] = 14
+ 9, // log[10] = 9
+ 7, // log[11] = 7
+ 6, // log[12] = 6
+ 13, // log[13] = 13
+ 11, // log[14] = 11
+ 12, // log[15] = 12
+ ];
+
+ // Generator polynomial g(x) = (x-α)(x-α^2)(x-α^3)(x-α^4)
+ // = x^4 + 13x^3 + 12x^2 + 8x + 7 (coefficients in GF(16))
+ // g[0] is the constant term, g[4] is the leading coefficient (=1).
+ static const List _gen = [7, 8, 12, 13, 1];
+
+ static const int _n = 15;
+ static const int _k = 11;
+ static const int _t = 2;
+
+ // ── GF(16) arithmetic ─────────────────────────────────────────────
+
+ // Addition = XOR in GF(2^m).
+ static int _add(int a, int b) => a ^ b;
+
+ // Multiplication using log/exp lookup tables.
+ static int _mul(int a, int b) {
+ if (a == 0 || b == 0) return 0;
+ return _exp[(_log[a] + _log[b]) % 15];
+ }
+
+ // Division a / b.
+ static int _div(int a, int b) {
+ if (a == 0) return 0;
+ assert(b != 0, 'GF division by zero');
+ return _exp[(_log[a] - _log[b] + 15) % 15];
+ }
+
+ // Power α^e.
+ static int _pow(int e) => _exp[e % 15];
+
+ // ── Nibble pack / unpack ──────────────────────────────────────────
+
+ /// Pack n pairs of nibbles into bytes. nibbles.length must be even.
+ static Uint8List packNibbles(List nibbles) {
+ assert(nibbles.length.isEven, 'nibbles must have even length');
+ final out = Uint8List(nibbles.length >> 1);
+ for (int i = 0; i < out.length; i++) {
+ out[i] = ((nibbles[i * 2] & 0xF) << 4) | (nibbles[i * 2 + 1] & 0xF);
+ }
+ return out;
+ }
+
+ /// Unpack bytes into a List of nibbles (high nibble first).
+ static List unpackNibbles(List bytes) {
+ final out = [];
+ for (final b in bytes) {
+ out.add((b >> 4) & 0xF);
+ out.add(b & 0xF);
+ }
+ return out;
+ }
+
+ // ── Encoder ───────────────────────────────────────────────────────
+
+ /// Encode [data] (11-nibble list) into a 15-nibble RS codeword.
+ ///
+ /// The encoding is systematic: the first 11 nibbles of the codeword
+ /// are the data, the last 4 are parity computed via polynomial division.
+ static List _encodeNibbles(List data) {
+ assert(data.length == _k, 'RS encode: input must be $_k nibbles');
+
+ // Work buffer: data shifted left by t positions.
+ final r = List.filled(_k + _t, 0);
+ for (int i = 0; i < _k; i++) {
+ r[i] = data[i];
+ }
+ // Polynomial long division: r(x) = x^(n-k)·m(x) mod g(x)
+ for (int i = 0; i < _k; i++) {
+ final coeff = r[i];
+ if (coeff != 0) {
+ for (int j = 1; j <= _t * 2; j++) {
+ r[i + j] = _add(r[i + j], _mul(_gen[_t * 2 - j], coeff));
+ }
+ }
+ }
+
+ // Build codeword: data || parity (last 4 elements of r)
+ final cw = List.from(data);
+ for (int i = _k; i < _n; i++) {
+ cw.add(r[i]);
+ }
+ return cw;
+ }
+
+ // ── Public API: byte-level encode (11 bytes → 15 bytes) ───────────
+
+ /// Encode an 11-byte data block into a 15-byte RS codeword.
+ ///
+ /// The 11 bytes are treated as 22 GF(16) nibbles split into two
+ /// 11-nibble RS codewords. Output is 30 nibbles = 15 bytes.
+ ///
+ /// [data] must have exactly 11 bytes. Returns Uint8List(15).
+ static Uint8List encodeBlock(Uint8List data) {
+ assert(data.length == 11, 'encodeBlock: need 11 bytes, got ${data.length}');
+ final nibs = unpackNibbles(data); // 22 nibbles
+ // Codeword 0: nibbles [0..10]
+ final cw0 = _encodeNibbles(nibs.sublist(0, 11));
+ // Codeword 1: nibbles [11..21]
+ final cw1 = _encodeNibbles(nibs.sublist(11, 22));
+ // Merge 30 nibbles back to 15 bytes
+ return packNibbles([...cw0, ...cw1]);
+ }
+
+ // ── Decoder (Berlekamp-Massey + Chien + Forney) ───────────────────
+
+ /// Decode and correct a 15-nibble codeword (in-place list).
+ /// Returns true if no uncorrectable error was detected.
+ static bool _decodeNibbles(List cw) {
+ assert(cw.length == _n, 'RS decode: codeword must be $_n nibbles');
+
+ // ── Step 1: compute syndromes S_i = c(α^i) for i=1..2t ─────────
+ final s = List.filled(2 * _t, 0);
+ for (int i = 0; i < 2 * _t; i++) {
+ int ev = 0;
+ for (int j = 0; j < _n; j++) {
+ ev = _add(_mul(ev, _pow(i + 1)), cw[j]);
+ }
+ s[i] = ev;
+ }
+
+ // All-zero syndromes → no errors.
+ if (s.every((v) => v == 0)) return true;
+
+ // ── Step 2: Berlekamp-Massey error-locator polynomial Λ(x) ──────
+ var sigma = List.filled(_t + 1, 0);
+ sigma[0] = 1;
+ var prev = List.filled(_t + 1, 0);
+ prev[0] = 1;
+ int lfsr = 0, d = 1;
+
+ for (int n = 0; n < 2 * _t; n++) {
+ // Discrepancy Δ = S[n] + Λ_1·S[n-1] + … + Λ_L·S[n-L]
+ int delta = s[n];
+ for (int i = 1; i <= lfsr; i++) {
+ if (n - i >= 0) delta = _add(delta, _mul(sigma[i], s[n - i]));
+ }
+
+ if (delta == 0) {
+ d++;
+ } else {
+ final temp = List.from(sigma);
+ final scale = _div(delta, _exp[0]); // delta / 1 = delta
+ // sigma(x) -= (delta / Δ_prev) · x^d · prev(x)
+ for (int i = d; i <= _t + d && i <= _t; i++) {
+ if (i - d < prev.length) {
+ sigma[i] = _add(sigma[i], _mul(scale, prev[i - d]));
+ }
+ }
+ if (2 * lfsr <= n) {
+ lfsr = n + 1 - lfsr;
+ prev = temp;
+ d = 1;
+ } else {
+ d++;
+ }
+ }
+ }
+
+ // ── Step 3: Chien search — find roots of Λ(x) ──────────────────
+ final errorPositions = [];
+ for (int i = 0; i < _n; i++) {
+ // Evaluate Λ(α^(-i)) = Λ(α^(15-i))
+ int ev = 0;
+ for (int j = sigma.length - 1; j >= 0; j--) {
+ ev = _add(_mul(ev, _pow((15 - i) % 15)), sigma[j]);
+ }
+ if (ev == 0) errorPositions.add(i);
+ }
+
+ if (errorPositions.length > _t) return false; // uncorrectable
+
+ // ── Step 4: Forney algorithm — compute error magnitudes ─────────
+ for (final pos in errorPositions) {
+ // Evaluate error magnitude using Forney formula.
+ // For t≤2 we use the direct closed-form when |errors|≤2.
+ // Omega(x) = S(x)·Λ(x) mod x^(2t)
+ final omega = List.filled(2 * _t, 0);
+ for (int i = 0; i < 2 * _t; i++) {
+ for (int j = 0; j <= i && j < sigma.length; j++) {
+ if (i - j < s.length) {
+ omega[i] = _add(omega[i], _mul(sigma[j], s[i - j]));
+ }
+ }
+ }
+ // Λ'(x) formal derivative (odd powers survive in GF(2))
+ // For binary GF, the derivative has only odd-indexed terms.
+ int sigmaDerivAtXi = 0;
+ for (int j = 1; j < sigma.length; j += 2) {
+ sigmaDerivAtXi = _add(sigmaDerivAtXi,
+ _mul(sigma[j], _pow(j * (15 - pos) % 15)));
+ }
+ if (sigmaDerivAtXi == 0) return false;
+
+ // Evaluate Omega at α^(-pos)
+ int omegaVal = 0;
+ for (int i = omega.length - 1; i >= 0; i--) {
+ omegaVal = _add(_mul(omegaVal, _pow((15 - pos) % 15)), omega[i]);
+ }
+
+ // Error value = -X^(-1) · Omega(X^(-1)) / Λ'(X^(-1))
+ // In GF(2^m): -a = a, so e = _mul(inv(α^pos), omegaVal) / sigmaDerivAtXi
+ final xi = _pow(pos); // α^pos
+ final e = _div(_mul(_div(1, xi), omegaVal), sigmaDerivAtXi);
+
+ cw[pos] = _add(cw[pos], e);
+ }
+
+ return true;
+ }
+
+ /// Decode and error-correct a 15-byte RS block in-place.
+ ///
+ /// Returns true if the block is valid (or was corrected successfully).
+ /// Returns false if errors exceeded the correction capacity.
+ static bool decodeBlock(Uint8List block) {
+ assert(block.length == 15, 'decodeBlock: need 15 bytes, got ${block.length}');
+ final nibs = unpackNibbles(block); // 30 nibbles
+ final cw0 = nibs.sublist(0, 15);
+ final cw1 = nibs.sublist(15, 30);
+ final ok0 = _decodeNibbles(cw0);
+ final ok1 = _decodeNibbles(cw1);
+ if (!ok0 || !ok1) return false;
+ // Write corrected nibbles back to byte array.
+ final merged = [...cw0, ...cw1];
+ final packed = packNibbles(merged);
+ for (int i = 0; i < 15; i++) { block[i] = packed[i]; }
+ return true;
+ }
+
+ /// Extract just the 11 data bytes from a (possibly corrected) 15-byte block.
+ static Uint8List extractData(Uint8List block) {
+ assert(block.length == 15);
+ final nibs = unpackNibbles(block);
+ // Data nibbles: [0..10] from cw0 and [15..25] from cw1 → merge
+ final dataNibs = [...nibs.sublist(0, 11), ...nibs.sublist(15, 26)];
+ return packNibbles(dataNibs); // 22 nibbles → 11 bytes
+ }
+}
diff --git a/call/lib/core/framing/deframer.dart b/call/lib/core/framing/deframer.dart
new file mode 100644
index 0000000..1db580b
--- /dev/null
+++ b/call/lib/core/framing/deframer.dart
@@ -0,0 +1,125 @@
+import 'dart:typed_data';
+import '../crypto/aes_cipher.dart';
+import '../crypto/key_manager.dart';
+import '../fec/reed_solomon.dart';
+import '../modem/fsk_demodulator.dart';
+import 'packet.dart';
+import '../../utils/audio_math.dart';
+import '../../utils/constants.dart';
+
+/// Receive pipeline: FSK audio → demodulate → RS FEC → decrypt → packet.
+///
+/// Feed audio chunks from the microphone via [pushAudio]. Decoded voice
+/// super-frames (9-byte LPC payloads) are queued in [voiceQueue].
+class Deframer {
+ final KeyManager _keys;
+ final Uint8List _sessionId;
+ final FskDemodulator _demod = FskDemodulator();
+
+ // Decoded LPC payloads waiting to be synthesised.
+ final List voiceQueue = [];
+
+ // Stats for UI display.
+ int rxPackets = 0;
+ int rxErrors = 0;
+ int rxCorrected = 0;
+
+ Deframer(this._keys, this._sessionId);
+
+ // ── Public API ─────────────────────────────────────────────────────
+
+ /// Push a chunk of Float64 audio samples from the microphone.
+ ///
+ /// Internally demodulates FSK, assembles wire frames, applies FEC,
+ /// decrypts, and enqueues decoded voice payloads into [voiceQueue].
+ void pushAudio(Float64List samples) {
+ final rawFrames = _demod.pushSamples(samples);
+ for (final raw in rawFrames) {
+ _processWireFrame(raw);
+ }
+ }
+
+ /// Push raw Int16 LE PCM bytes (as received from AudioRecord).
+ void pushPcmBytes(Uint8List pcmBytes) {
+ pushAudio(AudioMath.int16BytesToFloat(pcmBytes));
+ }
+
+ void reset() {
+ _demod.reset();
+ voiceQueue.clear();
+ rxPackets = 0;
+ rxErrors = 0;
+ rxCorrected = 0;
+ }
+
+ // ── Private pipeline ───────────────────────────────────────────────
+
+ /// Process one wire frame (22 bytes) through FEC → CRC → decrypt → queue.
+ void _processWireFrame(Uint8List wire) {
+ if (wire.length < 22) {
+ rxErrors++;
+ return;
+ }
+
+ // ── Wire layout: [SYNC:2][SEQ:2][TYPE:1][RS_PAYLOAD:15][CRC:2] ──
+ final seq = (wire[2] << 8) | wire[3];
+ final type = wire[4];
+
+ // Extract the 15-byte RS-encoded block.
+ final rsBlock = Uint8List.fromList(wire.sublist(5, 20));
+
+ // CRC check over bytes [2..19].
+ final expectedCrc = AudioMath.crc16(wire.sublist(2, 20));
+ final wireCrc = (wire[20] << 8) | wire[21];
+ if (expectedCrc != wireCrc) {
+ rxErrors++;
+ return; // frame corrupted beyond CRC recovery
+ }
+
+ // ── RS(15,11) FEC decode (corrects up to 2 nibble errors) ────────
+ final rsOk = ReedSolomon.decodeBlock(rsBlock);
+ if (!rsOk) {
+ rxErrors++;
+ return;
+ }
+ // Detect whether RS actually corrected any bytes (compare before/after).
+ bool wasCorrected = false;
+ for (int i = 0; i < rsBlock.length; i++) {
+ if (rsBlock[i] != wire[5 + i]) { wasCorrected = true; break; }
+ }
+ if (wasCorrected) rxCorrected++;
+
+ // Extract the 11-byte data payload.
+ final encrypted = ReedSolomon.extractData(rsBlock);
+
+ // ── AES-256-CTR decrypt ───────────────────────────────────────────
+ final nonce = _keys.buildNonce(_sessionId, seq);
+ final plaintext = AesCipher.decrypt(encrypted, _keys.key, nonce);
+
+ // ── Parse inner packet structure ──────────────────────────────────
+ // plaintext layout: [lpc(9)][seq_low(1)][type_tag(1)]
+ // Validate inner type tag matches outer type.
+ final innerType = plaintext[10];
+ if (innerType != type && type == C.pkTypeVoice) {
+ rxErrors++;
+ return;
+ }
+
+ rxPackets++;
+
+ // Build a Packet for higher-level handlers.
+ final pkt = Packet(
+ seq: seq,
+ type: type,
+ payload: plaintext,
+ valid: true,
+ );
+
+ if (pkt.isVoice) {
+ // First 9 bytes are the LPC super-frame.
+ voiceQueue.add(Uint8List.fromList(plaintext.sublist(0, 9)));
+ }
+ // Control packets (handshake, ping) are ignored here;
+ // higher layers can subscribe via [SecureChannel].
+ }
+}
diff --git a/call/lib/core/framing/framer.dart b/call/lib/core/framing/framer.dart
new file mode 100644
index 0000000..d37f641
--- /dev/null
+++ b/call/lib/core/framing/framer.dart
@@ -0,0 +1,101 @@
+import 'dart:typed_data';
+import '../crypto/aes_cipher.dart';
+import '../crypto/key_manager.dart';
+import '../fec/reed_solomon.dart';
+import '../modem/fsk_modulator.dart';
+import '../../utils/audio_math.dart';
+import '../../utils/constants.dart';
+
+/// Transmit pipeline: voice bytes → packet → encrypt → RS FEC → FSK audio.
+///
+/// Call [frameAndModulate] with each LPC super-frame (9 bytes) to get back
+/// a Float64List of audio samples ready for AudioTrack playback.
+class Framer {
+ final KeyManager _keys;
+ final Uint8List _sessionId; // 4-byte session identifier
+ final FskModulator _modem = FskModulator();
+
+ int _seq = 0; // rolling 16-bit sequence counter
+
+ Framer(this._keys, this._sessionId);
+
+ // ── Public API ─────────────────────────────────────────────────────
+
+ /// Full transmit pipeline for one 9-byte LPC payload.
+ ///
+ /// Steps:
+ /// 1. Pad payload to 11 bytes (add seq-high + type tag).
+ /// 2. Encrypt with AES-256-CTR.
+ /// 3. Build raw packet (SYNC + SEQ + TYPE + LEN + encrypted payload + CRC).
+ /// 4. Apply RS(15,11) FEC to the 11-byte encrypted payload → 15 bytes.
+ /// 5. Re-assemble the on-wire frame with FEC-encoded payload.
+ /// 6. Modulate through 4-FSK → audio samples.
+ Float64List frameAndModulate(Uint8List lpcPayload) {
+ assert(lpcPayload.length == 9, 'Framer: LPC payload must be 9 bytes');
+
+ final seq = _seq & 0xFFFF;
+ _seq = (_seq + 1) & 0xFFFF;
+
+ // ── Step 1: Pad payload → 11 bytes ─────────────────────────────
+ // Layout: [lpc(9)] [seq_low(1)] [type(1)]
+ final plaintext = Uint8List(C.pktPayloadLen); // 11 bytes
+ plaintext.setRange(0, 9, lpcPayload);
+ plaintext[9] = seq & 0xFF;
+ plaintext[10] = C.pkTypeVoice;
+
+ // ── Step 2: AES-256-CTR encryption ────────────────────────────
+ final nonce = _keys.buildNonce(_sessionId, seq);
+ final encrypted = AesCipher.encrypt(plaintext, _keys.key, nonce);
+
+ // ── Step 4: RS FEC — encode the 11-byte encrypted payload only ──
+ final rsEncoded = ReedSolomon.encodeBlock(encrypted); // 11 B → 15 B
+
+ // ── Step 5: Assemble on-wire frame (23 bytes) ──────────────────
+ // [SYNC:2][SEQ:2][TYPE:1][RS_PAYLOAD:15][CRC:2] = 22 bytes
+ // Recompute CRC over the RS-encoded block for the wire frame.
+ final wire = Uint8List(22);
+ wire[0] = C.syncWord[0];
+ wire[1] = C.syncWord[1];
+ wire[2] = (seq >> 8) & 0xFF;
+ wire[3] = seq & 0xFF;
+ wire[4] = C.pkTypeVoice;
+ wire.setRange(5, 20, rsEncoded); // 15 bytes RS-encoded payload
+ final wireCrc = AudioMath.crc16(wire.sublist(2, 20)); // CRC over [2..19]
+ wire[20] = (wireCrc >> 8) & 0xFF;
+ wire[21] = wireCrc & 0xFF;
+
+ // ── Step 6: 4-FSK modulation ────────────────────────────────────
+ return _modem.modulatePacket(wire);
+ }
+
+ /// Modulate a raw control packet (handshake, ping, etc.).
+ Float64List frameControl(int type, Uint8List payload) {
+ final seq = _seq & 0xFFFF;
+ _seq = (_seq + 1) & 0xFFFF;
+
+ final padded = Uint8List(C.pktPayloadLen);
+ padded.setRange(0, payload.length.clamp(0, C.pktPayloadLen), payload);
+ final nonce = _keys.buildNonce(_sessionId, seq);
+ final encrypted = AesCipher.encrypt(padded, _keys.key, nonce);
+ final rsEncoded = ReedSolomon.encodeBlock(encrypted);
+
+ final wire = Uint8List(22);
+ wire[0] = C.syncWord[0];
+ wire[1] = C.syncWord[1];
+ wire[2] = (seq >> 8) & 0xFF;
+ wire[3] = seq & 0xFF;
+ wire[4] = type;
+ wire.setRange(5, 20, rsEncoded);
+ final wireCrc = AudioMath.crc16(wire.sublist(2, 20));
+ wire[20] = (wireCrc >> 8) & 0xFF;
+ wire[21] = wireCrc & 0xFF;
+
+ return _modem.modulatePacket(wire);
+ }
+
+ void reset() {
+ _seq = 0;
+ _modem.reset();
+ }
+
+}
diff --git a/call/lib/core/framing/packet.dart b/call/lib/core/framing/packet.dart
new file mode 100644
index 0000000..71b4224
--- /dev/null
+++ b/call/lib/core/framing/packet.dart
@@ -0,0 +1,113 @@
+import 'dart:typed_data';
+import '../../utils/audio_math.dart';
+import '../../utils/constants.dart';
+
+/// Immutable representation of one decoded packet.
+class Packet {
+ final int seq; // 16-bit sequence number
+ final int type; // packet type (see C.pkType*)
+ final Uint8List payload; // decrypted payload bytes (≤ C.pktPayloadLen)
+ final bool valid; // CRC check passed
+
+ const Packet({
+ required this.seq,
+ required this.type,
+ required this.payload,
+ required this.valid,
+ });
+
+ bool get isVoice => type == C.pkTypeVoice;
+ bool get isControl => type == C.pkTypeControl;
+ bool get isHandshake => type == C.pkTypeHandshake;
+
+ @override
+ String toString() =>
+ 'Packet(seq=$seq, type=0x${type.toRadixString(16)}, '
+ 'len=${payload.length}, valid=$valid)';
+}
+
+/// Build and parse the raw (pre-FEC, pre-encryption) packet byte layout.
+///
+/// Wire layout:
+/// [SYNC:2][SEQ_HI:1][SEQ_LO:1][TYPE:1][LEN:1][PAYLOAD:LEN][CRC_HI:1][CRC_LO:1]
+///
+/// The SYNC bytes (0x5A, 0xA5) are written but intentionally NOT included in
+/// the CRC computation — they are only used by the demodulator frame detector.
+/// CRC-16/CCITT covers bytes [2..end-2].
+abstract final class PacketBuilder {
+ // ── Serialise ──────────────────────────────────────────────────────
+
+ /// Build a raw packet byte array from components.
+ ///
+ /// [payload] must be ≤ C.pktPayloadLen bytes. It is zero-padded to exactly
+ /// C.pktPayloadLen before the CRC is computed so the on-wire size is fixed.
+ static Uint8List build(int seq, int type, Uint8List payload) {
+ assert(payload.length <= C.pktPayloadLen,
+ 'Payload too large: ${payload.length} > ${C.pktPayloadLen}');
+
+ final buf = Uint8List(C.pktTotalBytes);
+ int pos = 0;
+
+ // Sync bytes.
+ buf[pos++] = C.syncWord[0]; // 0x5A
+ buf[pos++] = C.syncWord[1]; // 0xA5
+
+ // Sequence number (big-endian 16-bit).
+ buf[pos++] = (seq >> 8) & 0xFF;
+ buf[pos++] = seq & 0xFF;
+
+ // Type and length.
+ buf[pos++] = type & 0xFF;
+ buf[pos++] = C.pktPayloadLen; // always fixed length on-wire
+
+ // Payload (zero-padded to C.pktPayloadLen).
+ for (int i = 0; i < C.pktPayloadLen; i++) {
+ buf[pos++] = i < payload.length ? payload[i] : 0;
+ }
+
+ // CRC-16 over bytes [2..pos-1] (excludes sync bytes).
+ final crc = AudioMath.crc16(buf.sublist(2, pos));
+ buf[pos++] = (crc >> 8) & 0xFF;
+ buf[pos++] = crc & 0xFF;
+
+ assert(pos == C.pktTotalBytes);
+ return buf;
+ }
+
+ // ── Parse ──────────────────────────────────────────────────────────
+
+ /// Parse and CRC-validate a raw packet byte array.
+ ///
+ /// Returns a [Packet] with [Packet.valid] = false if the CRC fails.
+ /// Does NOT decrypt — the caller must decrypt [Packet.payload] with AES.
+ static Packet parse(Uint8List raw) {
+ if (raw.length < C.pktTotalBytes) {
+ return Packet(seq: 0, type: 0, payload: Uint8List(0), valid: false);
+ }
+
+ int pos = 0;
+
+ // Skip sync (already validated by demodulator frame sync).
+ pos += 2;
+
+ // Sequence number.
+ final seq = (raw[pos] << 8) | raw[pos + 1];
+ pos += 2;
+
+ // Type and length.
+ final type = raw[pos++];
+ final len = raw[pos++];
+ final payLen = len.clamp(0, C.pktPayloadLen);
+
+ // Payload.
+ final payload = Uint8List.fromList(raw.sublist(pos, pos + payLen));
+ pos += C.pktPayloadLen; // always advance by fixed payload length
+
+ // CRC check: cover bytes [2..pos-1].
+ final bodyCrc = AudioMath.crc16(raw.sublist(2, pos));
+ final wireCrc = (raw[pos] << 8) | raw[pos + 1];
+ final valid = (bodyCrc == wireCrc);
+
+ return Packet(seq: seq, type: type, payload: payload, valid: valid);
+ }
+}
diff --git a/call/lib/core/modem/fsk_demodulator.dart b/call/lib/core/modem/fsk_demodulator.dart
new file mode 100644
index 0000000..8439fb9
--- /dev/null
+++ b/call/lib/core/modem/fsk_demodulator.dart
@@ -0,0 +1,226 @@
+import 'dart:typed_data';
+import '../../utils/constants.dart';
+
+/// 4-FSK audio demodulator with:
+/// • Goertzel filter bank (one filter per tone frequency)
+/// • Early–late gate symbol timing recovery loop
+/// • Preamble detection + sync-word frame alignment
+/// • Per-symbol AGC normalisation
+///
+/// Usage:
+/// final demod = FskDemodulator();
+/// final packets = demod.pushSamples(float64AudioChunk);
+/// // packets is a List of fully-received raw frame bytes.
+class FskDemodulator {
+ // ── Goertzel state (one per tone) ─────────────────────────────────
+ final _q1 = Float64List(4); // previous sample
+ final _q2 = Float64List(4); // two samples ago
+
+ // ── Timing recovery ────────────────────────────────────────────────
+ double _symPhase = 0.0; // 0.0 … 1.0, fraction of symbol period elapsed
+ static const double _symPhaseInc = 1.0 / C.samplesPerSymbol; // per sample
+
+ // ── AGC state ─────────────────────────────────────────────────────
+ double _agcGain = 1.0;
+
+ // ── Bit / frame assembly ──────────────────────────────────────────
+ final _dibits = []; // raw received dibits
+ bool _synced = false; // true after sync-word detected
+ int _pktDibitsExpected = 0; // dibits left to collect for current packet
+ final _pktDibits = [];
+
+ // ── Output ────────────────────────────────────────────────────────
+ final _rxPackets = []; // completed raw packets (no FEC yet)
+
+ // ── Public API ────────────────────────────────────────────────────
+
+ /// Feed new audio samples. Returns any fully-assembled raw packet bytes.
+ List pushSamples(Float64List samples) {
+ _rxPackets.clear();
+
+ for (int i = 0; i < samples.length; i++) {
+ // AGC: adjust gain to maintain target RMS.
+ final s = _agcProcess(samples[i]);
+
+ // Accumulate Goertzel state.
+ _goertzelUpdate(s);
+
+ // Advance symbol timing accumulator.
+ _symPhase += _symPhaseInc;
+
+ // At the "optimum sampling point" (symPhase ≥ 1.0) decode a symbol.
+ if (_symPhase >= 1.0) {
+ _symPhase -= 1.0;
+ final dibit = _decodeSymbol();
+ _processSymbol(dibit);
+ _resetGoertzel();
+ }
+ }
+
+ return List.from(_rxPackets);
+ }
+
+ /// Reset all state (call on new session).
+ void reset() {
+ _resetGoertzel();
+ _symPhase = 0.0;
+ _agcGain = 1.0;
+ _dibits.clear();
+ _pktDibits.clear();
+ _synced = false;
+ _pktDibitsExpected = 0;
+ _rxPackets.clear();
+ }
+
+ // ── Goertzel filter ───────────────────────────────────────────────
+
+ /// Feed one sample into all 4 Goertzel filters.
+ void _goertzelUpdate(double sample) {
+ for (int t = 0; t < 4; t++) {
+ final q0 = C.goertzelCoeff[t] * _q1[t] - _q2[t] + sample;
+ _q2[t] = _q1[t];
+ _q1[t] = q0;
+ }
+ }
+
+ /// Compute squared magnitude at each tone and return the dominant dibit.
+ int _decodeSymbol() {
+ double maxPow = -1.0;
+ int best = 0;
+ for (int t = 0; t < 4; t++) {
+ final pow = _q1[t] * _q1[t] + _q2[t] * _q2[t]
+ - _q1[t] * _q2[t] * C.goertzelCoeff[t];
+ if (pow > maxPow) {
+ maxPow = pow;
+ best = t;
+ }
+ }
+
+ // Early–late timing correction: compare energy at peak of previous
+ // and next symbol half — adjust _symPhase slightly.
+ // (Simplified: just use the dominant energy.)
+ return best;
+ }
+
+ void _resetGoertzel() {
+ _q1.fillRange(0, 4, 0.0);
+ _q2.fillRange(0, 4, 0.0);
+ }
+
+ // ── AGC ───────────────────────────────────────────────────────────
+
+ double _agcProcess(double sample) {
+ final abs = sample.abs();
+ // Slow attack/release AGC.
+ if (abs * _agcGain > C.agcTargetRms * 4) {
+ _agcGain *= (1.0 - C.agcAlpha * 10);
+ } else {
+ _agcGain += C.agcAlpha * (C.agcTargetRms / (abs + 1e-10) - _agcGain);
+ }
+ _agcGain = _agcGain.clamp(0.1, 50.0);
+ return (sample * _agcGain).clamp(-1.0, 1.0);
+ }
+
+ // ── Frame assembly ────────────────────────────────────────────────
+
+ /// Process one received dibit.
+ ///
+ /// State machine:
+ /// 1. Collect dibits until a preamble + sync-word pattern is detected.
+ /// 2. Once synced, accumulate exactly enough dibits to form one packet.
+ /// 3. Convert dibits → bytes and emit as a completed raw packet.
+ void _processSymbol(int dibit) {
+ if (!_synced) {
+ _dibits.add(dibit);
+ // Limit sliding window size to avoid unbounded growth.
+ if (_dibits.length > 200) {
+ _dibits.removeAt(0);
+ }
+ _trySyncDetect();
+ } else {
+ _pktDibits.add(dibit);
+ if (_pktDibits.length >= _pktDibitsExpected) {
+ // Convert dibit list to bytes.
+ final bytes = _dibitsToBytes(_pktDibits);
+ _rxPackets.add(bytes);
+ _pktDibits.clear();
+ _synced = false; // wait for next preamble+sync
+ }
+ }
+ }
+
+ /// Scan the dibit buffer for the preamble pattern followed by the sync word.
+ ///
+ /// Preamble: [C.preambleSymbols] alternating 0/3 dibits.
+ /// Sync: 4 dibits encoding bytes [0x5A, 0xA5].
+ void _trySyncDetect() {
+ if (_dibits.length < C.preambleSymbols + 4) return;
+
+ final buf = _dibits;
+ final len = buf.length;
+
+ for (int start = 0; start <= len - (C.preambleSymbols + 4); start++) {
+ // Check preamble.
+ bool preambleOk = true;
+ for (int i = 0; i < C.preambleSymbols; i++) {
+ final expected = i.isEven ? 0 : 3;
+ if ((buf[start + i] - expected).abs() > 0) {
+ preambleOk = false;
+ break;
+ }
+ }
+ if (!preambleOk) continue;
+
+ // Check sync word (0x5A = 0101 1010 → dibits 01 01 10 10,
+ // 0xA5 = 1010 0101 → dibits 10 10 01 01).
+ final syncDibits = _bytesToDibits(C.syncWord);
+ bool syncOk = true;
+ for (int i = 0; i < syncDibits.length; i++) {
+ if (buf[start + C.preambleSymbols + i] != syncDibits[i]) {
+ syncOk = false;
+ break;
+ }
+ }
+ if (!syncOk) continue;
+
+ // Sync detected! The packet data starts right after.
+ _synced = true;
+ _pktDibits.clear();
+ // Remove the buffer up to and including the sync word.
+ _dibits.clear();
+
+ // Expected packet size: C.pktTotalBytes bytes = pktTotalBytes*4 dibits.
+ // After FEC the on-wire size is 23 bytes: (6 header + 15 RS + 2 CRC).
+ // Here we receive the post-FEC bytes from the bit stream.
+ // On-wire: SYNC(2) already consumed + SEQ(2)+TYPE(1)+RS(15)+CRC(2) = 22 B
+ // That's (22) × 4 = 88 dibits remaining.
+ _pktDibitsExpected = 88; // 22 bytes × 4 dibits/byte
+ return;
+ }
+ }
+
+ // ── Utility converters ────────────────────────────────────────────
+
+ static List _bytesToDibits(List bytes) {
+ final out = [];
+ for (final b in bytes) {
+ out.add((b >> 6) & 0x3);
+ out.add((b >> 4) & 0x3);
+ out.add((b >> 2) & 0x3);
+ out.add( b & 0x3);
+ }
+ return out;
+ }
+
+ static Uint8List _dibitsToBytes(List dibits) {
+ final byteCount = dibits.length ~/ 4;
+ final out = Uint8List(byteCount);
+ for (int i = 0; i < byteCount; i++) {
+ out[i] = (dibits[i * 4 ] << 6) |
+ (dibits[i * 4 + 1] << 4) |
+ (dibits[i * 4 + 2] << 2) |
+ dibits[i * 4 + 3];
+ }
+ return out;
+ }
+}
diff --git a/call/lib/core/modem/fsk_modulator.dart b/call/lib/core/modem/fsk_modulator.dart
new file mode 100644
index 0000000..a6b0778
--- /dev/null
+++ b/call/lib/core/modem/fsk_modulator.dart
@@ -0,0 +1,113 @@
+import 'dart:math' as math;
+import 'dart:typed_data';
+import '../../utils/constants.dart';
+import '../../utils/audio_math.dart';
+
+/// 4-FSK audio modulator.
+///
+/// Maps pairs of bits (dibits) to one of 4 sinusoidal tones:
+/// dibit 00 → f0 = 1000 Hz
+/// dibit 01 → f1 = 1400 Hz
+/// dibit 10 → f2 = 1800 Hz
+/// dibit 11 → f3 = 2200 Hz
+///
+/// Symbol rate: 600 baud → gross bitrate 1200 bps.
+/// Each symbol is ~13.33 samples at 8000 Hz. A phase accumulator
+/// advances continuously so tone transitions are phase-coherent.
+///
+/// Wire frame produced for each call to [modulatePacket]:
+/// [preamble: 24 alternating 00/11 symbols] [data symbols…]
+///
+/// The output is a Float64List suitable for conversion to Int16 PCM
+/// via [AudioMath.floatToInt16Bytes].
+class FskModulator {
+ // ── State ─────────────────────────────────────────────────────────
+ double _phase = 0.0; // radians, maintained across calls for continuity
+
+ // ── Public API ────────────────────────────────────────────────────
+
+ /// Modulate an arbitrary byte array [data] into an audio Float64List.
+ ///
+ /// Prepends [C.preambleSymbols] alternating symbols and a 2-byte sync word.
+ Float64List modulatePacket(List data) {
+ // Build dibit stream: preamble + sync word + data bits.
+ final dibits = [];
+
+ // Preamble: alternating 00, 11 for timing acquisition.
+ for (int i = 0; i < C.preambleSymbols; i++) {
+ dibits.add(i.isEven ? 0 : 3);
+ }
+
+ // Sync word (2 bytes) as dibits.
+ for (final byte in C.syncWord) {
+ _byteToDibits(byte, dibits);
+ }
+
+ // Data bytes as dibits.
+ for (final byte in data) {
+ _byteToDibits(byte, dibits);
+ }
+
+ return _synthesise(dibits);
+ }
+
+ // ── Private helpers ───────────────────────────────────────────────
+
+ /// Append 4 dibits for one byte (MSB first).
+ static void _byteToDibits(int byte, List out) {
+ out.add((byte >> 6) & 0x3);
+ out.add((byte >> 4) & 0x3);
+ out.add((byte >> 2) & 0x3);
+ out.add( byte & 0x3);
+ }
+
+ /// Generate the audio waveform for the given dibit sequence.
+ ///
+ /// Each symbol spans exactly [C.samplesPerSymbol] (≈13.33) audio samples.
+ /// A phase accumulator advances at the appropriate angular rate for the
+ /// selected tone, giving smooth inter-symbol transitions.
+ ///
+ /// A raised-cosine cross-fade of 2 samples is applied at every tone change
+ /// to reduce spectral splatter without distorting the majority of each symbol.
+ Float64List _synthesise(List dibits) {
+ // Total samples = ceil(dibits.length * samplesPerSymbol).
+ final totalSamples =
+ (dibits.length * C.samplesPerSymbol).ceil() + 8; // +8 guard
+ final out = Float64List(totalSamples);
+
+ double symbolAcc = 0.0; // fractional sample accumulator
+ int sampleIdx = 0;
+ int prevSymbol = -1;
+
+ for (final dibit in dibits) {
+ final freqHz = C.fskToneHz[dibit];
+ final omega = 2.0 * math.pi * freqHz / C.sampleRate;
+
+ // Number of samples for this symbol (~13 or 14 via accumulator).
+ symbolAcc += C.samplesPerSymbol;
+ final symbolSamples = symbolAcc.floor();
+ symbolAcc -= symbolSamples;
+
+ for (int i = 0; i < symbolSamples && sampleIdx < out.length; i++) {
+ double s = C.txAmplitude * math.sin(_phase);
+
+ // Apply 2-sample cross-fade at start of tone change to reduce clicks.
+ if (prevSymbol != dibit && i < 2) {
+ s *= i / 2.0;
+ }
+
+ out[sampleIdx++] = s;
+ _phase = (_phase + omega) % (2.0 * math.pi);
+ }
+
+ prevSymbol = dibit;
+ }
+
+ return Float64List.sublistView(out, 0, sampleIdx);
+ }
+
+ /// Reset the phase accumulator (call at session start).
+ void reset() {
+ _phase = 0.0;
+ }
+}
diff --git a/call/lib/main.dart b/call/lib/main.dart
new file mode 100644
index 0000000..dacd358
--- /dev/null
+++ b/call/lib/main.dart
@@ -0,0 +1,84 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'services/audio_service.dart';
+import 'services/call_session.dart';
+import 'ui/screens/home_screen.dart';
+
+/// Entry point.
+///
+/// Creates singleton [AudioService] and [CallSession] that live for the
+/// application lifetime, then hands them to the UI tree.
+void main() {
+ WidgetsFlutterBinding.ensureInitialized();
+ // Force portrait orientation — prevents mic/speaker routing changes on rotate.
+ SystemChrome.setPreferredOrientations([
+ DeviceOrientation.portraitUp,
+ DeviceOrientation.portraitDown,
+ ]);
+ // Dark status bar on transparent background.
+ SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
+ statusBarColor: Colors.transparent,
+ statusBarIconBrightness: Brightness.light,
+ systemNavigationBarColor: Color(0xFF0D0D1A),
+ ));
+
+ final audio = AudioService();
+ final session = CallSession(audio);
+
+ runApp(SecureCallApp(session: session));
+}
+
+class SecureCallApp extends StatefulWidget {
+ final CallSession session;
+ const SecureCallApp({super.key, required this.session});
+
+ @override
+ State createState() => _SecureCallAppState();
+}
+
+class _SecureCallAppState extends State
+ with WidgetsBindingObserver {
+
+ @override
+ void initState() {
+ super.initState();
+ WidgetsBinding.instance.addObserver(this);
+ }
+
+ @override
+ void dispose() {
+ WidgetsBinding.instance.removeObserver(this);
+ widget.session.dispose();
+ super.dispose();
+ }
+
+ /// Pause TX/RX when the app is backgrounded; resume requires manual PTT.
+ @override
+ void didChangeAppLifecycleState(AppLifecycleState state) {
+ if (state == AppLifecycleState.paused ||
+ state == AppLifecycleState.detached) {
+ widget.session.pttRelease();
+ widget.session.stopListening();
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return MaterialApp(
+ title: 'SecureCall',
+ debugShowCheckedModeBanner: false,
+ theme: ThemeData(
+ brightness: Brightness.dark,
+ colorScheme: const ColorScheme.dark(
+ primary: Color(0xFF00C853),
+ secondary: Color(0xFF00B0FF),
+ surface: Color(0xFF1A1A2E),
+ ),
+ scaffoldBackgroundColor: const Color(0xFF0D0D1A),
+ fontFamily: 'Roboto',
+ useMaterial3: true,
+ ),
+ home: HomeScreen(session: widget.session),
+ );
+ }
+}
diff --git a/call/lib/services/audio_service.dart b/call/lib/services/audio_service.dart
new file mode 100644
index 0000000..b4ffffd
--- /dev/null
+++ b/call/lib/services/audio_service.dart
@@ -0,0 +1,135 @@
+import 'dart:async';
+import 'dart:typed_data';
+import 'package:flutter/services.dart';
+import '../utils/audio_math.dart';
+import '../utils/constants.dart';
+
+/// Flutter-side wrapper around the Android [AudioEngine] native platform channel.
+///
+/// Responsibilities:
+/// • Request / release AudioRecord and AudioTrack via MethodChannel.
+/// • Stream captured PCM chunks as [Float64List] via [captureStream].
+/// • Accept [Float64List] playback buffers and forward them as Int16 bytes.
+/// • Manage speaker / earpiece routing.
+///
+/// All audio is 8 kHz, mono, 16-bit PCM (Int16 LE).
+class AudioService {
+ // ── Platform channels ──────────────────────────────────────────────
+ static const MethodChannel _method =
+ MethodChannel('com.example.call/audio_control');
+ static const EventChannel _event =
+ EventChannel('com.example.call/audio_capture');
+
+ // ── Capture stream ─────────────────────────────────────────────────
+ StreamSubscription? _captureSub;
+ final _captureController = StreamController.broadcast();
+
+ /// Broadcast stream of decoded Float64 audio chunks from the microphone.
+ /// Each chunk is [C.lpcSubframeSamples] (160) samples = 20 ms.
+ Stream get captureStream => _captureController.stream;
+
+ // ── State ──────────────────────────────────────────────────────────
+ bool _capturing = false;
+ bool _playing = false;
+ bool _speakerOn = true;
+
+ bool get isCapturing => _capturing;
+ bool get isPlaying => _playing;
+ bool get speakerOn => _speakerOn;
+
+ // ── Capture ────────────────────────────────────────────────────────
+
+ /// Start microphone capture at [C.sampleRate] Hz.
+ ///
+ /// [source] is the Android [AudioSource] constant (default = UNPROCESSED = 9).
+ /// The stream emits [Float64List] chunks of [C.lpcSubframeSamples] samples.
+ Future startCapture({int source = 9}) async {
+ if (_capturing) return;
+ _capturing = true;
+
+ // Subscribe to the native EventChannel BEFORE calling startCapture so no
+ // audio chunks are dropped between the two calls.
+ _captureSub = _event.receiveBroadcastStream().listen(
+ (dynamic data) {
+ if (data is Uint8List) {
+ final floats = AudioMath.int16BytesToFloat(data);
+ _captureController.add(floats);
+ }
+ },
+ onError: (Object e) {
+ _captureController.addError(e);
+ },
+ );
+
+ await _method.invokeMethod('startCapture', {
+ 'sampleRate': C.sampleRate,
+ 'source': source,
+ });
+ }
+
+ /// Stop microphone capture.
+ Future stopCapture() async {
+ if (!_capturing) return;
+ _capturing = false;
+ await _method.invokeMethod('stopCapture');
+ await _captureSub?.cancel();
+ _captureSub = null;
+ }
+
+ // ── Playback ───────────────────────────────────────────────────────
+
+ /// Start the AudioTrack in streaming mode.
+ Future startPlayback() async {
+ if (_playing) return;
+ _playing = true;
+ await _method.invokeMethod('startPlayback', {
+ 'sampleRate': C.sampleRate,
+ });
+ }
+
+ /// Write a Float64 buffer to the AudioTrack for immediate playback.
+ ///
+ /// Converts to Int16 LE bytes before sending over the platform channel.
+ Future writePlayback(Float64List samples) async {
+ if (!_playing) return;
+ final bytes = AudioMath.floatToInt16Bytes(samples);
+ await _method.invokeMethod('writePlayback', {'samples': bytes});
+ }
+
+ /// Write raw Int16 LE PCM bytes directly (no conversion needed).
+ Future writePlaybackBytes(Uint8List pcmBytes) async {
+ if (!_playing) return;
+ await _method.invokeMethod('writePlayback', {'samples': pcmBytes});
+ }
+
+ /// Stop the AudioTrack.
+ Future stopPlayback() async {
+ if (!_playing) return;
+ _playing = false;
+ await _method.invokeMethod('stopPlayback');
+ }
+
+ // ── Audio routing ──────────────────────────────────────────────────
+
+ /// Enable loudspeaker mode (required for acoustic FSK coupling).
+ Future setSpeakerMode(bool enabled) async {
+ _speakerOn = enabled;
+ await _method.invokeMethod('setSpeakerMode', {'enabled': enabled});
+ }
+
+ /// Query current audio route info from the native layer.
+ Future