build.gradle 3.89 KB
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}


def flutterVersionCode = "383"
if (flutterVersionCode == null) {
    flutterVersionCode = '383'
}

def flutterVersionName = "3.8.3"
if (flutterVersionName == null) {
    flutterVersionName = '3.8.3'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

apply plugin: 'com.huawei.agconnect'

android {
    compileSdkVersion 28


    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.naji.one_key"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        ndk {
            //选择要添加的对应 cpu 类型的 .so 库。
            abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a'
        }

        manifestPlaceholders = [
                XG_ACCESS_ID    : '1500012875',
                XG_ACCESS_KEY   : 'AVR2GJERH0HC',
                HW_APPID        : '102832405',
                VIVO_APPID: "103886384",
                VIVO_APPKEY:"5a04e5c3485c0b19a2911c95dcaff5d2",
                PACKAGE_NAME    : "com.naji.one_key",// 小米通道
                AMAP_KEY : "dbced781d0acd36184d5b4b54da7188d"
        ]
    }

    signingConfigs {
        release {
            storeFile file("./src/main/assets/xiaotao.jks")
            storePassword "xt123456"
            keyAlias "key0"
            keyPassword "xt123456"
        }

        debug {
            storeFile file("./src/main/assets/xiaotao.jks")
            storePassword "xt123456"
            keyAlias "key0"
            keyPassword "xt123456"
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
        debug{
            minifyEnabled true
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.tencent.tpns:huawei:1.2.0.3-release'// 华为推送
    implementation 'com.tencent.tpns:xiaomi:1.2.0.3-release'  // 小米推送
    implementation 'com.tencent.tpns:oppo:1.2.0.3-release'  // OPPO 推送
    implementation 'com.tencent.tpns:vivo:1.2.0.3-release'  // vivo 推送
    implementation 'com.amap.api:location:latest.integration'
    implementation 'com.zhihu.android:matisse:0.5.3-beta3'
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
}