build.gradle 10 KB

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