build.gradle 10.1 KB
plugins {
    id 'com.android.application'
    id 'io.objectbox'
}

android {
    compileSdkVersion 29
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.whaty.nafmii"
        minSdkVersion 24
        targetSdkVersion 29
        versionCode 210
        versionName "2.1"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        flavorDimensions "versionCode"
        flavorDimensions "versionName"

        buildConfigField "String", "ASSETS_DIST_DIR", "\"\""
        buildConfigField "String", "API_HOST", "\"http://10.10.81.189/nafmii/app/\""
        buildConfigField "String", "IMG_API", "\"http://10.10.81.172/group1/\""
        buildConfigField "String", "WX_APPID", "\"wx06a3b88ecb27f0d8\""
        buildConfigField "String", "QQ_APPID", "\"101975384\""
        buildConfigField "String", "ONLINE_URL", "\"http://10.10.81.189/h5/\""
        buildConfigField "String", "MODULE_LEARN", "\"http://ycjytest.cfae.cn/sites/bank/mb/index.html\""
        buildConfigField "boolean", "SHOW_INPUT", "true"
        buildConfigField "boolean", "ONLINE", "false"
        ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
        }
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [
                        "objectbox.modelPath"         : "$projectDir\\schemas\\objectbox.json".toString(),
                        "objectbox.myObjectBoxPackage": "com.polysoft.nafmii.database"
                ]
            }
        }
        manifestPlaceholders = [
                JPUSH_PKGNAME: applicationId,
                JPUSH_APPKEY : "ef86f246857d981193987dee",//值来自开发者平台取得的AppKey
                JPUSH_CHANNEL: "default_developer",

                //meizu_config_start
//                MEIZU_APPKEY  : "MZ-魅族的APPKEY",
//                MEIZU_APPID   : "MZ-魅族的APPID",
                //meizu_config_end
                //xiaomi_config_start
                XIAOMI_APPID : "MI-小米的APPID",
                XIAOMI_APPKEY: "MI-小米的APPKEY",
                //xiaomi_config_end
                //oppo_config_start
//                OPPO_APPKEY   : "OP-oppo的APPKEY",
//                OPPO_APPID    : "OP-oppo的APPID",
//                OPPO_APPSECRET: "OP-oppo的APPSECRET",
//                //oppo_config_end
//                //vivo_config_start
//                VIVO_APPKEY   : "vivo的APPKEY",
//                VIVO_APPID    : "vivo的APPID",
                //vivo_config_end


        ]
    }
    // 代码扫描分析
    lintOptions{

    }

    productFlavors {
//        onLine {
//            buildConfigField "boolean", "ONLINE", "true"
//        }
        offLine {
            buildConfigField "boolean", "ONLINE", "false"
        }
    }
    signingConfigs {
//        debug {
//            storeFile file('../nafmii.keystore')
//            storePassword 'whaty123'
//            keyPassword 'whaty123'
//            keyAlias 'whaty'
//        }
        release {
            storeFile file('../nafmii.keystore')
            storePassword 'whaty123'
            keyAlias 'whaty'
            keyPassword 'whaty123'
        }
    }
    buildTypes {
        release {
            debuggable false
            minifyEnabled true                      //是否混淆
            zipAlignEnabled true                    //是否设置zip对齐优化
            shrinkResources true                    // 移除无用的resource文件
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            resValue "string", "app_name", "NAFMII之窗"
            buildConfigField "String", "UNZIP_KEY", "\"UNZIP_RELEASE_V2\""
            buildConfigField "String", "H5_VERSION", "\"1.0.0\""
            buildConfigField "String", "ASSETS_DIST_DIR", "\"release\""
            buildConfigField "String", "WX_APPID", "\"wx9e7f89e43fc75dae\""
            buildConfigField "String", "QQ_APPID", "\"101977401\""
            buildConfigField "String", "API_HOST", "\"https://nafmiiapp.cfae.cn/nafmii/app/\""
            buildConfigField "String", "IMG_API", "\"https://nafmiiapp.cfae.cn/file/\""
            buildConfigField "String", "ONLINE_URL", "\"https://nafmiiapp.cfae.cn/h5/\""
            buildConfigField "String", "MODULE_LEARN", "\"https://ycjyconfirm.cfae.cn/sites/bank/mb/index.html\""
            manifestPlaceholders = [
                    JPUSH_PKGNAME: "com.whaty.nafmii",
                    JPUSH_APPKEY : "ab26b513a5d86ea1b7179e18",//值来自开发者平台取得的AppKey
                    JPUSH_CHANNEL: "default_developer"
            ]
        }
        debug {
            signingConfig signingConfigs.release
        }
        pre { // 模拟
            debuggable true
            minifyEnabled true                      //是否混淆
            zipAlignEnabled true                    //是否设置zip对齐优化
            shrinkResources true
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            resValue "string", "app_name", "NAFMII之窗-qp"
            applicationIdSuffix "qp"
            versionNameSuffix ".3"
            buildConfigField "String", "UNZIP_KEY", "\"UNZIP_PRE_V1\""
            buildConfigField "String", "H5_VERSION", "\"1.0.11\""
            buildConfigField "String", "ASSETS_DIST_DIR", "\"pre\""
            buildConfigField "String", "WX_APPID", "\"wx0c80bdc32795951b\""
            buildConfigField "String", "QQ_APPID", "\"101976821\""
            buildConfigField "String", "API_HOST", "\"https://nafmiiapppre.cfae.cn/nafmii/app/\""
            buildConfigField "String", "IMG_API", "\"https://nafmiiapppre.cfae.cn/file/\""
            buildConfigField "String", "ONLINE_URL", "\"https://nafmiiapppre.cfae.cn/h5/\""
            buildConfigField "String", "MODULE_LEARN", "\"https://ycjyconfirm.cfae.cn/sites/bank/mb/index.html\""
            manifestPlaceholders = [
                    JPUSH_PKGNAME: "com.whaty.nafmii.qp",
                    JPUSH_APPKEY : "0d722942c25af282e039eb24",//值来自开发者平台取得的AppKey
                    JPUSH_CHANNEL: "default_developer"
            ]
        }

        uat { // 测试
            debuggable true
            minifyEnabled false
            signingConfig signingConfigs.release
            resValue "string", "app_name", "NAFMII之窗-uat"
            applicationIdSuffix "uat"
            versionNameSuffix ".2"
            buildConfigField "String", "UNZIP_KEY", "\"UNZIP_UAT_V1\""
            buildConfigField "String", "H5_VERSION", "\"1.0.8\""
            buildConfigField "String", "ASSETS_DIST_DIR", "\"uat\""
            buildConfigField "String", "WX_APPID", "\"wxb9dd952e6522ef31\""
            buildConfigField "String", "QQ_APPID", "\"101975384\""
            buildConfigField "String", "API_HOST", "\"https://nafmiiappuat.cfae.cn/nafmii/app/\""
            buildConfigField "String", "IMG_API", "\"https://nafmiiappuat.cfae.cn/file/\""
            buildConfigField "String", "ONLINE_URL", "\"https://nafmiiappuat.cfae.cn/h5/\""
            buildConfigField "String", "MODULE_LEARN", "\"http://ycjytest.cfae.cn/sites/bank/mb/index.html\""
            manifestPlaceholders = [
                    JPUSH_PKGNAME: "com.whaty.nafmii.uat",
                    JPUSH_APPKEY : "506f65662d2d2b010159f606",//值来自开发者平台取得的AppKey
                    JPUSH_CHANNEL: "default_developer"
            ]
        }
        dev {
            debuggable true
            minifyEnabled false
            signingConfig signingConfigs.release
            resValue "string", "app_name", "NAFMII之窗-dev"
            applicationIdSuffix "dev"
            versionNameSuffix ".4"
            buildConfigField "String", "UNZIP_KEY", "\"UNZIP_DEV_V1\""
            buildConfigField "String", "H5_VERSION", "\"1.0.8\""
            buildConfigField "String", "ASSETS_DIST_DIR", "\"dev\""
            buildConfigField "String", "WX_APPID", "\"wx06a3b88ecb27f0d8\""
            buildConfigField "String", "QQ_APPID", "\"101975384\""
            buildConfigField "String", "API_HOST", "\"http://10.10.81.189/nafmii/app/\""
            buildConfigField "String", "IMG_API", "\"http://10.10.81.172/group1/\""
            buildConfigField "String", "ONLINE_URL", "\"http://10.10.81.189/h5/\""
            buildConfigField "String", "MODULE_LEARN", "\"http://bank.lms.webtrn.cn/sites/bank/mb/index.html\""
            manifestPlaceholders = [
                    JPUSH_PKGNAME: "com.whaty.nafmii.dev",
                    JPUSH_APPKEY : "5e402f8bcad079affc7da490",//值来自开发者平台取得的AppKey
                    JPUSH_CHANNEL: "default_developer"
            ]
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    ndkVersion '20.0.5594570'
}

dependencies {
    implementation 'androidx.wear:wear:1.0.0'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    implementation 'ren.yale.android:cachewebviewlib:2.1.8'
    implementation 'com.alibaba:fastjson:1.2.75'
    implementation 'com.wang.avi:library:2.1.3'
    implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.7.0'
    implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.2'
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    implementation 'org.greenrobot:eventbus:3.2.0'
    implementation 'cn.jiguang.sdk:jpush:4.3.0'  // 此处以JPush 4.3.0 版本为例。
    implementation 'cn.jiguang.sdk:jcore:2.9.0'  // 此处以JCore 2.9.0 版本为例。
    implementation "io.objectbox:objectbox-android:$objectboxVersion"
    annotationProcessor "io.objectbox:objectbox-processor:$objectboxVersion"
    implementation 'me.jessyan:autosize:1.2.1'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    compileOnly 'com.google.android.wearable:wearable:2.7.0'
}