cfd314ffa2
Безопасность: - Сервер bind на loopback (127.0.0.1) вместо 0.0.0.0 - Лимит соединений: Semaphore(10) для защиты от DoS - Валидация fileSize: max 10 ГБ, reject при превышении - Валидация пути файла: canonicalPath must startWith downloadsDir - FileUtils.resolveUniqueFile: max counter 1000 - FileUtils.deleteIfExists: исправлен TOCTOU race - Скрытие путей в ошибках (не泄漏 internal paths) - Трансфер-история ограничена 50 записями - Таймаут сокета увеличен до 60 сек - compareAndSet для защиты от double-bind - require(file.exists()) в sendFile Сборка: - Android: APK подписан debug keystore (self-signed) - Android: конвертирован из library в application - macOS: AeroToss.app (113 МБ) + JAR (28 МБ) - LICENSE: GPLv3 Тесты: все 71+ проходят
132 lines
3.7 KiB
Kotlin
132 lines
3.7 KiB
Kotlin
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
|
|
|
plugins {
|
|
alias(libs.plugins.kotlin.multiplatform)
|
|
alias(libs.plugins.kotlin.serialization)
|
|
alias(libs.plugins.compose.multiplatform)
|
|
alias(libs.plugins.compose.compiler)
|
|
alias(libs.plugins.android.application)
|
|
}
|
|
|
|
kotlin {
|
|
androidTarget {
|
|
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
|
compilerOptions {
|
|
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
|
}
|
|
}
|
|
|
|
jvm("desktop") {
|
|
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
|
compilerOptions {
|
|
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
val commonMain by getting {
|
|
dependencies {
|
|
implementation(compose.runtime)
|
|
implementation(compose.foundation)
|
|
implementation(compose.material3)
|
|
implementation(compose.materialIconsExtended)
|
|
implementation(compose.ui)
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
implementation(libs.kotlinx.serialization.json)
|
|
implementation(libs.ktor.client.core)
|
|
implementation(libs.ktor.network)
|
|
}
|
|
}
|
|
|
|
val commonTest by getting {
|
|
dependencies {
|
|
implementation(libs.kotlin.test)
|
|
implementation(libs.kotlinx.serialization.json)
|
|
}
|
|
}
|
|
|
|
val androidMain by getting {
|
|
dependencies {
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
implementation(libs.kotlinx.serialization.json)
|
|
implementation(libs.androidx.activity.compose)
|
|
}
|
|
}
|
|
|
|
val desktopMain by getting {
|
|
dependencies {
|
|
implementation(compose.desktop.common)
|
|
implementation(compose.desktop.currentOs)
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
implementation(libs.kotlinx.serialization.json)
|
|
implementation(libs.jmdns)
|
|
implementation(libs.junit)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace = "com.aerotoss"
|
|
compileSdk = 35
|
|
|
|
defaultConfig {
|
|
applicationId = "com.aerotoss"
|
|
minSdk = 24
|
|
targetSdk = 35
|
|
versionCode = 1
|
|
versionName = "1.0.0"
|
|
}
|
|
|
|
signingConfigs {
|
|
getByName("debug") {
|
|
storeFile = file("debug.keystore")
|
|
storePassword = "aerotoss123"
|
|
keyAlias = "aerotoss"
|
|
keyPassword = "aerotoss123"
|
|
}
|
|
create("release") {
|
|
storeFile = file("debug.keystore")
|
|
storePassword = "aerotoss123"
|
|
keyAlias = "aerotoss"
|
|
keyPassword = "aerotoss123"
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
signingConfig = signingConfigs.getByName("debug")
|
|
}
|
|
release {
|
|
signingConfig = signingConfigs.getByName("release")
|
|
isMinifyEnabled = false
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
lint {
|
|
abortOnError = false
|
|
checkReleaseBuilds = false
|
|
checkDependencies = false
|
|
}
|
|
}
|
|
|
|
compose.desktop {
|
|
application {
|
|
mainClass = "com.aerotoss.MainKt"
|
|
|
|
nativeDistributions {
|
|
targetFormats(org.jetbrains.compose.desktop.application.dsl.TargetFormat.Dmg)
|
|
packageName = "AeroToss"
|
|
packageVersion = "1.0.0"
|
|
description = "Кроссплатформенное приложение для передачи файлов"
|
|
vendor = "AeroToss"
|
|
licenseFile = file("../LICENSE")
|
|
}
|
|
}
|
|
}
|