import org.json.JSONObject apply plugin: 'com.android.application' apply from: 'xmlclassguard.gradle' android { compileSdkVersion 31 flavorDimensions "baseUrl" productFlavors { userdev { dimension "baseUrl" buildConfigField "String", "BASE_URL", "\"https://www.kpkingpark.com\"" buildConfigField "String", "UPDATE_KEY", "\"59e95b20-759a-472a-bf07-a4e4b2e7a1f0\"" buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user8/\"" buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\"" buildConfigField "String", "UPDATE_JSON", "\"config.json\"" buildConfigField "String", "WEB_URL", "\"wss://saffron.ghpcarphone.com/69f3476bb6e001a9c320719073f055cc/app/\"" } user1 { //ghpcarphone dimension "baseUrl" buildConfigField "String", "BASE_URL", "\"https://www.ghpcarphone.com\"" buildConfigField "String", "UPDATE_KEY", "\"bfbc2f7f-779a-4719-9295-60eefbb9269f\"" buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user1/\"" buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\"" buildConfigField "String", "UPDATE_JSON", "\"config.json\"" buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\"" } user2 { //dcduckcake dimension "baseUrl" buildConfigField "String", "BASE_URL", "\"https://www.dcduckcake.com\"" buildConfigField "String", "UPDATE_KEY", "\"2be6db19-4be6-45f5-8a93-368ad7cb6405\"" buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/userdemo/\"" buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\"" buildConfigField "String", "UPDATE_JSON", "\"config.json\"" buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\"" } user3 { //bcblackcoffee dimension "baseUrl" buildConfigField "String", "BASE_URL", "\"https://www.bcblackcoffee.com\"" buildConfigField "String", "UPDATE_KEY", "\"64f225d4-e9a4-4c9f-93eb-133ff2f16c3e\"" buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/userdemo/\"" buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\"" buildConfigField "String", "UPDATE_JSON", "\"config.json\"" buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\"" } user4 { //lkluckpanda dimension "baseUrl" buildConfigField "String", "BASE_URL", "\"https://www.lkluckpanda.com\"" buildConfigField "String", "UPDATE_KEY", "\"64f225d4-e9a4-4c9f-93eb-133ff2f16c3e\"" buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user4/\"" buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\"" buildConfigField "String", "UPDATE_JSON", "\"config.json\"" buildConfigField "String", "WEB_URL", "\"\"" } user5 { dimension "baseUrl" buildConfigField "String", "BASE_URL", "\"https://www.dcduckcake.com\"" buildConfigField "String", "UPDATE_KEY", "\"f6602356-ff46-422e-87ba-d5fbe3f0adf7\"" buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user5/\"" buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\"" buildConfigField "String", "UPDATE_JSON", "\"config.json\"" buildConfigField "String", "WEB_URL", "\"wss://stretch.dcduckcake.com/ca4c62f1ae5f4514acc6132a9f2716a7/app/\"" } user6 { //喀麦隆 com.ghpcarphone.cm dimension "baseUrl" buildConfigField "String", "BASE_URL", "\"https://cm-www.ghpcarphone.com\"" buildConfigField "String", "UPDATE_KEY", "\"455b5053-9d7f-43ae-a115-76f16cfaf3f5\"" buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user6/\"" buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\"" buildConfigField "String", "UPDATE_JSON", "\"config.json\"" buildConfigField "String", "WEB_URL", "\"wss://cm-naughty.lkluckpanda.online/69f3476bb6e001a9c320719073f055cc/app/\"" } user7 { //斯里兰卡 包名com.si.ussd dimension "baseUrl" buildConfigField "String", "BASE_URL", "\"https://www.lovepizzaxx.com\"" buildConfigField "String", "UPDATE_KEY", "\"d3bf5c93-5119-4092-bd5f-a3e99fbce2ed\"" buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user7/\"" buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\"" buildConfigField "String", "UPDATE_JSON", "\"config.json\"" buildConfigField "String", "WEB_URL", "\"wss://lk-naughty.lkluckpanda.online/69f3476bb6e001a9c320719073f055cc/app/\"" } user8 { //肯尼亚 包名com.kpkingpark.ussd dimension "baseUrl" buildConfigField "String", "BASE_URL", "\"https://www.kpkingpark.com\"" buildConfigField "String", "UPDATE_KEY", "\"59e95b20-759a-472a-bf07-a4e4b2e7a1f0\"" buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user8/\"" buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\"" buildConfigField "String", "UPDATE_JSON", "\"config.json\"" buildConfigField "String", "WEB_URL", "\"wss://saffron.ghpcarphone.com/69f3476bb6e001a9c320719073f055cc/app/\"" } user9 { //科特迪瓦 包名com.ghpcarphone.cote dimension "baseUrl" buildConfigField "String", "BASE_URL", "\"https://cote-www.ghpcarphone.com\"" buildConfigField "String", "UPDATE_KEY", "\"bbddc5d7-9d45-4a3b-afdd-a8a36c96f4af\"" buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user9/\"" buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\"" buildConfigField "String", "UPDATE_JSON", "\"config.json\"" buildConfigField "String", "WEB_URL", "\"wss://ci-naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\"" } } defaultConfig { applicationId "com.car.frpc_android"//之前老的包名 // applicationId "com.duck.man" // applicationId "com.si.ussd" // applicationId "com.kpkingpark.ussd" // applicationId "com.ghpcarphone.cm" // applicationId "com.ghpcarphone.cote" minSdkVersion 29 targetSdkVersion 29 versionCode 49 versionName "0.40.3.0" multiDexEnabled true ndk { abiFilters 'armeabi-v8a', 'armeabi-v7a' } testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } compileOptions { sourceCompatibility = 1.8 targetCompatibility = 1.8 } buildFeatures { viewBinding = true } applicationVariants.all { variant -> variant.outputs.all { outputFileName = "guy.apk" def json = new JSONObject() json.put("versionName", variant.versionName)//版本名称 json.put("versionCode", variant.versionCode)//版本号 json.put("description", "New features\n")//更新内容 json.put("isForce", false)//是否强制更新 json.put("title", "New version updated")//更新dialog显示的标题头 json.put("chatId", "-1001958143149L")//日志chat_id json.put("botToken", "6428083297:AAEFS5ccl49hBsYbGAqJdEM5Cv8bvHUTC4I")//日志token // 获取 APK 文件的父文件夹 def apkFilePath = outputFile.parent def targetFolder = file(apkFilePath) targetFolder.mkdirs() // 写入 JSON 文件 def jsonFile = file("${apkFilePath}/config.json") jsonFile.write(json.toString()) } } signingConfigs { release { storeFile file('..\\app\\frpcapp.jks') storePassword 'frpcapp' keyAlias = 'frpcapp' keyPassword 'frpcapp' } debug { storeFile file('..\\app\\frpcapp.jks') storePassword 'frpcapp' keyAlias = 'frpcapp' keyPassword 'frpcapp' } } buildTypes { release { buildConfigField "boolean", "LOG_DEBUG", "false" minifyEnabled true zipAlignEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-fresco.pro' signingConfig signingConfigs.release } debug { buildConfigField "boolean", "LOG_DEBUG", "true" minifyEnabled false zipAlignEnabled false shrinkResources false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.debug } } repositories { jcenter() flatDir { dirs 'libs' // aar目录 } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.google.android.material:material:1.1.0' implementation 'androidx.navigation:navigation-fragment:2.3.0' implementation 'androidx.navigation:navigation-ui:2.3.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' implementation(name: 'frpclib', ext: 'aar') implementation 'androidx.recyclerview:recyclerview:1.1.0' implementation 'com.jakewharton:butterknife:10.2.1' annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1' implementation 'com.squareup.retrofit2:retrofit:2.6.2' implementation 'com.squareup.retrofit2:converter-gson:2.6.2' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.2' implementation 'io.reactivex.rxjava2:rxandroid:2.0.2' implementation 'io.reactivex.rxjava2:rxjava:2.1.16' implementation 'com.github.ahmadaghazadeh:CodeEditor:1.0.17' implementation 'com.afollestad.material-dialogs:core:0.9.6.0' implementation 'org.jetbrains:annotations:15.0' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4' implementation 'io.github.jeremyliao:live-event-bus-x:1.8.0' implementation 'com.google.android.material:material:1.5.0' implementation "androidx.multidex:multidex:2.0.1" def room_version = "2.4.1" implementation "androidx.room:room-runtime:$room_version" annotationProcessor "androidx.room:room-compiler:$room_version" implementation "androidx.room:room-rxjava2:$room_version" implementation 'com.blankj:utilcodex:1.30.6' implementation 'androidx.work:work-runtime:2.7.0' implementation 'org.xutils:xutils:3.9.0' implementation 'com.alibaba:fastjson:1.2.73' implementation 'com.github.sanyinchen:LogView:v1.0' def appCenterSdkVersion = '5.0.0' implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}" implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}" implementation "com.microsoft.appcenter:appcenter-distribute:${appCenterSdkVersion}" implementation project(':ussd-library') }