diff --git a/.gradle/8.11.1/executionHistory/executionHistory.bin b/.gradle/8.11.1/executionHistory/executionHistory.bin index 606a4a2..cd8ecb3 100644 Binary files a/.gradle/8.11.1/executionHistory/executionHistory.bin and b/.gradle/8.11.1/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.11.1/executionHistory/executionHistory.lock b/.gradle/8.11.1/executionHistory/executionHistory.lock index c094619..4aa6ea3 100644 Binary files a/.gradle/8.11.1/executionHistory/executionHistory.lock and b/.gradle/8.11.1/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.11.1/fileHashes/fileHashes.bin b/.gradle/8.11.1/fileHashes/fileHashes.bin index a4ce77e..529828b 100644 Binary files a/.gradle/8.11.1/fileHashes/fileHashes.bin and b/.gradle/8.11.1/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.11.1/fileHashes/fileHashes.lock b/.gradle/8.11.1/fileHashes/fileHashes.lock index 2233a4d..bb72d5a 100644 Binary files a/.gradle/8.11.1/fileHashes/fileHashes.lock and b/.gradle/8.11.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.11.1/fileHashes/resourceHashesCache.bin b/.gradle/8.11.1/fileHashes/resourceHashesCache.bin index 524b580..14a90fd 100644 Binary files a/.gradle/8.11.1/fileHashes/resourceHashesCache.bin and b/.gradle/8.11.1/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index b76e6cd..9c826ae 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/app/build.gradle b/app/build.gradle index 0a7eb50..cd95db4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.soniox.remotemic" minSdk 24 targetSdk 34 - versionCode 2 - versionName "1.001" + versionCode 3 + versionName "1.002" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/build/intermediates/dex/debug/mergeProjectDexDebug/5/classes.dex b/app/build/intermediates/dex/debug/mergeProjectDexDebug/5/classes.dex index 888688f..6d41066 100644 Binary files a/app/build/intermediates/dex/debug/mergeProjectDexDebug/5/classes.dex and b/app/build/intermediates/dex/debug/mergeProjectDexDebug/5/classes.dex differ diff --git a/app/build/intermediates/incremental/packageDebug/tmp/debug/dex-renamer-state.txt b/app/build/intermediates/incremental/packageDebug/tmp/debug/dex-renamer-state.txt index b8303c4..a08c53a 100644 --- a/app/build/intermediates/incremental/packageDebug/tmp/debug/dex-renamer-state.txt +++ b/app/build/intermediates/incremental/packageDebug/tmp/debug/dex-renamer-state.txt @@ -1,4 +1,4 @@ -#Tue Aug 25 18:43:45 UTC 2026 +#Tue Aug 25 18:54:13 UTC 2026 path.3=5/classes.dex path.2=10/classes.dex path.1=0/classes.dex diff --git a/app/build/intermediates/incremental/packageDebug/tmp/debug/zip-cache/androidResources b/app/build/intermediates/incremental/packageDebug/tmp/debug/zip-cache/androidResources index b0fddb9..84ddcca 100644 Binary files a/app/build/intermediates/incremental/packageDebug/tmp/debug/zip-cache/androidResources and b/app/build/intermediates/incremental/packageDebug/tmp/debug/zip-cache/androidResources differ diff --git a/app/build/intermediates/manifest_merge_blame_file/debug/processDebugMainManifest/manifest-merger-blame-debug-report.txt b/app/build/intermediates/manifest_merge_blame_file/debug/processDebugMainManifest/manifest-merger-blame-debug-report.txt index 18c172e..18b6f48 100644 --- a/app/build/intermediates/manifest_merge_blame_file/debug/processDebugMainManifest/manifest-merger-blame-debug-report.txt +++ b/app/build/intermediates/manifest_merge_blame_file/debug/processDebugMainManifest/manifest-merger-blame-debug-report.txt @@ -1,8 +1,8 @@ 1 2 +4 android:versionCode="3" +5 android:versionName="1.002" > 6 7 + android:versionCode="3" + android:versionName="1.002" > + android:versionCode="3" + android:versionName="1.002" > + android:versionCode="3" + android:versionName="1.002" > ,7R!*/$T19# \ No newline at end of file +ƋPUX!*!ëok )9Č,29O*3&%).$ň!,э/I#05IӶ#<3-%ط$/(>,7R!*/$T19#͡*/4#; \ No newline at end of file diff --git a/app/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i b/app/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i index ee9c3d9..ef0a3ea 100644 Binary files a/app/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i and b/app/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i differ diff --git a/app/build/kotlin/compileDebugKotlin/cacheable/last-build.bin b/app/build/kotlin/compileDebugKotlin/cacheable/last-build.bin index 407e62f..fb60344 100644 Binary files a/app/build/kotlin/compileDebugKotlin/cacheable/last-build.bin and b/app/build/kotlin/compileDebugKotlin/cacheable/last-build.bin differ diff --git a/app/build/kotlin/compileDebugKotlin/local-state/build-history.bin b/app/build/kotlin/compileDebugKotlin/local-state/build-history.bin index a371a93..46f55ff 100644 Binary files a/app/build/kotlin/compileDebugKotlin/local-state/build-history.bin and b/app/build/kotlin/compileDebugKotlin/local-state/build-history.bin differ diff --git a/app/build/outputs/apk/debug/app-debug.apk b/app/build/outputs/apk/debug/app-debug.apk index e121f1d..f8553e3 100644 Binary files a/app/build/outputs/apk/debug/app-debug.apk and b/app/build/outputs/apk/debug/app-debug.apk differ diff --git a/app/build/outputs/apk/debug/output-metadata.json b/app/build/outputs/apk/debug/output-metadata.json index d79520f..61e4181 100644 --- a/app/build/outputs/apk/debug/output-metadata.json +++ b/app/build/outputs/apk/debug/output-metadata.json @@ -11,8 +11,8 @@ "type": "SINGLE", "filters": [], "attributes": [], - "versionCode": 2, - "versionName": "1.001", + "versionCode": 3, + "versionName": "1.002", "outputFile": "app-debug.apk" } ], diff --git a/app/build/tmp/kotlin-classes/debug/com/soniox/remotemic/MainActivity.class b/app/build/tmp/kotlin-classes/debug/com/soniox/remotemic/MainActivity.class index 6231b91..d7fdc6d 100644 Binary files a/app/build/tmp/kotlin-classes/debug/com/soniox/remotemic/MainActivity.class and b/app/build/tmp/kotlin-classes/debug/com/soniox/remotemic/MainActivity.class differ diff --git a/app/build/tmp/kotlin-classes/debug/com/soniox/remotemic/StreamDictationClient.class b/app/build/tmp/kotlin-classes/debug/com/soniox/remotemic/StreamDictationClient.class index 3931782..5f3d880 100644 Binary files a/app/build/tmp/kotlin-classes/debug/com/soniox/remotemic/StreamDictationClient.class and b/app/build/tmp/kotlin-classes/debug/com/soniox/remotemic/StreamDictationClient.class differ diff --git a/app/src/main/java/com/soniox/remotemic/MainActivity.kt b/app/src/main/java/com/soniox/remotemic/MainActivity.kt index df240e7..9f5b5e0 100644 --- a/app/src/main/java/com/soniox/remotemic/MainActivity.kt +++ b/app/src/main/java/com/soniox/remotemic/MainActivity.kt @@ -121,8 +121,8 @@ class MainActivity : AppCompatActivity() { setupUI() checkPermissions() - binding.tvSubtitle.text = "همگام‌سازی زنده و تایپ صوتی بیسیم (v1.001)" - AppLogger.log("Main", "اپلیکیشن راه‌اندازی شد (v1.001 - استریم زنده دورنگ در اینپوت‌باکس)") + binding.tvSubtitle.text = "همگام‌سازی زنده و تایپ صوتی بیسیم (v1.002)" + AppLogger.log("Main", "اپلیکیشن راه‌اندازی شد (v1.002 - همگام‌سازی دوطرفه شفاف و لاگ‌های تشخیصی)") // Initialize Collaborative WebSocket Client streamDictationClient = StreamDictationClient( diff --git a/app/src/main/java/com/soniox/remotemic/StreamDictationClient.kt b/app/src/main/java/com/soniox/remotemic/StreamDictationClient.kt index b6cb150..e0da430 100644 --- a/app/src/main/java/com/soniox/remotemic/StreamDictationClient.kt +++ b/app/src/main/java/com/soniox/remotemic/StreamDictationClient.kt @@ -71,6 +71,23 @@ class StreamDictationClient( connectWebSocket() } + private fun diagnoseDisconnectReason(t: Throwable): String { + val msg = t.message ?: t.javaClass.simpleName + return when { + msg.contains("Software caused connection abort", ignoreCase = true) -> + "قطع شدن سوکت به دلیل سوییچ اینترنت/تغییر مسیر شبکه گوشی (Software connection abort)" + msg.contains("failed to connect", ignoreCase = true) && msg.contains("after", ignoreCase = true) -> + "تایم‌اوت شبکه اپراتور موبایل (عدم پاسخگویی پورت در بازه زمانی تعیین‌شده)" + msg.contains("sent ping but didn't receive pong", ignoreCase = true) -> + "افت پکت‌های شبکه یا تاخیر پینگ بین گوشی و سرور (Ping/Pong timeout)" + msg.contains("Connection refused", ignoreCase = true) -> + "سرویس سرور در دسترس نیست یا متوقف شده (Connection refused)" + msg.contains("Network is unreachable", ignoreCase = true) || msg.contains("ENETUNREACH", ignoreCase = true) -> + "عدم دسترسی گوشی به اینترنت (Network unreachable)" + else -> msg + } + } + @Synchronized fun connectWebSocket() { if (isConnected.get() || isConnecting.get()) return @@ -110,6 +127,9 @@ class StreamDictationClient( val ts = json.optDouble("timestamp", System.currentTimeMillis() / 1000.0) val payload = SyncStatePayload(source, app, txt, cursor, sel, rev, ts) + if (source != "android") { + AppLogger.log("MacSync", "📥 دریافت وضعیت از مک [$app]: '${txt.take(30)}' (کرسر: $cursor)") + } mainHandler.post { onSyncStateReceived(payload) } return } @@ -151,7 +171,8 @@ class StreamDictationClient( } override fun onFailure(ws: WebSocket, t: Throwable, response: Response?) { - AppLogger.log(tag, "🔴 قطع سوکت: ${t.message}. تلاش مجدد...") + val diagnostic = diagnoseDisconnectReason(t) + AppLogger.log(tag, "🔴 قطع سوکت: $diagnostic. تلاش مجدد...") isConnecting.set(false) isConnected.set(false) webSocket = null