import java.text.SimpleDateFormat
import java.util.Date

plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.android)
    id("kotlin-kapt")
    id("com.google.gms.google-services")
    id("com.google.firebase.crashlytics")
}
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
android {
    namespace = "com.gallery.free.wallpaper"
    compileSdk = 36

    defaultConfig {
        applicationId = "com.gallery.free.wallpaper"
        minSdk = 24
        targetSdk = 36
        versionCode = 2
        versionName = "1.1"

        setProperty("archivesBaseName", "WallpaperGallery_V" + versionName + "(${versionCode})_$timestamp")
        testInstrumentationRunner = "androidx.live.runner.AndroidJUnitRunner"
    }



    buildTypes {
        release {
            isMinifyEnabled = true
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = "11"
    }
    buildFeatures{
        viewBinding = true
    }
}

dependencies {
    implementation("androidx.cardview:cardview:1.0.0")
    implementation("androidx.viewpager2:viewpager2:1.0.0")
    implementation("com.google.android.material:material:1.10.0")
    implementation("androidx.recyclerview:recyclerview:1.3.0")
    implementation("com.google.code.gson:gson:2.8.9")
    implementation ("com.github.bumptech.glide:glide:5.0.5")
    implementation ("jp.wasabeef:glide-transformations:4.3.0") // Glide Transformations
    implementation("androidx.core:core-ktx:1.12.0")
    implementation("androidx.lifecycle:lifecycle-process:2.6.2")// 添加生命周期扩展
    implementation("androidx.lifecycle:lifecycle-common-java8:2.6.2")
    implementation("androidx.work:work-runtime-ktx:2.8.1")// 添加 WorkManager（用于后台任务）

    // 添加协程依赖
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
    implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
    implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
    implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2")

    implementation(libs.androidx.core.ktx)
    implementation(libs.androidx.appcompat)
    implementation(libs.material)
    implementation(libs.androidx.activity)
    implementation(libs.androidx.constraintlayout)
    implementation(libs.androidx.ui.graphics)
    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.junit)
    androidTestImplementation(libs.androidx.espresso.core)

    implementation(files("libs/TradPlusLibrary_01_04_12_20-release.aar"))
    implementation(files("libs/UpLoadLibrary_12_03_15_13-release.aar"))
    implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
    implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
    implementation("com.google.android.gms:play-services-location:21.0.1")
    implementation("com.google.android.gms:play-services-appset:16.0.1")
    // Import the Firebase BoM
    implementation(platform("com.google.firebase:firebase-bom:34.6.0"))
    implementation("com.google.firebase:firebase-crashlytics-ndk")
    implementation("com.google.firebase:firebase-analytics")
    // okhttp
    implementation ("com.squareup.okhttp3:okhttp:4.12.0")
    implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")

    // TradPlus
    implementation("com.tradplusad:tradplus:15.2.0.1")
    implementation("androidx.legacy:legacy-support-v4:1.0.0")
    implementation("androidx.appcompat:appcompat:1.3.0-alpha02")

    // IronSource
    implementation("com.ironsource.sdk:mediationsdk:9.0.0")
    implementation("com.tradplusad:tradplus-ironsource:10.15.2.0.1")

    // Pangle
    implementation("com.tradplusad:tradplus-pangle:19.15.2.0.1")
    implementation("com.pangle.global:pag-sdk:7.8.0.7")

    // UnityAds
    implementation("com.tradplusad:tradplus-unity:5.15.2.0.1")
    implementation("com.unity3d.ads:unity-ads:4.16.3")

    // Chartboost
    implementation("com.tradplusad:tradplus-chartboostx:15.15.2.0.1")
    implementation("com.chartboost:chartboost-sdk:9.10.0")
    implementation("com.google.android.gms:play-services-ads-identifier:17.0.0")
    implementation("com.google.android.gms:play-services-base:17.4.0")

    //上面新版本下载失败用旧版本
//    implementation("com.tradplusad:tradplus-chartboostx:15.14.5.0.1")
//    implementation("com.chartboost:chartboost-sdk:9.8.3")
//    implementation("com.google.android.gms:play-services-ads-identifier:17.0.0")
//    implementation("com.google.android.gms:play-services-base:17.4.0")

    // InMobi
    implementation("com.tradplusad:tradplus-inmobix:23.15.2.0.1")
    implementation("com.inmobi.monetization:inmobi-ads-kotlin:11.0.0")
    implementation("com.squareup.okhttp3:okhttp:3.14.9")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")
    implementation("androidx.core:core-ktx:1.5.0")
    implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.0")

    implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
    implementation("com.google.android.gms:play-services-location:21.0.1") // optional
    implementation("androidx.browser:browser:1.8.0")
    implementation("com.squareup.picasso:picasso:2.8")
    implementation("androidx.viewpager:viewpager:1.0.0")
    implementation("androidx.recyclerview:recyclerview:1.2.1")

    // Fyber
    implementation("com.fyber:marketplace-sdk:8.4.0")
    implementation("com.tradplusad:tradplus-fyber:24.15.2.0.1")
    implementation("com.google.android.gms:play-services-ads-identifier:17.0.0")
    implementation("com.google.android.gms:play-services-base:17.4.0")

    // Mintegral
    implementation("com.tradplusad:tradplus-mintegralx_overseas:18.15.2.0.1")
    implementation("androidx.recyclerview:recyclerview:1.1.0")
    implementation("com.mbridge.msdk.oversea:mbridge_android_sdk:16.10.11")

    // Liftoff (Vungle)
    implementation("com.tradplusad:tradplus-vunglex:7.15.2.0.1")
    implementation("com.vungle:vungle-ads:7.6.0")

    // Bigo
    implementation("com.bigossp:bigo-ads:5.5.2")
    implementation("com.tradplusad:tradplus-bigo:57.15.2.0.1")

    // Cross Promotion
    implementation("com.tradplusad:tradplus-crosspromotion:27.15.2.0.1")

    // TP Exchange（注意与主包版本同步）
    implementation("com.google.code.gson:gson:2.8.6")
    implementation("com.tradplusad:tp_exchange:40.15.2.0.1")

    // Google UMP
    implementation ("com.google.android.ump:user-messaging-platform:3.2.0")
}