connection fixes

This commit is contained in:
2025-10-06 09:41:23 +09:00
parent 4ceccae6ce
commit fa55367e68
361 changed files with 24633 additions and 6206 deletions

View File

@@ -0,0 +1,2 @@
#Sun Oct 05 11:59:43 KST 2025
gradle.version=8.9

View File

@@ -1,62 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="7.2.2" />
<option name="LAST_KNOWN_AGP_VERSION" value="7.2.2" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
<facet type="kotlin-language" name="Kotlin">
<configuration version="5" platform="JVM 1.8" allPlatforms="JVM [1.8]" useProjectSettings="false">
<compilerSettings>
<option name="additionalArguments" value="-java-parameters" />
</compilerSettings>
<compilerArguments>
<stringArguments>
<stringArg name="jvmTarget" arg="1.8" />
</stringArguments>
</compilerArguments>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/build/intermediates/javac/debug/classes" />
<output-test url="file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/kotlin" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="jdk" jdkName="Android API 32 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="Gradle: androidx.core:core-ktx:1.8.0@aar" level="project" />
<orderEntry type="library" exported="" name="Gradle: androidx.appcompat:appcompat:1.5.0@aar" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.google.android.material:material:1.6.1@aar" level="project" />
<orderEntry type="library" exported="" name="Gradle: androidx.constraintlayout:constraintlayout:2.1.4@aar" level="project" />
</component>
</module>

View File

@@ -1,29 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# WebRTC ProGuard rules
-keep class org.webrtc.** { *; }
-dontwarn org.webrtc.**
# Socket.IO ProGuard rules
-keep class io.socket.** { *; }
-dontwarn io.socket.**

View File

@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- Permissions -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<!-- Hardware features -->
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="true" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.GodEye"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -32,7 +32,6 @@ class SocketManager(
sock.on(Socket.EVENT_CONNECT, onConnect)
sock.on(Socket.EVENT_DISCONNECT, onDisconnect)
sock.on(Socket.EVENT_CONNECT_ERROR, onConnectError)
sock.on("server:hello", createServerHelloHandler(availableCameras))
sock.on("register:success", onRegisterSuccess)
sock.on("register:error", onRegisterError)
sock.on("camera:request", onCameraRequestReceived)
@@ -43,6 +42,22 @@ class SocketManager(
sock.on("webrtc:ice-candidate", onWebRTCIceCandidate)
sock.connect()
// Регистрация устройства
val deviceInfo = JSONObject().apply {
put("model", android.os.Build.MODEL)
put("manufacturer", android.os.Build.MANUFACTURER)
put("androidVersion", android.os.Build.VERSION.RELEASE)
put("appVersion", "1.0.0")
put("availableCameras", JSONArray(availableCameras))
}
val registerData = JSONObject().apply {
put("deviceId", deviceId)
put("deviceInfo", deviceInfo)
}
sock.emit("register:android", registerData)
}
} catch (e: Exception) {
Log.e(TAG, "Connection error", e)
@@ -61,7 +76,11 @@ class SocketManager(
val response = JSONObject().apply {
put("sessionId", sessionId)
put("accepted", accepted)
put("message", if (accepted) "Доступ разрешен" else "Доступ отклонен")
if (accepted) {
put("streamUrl", "webrtc")
} else {
put("error", "Доступ отклонен пользователем")
}
}
socket?.emit("camera:response", response)
Log.d(TAG, "Camera request response sent: $accepted")

View File

@@ -1,13 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#ffffff"
android:pathData="M54,30c-13.3,0 -24,10.7 -24,24s10.7,24 24,24s24,-10.7 24,-24S67.3,30 54,30zM54,70c-8.8,0 -16,-7.2 -16,-16s7.2,-16 16,-16s16,7.2 16,16S62.8,70 54,70z"/>
<path android:fillColor="#ffffff"
android:pathData="M54,38c-8.8,0 -16,7.2 -16,16s7.2,16 16,16s16,-7.2 16,-16S62.8,38 54,38zM54,62c-4.4,0 -8,-3.6 -8,-8s3.6,-8 8,-8s8,3.6 8,8S58.4,62 54,62z"/>
</vector>

View File

@@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/android-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal">
<!-- Header -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GodEye Signal Center"
android:textSize="24sp"
android:textStyle="bold"
android:layout_marginBottom="24dp"
android:textColor="@color/design_default_color_primary" />
<!-- Device Info -->
<TextView
android:id="@+id/tvDeviceId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Device ID: ..."
android:textSize="14sp"
android:background="@color/design_default_color_surface"
android:padding="12dp"
android:layout_marginBottom="16dp" />
<!-- Connection Status -->
<TextView
android:id="@+id/tvStatus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Отключено"
android:textSize="16sp"
android:textStyle="bold"
android:textAlignment="center"
android:padding="12dp"
android:background="@color/design_default_color_surface"
android:layout_marginBottom="24dp" />
<!-- Server Configuration -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Настройки сервера"
android:textSize="18sp"
android:textStyle="bold"
android:layout_marginBottom="8dp" />
<EditText
android:id="@+id/etServerUrl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="URL сервера (например: http://192.168.1.100:3001)"
android:inputType="textUri"
android:layout_marginBottom="16dp" />
<!-- Control Buttons -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginBottom="32dp">
<Button
android:id="@+id/btnConnect"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Подключиться"
android:layout_marginEnd="8dp" />
<Button
android:id="@+id/btnDisconnect"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Отключиться"
android:layout_marginStart="8dp"
android:enabled="false" />
</LinearLayout>
<!-- Active Sessions -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Активные сессии"
android:textSize="18sp"
android:textStyle="bold"
android:layout_marginBottom="8dp" />
<LinearLayout
android:id="@+id/rvSessions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/design_default_color_surface"
android:padding="16dp"
android:minHeight="100dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Нет активных сессий"
android:textAlignment="center"
android:textColor="@android:color/darker_gray" />
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<!-- Custom colors -->
<color name="status_background">#E3F2FD</color>
<color name="video_background">#212121</color>
<color name="error_color">#F44336</color>
<color name="success_color">#4CAF50</color>
</resources>

View File

@@ -1,4 +0,0 @@
<resources>
<color name="ic_launcher_background">#3DDC84</color>
</resources>

View File

@@ -1,14 +0,0 @@
<resources>
<string name="app_name">GodEye Signal Center</string>
<string name="permission_denied_title">Необходимы разрешения</string>
<string name="permission_denied_message">Для работы приложения необходим доступ к камере, микрофону и интернету</string>
<string name="camera_request_title">Запрос доступа к камере</string>
<string name="camera_request_message">Оператор %1$s запрашивает доступ к камере %2$s. Разрешить?</string>
<string name="allow">Разрешить</string>
<string name="deny">Отклонить</string>
<string name="connecting">Подключение...</string>
<string name="connected">Подключено</string>
<string name="disconnected">Отключено</string>
<string name="error">Ошибка</string>
</resources>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.GodEye" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/design_default_color_primary</item>
<item name="colorPrimaryVariant">@color/design_default_color_primary_variant</item>
<item name="colorOnPrimary">@color/design_default_color_on_primary</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/design_default_color_secondary</item>
<item name="colorSecondaryVariant">@color/design_default_color_secondary_variant</item>
<item name="colorOnSecondary">@color/design_default_color_on_secondary</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<!-- Exclude sensitive data from backup -->
<exclude domain="sharedpref" path="secure_prefs.xml"/>
</full-backup-content>

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>