build.gradle 11 KB

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