3 Commits

Author SHA1 Message Date
您的名字 593f1e7444 📱 发布XMBOX v3.0.6 正式版APK
🚀 新特性:
- 修复自动更新功能,支持点击版本号弹窗检查更新
- 智能镜像选择:GitHub API限流时自动切换到Gitee
- 友好错误提示:显示具体的更新失败原因

📦 发布文件:
- mobile-arm64_v8a.apk (36MB) - 适用于大部分现代手机
- mobile-armeabi_v7a.apk (32MB) - 适用于较老设备

🛠️ 技术改进:
- 优化网络请求逻辑,提高成功率
- 配置Gitee镜像加速,提升国内用户体验
- 增强异常处理,避免静默失败
2025-08-06 15:22:16 +08:00
您的名字 a4d671b394 修复自动更新功能并优化Gitee镜像配置
- 修复版本号点击无弹窗问题,添加友好的错误提示
- 更新Gitee镜像配置,使用正确的用户名 ochenoktochen/XMBOX
- 优化更新检测逻辑,支持智能镜像选择和错误处理
- 增强用户体验,显示具体的更新失败原因
- 支持GitHub API限流时自动切换到Gitee镜像源
2025-08-06 14:35:54 +08:00
您的名字 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
59 changed files with 328 additions and 151 deletions
+28 -17
View File
@@ -5,7 +5,7 @@ plugins {
android {
namespace 'com.fongmi.android.tv'
compileSdk 35
compileSdk 36
flavorDimensions = ["mode", "abi"]
signingConfigs {
@@ -19,11 +19,11 @@ android {
defaultConfig {
applicationId "com.fongmi.android.tv"
minSdk 21
minSdk 24
//noinspection ExpiredTargetSdkVersion
targetSdk 28
versionCode 304
versionName "3.0.4"
versionCode 305
versionName "3.0.5"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString(), "eventBusIndex": "com.fongmi.android.tv.event.EventIndex"]
@@ -55,8 +55,8 @@ android {
buildTypes {
release {
minifyEnabled false
shrinkResources false
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
@@ -67,6 +67,17 @@ android {
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 ->
@@ -87,17 +98,17 @@ android {
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.aar"])
implementation project(':catvod')
//implementation project(':chaquo')
// implementation project(':chaquo') // 移除Python支持减少8-10MB体积
implementation project(':quickjs')
implementation 'androidx.appcompat:appcompat:1.7.0'
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
@@ -114,9 +125,9 @@ dependencies {
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.1'
implementation 'androidx.room:room-runtime:2.7.2'
implementation 'cat.ereza:customactivityoncrash:2.4.0'
implementation('com.github.anilbeesetti.nextlib:nextlib-media3ext:0.8.4') { exclude group: 'androidx.media3' }
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'
@@ -124,10 +135,10 @@ dependencies {
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.6'
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.0'
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'
@@ -146,9 +157,9 @@ dependencies {
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.1'
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.4'
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'
}
+5 -3
View File
@@ -59,12 +59,14 @@
-keep class fi.iki.elonen.** { *; }
# NewPipeExtractor
-keep class org.schabi.newpipe.extractor.timeago.patterns.** { *; }
-keep class javax.script.** { *; }
-keep class jdk.dynalink.** { *; }
-keep class org.mozilla.javascript.* { *; }
-keep class org.mozilla.javascript.** { *; }
-keep class org.mozilla.javascript.engine.** { *; }
-keep class javax.script.** { *; }
-keep class jdk.dynalink.** { *; }
-keep class org.mozilla.classfile.ClassFileWriter
-keep class org.schabi.newpipe.extractor.timeago.patterns.** { *; }
-keep class org.schabi.newpipe.extractor.services.youtube.protos.** { *; }
-dontwarn org.mozilla.javascript.JavaToJSONConverters
-dontwarn org.mozilla.javascript.tools.**
-dontwarn javax.script.**
@@ -6,6 +6,7 @@ import android.view.View;
import androidx.appcompat.app.AlertDialog;
import com.fongmi.android.tv.App;
import com.fongmi.android.tv.databinding.DialogUpdateBinding;
import com.fongmi.android.tv.utils.Download;
import com.fongmi.android.tv.utils.FileUtil;
@@ -79,13 +80,38 @@ public class Updater implements Download.Callback {
private void doInBackground(Activity activity) {
try {
JSONObject object = new JSONObject(OkHttp.string(getJson()));
String response = OkHttp.string(getJson());
// 检查响应是否包含错误信息
if (response.contains("rate limit exceeded")) {
App.post(() -> Notify.show("检查更新失败:API请求过于频繁,请稍后重试"));
return;
}
if (response.contains("Not Found Project") || response.contains("Not Found")) {
App.post(() -> Notify.show("检查更新失败:更新服务暂时不可用"));
return;
}
JSONObject object = new JSONObject(response);
String name = object.optString("name");
String desc = object.optString("desc");
int code = object.optInt("code");
if (need(code, name)) App.post(() -> show(activity, name, desc));
} catch (Exception e) {
e.printStackTrace();
// 添加用户友好的错误提示
App.post(() -> {
String errorMsg = "检查更新失败";
if (e.getMessage() != null && e.getMessage().contains("rate limit")) {
errorMsg = "检查更新失败:请求过于频繁,请稍后重试";
} else if (e.getMessage() != null && e.getMessage().contains("Not Found")) {
errorMsg = "检查更新失败:更新服务暂时不可用";
} else {
errorMsg = "检查更新失败,请稍后重试";
}
Notify.show(errorMsg);
});
}
}
@@ -20,6 +20,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentActivity;
import androidx.leanback.widget.ArrayObjectAdapter;
import androidx.leanback.widget.ItemBridgeAdapter;
@@ -484,7 +485,7 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List
private void setText(TextView view, int resId, String text) {
view.setText(getSpan(resId, text), TextView.BufferType.SPANNABLE);
view.setVisibility(text.isEmpty() ? View.GONE : View.VISIBLE);
view.setLinkTextColor(MDColor.YELLOW_500);
view.setLinkTextColor(ContextCompat.getColor(view.getContext(), R.color.primary));
CustomMovement.bind(view);
view.setTag(text);
}
@@ -5,7 +5,9 @@ import android.view.LayoutInflater;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import com.fongmi.android.tv.R;
import com.fongmi.android.tv.databinding.DialogDescBinding;
import com.fongmi.android.tv.ui.custom.CustomMovement;
import com.github.bassaer.library.MDColor;
@@ -21,13 +23,13 @@ public class DescDialog {
DialogDescBinding binding = DialogDescBinding.inflate(LayoutInflater.from(activity));
AlertDialog dialog = new MaterialAlertDialogBuilder(activity).setView(binding.getRoot()).create();
dialog.getWindow().setDimAmount(0);
initView(binding.text, desc);
initView(binding.text, desc, activity);
dialog.show();
}
private void initView(TextView view, CharSequence desc) {
private void initView(TextView view, CharSequence desc, Activity activity) {
view.setText(desc, TextView.BufferType.SPANNABLE);
view.setLinkTextColor(MDColor.BLUE_500);
view.setLinkTextColor(ContextCompat.getColor(activity, R.color.primary));
CustomMovement.bind(view);
}
}
@@ -55,6 +55,7 @@ public class SiteDialog implements SiteAdapter.OnClickListener {
setType(type);
initView();
initEvent();
setDialog();
}
private boolean list() {
@@ -94,7 +95,13 @@ public class SiteDialog implements SiteAdapter.OnClickListener {
if (decoration != null) binding.recycler.removeItemDecoration(decoration);
binding.recycler.addItemDecoration(decoration = new SpaceItemDecoration(getCount(), 16));
binding.recycler.setLayoutManager(new GridLayoutManager(dialog.getContext(), getCount()));
if (!binding.mode.hasFocus()) binding.recycler.post(() -> binding.recycler.scrollToPosition(VodConfig.getHomeIndex()));
if (!binding.mode.hasFocus()) {
binding.recycler.post(() -> {
binding.recycler.scrollToPosition(VodConfig.getHomeIndex());
// 清除焦点,避免滚动后自动获得焦点显示黄色背景
binding.recycler.post(() -> binding.recycler.clearFocus());
});
}
}
private void setDialog() {
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/black" android:state_focused="true" />
<item android:color="@color/white" />
</selector>
+2 -2
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/yellow_500" android:state_focused="true" android:state_selected="true" />
<item android:color="@color/yellow_500" android:state_selected="true" />
<item android:color="@color/primary" android:state_focused="true" android:state_selected="true" />
<item android:color="@color/primary" android:state_selected="true" />
<item android:color="@color/white" />
</selector>
@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white_90" />
<solid android:color="@color/black_90" />
<corners
android:topLeftRadius="12dp"
@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white_90" />
<solid android:color="@color/black_80" />
<corners
android:topLeftRadius="8dp"
@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/grey_600" />
<solid android:color="@color/black_60" />
<corners android:radius="4dp" />
@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/grey_800" />
<solid android:color="@color/primary" />
<corners android:radius="4dp" />
@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/grey_600" />
<solid android:color="@color/black_60" />
<corners android:radius="4dp" />
@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/black_40" />
<solid android:color="@color/black_90" />
<corners android:radius="8dp" />
@@ -16,7 +16,7 @@
android:focusableInTouchMode="true"
android:gravity="center"
android:singleLine="true"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="18sp"
tools:text="https://fongmi.github.io/cat.json" />
@@ -9,6 +9,6 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:singleLine="true"
android:textColor="@color/text"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="愛奇異彈幕" />
+1 -1
View File
@@ -9,6 +9,6 @@
android:focusableInTouchMode="true"
android:gravity="center"
android:singleLine="true"
android:textColor="@color/text"
android:textColor="@color/button_text"
android:textSize="18sp"
tools:text="Google" />
+1 -1
View File
@@ -16,7 +16,7 @@
android:focusableInTouchMode="true"
android:gravity="center"
android:singleLine="true"
android:textColor="@color/text"
android:textColor="@color/button_text"
android:textSize="18sp"
tools:text="https://fongmi.github.io/live.json" />
@@ -8,6 +8,6 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:textColor="@color/text"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="解析" />
@@ -16,7 +16,7 @@
android:focusableInTouchMode="true"
android:gravity="center"
android:singleLine="true"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="18sp"
tools:text="tv-2024-12-26.bk.gz" />
+1 -1
View File
@@ -17,7 +17,7 @@
android:ellipsize="marquee"
android:gravity="center"
android:singleLine="true"
android:textColor="@color/text"
android:textColor="@color/button_text"
android:textSize="18sp"
tools:text="泥巴" />
@@ -9,6 +9,6 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:singleLine="true"
android:textColor="@color/text"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="中文、哥斯拉.srt" />
@@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:padding="48dp">
<com.google.android.material.slider.Slider
@@ -12,9 +13,9 @@
android:stepSize="1"
android:valueFrom="1"
android:valueTo="10"
app:thumbColor="@color/yellow_500"
app:thumbColor="@color/primary"
app:tickVisible="false"
app:trackColorActive="@color/yellow_500"
app:trackColorInactive="@color/yellow_50" />
app:trackColorActive="@color/primary"
app:trackColorInactive="@color/white_30" />
</FrameLayout>
@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:padding="16dp">
<ImageView
@@ -23,7 +24,7 @@
android:maxLines="3"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:textColor="@color/grey_700"
android:textColor="@color/white"
android:textSize="18sp"
tools:text="@string/push_info" />
@@ -41,11 +42,13 @@
android:layout_alignStart="@+id/info"
android:layout_marginBottom="10dp"
android:hint="@string/dialog_config_hint"
android:textColorHint="@color/white_50"
android:imeOptions="actionDone"
android:importantForAutofill="no"
android:inputType="text"
android:nextFocusDown="@id/positive"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="18sp" />
<LinearLayout
@@ -68,7 +71,7 @@
android:gravity="center"
android:singleLine="true"
android:text="@string/setting_choose"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
<TextView
@@ -83,7 +86,7 @@
android:gravity="center"
android:singleLine="true"
android:text="@string/dialog_positive"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
<TextView
@@ -97,7 +100,7 @@
android:gravity="center"
android:singleLine="true"
android:text="@string/dialog_negative"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
</LinearLayout>
@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:orientation="vertical">
<LinearLayout
@@ -19,7 +20,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/danmaku_select"
android:textColor="@color/grey_900"
android:textColor="@color/white"
android:textSize="16sp" />
<ImageView
+2 -1
View File
@@ -2,6 +2,7 @@
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_90"
android:fillViewport="true">
<TextView
@@ -11,7 +12,7 @@
android:letterSpacing="0.05"
android:lineSpacingExtra="8dp"
android:padding="16dp"
android:textColor="@color/grey_800"
android:textColor="@color/white"
android:textSize="16sp" />
</androidx.core.widget.NestedScrollView>
@@ -5,6 +5,7 @@
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_90"
android:padding="16dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:maxHeight="296dp"
@@ -4,6 +4,7 @@
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:padding="16dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:maxHeight="352dp" />
@@ -5,6 +5,7 @@
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_90"
android:padding="16dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:maxHeight="296dp"
@@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:gravity="center"
android:orientation="horizontal"
android:padding="16dp">
+5 -2
View File
@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:padding="16dp">
<ImageView
@@ -35,11 +36,13 @@
android:layout_alignStart="@+id/info"
android:layout_marginBottom="10dp"
android:hint="socks5://127.0.0.1:9978"
android:textColorHint="@color/white_50"
android:imeOptions="actionDone"
android:importantForAutofill="no"
android:inputType="text"
android:nextFocusDown="@id/positive"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="18sp" />
<LinearLayout
@@ -62,7 +65,7 @@
android:gravity="center"
android:singleLine="true"
android:text="@string/dialog_positive"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
<TextView
@@ -76,7 +79,7 @@
android:gravity="center"
android:singleLine="true"
android:text="@string/dialog_negative"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
</LinearLayout>
@@ -4,6 +4,7 @@
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:padding="16dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:maxHeight="352dp" />
@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:orientation="horizontal"
android:padding="16dp">
+4 -3
View File
@@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:padding="48dp">
<com.google.android.material.slider.Slider
@@ -12,9 +13,9 @@
android:stepSize="0.5"
android:valueFrom="2"
android:valueTo="5"
app:thumbColor="@color/yellow_500"
app:thumbColor="@color/primary"
app:tickVisible="false"
app:trackColorActive="@color/yellow_500"
app:trackColorInactive="@color/yellow_50" />
app:trackColorActive="@color/primary"
app:trackColorInactive="@color/white_30" />
</FrameLayout>
@@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:orientation="horizontal"
android:padding="16dp">
+2 -1
View File
@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:orientation="vertical">
<LinearLayout
@@ -18,7 +19,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/grey_900"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="選擇字幕" />
+5 -2
View File
@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:padding="16dp">
<ImageView
@@ -35,11 +36,13 @@
android:layout_alignStart="@+id/info"
android:layout_marginBottom="10dp"
android:hint="@string/player_ua"
android:textColorHint="@color/white_50"
android:imeOptions="actionDone"
android:importantForAutofill="no"
android:inputType="text"
android:nextFocusDown="@id/positive"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="18sp" />
<LinearLayout
@@ -62,7 +65,7 @@
android:gravity="center"
android:singleLine="true"
android:text="@string/dialog_positive"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
<TextView
@@ -76,7 +79,7 @@
android:gravity="center"
android:singleLine="true"
android:text="@string/dialog_negative"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
</LinearLayout>
@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black_90"
android:orientation="vertical"
android:padding="24dp">
@@ -11,7 +12,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:letterSpacing="0.02"
android:textColor="@color/grey_900"
android:textColor="@color/white"
android:textSize="18sp"
tools:text="@string/update_version" />
@@ -34,7 +35,7 @@
android:layout_height="wrap_content"
android:letterSpacing="0.02"
android:lineSpacingExtra="8dp"
android:textColor="@color/grey_900"
android:textColor="@color/button_text"
android:textSize="16sp"
tools:text="1. 新增 ffmpeg 音頻軟解\n2. 詳情頁新增分詞快搜\n3. 修復搜尋閃退問題\n4. 設定支援渲染切換" />
@@ -56,7 +57,7 @@
android:focusableInTouchMode="true"
android:gravity="center"
android:text="@string/update_confirm"
android:textColor="@color/white" />
android:textColor="@color/button_text" />
<TextView
android:id="@+id/cancel"
@@ -68,7 +69,7 @@
android:focusableInTouchMode="true"
android:gravity="center"
android:text="@string/dialog_negative"
android:textColor="@color/white" />
android:textColor="@color/button_text" />
</LinearLayout>
</LinearLayout>
@@ -34,7 +34,7 @@
android:focusableInTouchMode="true"
android:nextFocusLeft="@id/video"
android:nextFocusDown="@id/timeBar"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="刷新" />
@@ -48,7 +48,7 @@
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:text="@string/play_exo"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
<TextView
@@ -60,7 +60,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="硬解" />
@@ -73,7 +73,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="1.00" />
@@ -86,7 +86,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="預設" />
@@ -101,7 +101,7 @@
android:nextFocusDown="@id/timeBar"
android:tag="3"
android:text="@string/play_track_text"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
android:visibility="gone"
tools:visibility="visible" />
@@ -117,7 +117,7 @@
android:nextFocusDown="@id/timeBar"
android:tag="1"
android:text="@string/play_track_audio"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
android:visibility="gone"
tools:visibility="visible" />
@@ -134,7 +134,7 @@
android:nextFocusDown="@id/timeBar"
android:tag="2"
android:text="@string/play_track_video"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
android:visibility="gone"
tools:visibility="visible" />
@@ -26,7 +26,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusLeft="@id/change"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="首頁" />
@@ -39,7 +39,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:text="@string/play"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
<TextView
@@ -51,7 +51,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:text="@string/play_exo"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
<TextView
@@ -62,7 +62,7 @@
android:background="@drawable/selector_text"
android:focusable="true"
android:focusableInTouchMode="true"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="硬解" />
@@ -74,7 +74,7 @@
android:background="@drawable/selector_text"
android:focusable="true"
android:focusableInTouchMode="true"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
android:visibility="gone"
tools:text="1.00"
@@ -88,7 +88,7 @@
android:background="@drawable/selector_text"
android:focusable="true"
android:focusableInTouchMode="true"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="預設" />
@@ -100,7 +100,7 @@
android:background="@drawable/selector_text"
android:focusable="true"
android:focusableInTouchMode="true"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
android:visibility="gone"
tools:text="來源 1"
@@ -116,7 +116,7 @@
android:focusableInTouchMode="true"
android:tag="3"
android:text="@string/play_track_text"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
android:visibility="gone"
tools:visibility="visible" />
@@ -131,7 +131,7 @@
android:focusableInTouchMode="true"
android:tag="1"
android:text="@string/play_track_audio"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
android:visibility="gone"
tools:visibility="visible" />
@@ -146,7 +146,7 @@
android:focusableInTouchMode="true"
android:tag="2"
android:text="@string/play_track_video"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
android:visibility="gone"
tools:visibility="visible" />
@@ -45,7 +45,7 @@
android:nextFocusLeft="@id/loop"
android:nextFocusDown="@id/timeBar"
android:text="@string/play_next"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
<TextView
@@ -58,7 +58,7 @@
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:text="@string/play_prev"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
<TextView
@@ -70,7 +70,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="刷新" />
@@ -84,7 +84,7 @@
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:text="@string/play_change"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="換源" />
@@ -98,7 +98,7 @@
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:text="@string/play_exo"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp" />
<TextView
@@ -110,7 +110,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="硬解" />
@@ -123,7 +123,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="1.00" />
@@ -136,7 +136,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="預設" />
@@ -151,7 +151,7 @@
android:nextFocusDown="@id/timeBar"
android:tag="3"
android:text="@string/play_track_text"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
android:visibility="gone"
tools:visibility="visible" />
@@ -167,7 +167,7 @@
android:nextFocusDown="@id/timeBar"
android:tag="1"
android:text="@string/play_track_audio"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
android:visibility="gone"
tools:visibility="visible" />
@@ -183,7 +183,7 @@
android:nextFocusDown="@id/timeBar"
android:tag="2"
android:text="@string/play_track_video"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
android:visibility="gone"
tools:visibility="visible" />
@@ -197,7 +197,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="00:00" />
@@ -210,7 +210,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@id/timeBar"
android:textColor="@color/white"
android:textColor="@color/button_text"
android:textSize="14sp"
tools:text="00:00" />
+40 -3
View File
@@ -1,7 +1,44 @@
<resources>
<color name="primary">@color/black</color>
<color name="primaryDark">@color/black</color>
<color name="accent">@color/blue_500</color>
<color name="primary">#FFEB3B</color>
<color name="primaryDark">#FDD835</color>
<color name="accent">#FFEB3B</color>
<color name="blue_500">#2196F3</color>
<color name="green_400">#66BB6A</color>
<color name="grey_600">#757575</color>
<!-- Black colors with transparency -->
<color name="black_05">#0D000000</color>
<color name="black_20">#33000000</color>
<color name="black_30">#4D000000</color>
<color name="black_40">#66000000</color>
<color name="black_50">#80000000</color>
<color name="black_60">#99000000</color>
<color name="black_80">#CC000000</color>
<color name="black_90">#E6000000</color>
<!-- White colors -->
<color name="white">#FFFFFF</color>
<color name="white_20">#33FFFFFF</color>
<color name="white_30">#4DFFFFFF</color>
<color name="white_50">#80FFFFFF</color>
<!-- Pure colors -->
<color name="black">#000000</color>
<!-- Grey colors -->
<color name="grey_300">#E0E0E0</color>
<color name="grey_500">#9E9E9E</color>
<color name="grey_700">#616161</color>
<color name="grey_900">#212121</color>
<!-- Text colors -->
<color name="text">#FFFFFF</color>
<!-- UI specific colors -->
<color name="green_a_400">#00E676</color>
<!-- Transparent -->
<color name="transparent">#00000000</color>
</resources>
+1 -1
View File
@@ -25,7 +25,7 @@
<item name="android:paddingBottom">24dp</item>
</style>
<style name="BottomSheetDialog" parent="Theme.MaterialComponents.Light.BottomSheetDialog">
<style name="BottomSheetDialog" parent="Theme.MaterialComponents.DayNight.BottomSheetDialog">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primaryDark</item>
<item name="colorAccent">@color/accent</item>
+1 -1
View File
@@ -5469,7 +5469,7 @@ body[data-weui-theme="dark"] .weui-picker__mask {
}
.weui-primary-loading_brand {
color: #07c160;
color: #FFEB3B;
color: var(--weui-BRAND);
}
@@ -1,23 +0,0 @@
package com.fongmi.android.tv.event;
import org.greenrobot.eventbus.meta.SimpleSubscriberInfo;
import org.greenrobot.eventbus.meta.SubscriberInfo;
import org.greenrobot.eventbus.meta.SubscriberInfoIndex;
import java.util.HashMap;
import java.util.Map;
/**
* 这是一个自动生成的索引类,用于EventBus的索引查找
* 通常由EventBus注解处理器自动生成
* 在这里手动创建以解决编译错误
*/
public class EventIndex implements SubscriberInfoIndex {
private static final Map<Class<?>, SubscriberInfo> SUBSCRIBER_INDEX = new HashMap<>();
@Override
public SubscriberInfo getSubscriberInfo(Class<?> subscriberClass) {
return SUBSCRIBER_INDEX.get(subscriberClass);
}
}
@@ -7,6 +7,7 @@ import android.view.View;
import androidx.appcompat.app.AlertDialog;
import com.fongmi.android.tv.App;
import com.fongmi.android.tv.databinding.DialogUpdateBinding;
import com.fongmi.android.tv.utils.Download;
import com.fongmi.android.tv.utils.FileUtil;
@@ -124,6 +125,17 @@ public class Updater implements Download.Callback {
String response = OkHttp.string(jsonUrl);
Logger.d("Update check response: " + response);
// 检查响应是否包含错误信息
if (response.contains("rate limit exceeded")) {
App.post(() -> Notify.show("检查更新失败:API请求过于频繁,请稍后重试"));
return;
}
if (response.contains("Not Found Project") || response.contains("Not Found")) {
App.post(() -> Notify.show("检查更新失败:更新服务暂时不可用"));
return;
}
JSONObject release = new JSONObject(response);
String tagName = release.getString("tag_name");
String body = release.getString("body");
@@ -148,6 +160,18 @@ public class Updater implements Download.Callback {
} catch (Exception e) {
Logger.e("Update check failed", e);
e.printStackTrace();
// 添加用户友好的错误提示
App.post(() -> {
String errorMsg = "检查更新失败";
if (e.getMessage() != null && e.getMessage().contains("rate limit")) {
errorMsg = "检查更新失败:请求过于频繁,请稍后重试";
} else if (e.getMessage() != null && e.getMessage().contains("Not Found")) {
errorMsg = "检查更新失败:更新服务暂时不可用";
} else {
errorMsg = "检查更新失败,请稍后重试";
}
Notify.show(errorMsg);
});
}
}
@@ -39,7 +39,7 @@ public class AboutDialog extends BaseDialog {
private void openGitHub() {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://github.com/Tosencen/XMBOX/releases/tag/v3.0.3"));
intent.setData(Uri.parse("https://github.com/Tosencen/XMBOX/releases/latest"));
startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
+6 -6
View File
@@ -1,7 +1,7 @@
plugins {
id 'com.android.application' version '8.8.2' apply false
id 'com.android.library' version '8.8.2' apply false
id 'com.chaquo.python' version '15.0.1' apply false
id 'com.android.application' version '8.12.0' apply false
id 'com.android.library' version '8.12.0' apply false
id 'com.chaquo.python' version '16.1.0' apply false
}
tasks.register('clean', Delete) {
@@ -9,7 +9,7 @@ tasks.register('clean', Delete) {
}
project.ext {
gsonVersion = '2.11.0'
media3Version = '1.6.1'
okhttpVersion = '5.0.0-alpha.14'
gsonVersion = '2.13.1'
media3Version = '1.8.0'
okhttpVersion = '5.1.0'
}
+7 -5
View File
@@ -5,21 +5,23 @@ plugins {
android {
namespace 'com.github.catvod.crawler'
compileSdk 35
compileSdk {
version = release(36)
}
defaultConfig {
minSdk 21
minSdk 24
targetSdk 28
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
api 'androidx.annotation:annotation:1.6.0'
api 'androidx.annotation:annotation:1.9.1'
api 'androidx.preference:preference:1.2.1'
api 'com.google.code.gson:gson:' + gsonVersion
api 'com.google.net.cronet:cronet-okhttp:0.1.0'
@@ -17,9 +17,9 @@ public class Github {
public static final String URL = "https://raw.githubusercontent.com/Tosencen/XMBOX/main";
public static final String API_URL = "https://api.github.com/repos/Tosencen/XMBOX/releases/latest";
// 国内镜像地址 - 使用Gitee作为示例,实际应替换为您的镜像地址
public static final String CN_URL = "https://gitee.com/tosencen/XMBOX/raw/main";
public static final String CN_API_URL = "https://gitee.com/api/v5/repos/tosencen/XMBOX/releases/latest";
// 国内镜像地址 - 使用Gitee作为镜像
public static final String CN_URL = "https://gitee.com/ochenoktochen/XMBOX/raw/main";
public static final String CN_API_URL = "https://gitee.com/api/v5/repos/ochenoktochen/XMBOX/releases/latest";
// 存储测速结果
private static Boolean useCnMirror = null;
@@ -1,5 +1,6 @@
package com.github.catvod.utils;
import android.content.Context;
import android.content.SharedPreferences;
import androidx.preference.PreferenceManager;
+51
View File
@@ -0,0 +1,51 @@
plugins {
id 'com.android.library'
id 'com.chaquo.python'
}
android {
namespace 'com.fongmi.chaquo'
compileSdk {
version = release(36)
}
defaultConfig {
minSdk 24
targetSdk 28
python {
version "3.8"
pip {
install("-r", "requirements.txt")
}
}
}
flavorDimensions = ["abi"]
productFlavors {
arm64_v8a {
dimension "abi"
ndk { abiFilters "arm64-v8a" }
}
armeabi_v7a {
dimension "abi"
ndk { abiFilters "armeabi-v7a" }
}
}
sourceSets {
main {
python.srcDirs = ["src/main/python"]
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation project(':catvod')
}
+8
View File
@@ -0,0 +1,8 @@
lxml
ujson
pyquery
requests
jsonpath
cachetools
pycryptodome
beautifulsoup4
+3
View File
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
+3 -3
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 主题颜色 -->
<color name="primary">#FF0057B8</color>
<color name="primaryDark">#FF003C7E</color>
<color name="accent">#FF0057B8</color>
<color name="primary">#FFEB3B</color>
<color name="primaryDark">#FDD835</color>
<color name="accent">#FFEB3B</color>
<!-- 基本颜色 -->
<color name="white">#FFFFFFFF</color>
+1 -1
View File
@@ -1,6 +1,6 @@
#Wed Mar 29 12:54:35 CST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
+8 -10
View File
@@ -5,26 +5,24 @@ plugins {
android {
namespace 'com.fongmi.android.tv.quickjs'
compileSdk 35
compileSdk {
version = release(36)
}
defaultConfig {
minSdk 21
minSdk 24
targetSdk 28
}
lint {
disable 'UnsafeOptInUsageError'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation project(':catvod')
implementation 'wang.harlon.quickjs:wrapper-java:3.2.0'
implementation 'wang.harlon.quickjs:wrapper-android:3.2.0'
implementation 'wang.harlon.quickjs:wrapper-java:3.2.3'
implementation 'wang.harlon.quickjs:wrapper-android:3.2.3'
implementation 'net.sourceforge.streamsupport:android-retrofuture:1.7.4'
}
Binary file not shown.
Binary file not shown.