build.gradle 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. plugins {
  2. id 'com.android.application'
  3. }
  4. def legacyBuild = providers.gradleProperty("legacy").orNull == "true"
  5. def localProps = new Properties()
  6. def localPropsFile = rootProject.file('local.properties')
  7. if (localPropsFile.exists()) {
  8. localPropsFile.withInputStream {
  9. localProps.load(it)
  10. }
  11. }
  12. android {
  13. namespace = 'com.fongmi.android.tv'
  14. compileSdk {
  15. version = release(37)
  16. }
  17. defaultConfig {
  18. applicationId "com.fongmi.android.tv"
  19. minSdk legacyBuild ? 23 : 24
  20. //noinspection ExpiredTargetSdkVersion
  21. targetSdk 28
  22. versionCode 541
  23. versionName "5.4.1"
  24. javaCompileOptions {
  25. annotationProcessorOptions {
  26. arguments = ["room.schemaLocation": "$projectDir/schemas".toString(), "eventBusIndex": "com.fongmi.android.tv.event.EventIndex"]
  27. }
  28. }
  29. }
  30. flavorDimensions = ["mode", "abi"]
  31. productFlavors {
  32. leanback {
  33. dimension "mode"
  34. }
  35. mobile {
  36. dimension "mode"
  37. }
  38. arm64_v8a {
  39. dimension "abi"
  40. ndk { abiFilters "arm64-v8a" }
  41. }
  42. armeabi_v7a {
  43. dimension "abi"
  44. ndk { abiFilters "armeabi-v7a" }
  45. }
  46. }
  47. buildFeatures {
  48. buildConfig = true
  49. viewBinding = true
  50. }
  51. if (legacyBuild) {
  52. sourceSets.main.java.srcDir("src/legacy/java")
  53. }
  54. signingConfigs {
  55. debug {
  56. enableV1Signing true
  57. enableV2Signing true
  58. }
  59. if (localProps['storeFile'] && localProps['keyAlias'] && localProps['storePassword']) {
  60. release {
  61. storeFile file(localProps['storeFile'])
  62. keyAlias localProps['keyAlias']
  63. keyPassword localProps['storePassword']
  64. storePassword localProps['storePassword']
  65. enableV1Signing true
  66. enableV2Signing true
  67. }
  68. }
  69. }
  70. buildTypes {
  71. release {
  72. minifyEnabled = true
  73. shrinkResources = true
  74. signingConfig = signingConfigs.findByName('release') ?: signingConfigs.debug
  75. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-rules-media.pro'
  76. }
  77. }
  78. packagingOptions {
  79. resources {
  80. exclude 'META-INF/beans.xml'
  81. exclude 'META-INF/versions/9/OSGI-INF/MANIFEST.MF'
  82. }
  83. }
  84. configurations.configureEach {
  85. exclude group: 'com.android.support'
  86. resolutionStrategy {
  87. force 'com.squareup.okhttp3:okhttp:' + okhttpVersion
  88. }
  89. }
  90. lint {
  91. disable 'UnsafeOptInUsageError'
  92. }
  93. compileOptions {
  94. coreLibraryDesugaringEnabled = true
  95. sourceCompatibility JavaVersion.VERSION_17
  96. targetCompatibility JavaVersion.VERSION_17
  97. }
  98. }
  99. androidComponents {
  100. onVariants(selector().withBuildType('release')) { variant ->
  101. def flavors = variant.productFlavors.collectEntries { [(it.first): it.second] }
  102. def mode = flavors['mode'] ?: 'mode'
  103. def abi = flavors['abi'] ?: 'abi'
  104. variant.outputs.each { output ->
  105. output.outputFileName.set("${mode}-${abi}.apk")
  106. }
  107. }
  108. }
  109. dependencies {
  110. implementation fileTree(dir: "libs", include: ["*.aar"])
  111. implementation project(':catvod')
  112. if (!legacyBuild) implementation project(':chaquo')
  113. implementation project(':quickjs')
  114. implementation 'androidx.appcompat:appcompat:1.7.1'
  115. implementation 'androidx.core:core-splashscreen:1.2.0'
  116. implementation 'androidx.lifecycle:lifecycle-service:2.10.0'
  117. implementation 'androidx.media:media:1.7.1'
  118. implementation 'androidx.media3:media3-common:' + media3Version
  119. implementation 'androidx.media3:media3-container:' + media3Version
  120. implementation 'androidx.media3:media3-database:' + media3Version
  121. implementation 'androidx.media3:media3-datasource:' + media3Version
  122. implementation 'androidx.media3:media3-datasource-okhttp:' + media3Version
  123. implementation 'androidx.media3:media3-datasource-rtmp:' + media3Version
  124. implementation 'androidx.media3:media3-decoder:' + media3Version
  125. implementation 'androidx.media3:media3-effect:' + media3Version
  126. implementation 'androidx.media3:media3-exoplayer:' + media3Version
  127. implementation 'androidx.media3:media3-exoplayer-dash:' + media3Version
  128. implementation 'androidx.media3:media3-exoplayer-hls:' + media3Version
  129. implementation 'androidx.media3:media3-exoplayer-rtsp:' + media3Version
  130. implementation 'androidx.media3:media3-exoplayer-smoothstreaming:' + media3Version
  131. implementation 'androidx.media3:media3-extractor:' + media3Version
  132. implementation 'androidx.media3:media3-session:' + media3Version
  133. implementation 'androidx.media3:media3-ui:' + media3Version
  134. implementation 'androidx.palette:palette:1.0.0'
  135. implementation 'androidx.recyclerview:recyclerview:1.4.0'
  136. implementation 'androidx.room:room-runtime:2.8.4'
  137. implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.2.0'
  138. implementation 'androidx.viewpager2:viewpager2:1.1.0'
  139. implementation 'cat.ereza:customactivityoncrash:2.4.0'
  140. implementation 'com.airbnb.android:lottie:6.7.1'
  141. implementation 'com.github.bassaer:materialdesigncolors:1.0.0'
  142. implementation 'com.github.bumptech.glide:glide:' + glideVersion
  143. implementation 'com.github.bumptech.glide:annotations:' + glideVersion
  144. implementation 'com.github.bumptech.glide:avif-integration:' + glideVersion
  145. implementation 'com.github.bumptech.glide:okhttp3-integration:' + glideVersion
  146. implementation 'com.github.jahirfiquitiva:TextDrawable:1.0.3'
  147. implementation 'com.github.TeamNewPipe:NewPipeExtractor:v0.26.1'
  148. implementation 'com.google.android.flexbox:flexbox:3.0.0'
  149. implementation 'com.google.android.material:material:1.14.0-beta01'
  150. implementation 'com.guolindev.permissionx:permissionx:1.8.1'
  151. implementation 'org.jupnp:org.jupnp:3.0.4'
  152. implementation 'org.jupnp:org.jupnp.android:3.0.4'
  153. implementation 'org.jupnp:org.jupnp.support:3.0.4'
  154. implementation 'org.greenrobot:eventbus:3.3.1'
  155. implementation 'org.nanohttpd:nanohttpd:2.3.1'
  156. implementation('org.simpleframework:simple-xml:2.7.1') { exclude group: 'stax', module: 'stax-api' exclude group: 'xpp3', module: 'xpp3' }
  157. implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.31'
  158. leanbackImplementation 'androidx.leanback:leanback:1.2.0'
  159. leanbackImplementation 'com.github.JessYanCoding:AndroidAutoSize:1.2.1'
  160. mobileImplementation 'androidx.biometric:biometric:1.1.0'
  161. mobileImplementation 'com.journeyapps:zxing-android-embedded:4.3.0'
  162. annotationProcessor 'androidx.room:room-compiler:2.8.4'
  163. annotationProcessor 'com.github.bumptech.glide:compiler:' + glideVersion
  164. annotationProcessor 'org.greenrobot:eventbus-annotation-processor:3.3.1'
  165. coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.1.5'
  166. }