feat: dev-5.1 分支基线(v1.3.35 发版后代码 + 5.1 声道改造文档)
- 以 main(ccc65af) 为基线提交当前工作区代码
- 新增 5.1 声道改造文档两份
- .gitignore 补充 .vscode/、.screenshots/
This commit is contained in:
147
app/build.gradle
Executable file → Normal file
147
app/build.gradle
Executable file → Normal file
@@ -1,5 +1,3 @@
|
||||
import com.android.build.api.variant.BuildConfigField
|
||||
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
@@ -16,13 +14,21 @@ android {
|
||||
checkReleaseBuilds false
|
||||
abortOnError false
|
||||
}
|
||||
// 单元测试跑在 JVM 上,org.json 等 Android SDK 类默认抛 "not mocked";
|
||||
// voice/parser(SkyworthVodParser 等)依赖 org.json 解析 payload,
|
||||
// 需要真实实现。这里引入官方 json.org 的 JVM 版本(仅 test classpath)。
|
||||
testOptions {
|
||||
unitTests {
|
||||
includeAndroidResources = true
|
||||
}
|
||||
}
|
||||
def versionSuffix = "0" // 定义版本后缀变量,必须小于或等于9大于0
|
||||
defaultConfig {
|
||||
applicationId "tv.huashi.jetsenx.jetsenfilx.jsttv"
|
||||
minSdk app_android.minSdkVersion
|
||||
targetSdk app_android.targetSdkVersion
|
||||
versionCode Integer.parseInt(new Date().format("yyMMddHH") + versionSuffix)
|
||||
versionName "v1.3.28"
|
||||
versionName "v1.3.35"
|
||||
multiDexEnabled true
|
||||
//压缩语言种类,目前只支持中文语言
|
||||
resConfigs('zh-rCN')
|
||||
@@ -30,6 +36,10 @@ android {
|
||||
// Define flavor dimensions
|
||||
flavorDimensions "channel", "control"
|
||||
|
||||
// ===== 语音协议占位符默认值(文档 §6.2 signature-level permission) =====
|
||||
// debug 通过 flavor 覆盖为 normal 方便联调,release 维持 signature。
|
||||
manifestPlaceholders = [voiceProtectionLevel: "signature"]
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
//酒店 ANNING 安柠 AISHI 爱视(不要手柄)
|
||||
buildConfigField "String", "HOTEL_TYPE", "\"AISHI\""
|
||||
@@ -39,9 +49,11 @@ android {
|
||||
buildConfigField "boolean", "NEED_ACTIVATION_CODE", "true"
|
||||
//是否为扫码变体(as8Scan 覆盖为 true;asAScan 同样覆盖为 true)
|
||||
buildConfigField "boolean", "SCAN_VARIANT", "false"
|
||||
//是否为家用版(home flavor 覆盖为 true)
|
||||
buildConfigField "boolean", "IS_HOME_EDITION", "false"
|
||||
//默认激活码:扫码变体在 NEED_ACTIVATION_CODE=false 时使用,普通渠道为空字符串
|
||||
buildConfigField "String", "DEFAULT_ACTIVATION_CODE", "\"\""
|
||||
buildConfigField "String", "BUGLY_APP_ID", "\"01f1b10fca\""
|
||||
//是否为第三方变体(thirdparty flavor 覆盖为 true)
|
||||
buildConfigField "boolean", "THIRDPARTY_VARIANT", "false"
|
||||
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
@@ -71,6 +83,8 @@ android {
|
||||
zipAlignEnabled true // 是否开启zip压缩
|
||||
signingConfig signingConfigs.release
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
// release 严格按文档 §6.2 使用 signature-level permission
|
||||
manifestPlaceholders = [voiceProtectionLevel: "signature"]
|
||||
}
|
||||
|
||||
// preview {
|
||||
@@ -86,12 +100,14 @@ android {
|
||||
|
||||
debug {
|
||||
// AS 域 baseUrl:debug 走测试/内网域名
|
||||
buildConfigField "String", "AS_BASE_URL", "\"https://jst-test.ainetv.cn/api/\"" //http://as-partner-end.172.16.100.110.sslip.io/
|
||||
buildConfigField "String", "AS_BASE_URL", "\"http://as-partner-end.172.16.100.105.sslip.io/\"" //http://as-partner-end.172.16.100.105.sslip.io/
|
||||
minifyEnabled false
|
||||
shrinkResources false
|
||||
zipAlignEnabled true // 是否开启zip压缩
|
||||
signingConfig signingConfigs.release
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
// 联调期间把 voice 协议自定义 permission 降级为 normal,让 adb shell 可投递(release 仍走 signature)。
|
||||
manifestPlaceholders = [voiceProtectionLevel: "normal"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,16 +154,29 @@ android {
|
||||
buildConfigField "String", "CHANNEL_ID", "\"TS\""
|
||||
}
|
||||
|
||||
// --- aishi 子方向:扫码版(无激活码 默认 8888 的激活码) ---
|
||||
// --- aishi 子方向:扫码版(无激活码 默认 88888 的激活码) ---
|
||||
// 共享 aishi 渠道路由(X-Channel-Id="AS"),仅客户端激活流程差异
|
||||
as8Scan {
|
||||
dimension "channel"
|
||||
manifestPlaceholders = [
|
||||
APP_CHANNEL_ID : "aishi",
|
||||
APP_CHANNEL_ID : "as8Scan",
|
||||
splash_theme : "@style/SplashTheme"]
|
||||
buildConfigField "String", "CHANNEL_ID", "\"AS\""
|
||||
buildConfigField "boolean", "NEED_ACTIVATION_CODE", "false"
|
||||
buildConfigField "boolean", "SCAN_VARIANT", "true"
|
||||
buildConfigField "String", "DEFAULT_ACTIVATION_CODE", "\"88888\""
|
||||
}
|
||||
|
||||
// --- 声立方:扫码版(无激活码 默认 UK4KQ 的激活码) ---
|
||||
fxScan {
|
||||
dimension "channel"
|
||||
manifestPlaceholders = [
|
||||
APP_CHANNEL_ID : "fxScan",
|
||||
splash_theme : "@style/SplashTheme"]
|
||||
buildConfigField "String", "CHANNEL_ID", "\"FX\""
|
||||
buildConfigField "boolean", "NEED_ACTIVATION_CODE", "false"
|
||||
buildConfigField "boolean", "SCAN_VARIANT", "true"
|
||||
buildConfigField "String", "DEFAULT_ACTIVATION_CODE", "\"UK4KQ\""
|
||||
}
|
||||
|
||||
// --- aishi 子方向:激活扫码版(有激活码) ---
|
||||
@@ -157,23 +186,58 @@ android {
|
||||
asAScan {
|
||||
dimension "channel"
|
||||
manifestPlaceholders = [
|
||||
APP_CHANNEL_ID : "aishi",
|
||||
APP_CHANNEL_ID : "asAScan",
|
||||
splash_theme : "@style/SplashTheme"]
|
||||
buildConfigField "String", "CHANNEL_ID", "\"AS\""
|
||||
buildConfigField "boolean", "SCAN_VARIANT", "true"
|
||||
}
|
||||
|
||||
// --- 第三方渠道(thirdparty) ---
|
||||
thirdparty {
|
||||
// 测试渠道分销
|
||||
qnAScan {
|
||||
dimension "channel"
|
||||
applicationIdSuffix ".thirdparty"
|
||||
manifestPlaceholders = [
|
||||
APP_CHANNEL_ID : "thirdparty",
|
||||
APP_CHANNEL_ID : "qnAScan",
|
||||
splash_theme : "@style/SplashTheme"]
|
||||
buildConfigField "String", "CHANNEL_ID", "\"TP\""
|
||||
buildConfigField "boolean", "THIRDPARTY_VARIANT", "true"
|
||||
// 注意:AS_BASE_URL 不能在此处覆盖,buildType 的 buildConfigField 优先级更高会将其覆盖。
|
||||
// 第三方域名通过下方 androidComponents.onVariants 设置(Variant API 优先级最高)。
|
||||
buildConfigField "String", "CHANNEL_ID", "\"QN\""
|
||||
buildConfigField "boolean", "SCAN_VARIANT", "true"
|
||||
}
|
||||
|
||||
|
||||
// --- 家用版:独立 applicationId,与商用渠道并行发行 ---
|
||||
// 暂与商用版共用 BUGLY_APP_ID / versionCode(家用版需独立时再覆盖)。
|
||||
// 未来若需按地区/子渠道拆分,加为 sibling flavor 并各自挂 applicationIdSuffix 即可。
|
||||
//
|
||||
// CHANNEL_ID="HM":与 CLAUDE.md 渠道表一致,且避免与 fxScan("FX") 在 X-Channel-ID 头冲突
|
||||
// (OkHttpClientUtil + HttpRequestInterceptor 注入该头,相同 CHANNEL_ID 会让后端把家用版路由为声立方扫码版)。
|
||||
// SCAN_VARIANT=true + DEFAULT_ACTIVATION_CODE="UK4KQ":保持与 as8Scan/fxScan 同款的"扫码 + 静默激活"语义,
|
||||
// 配合 tryAutoActivateWithDefaultCode 在 MainActivity 静默激活家用版设备。
|
||||
// 若后续家用版切换为需要激活码输入面板,可将 NEED_ACTIVATION_CODE 改回 true 并清空 DEFAULT_ACTIVATION_CODE。
|
||||
home {
|
||||
dimension "channel"
|
||||
applicationIdSuffix ".home"
|
||||
manifestPlaceholders = [
|
||||
APP_CHANNEL_ID : "home",
|
||||
splash_theme : "@style/SplashTheme"]
|
||||
buildConfigField "String", "CHANNEL_ID", "\"FX\""
|
||||
buildConfigField "String", "HOTEL_TYPE", "\"HOME\""
|
||||
buildConfigField "boolean", "IS_HOME_EDITION", "true"
|
||||
buildConfigField "boolean", "NEED_ACTIVATION_CODE", "false"
|
||||
buildConfigField "boolean", "SCAN_VARIANT", "false"
|
||||
buildConfigField "String", "DEFAULT_ACTIVATION_CODE", "\"UK4KQ\""
|
||||
}
|
||||
|
||||
ashome {
|
||||
dimension "channel"
|
||||
applicationIdSuffix ".home"
|
||||
manifestPlaceholders = [
|
||||
APP_CHANNEL_ID : "home",
|
||||
splash_theme : "@style/SplashTheme"]
|
||||
buildConfigField "String", "CHANNEL_ID", "\"AS\""
|
||||
buildConfigField "String", "HOTEL_TYPE", "\"HOME\""
|
||||
buildConfigField "boolean", "IS_HOME_EDITION", "true"
|
||||
buildConfigField "boolean", "NEED_ACTIVATION_CODE", "false"
|
||||
buildConfigField "boolean", "SCAN_VARIANT", "false"
|
||||
buildConfigField "String", "DEFAULT_ACTIVATION_CODE", "\"88888\""
|
||||
}
|
||||
|
||||
// Add more channels to this list as needed
|
||||
@@ -222,18 +286,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
// 第三方变体 AS_BASE_URL 覆盖:
|
||||
// buildType 的 buildConfigField 优先级高于 flavor,因此 thirdparty flavor 内直接设置会被
|
||||
// debug/release buildType 覆盖为 jst-test/jst.ainetv.cn。Variant API 的优先级最高,在此统一覆盖。
|
||||
androidComponents {
|
||||
onVariants(selector().withFlavor("channel", "thirdparty")) { variant ->
|
||||
variant.buildConfigFields.put(
|
||||
"AS_BASE_URL",
|
||||
new BuildConfigField("String", "\"http://58.220.83.58:8084/\"", null)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -260,12 +312,13 @@ dependencies {
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
|
||||
implementation 'com.google.android.exoplayer:exoplayer:2.19.1'
|
||||
//implementation(name: 'exoplayer-ffmpeg-extension-2.19.1', ext: 'aar')
|
||||
// 5.1声道兜底(AC3/EAC3/DTS/TrueHD),配合 PkExoMediaPlayer 的 EXTENSION_RENDERER_MODE_ON:
|
||||
// 平台渲染器优先(支持AC3直通/HW解码的设备走平台),FFmpeg仅在平台不支持时兜底软解为PCM
|
||||
implementation files('libs/exoplayer-ffmpeg-extension-2.19.1.aar')
|
||||
|
||||
// implementation 'com.sensorsdata.analytics.android:SensorsAnalyticsSDK:6.8.3'
|
||||
implementation 'commons-codec:commons-codec:1.15'
|
||||
// 3.12.0:3.12.1+(含 3.12.13)引入 Android10Platform 触发 Dalvik VerifyError,必须精确锁 3.12.0
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
|
||||
implementation 'com.google.code.gson:gson:2.8.9'
|
||||
implementation 'com.github.gzu-liyujiang:Android_CN_OAID:4.1.3'
|
||||
implementation('io.github.volcengine-tls:tls-android-producer:2.0.2-api16') {
|
||||
@@ -279,32 +332,30 @@ dependencies {
|
||||
implementation 'com.google.guava:guava:31.1-android'
|
||||
|
||||
// ===== 网络层(脚手架新引入,与既有 HttpUtils 双栈共存) =====
|
||||
// ===== Android 4.2 兼容(对齐 mediaapp 已验证组合,见 Android4.2兼容性改动文档)=====
|
||||
// - OkHttp 4.x 官方要求 API 21+;3.13+ 含 Android10Platform(API 10 SSL API)触发 Dalvik VerifyError。
|
||||
// 3.12.0 是支持 API 9-20 的长期分支(与 libcore/libdata 老栈版本一致),配合下方 force 全局锁定。
|
||||
// - Retrofit 2.6.0:suspend 函数 2.6.0 起支持;2.9+ 传递依赖 OkHttp 3.14.9(含 Android10Platform)。
|
||||
// - Coroutines 1.6.4:1.7+ 要求 minSdk 21,1.6.4 兼容 API 16+。
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
|
||||
implementation 'com.squareup.retrofit2:converter-moshi:2.6.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.0'
|
||||
// 为什么显式指定版本:app 模块此前未声明 retrofit/okhttp/moshi/coroutines,避免被根 config.gradle 隐式拉入不同版本。
|
||||
// Kotlin 1.9.22 -> KSP 1.9.22-1.0.17 已对齐。
|
||||
// 为什么用 `platform(enforcedPlatform)` 而非 `implementation`:okhttp-bom 是 Bill-of-Materials,本身仅提供版本对齐,
|
||||
// 不能被当作运行时产物拉到 runtime classpath(这正是上一个编译报错的根因)。
|
||||
implementation platform('com.squareup.okhttp3:okhttp-bom:4.12.0')
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.11.0'
|
||||
implementation 'com.squareup.retrofit2:converter-moshi:2.11.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor'
|
||||
implementation 'com.squareup.moshi:moshi:1.15.1'
|
||||
implementation 'com.squareup.moshi:moshi-kotlin:1.15.1'
|
||||
ksp 'com.squareup.moshi:moshi-kotlin-codegen:1.15.1'
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
|
||||
|
||||
// 防止其他依赖(tls-producer/libdata 等)传递引入更高版本 OkHttp/Retrofit 破坏 4.2 兼容
|
||||
configurations.all {
|
||||
resolutionStrategy.force 'com.squareup.okhttp3:okhttp:3.12.0'
|
||||
resolutionStrategy.force 'com.squareup.retrofit2:retrofit:2.6.0'
|
||||
}
|
||||
|
||||
implementation 'net.jpountz.lz4:lz4:1.3.0'
|
||||
implementation 'org.slf4j:slf4j-android:1.7.36'
|
||||
//腾讯buggly
|
||||
implementation 'com.tencent.bugly:crashreport:latest.release'
|
||||
//爱奇艺本地奔溃日志
|
||||
implementation 'com.iqiyi.xcrash:xcrash-android-lib:3.1.0'
|
||||
|
||||
// org.json 的 JVM 实现:Android SDK 自带的 org.json 在本地单测里是空壳(not mocked),
|
||||
// 供 voice/parser 下基于 JSONObject 的解析逻辑做真实单测。
|
||||
testImplementation 'org.json:json:20180813'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user