build.gradle 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. import org.json.JSONObject
  2. apply plugin: 'com.android.application'
  3. apply from: 'xmlclassguard.gradle'
  4. android {
  5. compileSdkVersion 31
  6. flavorDimensions "baseUrl"
  7. productFlavors {
  8. user1 {//ghpcarphone
  9. dimension "baseUrl"
  10. buildConfigField "String", "BASE_URL", "\"https://www.ghpcarphone.com\""
  11. buildConfigField "String", "UPDATE_KEY", "\"bfbc2f7f-779a-4719-9295-60eefbb9269f\""
  12. buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user1/\""
  13. buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
  14. buildConfigField "String", "UPDATE_JSON", "\"config.json\""
  15. buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\""
  16. }
  17. user2 {//dcduckcake
  18. dimension "baseUrl"
  19. buildConfigField "String", "BASE_URL", "\"https://www.dcduckcake.com\""
  20. buildConfigField "String", "UPDATE_KEY", "\"2be6db19-4be6-45f5-8a93-368ad7cb6405\""
  21. buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/userdemo/\""
  22. buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
  23. buildConfigField "String", "UPDATE_JSON", "\"config.json\""
  24. buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\""
  25. }
  26. user3 {//bcblackcoffee
  27. dimension "baseUrl"
  28. buildConfigField "String", "BASE_URL", "\"https://www.bcblackcoffee.com\""
  29. buildConfigField "String", "UPDATE_KEY", "\"64f225d4-e9a4-4c9f-93eb-133ff2f16c3e\""
  30. buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/userdemo/\""
  31. buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
  32. buildConfigField "String", "UPDATE_JSON", "\"config.json\""
  33. buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\""
  34. }
  35. user4 {//lkluckpanda
  36. dimension "baseUrl"
  37. buildConfigField "String", "BASE_URL", "\"https://www.lkluckpanda.com\""
  38. buildConfigField "String", "UPDATE_KEY", "\"64f225d4-e9a4-4c9f-93eb-133ff2f16c3e\""
  39. buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/userdemo/\""
  40. buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
  41. buildConfigField "String", "UPDATE_JSON", "\"config.json\""
  42. buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\""
  43. }
  44. userfy {
  45. dimension "baseUrl"
  46. buildConfigField "String", "BASE_URL", "\"https://www.ghpcarphone.online\""
  47. buildConfigField "String", "UPDATE_KEY", "\"52447696-7b59-40db-ad58-5a7bdc0f6d30\""
  48. buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/userdemo/\""
  49. buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
  50. buildConfigField "String", "UPDATE_JSON", "\"config.json\""
  51. buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\""
  52. }
  53. user5 {
  54. dimension "baseUrl"
  55. buildConfigField "String", "BASE_URL", "\"https://www.dcduckcake.com\""
  56. buildConfigField "String", "UPDATE_KEY", "\"f6602356-ff46-422e-87ba-d5fbe3f0adf7\""
  57. buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user5/\""
  58. buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
  59. buildConfigField "String", "UPDATE_JSON", "\"config.json\""
  60. buildConfigField "String", "WEB_URL", "\"wss://stretch.dcduckcake.com/ca4c62f1ae5f4514acc6132a9f2716a7/app/\""
  61. }
  62. }
  63. defaultConfig {
  64. // applicationId "com.car.frpc_android"//之前老的包名
  65. applicationId "com.duck.man"//加纳支付新包名用这个
  66. minSdkVersion 30
  67. targetSdkVersion 31
  68. versionCode 24
  69. versionName "0.39.5.4"
  70. multiDexEnabled true
  71. ndk {
  72. abiFilters 'armeabi-v8a','armeabi-v7a'
  73. }
  74. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  75. }
  76. compileOptions {
  77. sourceCompatibility = 1.8
  78. targetCompatibility = 1.8
  79. }
  80. buildFeatures {
  81. viewBinding = true
  82. }
  83. applicationVariants.all { variant ->
  84. variant.outputs.all {
  85. outputFileName = "guy.apk"
  86. def json = new JSONObject()
  87. json.put("versionName", variant.versionName)//版本名称
  88. json.put("versionCode", variant.versionCode)//版本号
  89. json.put("description", "1.更新已知问题\n")//更新内容
  90. json.put("isForce", true)//是否强制更新
  91. json.put("title", "有新的版本可以更新!")//更新dialog显示的标题头
  92. json.put("chatId", "-1001958143149L")//日志chat_id
  93. json.put("botToken", "6428083297:AAEFS5ccl49hBsYbGAqJdEM5Cv8bvHUTC4I")//日志token
  94. // 获取 APK 文件的父文件夹
  95. def apkFilePath = outputFile.parent
  96. def targetFolder = file(apkFilePath)
  97. targetFolder.mkdirs()
  98. // 写入 JSON 文件
  99. def jsonFile = file("${apkFilePath}/config.json")
  100. jsonFile.write(json.toString())
  101. }
  102. }
  103. signingConfigs {
  104. release {
  105. storeFile file('..\\app\\frpcapp.jks')
  106. storePassword 'frpcapp'
  107. keyAlias = 'frpcapp'
  108. keyPassword 'frpcapp'
  109. }
  110. debug {
  111. storeFile file('..\\app\\frpcapp.jks')
  112. storePassword 'frpcapp'
  113. keyAlias = 'frpcapp'
  114. keyPassword 'frpcapp'
  115. }
  116. }
  117. buildTypes {
  118. release {
  119. buildConfigField "boolean", "LOG_DEBUG", "false"
  120. minifyEnabled true
  121. zipAlignEnabled true
  122. shrinkResources true
  123. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-fresco.pro'
  124. signingConfig signingConfigs.release
  125. }
  126. debug {
  127. buildConfigField "boolean", "LOG_DEBUG", "true"
  128. minifyEnabled true
  129. zipAlignEnabled true
  130. shrinkResources true
  131. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-fresco.pro'
  132. signingConfig signingConfigs.debug
  133. }
  134. }
  135. repositories {
  136. jcenter()
  137. flatDir {
  138. dirs 'libs' // aar目录
  139. }
  140. }
  141. }
  142. dependencies {
  143. implementation fileTree(dir: 'libs', include: ['*.jar'])
  144. implementation 'androidx.appcompat:appcompat:1.1.0'
  145. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  146. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  147. implementation 'com.google.android.material:material:1.1.0'
  148. implementation 'androidx.navigation:navigation-fragment:2.3.0'
  149. implementation 'androidx.navigation:navigation-ui:2.3.0'
  150. implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
  151. testImplementation 'junit:junit:4.12'
  152. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  153. androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  154. implementation(name: 'frpclib', ext: 'aar')
  155. implementation 'androidx.recyclerview:recyclerview:1.1.0'
  156. implementation 'com.jakewharton:butterknife:10.2.1'
  157. annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
  158. implementation 'com.squareup.retrofit2:retrofit:2.6.2'
  159. implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
  160. implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.2'
  161. implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
  162. implementation 'io.reactivex.rxjava2:rxjava:2.1.16'
  163. implementation 'com.github.ahmadaghazadeh:CodeEditor:1.0.17'
  164. implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
  165. implementation 'org.jetbrains:annotations:15.0'
  166. implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
  167. implementation 'io.github.jeremyliao:live-event-bus-x:1.8.0'
  168. implementation 'com.google.android.material:material:1.5.0'
  169. implementation "androidx.multidex:multidex:2.0.1"
  170. def room_version = "2.4.1"
  171. implementation "androidx.room:room-runtime:$room_version"
  172. annotationProcessor "androidx.room:room-compiler:$room_version"
  173. implementation "androidx.room:room-rxjava2:$room_version"
  174. implementation 'com.blankj:utilcodex:1.30.6'
  175. implementation 'androidx.work:work-runtime:2.7.0'
  176. implementation 'org.xutils:xutils:3.9.0'
  177. implementation 'com.alibaba:fastjson:1.2.73'
  178. implementation 'com.github.sanyinchen:LogView:v1.0'
  179. def appCenterSdkVersion = '5.0.0'
  180. implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
  181. implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
  182. implementation "com.microsoft.appcenter:appcenter-distribute:${appCenterSdkVersion}"
  183. implementation project(':ussd-library')
  184. implementation 'com.elvishew:xlog:1.11.0'
  185. }