buildscript {
    repositories {
        google()
        mavenCentral()
        // hms， 若不集成华为厂商通道，可直接跳过
        maven { url = 'https://developer.huawei.com/repo/' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.13.0'
        classpath 'com.google.gms:google-services:4.4.4'

        // hms，若不集成华为厂商通道，可直接跳过
        // 增加AGC插件配置，请您参见AGC插件依赖关系选择合适的AGC插件版本。
        classpath 'com.huawei.agconnect:agcp:1.6.0.300'
    }
    allprojects {
        repositories {
            google()
            mavenCentral()
            //hms，若不集成华为厂商通道，可直接跳过
            maven { url = 'https://developer.huawei.com/repo/' }
        }
    }
}

ext {
    // Note: Some of the following dependencies are optional - only add/update the ones your plugin actually uses.
   // If you use any of these dependencies, update them to the versions shown below.
    junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
    androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
    androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
    androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
    androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.11.0'
   androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.3.0'
   androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.17.0'
   androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.8.9'
   firebaseMessagingVersion = project.hasProperty('firebaseMessagingVersion') ? rootProject.ext.firebaseMessagingVersion : '25.0.1'
   androidxBrowserVersion = project.hasProperty('androidxBrowserVersion') ? rootProject.ext.androidxBrowserVersion : '1.9.0'
   androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.13.0'
   androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.4.1'
   coreSplashScreenVersion = project.hasProperty('coreSplashScreenVersion') ? rootProject.ext.coreSplashScreenVersion : '1.2.0'
   androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.14.0'
}


apply plugin: 'com.android.library'
apply plugin: 'com.huawei.agconnect'

android {
    namespace = "com.capacitor.jpush"
    compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
    defaultConfig {
        minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
        targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        ndk {
            //选择要添加的对应 cpu 类型的 .so 库。
            abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a'
            // 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
        }

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError = false
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_21
        targetCompatibility JavaVersion.VERSION_21
    }

    repositories {
        flatDir {
            dirs 'libs'
        }
    }
}


repositories {
    google()
    mavenCentral()
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':capacitor-android')
    implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
    testImplementation "junit:junit:$junitVersion"
    androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
    androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"

    // -------------------------------- jpush start

    // 国内 jpush 版本
    implementation 'cn.jiguang.sdk:jpush:5.8.0'

    // honor 厂商
    //    implementation 'cn.jiguang.sdk.plugin:honor:5.3.1' //5.3.1 极光对应插件的版本号
    //    implementation 'com.hihonor.mcs:push:7.0.61.303'

    // Google Play 版本 SDK, 仅适用于海外开发者
    // implementation 'cn.jiguang.sdk:jpush-google:5.3.1'

    // 极光厂商插件版本与接入 JPush 版本保持一致，下同
    // 接入华为厂商
    //    implementation 'com.huawei.hms:push:6.9.0.300'
    //    implementation 'cn.jiguang.sdk.plugin:huawei:5.0.0'

    // 接入 FCM 厂商
    // implementation 'com.google.firebase:firebase-messaging:23.0.5'
    // implementation 'cn.jiguang.sdk.plugin:fcm:5.0.0'


    // 接入魅族厂商
    //implementation 'cn.jiguang.sdk.plugin:meizu:5.0.0'

    // 接入 VIVO 厂商
    //implementation 'cn.jiguang.sdk.plugin:vivo:5.0.0'

    // 接入小米厂商
    //implementation 'cn.jiguang.sdk.plugin:xiaomi:5.0.0'

    // 接入 OPPO 厂商
    // implementation 'cn.jiguang.sdk.plugin:oppo:5.0.0'
    // JPush Android SDK v4.6.0 开始，需要单独引入 oppo 厂商 aar ，请下载官网 SDK 包并把 jpush-android-xxx-release/third-push/oppo/libs 下的 aar 文件单独拷贝一份到应用 module/libs 下
    // implementation(name: 'com.heytap.msp-push-3.1.0', ext: 'aar')

    //以下为 OPPO 3.1.0 aar需要依赖
    // implementation 'com.google.code.gson:gson:2.6.2'
    // implementation 'commons-codec:commons-codec:1.6'
    // implementation 'androidx.annotation:annotation:1.1.0'

    // 接入荣耀厂商
    // implementation 'cn.jiguang.sdk.plugin:honor:5.0.0'
    // 需要单独引入荣耀厂商 aar ，请下载官网 SDK 包并把 jpush-android-xxx-release/third-push/honor/libs 下的 aar 文件单独拷贝一份到应用 module/libs 下
    // implementation(name: 'HiPushSdk-v7.0.1.103', ext: 'aar')

    // ------------------------------------- jpush end
}
