diff --git a/HISTORY.md b/HISTORY.md index 8f947e11..1f315a69 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ ## 更新日誌 +### v2.1.1 + +* 平衡聲音 + ### v2.1.0 * 恢復播放 diff --git a/app/.gitignore b/app/.gitignore index 9bc39b48..7699bed4 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -4,3 +4,4 @@ /CMakeFiles/ /Makefile /src/main/cpp/native.c +/src/main/cpp/aes.c diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 386ed163..775e4844 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -21,7 +21,9 @@ if (IS_SO_BUILD) SHARED # Provides a relative path to your source file(s). - src/main/cpp/native.c) + src/main/cpp/native.c + src/main/cpp/aes.c + ) # 设置编译输出路径 set_target_properties( diff --git a/app/build.gradle b/app/build.gradle index b0d116ae..55390836 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -98,6 +98,10 @@ static def VersionName() { } } +def gson_version = "2.10.1" +def failureaccess_version = "1.0.2" +def guava_version = "33.2.1-android" + dependencies { // minSdk17 @@ -106,11 +110,13 @@ dependencies { implementation "androidx.media3:media3-ui:$media3_version" // For media playback using ExoPlayer - implementation ("com.google.guava:guava:31.1-android") - implementation ("androidx.media3:media3-common:$media3_version") { - exclude group: 'com.google.common', module: 'guava' + implementation("com.google.guava:failureaccess:$failureaccess_version") + implementation("com.google.guava:guava:$guava_version") + implementation("androidx.media3:media3-common:$media3_version") { + exclude group: 'com.google.guava', module: 'guava' + exclude group: 'com.google.guava', module: 'failureaccess' } - implementation ("androidx.media3:media3-exoplayer:$media3_version") + implementation("androidx.media3:media3-exoplayer:$media3_version") // For HLS playback support with ExoPlayer implementation "androidx.media3:media3-exoplayer-hls:$media3_version" @@ -120,7 +126,7 @@ dependencies { implementation 'com.google.protobuf:protobuf-kotlin:3.25.1' // Gson 2.10.1 and older: API level 19 - implementation("com.google.code.gson:gson:2.10.1") + implementation("com.google.code.gson:gson:$gson_version") implementation("com.squareup.retrofit2:converter-gson:$retrofit2_version") { exclude group: 'com.google.code.gson', module: 'gson' } @@ -144,7 +150,19 @@ dependencies { configurations.configureEach { resolutionStrategy { - force 'com.google.code.gson:gson:2.10.1' - force 'com.google.guava:guava:31.1-android' + force("com.google.code.gson:gson:$gson_version") + force "com.google.guava:failureaccess:$failureaccess_version" + force "com.google.guava:guava:$guava_version" + eachDependency { details -> + if (details.requested.group == 'com.google.code.gson') { + details.useVersion "$gson_version" + } + if (details.requested.group == 'com.google.guava' && details.requested.name == 'failureaccess') { + details.useVersion "$failureaccess_version" + } + if (details.requested.group == 'com.google.guava' && details.requested.name == 'guava') { + details.useVersion "$guava_version" + } + } } } \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 481bb434..3f3a1193 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -18,4 +18,10 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +-keep class com.google.gson.** { *; } +-dontwarn com.google.gson.** + +-keep class com.google.guava.** { *; } +-dontwarn com.google.guava.** \ No newline at end of file diff --git a/app/src/main/cpp/arm64-v8a/libnative.so b/app/src/main/cpp/arm64-v8a/libnative.so index b1167aed..bd74dae2 100755 Binary files a/app/src/main/cpp/arm64-v8a/libnative.so and b/app/src/main/cpp/arm64-v8a/libnative.so differ diff --git a/app/src/main/cpp/armeabi-v7a/libnative.so b/app/src/main/cpp/armeabi-v7a/libnative.so index a2279b13..25d7f928 100755 Binary files a/app/src/main/cpp/armeabi-v7a/libnative.so and b/app/src/main/cpp/armeabi-v7a/libnative.so differ diff --git a/app/src/main/cpp/include/aes.h b/app/src/main/cpp/include/aes.h new file mode 100644 index 00000000..f2fbae35 --- /dev/null +++ b/app/src/main/cpp/include/aes.h @@ -0,0 +1,9 @@ +#ifndef AES_H +#define AES_H + +#include + +void init(); +void encode(const char *in, size_t size, char *out); + +#endif diff --git a/app/src/main/java/com/lizongying/mytv/PlayerFragment.kt b/app/src/main/java/com/lizongying/mytv/PlayerFragment.kt index b2a56a3d..bca3b598 100644 --- a/app/src/main/java/com/lizongying/mytv/PlayerFragment.kt +++ b/app/src/main/java/com/lizongying/mytv/PlayerFragment.kt @@ -93,6 +93,7 @@ class PlayerFragment : Fragment() { playerView?.player?.run { setMediaItem(MediaItem.fromUri(tvViewModel.getVideoUrlCurrent())) prepare() + volume = tvViewModel.getTV().volume } } diff --git a/app/src/main/java/com/lizongying/mytv/api/Encryptor.kt b/app/src/main/java/com/lizongying/mytv/api/Encryptor.kt index 5935679d..047e9046 100644 --- a/app/src/main/java/com/lizongying/mytv/api/Encryptor.kt +++ b/app/src/main/java/com/lizongying/mytv/api/Encryptor.kt @@ -7,6 +7,8 @@ class Encryptor { external fun encrypt(t: String, e: String, r: String, n: String, i: String): String + external fun encrypt2(t: String): String + external fun hash(data: ByteArray): ByteArray? external fun hash2(data: ByteArray): ByteArray? diff --git a/app/src/main/java/com/lizongying/mytv/api/YSP.kt b/app/src/main/java/com/lizongying/mytv/api/YSP.kt index 876e67b7..06f9f98b 100644 --- a/app/src/main/java/com/lizongying/mytv/api/YSP.kt +++ b/app/src/main/java/com/lizongying/mytv/api/YSP.kt @@ -1,6 +1,7 @@ package com.lizongying.mytv.api import android.content.Context +import android.util.Log import com.lizongying.mytv.SP import com.lizongying.mytv.Utils.getDateTimestamp import com.lizongying.mytv.models.TVViewModel @@ -57,6 +58,7 @@ object YSP { var yspsdkinput = "" var openapi_signature = "" + var yspticket = "" var nseqId = 1 var nrequest_id = "" @@ -85,6 +87,8 @@ object YSP { encryptor.encrypt(cnlid, timeStr, appVer, guid, platform) randStr = getRand() signature = getSignature() + yspticket = encryptor.encrypt2("$livepid&$timeStr&$guid&519748109").lowercase() + return """{"cnlid":"$cnlid","livepid":"$livepid","stream":"$stream","guid":"$guid","cKey":"$cKey","adjust":$adjust,"sphttps":"$sphttps","platform":"$platform","cmd":"$cmd","encryptVer":"$encryptVer","dtype":"$dtype","devid":"$devid","otype":"$otype","appVer":"$appVer","app_version":"$appVersion","rand_str":"$randStr","channel":"$channel","defn":"$defn","signature":"$signature"}""" } diff --git a/app/src/main/java/com/lizongying/mytv/api/YSPApiService.kt b/app/src/main/java/com/lizongying/mytv/api/YSPApiService.kt index 6adbb3d6..3810cd67 100644 --- a/app/src/main/java/com/lizongying/mytv/api/YSPApiService.kt +++ b/app/src/main/java/com/lizongying/mytv/api/YSPApiService.kt @@ -22,6 +22,7 @@ interface YSPApiService { @Header("Yspplayertoken") token: String, @Header("Yspsdkinput") Yspsdkinput: String, @Header("yspsdksign") yspsdksign: String, + @Header("Yspticket") Yspticket: String, @Header("Seqid") Seqid: String, @Header("Request-Id") RequestId: String, @Header("Yspappid") Yspappid: String="519748109", diff --git a/app/src/main/java/com/lizongying/mytv/models/TV.kt b/app/src/main/java/com/lizongying/mytv/models/TV.kt index 6f493ea6..de017315 100644 --- a/app/src/main/java/com/lizongying/mytv/models/TV.kt +++ b/app/src/main/java/com/lizongying/mytv/models/TV.kt @@ -15,6 +15,7 @@ data class TV( var programType: ProgramType, var needToken: Boolean = false, var mustToken: Boolean = false, + var volume: Float = 0.1F, ) : Serializable { override fun toString(): String { diff --git a/app/src/main/java/com/lizongying/mytv/models/TVList.kt b/app/src/main/java/com/lizongying/mytv/models/TVList.kt index 0a6f7e29..1d6b1a72 100644 --- a/app/src/main/java/com/lizongying/mytv/models/TVList.kt +++ b/app/src/main/java/com/lizongying/mytv/models/TVList.kt @@ -21,7 +21,8 @@ object TVList { "2022576801", ProgramType.Y_PROTO, false, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -34,7 +35,8 @@ object TVList { "2022576701", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -47,7 +49,8 @@ object TVList { "2022576501", ProgramType.Y_PROTO, true, - mustToken = true + mustToken = true, + 0.5F ), TV( 0, @@ -60,7 +63,8 @@ object TVList { "2022576601", ProgramType.Y_PROTO, false, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -73,7 +77,8 @@ object TVList { "2022576401", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -86,7 +91,8 @@ object TVList { "2013693901", ProgramType.Y_PROTO, true, - mustToken = true + mustToken = true, + 0.5F ), TV( 0, @@ -99,7 +105,8 @@ object TVList { "2022576201", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -112,7 +119,8 @@ object TVList { "2022576101", ProgramType.Y_PROTO, true, - mustToken = true + mustToken = true, + 0.5F ), TV( 0, @@ -125,7 +133,8 @@ object TVList { "2022576001", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -138,7 +147,8 @@ object TVList { "2022573001", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -151,7 +161,8 @@ object TVList { "2022575901", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -164,7 +175,8 @@ object TVList { "2022575801", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -177,7 +189,8 @@ object TVList { "2022575701", ProgramType.Y_PROTO, false, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -190,7 +203,8 @@ object TVList { "2022575601", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -203,7 +217,8 @@ object TVList { "2022575501", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -216,7 +231,8 @@ object TVList { "2022575401", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -229,7 +245,8 @@ object TVList { "2022575301", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -242,7 +259,8 @@ object TVList { "2022576301", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -255,7 +273,8 @@ object TVList { "2022575201", ProgramType.Y_PROTO, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -268,7 +287,8 @@ object TVList { "2020603421", ProgramType.Y_JCE, false, - mustToken = false + mustToken = false, + 0.8F ), TV( 0, @@ -738,7 +758,8 @@ object TVList { "2019927403", ProgramType.Y_JCE, true, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -751,7 +772,8 @@ object TVList { "2022606701", ProgramType.Y_JCE, true, - mustToken = false + mustToken = false, + 0.8F ), TV( 0, @@ -764,7 +786,8 @@ object TVList { "2022823801", ProgramType.Y_JCE, true, - mustToken = false + mustToken = false, + 0.6F ), ), "港澳台" to listOf( @@ -779,7 +802,8 @@ object TVList { "", ProgramType.F, false, - mustToken = false + mustToken = false, + 0.7F ), TV( 0, @@ -792,7 +816,8 @@ object TVList { "", ProgramType.F, false, - mustToken = false + mustToken = false, + 0.7F ), TV( 0, @@ -805,7 +830,8 @@ object TVList { "", ProgramType.F, false, - mustToken = false + mustToken = false, + 0.7F ), ), "国际" to listOf( @@ -820,7 +846,8 @@ object TVList { "2022575001", ProgramType.Y_PROTO, false, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -833,7 +860,8 @@ object TVList { "2022574901", ProgramType.Y_PROTO, false, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -846,7 +874,8 @@ object TVList { "2022574801", ProgramType.Y_PROTO, false, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -859,7 +888,8 @@ object TVList { "2022574601", ProgramType.Y_PROTO, false, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -872,7 +902,8 @@ object TVList { "2022571701", ProgramType.Y_PROTO, false, - mustToken = false + mustToken = false, + 0.5F ), TV( 0, @@ -885,7 +916,8 @@ object TVList { "2022574701", ProgramType.Y_PROTO, false, - mustToken = false + mustToken = false, + 0.5F ), ) ) diff --git a/app/src/main/java/com/lizongying/mytv/requests/Request.kt b/app/src/main/java/com/lizongying/mytv/requests/Request.kt index 8d6d092f..af2a92bd 100644 --- a/app/src/main/java/com/lizongying/mytv/requests/Request.kt +++ b/app/src/main/java/com/lizongying/mytv/requests/Request.kt @@ -316,10 +316,11 @@ object Request { val request = LiveInfoRequest(data) call = request.let { yspApiService.getLiveInfo( - "guid=${YSP.getGuid()}; gr_user_id=261eecf2-0ce4-4316-a6a1-7171e3de7389; $cookie; newLogin=1; nseqId=${YSP.nseqId}; nrequest-id=${YSP.nrequest_id}", + "guid=${YSP.getGuid()}; gr_user_id=1; $cookie; newLogin=1; nseqId=${YSP.nseqId}; nrequest-id=${YSP.nrequest_id}", YSP.token, YSP.yspsdkinput, YSP.openapi_signature, + YSP.yspticket, "${YSP.nseqId}", YSP.nrequest_id, "519748109", diff --git a/version.json b/version.json index 8aa064eb..17044c73 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{"version_code": 33619968, "version_name": "v2.1.0"} +{"version_code": 33620224, "version_name": "v2.1.1"}