Files
XMBOX/app/build.gradle
T
您的名字 836e363f94 feat: 发布 XMBOX v3.0.5 - 重大稳定性提升
🔥 主要更新:
- 升级到最新依赖版本 (AGP 8.12.0, Gradle 8.13, Java 17)
- 完全重构 Context 管理系统,解决闪退问题
- 采用原项目 FongMi/TV 的稳定策略
- 启用 EventBus 编译时优化,提升性能
- 修复关于页面 GitHub 链接,永远指向最新版本

🐛 修复问题:
- 修复 Context 初始化时序问题导致的崩溃
- 修复 ApplicationContext 被垃圾回收的问题
- 修复 Updater 构造函数的过早调用问题
- 解决 Android 15 设备兼容性问题

 性能优化:
- EventBus 性能提升 (编译时索引生成)
- APK 体积优化 (release 版本 36MB vs 49MB debug)
- 代码混淆和资源压缩启用
- 内存使用优化

📦 构建改进:
- 支持 arm64-v8a 和 armeabi-v7a 双架构
- 完整的 release 和 debug 版本构建
- 新增 chaquo Python 模块支持
- 同步所有依赖到最新稳定版本

🛡️ 稳定性:
- 采用经过 6.3k+ 星标验证的原项目策略
- 完善的异常处理机制
- 防护性编程实践
- 支持 Android 5.0+ 到 Android 15
2025-08-06 11:55:38 +08:00

165 lines
6.6 KiB
Groovy

plugins {
id 'com.android.application'
}
android {
namespace 'com.fongmi.android.tv'
compileSdk 36
flavorDimensions = ["mode", "abi"]
signingConfigs {
release {
storeFile file("../keystore/release.jks")
storePassword "xmbox123"
keyAlias "xmbox"
keyPassword "xmbox123"
}
}
defaultConfig {
applicationId "com.fongmi.android.tv"
minSdk 24
//noinspection ExpiredTargetSdkVersion
targetSdk 28
versionCode 305
versionName "3.0.5"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString(), "eventBusIndex": "com.fongmi.android.tv.event.EventIndex"]
}
}
}
productFlavors {
leanback {
dimension "mode"
}
mobile {
dimension "mode"
}
arm64_v8a {
dimension "abi"
ndk { abiFilters "arm64-v8a" }
}
armeabi_v7a {
dimension "abi"
ndk { abiFilters "armeabi-v7a" }
}
}
buildFeatures {
buildConfig true
viewBinding true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
resources {
exclude 'META-INF/beans.xml'
exclude 'META-INF/versions/9/OSGI-INF/MANIFEST.MF'
}
jniLibs {
// 解决重复的JNI库问题,只保留第一个找到的
pickFirsts += [
'**/libavcodec.so',
'**/libavutil.so',
'**/libmedia3ext.so',
'**/libquickjs-android-wrapper.so',
'**/libswresample.so',
'**/libswscale.so'
]
}
}
android.applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
outputFileName = "${variant.productFlavors[0].name}-${variant.productFlavors[1].name}.apk"
}
}
configurations.configureEach {
resolutionStrategy {
force 'com.squareup.okhttp3:okhttp:' + okhttpVersion
}
}
lint {
disable 'UnsafeOptInUsageError'
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.aar"])
implementation project(':catvod')
// implementation project(':chaquo') // 移除Python支持减少8-10MB体积
implementation project(':quickjs')
implementation 'androidx.appcompat:appcompat:1.7.1'
implementation 'androidx.media:media:1.7.0'
implementation 'androidx.media3:media3-common:' + media3Version
implementation 'androidx.media3:media3-container:' + media3Version
implementation 'androidx.media3:media3-database:' + media3Version
implementation 'androidx.media3:media3-datasource:' + media3Version
implementation 'androidx.media3:media3-datasource-okhttp:' + media3Version
implementation 'androidx.media3:media3-datasource-rtmp:' + media3Version
implementation 'androidx.media3:media3-decoder:' + media3Version
implementation 'androidx.media3:media3-effect:' + media3Version
implementation 'androidx.media3:media3-exoplayer:' + media3Version
implementation 'androidx.media3:media3-exoplayer-dash:' + media3Version
implementation 'androidx.media3:media3-exoplayer-hls:' + media3Version
implementation 'androidx.media3:media3-exoplayer-rtsp:' + media3Version
implementation 'androidx.media3:media3-exoplayer-smoothstreaming:' + media3Version
implementation 'androidx.media3:media3-extractor:' + media3Version
implementation 'androidx.media3:media3-ui:' + media3Version
implementation 'androidx.room:room-runtime:2.7.2'
implementation 'cat.ereza:customactivityoncrash:2.4.0'
implementation 'io.github.anilbeesetti:nextlib-media3ext:1.8.0-0.9.0'
implementation 'com.github.bassaer:materialdesigncolors:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.16.0'
implementation 'com.github.bumptech.glide:annotations:4.16.0'
implementation('com.github.bumptech.glide:avif-integration:4.16.0') { exclude group: 'org.aomedia.avif.android', module: 'avif' }
implementation 'com.github.bumptech.glide:okhttp3-integration:4.16.0'
implementation 'com.github.jahirfiquitiva:TextDrawable:1.0.3'
implementation 'com.github.thegrizzlylabs:sardine-android:0.9'
implementation 'com.github.teamnewpipe:NewPipeExtractor:v0.24.8'
implementation 'com.google.android.material:material:1.12.0'
implementation 'com.google.zxing:core:3.5.3'
implementation 'com.guolindev.permissionx:permissionx:1.8.1'
implementation 'com.hierynomus:smbj:0.14.0'
implementation 'io.antmedia:rtmp-client:3.2.0'
implementation 'javax.servlet:javax.servlet-api:3.1.0'
implementation 'org.aomedia.avif.android:avif:1.1.1.14d8e3c4'
implementation 'org.eclipse.jetty:jetty-client:8.1.21.v20160908'
implementation('org.eclipse.jetty:jetty-server:8.1.21.v20160908') { exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet' }
implementation('org.eclipse.jetty:jetty-servlet:8.1.21.v20160908') { exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet' }
implementation 'org.fourthline.cling:cling-core:2.1.1'
implementation 'org.fourthline.cling:cling-support:2.1.1'
implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'org.nanohttpd:nanohttpd:2.3.1'
implementation('org.simpleframework:simple-xml:2.7.1') { exclude group: 'stax', module: 'stax-api' exclude group: 'xpp3', module: 'xpp3' }
leanbackImplementation 'androidx.leanback:leanback:1.2.0'
leanbackImplementation 'com.github.JessYanCoding:AndroidAutoSize:1.2.1'
mobileImplementation 'androidx.biometric:biometric:1.1.0'
mobileImplementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
mobileImplementation 'com.google.android.flexbox:flexbox:3.0.0'
mobileImplementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }
annotationProcessor 'androidx.room:room-compiler:2.7.2'
// annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'
annotationProcessor 'org.greenrobot:eventbus-annotation-processor:3.3.1'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.1.5'
implementation 'io.noties.markwon:core:4.6.2'
}