plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace 'com.securechat.app'
    compileSdk 34

    defaultConfig {
        applicationId "com.securechat.app"
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "1.0.0"
        // Backend base URLs — user should edit these to their VPS domain.
        buildConfigField "String", "API_BASE", "\"https://callcrm.dholerametrocityoffer.com/securechat/backend/public/api\""
        buildConfigField "String", "WS_URL",   "\"wss://chat.example.com/ws\""
    }

    signingConfigs {
        release {
            storeFile file("securechat.keystore")
            storePassword "securechat123"
            keyAlias "securechat"
            keyPassword "securechat123"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            signingConfig signingConfigs.release
        }
        debug {
            signingConfig signingConfigs.release
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions { jvmTarget = '17' }
    buildFeatures { viewBinding true; buildConfig true }
}

dependencies {
    implementation 'androidx.core:core-ktx:1.12.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.11.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.recyclerview:recyclerview:1.3.2'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
    implementation 'androidx.activity:activity-ktx:1.8.2'
    implementation 'androidx.fragment:fragment-ktx:1.6.2'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
    // OkHttp for REST + WebSocket
    implementation 'com.squareup.okhttp3:okhttp:4.12.0'
    // JSON
    implementation 'org.json:json:20231013'
}
