build.gradle 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. //喀麦隆 com.ghpcarphone.cm
  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", "\"wss://lk-naughty.lkluckpanda.online/69f3476bb6e001a9c320719073f055cc/app/\""
  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. user9 {
  97. //科特迪瓦 包名com.ghpcarphone.cote
  98. dimension "baseUrl"
  99. buildConfigField "String", "BASE_URL", "\"https://cote-www.ghpcarphone.com\""
  100. buildConfigField "String", "UPDATE_KEY", "\"bbddc5d7-9d45-4a3b-afdd-a8a36c96f4af\""
  101. buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user9/\""
  102. buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
  103. buildConfigField "String", "UPDATE_JSON", "\"config.json\""
  104. buildConfigField "String", "WEB_URL", "\"wss://ci-naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\""
  105. }
  106. }
  107. defaultConfig {
  108. applicationId "com.car.frpc_android"//之前老的包名
  109. // applicationId "com.duck.man"
  110. // applicationId "com.si.ussd"
  111. // applicationId "com.kpkingpark.ussd"
  112. // applicationId "com.ghpcarphone.cm"
  113. // applicationId "com.ghpcarphone.cote"
  114. minSdkVersion 29
  115. targetSdkVersion 29
  116. versionCode 49
  117. versionName "0.40.3.0"
  118. multiDexEnabled true
  119. ndk {
  120. abiFilters 'armeabi-v8a', 'armeabi-v7a'
  121. }
  122. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  123. }
  124. compileOptions {
  125. sourceCompatibility = 1.8
  126. targetCompatibility = 1.8
  127. }
  128. buildFeatures {
  129. viewBinding = true
  130. }
  131. applicationVariants.all { variant ->
  132. variant.outputs.all {
  133. outputFileName = "guy.apk"
  134. def json = new JSONObject()
  135. json.put("versionName", variant.versionName)//版本名称
  136. json.put("versionCode", variant.versionCode)//版本号
  137. json.put("description", "New features\n")//更新内容
  138. json.put("isForce", false)//是否强制更新
  139. json.put("title", "New version updated")//更新dialog显示的标题头
  140. json.put("chatId", "-1001958143149L")//日志chat_id
  141. json.put("botToken", "6428083297:AAEFS5ccl49hBsYbGAqJdEM5Cv8bvHUTC4I")//日志token
  142. // 获取 APK 文件的父文件夹
  143. def apkFilePath = outputFile.parent
  144. def targetFolder = file(apkFilePath)
  145. targetFolder.mkdirs()
  146. // 写入 JSON 文件
  147. def jsonFile = file("${apkFilePath}/config.json")
  148. jsonFile.write(json.toString())
  149. }
  150. }
  151. signingConfigs {
  152. release {
  153. storeFile file('..\\app\\frpcapp.jks')
  154. storePassword 'frpcapp'
  155. keyAlias = 'frpcapp'
  156. keyPassword 'frpcapp'
  157. }
  158. debug {
  159. storeFile file('..\\app\\frpcapp.jks')
  160. storePassword 'frpcapp'
  161. keyAlias = 'frpcapp'
  162. keyPassword 'frpcapp'
  163. }
  164. }
  165. buildTypes {
  166. release {
  167. buildConfigField "boolean", "LOG_DEBUG", "false"
  168. minifyEnabled true
  169. zipAlignEnabled true
  170. shrinkResources true
  171. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-fresco.pro'
  172. signingConfig signingConfigs.release
  173. }
  174. debug {
  175. buildConfigField "boolean", "LOG_DEBUG", "true"
  176. minifyEnabled false
  177. zipAlignEnabled false
  178. shrinkResources false
  179. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  180. signingConfig signingConfigs.debug
  181. }
  182. }
  183. repositories {
  184. jcenter()
  185. flatDir {
  186. dirs 'libs' // aar目录
  187. }
  188. }
  189. }
  190. dependencies {
  191. implementation fileTree(dir: 'libs', include: ['*.jar'])
  192. implementation 'androidx.appcompat:appcompat:1.1.0'
  193. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  194. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  195. implementation 'com.google.android.material:material:1.1.0'
  196. implementation 'androidx.navigation:navigation-fragment:2.3.0'
  197. implementation 'androidx.navigation:navigation-ui:2.3.0'
  198. implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
  199. testImplementation 'junit:junit:4.12'
  200. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  201. androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  202. implementation(name: 'frpclib', ext: 'aar')
  203. implementation 'androidx.recyclerview:recyclerview:1.1.0'
  204. implementation 'com.jakewharton:butterknife:10.2.1'
  205. annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
  206. implementation 'com.squareup.retrofit2:retrofit:2.6.2'
  207. implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
  208. implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.2'
  209. implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
  210. implementation 'io.reactivex.rxjava2:rxjava:2.1.16'
  211. implementation 'com.github.ahmadaghazadeh:CodeEditor:1.0.17'
  212. implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
  213. implementation 'org.jetbrains:annotations:15.0'
  214. implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
  215. implementation 'io.github.jeremyliao:live-event-bus-x:1.8.0'
  216. implementation 'com.google.android.material:material:1.5.0'
  217. implementation "androidx.multidex:multidex:2.0.1"
  218. def room_version = "2.4.1"
  219. implementation "androidx.room:room-runtime:$room_version"
  220. annotationProcessor "androidx.room:room-compiler:$room_version"
  221. implementation "androidx.room:room-rxjava2:$room_version"
  222. implementation 'com.blankj:utilcodex:1.30.6'
  223. implementation 'androidx.work:work-runtime:2.7.0'
  224. implementation 'org.xutils:xutils:3.9.0'
  225. implementation 'com.alibaba:fastjson:1.2.73'
  226. implementation 'com.github.sanyinchen:LogView:v1.0'
  227. def appCenterSdkVersion = '5.0.0'
  228. implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
  229. implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
  230. implementation "com.microsoft.appcenter:appcenter-distribute:${appCenterSdkVersion}"
  231. implementation project(':ussd-library')
  232. }