Compare commits

...

20 Commits

Author SHA1 Message Date
Studio
d3943aa5b7 <appbase>APK 15.20.25 release Publish. 2026-06-03 06:52:38 +08:00
c7c953f655 移除调试码 2026-06-03 06:52:08 +08:00
Studio
86c9fbad4d <libappbase>Library Release 15.20.24 2026-06-03 06:48:12 +08:00
Studio
e234436853 <appbase>APK 15.20.24 release Publish. 2026-06-03 06:48:01 +08:00
79d49fbc10 添加应用测试示例代码,暂时应用创建函数的范例 2026-06-03 06:43:45 +08:00
406b15ccc5 减少应用名称获取方法的其他函数依赖保证函数通用性。 2026-06-03 06:42:33 +08:00
bdefa7dec9 修改应用框架级崩溃报告的显示信息 2026-06-03 06:40:48 +08:00
Studio
b931a1e0bd <libappbase>Library Release 15.20.23 2026-06-03 06:04:14 +08:00
Studio
60afeabed0 <appbase>APK 15.20.23 release Publish. 2026-06-03 06:03:05 +08:00
cbfebb921a <libappbase>GlobalApplication初始化异常安全增强
在GlobalApplication.onCreate()中增加try-catch异常捕获,
初始化失败时通过CrashHandleNotifyUtils发送崩溃通知。
2026-06-03 05:49:51 +08:00
208ced7af5 <libappbase>Library Release 15.20.22 2026-05-27 14:51:42 +08:00
bf9a89dc7a <appbase>APK 15.20.22 release Publish. 2026-05-27 14:51:29 +08:00
b28054cf57 编译参数修复 2026-05-27 14:50:46 +08:00
102aae8e66 设置点击调试密钥提示框外部时不关闭对话框。 2026-05-27 14:40:49 +08:00
9e52dc29a7 恢复修复前的前一版本。 2026-05-27 13:28:05 +08:00
dc622003bd fix(AboutView): 调试解锁对话框改为普通Dialog,禁止点击外部关闭
- AlertDialog → Dialog + 自定义布局,绕过AlertController触摸干扰
- 添加 setCancelable(false) + setCanceledOnTouchOutside(false) 双重防护
- 移除DialogInterface.OnShowListener,改用按钮直接绑定OnClickListener
2026-05-27 12:13:46 +08:00
91841962f1 合并projects_keeper_tag 2026-05-24 10:24:03 +08:00
qinglong
ab4cef21f0 合并模块APPBase 同步最新时间标签appbase-v15.20.21 2026-05-24 10:00:01 +08:00
9071d3abd0 <libappbase>Library Release 15.20.21 2026-05-24 09:53:18 +08:00
2754a2ad7c 合并模块AES 同步最新时间标签aes-v15.20.8 2026-05-20 21:00:01 +08:00
6 changed files with 62 additions and 27 deletions

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sun May 24 09:53:05 HKT 2026
stageCount=22
#Wed Jun 03 06:52:38 HKT 2026
stageCount=26
libraryProject=libappbase
baseVersion=15.20
publishVersion=15.20.21
publishVersion=15.20.25
buildCount=0
baseBetaVersion=15.20.22
baseBetaVersion=15.20.26

View File

@@ -1,8 +1,11 @@
package cc.winboll.studio.appbase;
import cc.winboll.studio.libappbase.CrashHandler;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.libappbase.BuildConfig;
import cc.winboll.studio.libappbase.utils.CrashHandleNotifyUtils;
import java.io.PrintWriter;
import java.io.StringWriter;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
@@ -21,10 +24,24 @@ public class App extends GlobalApplication {
*/
@Override
public void onCreate() {
super.onCreate();
// 初始化 Toast 工具类(传入应用全局上下文,确保 Toast 可在任意地方调用)
ToastUtils.init(getApplicationContext());
try {
super.onCreate();
// 初始化 Toast 工具类(传入应用全局上下文,确保 Toast 可在任意地方调用)
ToastUtils.init(getApplicationContext());
} catch (Throwable e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
pw.close();
String stackTraceStr = sw.toString();
CrashHandleNotifyUtils.handleUncaughtException(
this,
getPackageName(),
stackTraceStr,
CrashHandler.CrashActivity.class
);
}
}
/**

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sun May 24 09:53:05 HKT 2026
stageCount=22
#Wed Jun 03 06:52:38 HKT 2026
stageCount=26
libraryProject=libappbase
baseVersion=15.20
publishVersion=15.20.21
publishVersion=15.20.25
buildCount=0
baseBetaVersion=15.20.22
baseBetaVersion=15.20.26

View File

@@ -263,7 +263,7 @@ public final class CrashHandler {
setContentView(contentView);
getActionBar().setTitle(TITTLE);
getActionBar().setSubtitle(GlobalApplication.class.getSimpleName() + " Error");
getActionBar().setSubtitle(GlobalApplication.getAppName(getApplicationContext()) + " Error");
}
@Override

View File

@@ -6,6 +6,10 @@ import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.util.Log;
import cc.winboll.studio.libappbase.utils.CrashHandleNotifyUtils;
import java.io.PrintWriter;
import java.io.StringWriter;
/**
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
@@ -125,17 +129,32 @@ public class GlobalApplication extends Application {
*/
@Override
public void onCreate() {
super.onCreate();
// 初始化单例实例(确保在所有初始化操作前完成)
sInstance = this;
try {
super.onCreate();
// 初始化单例实例(确保在所有初始化操作前完成)
sInstance = this;
restoreDebugStatus();
// 初始化基础组件日志、崩溃处理、Toast
initCoreComponents();
// 初始化服务器地址(从 SP 读取到内存,提高后续访问效率)
initWinbollHost();
restoreDebugStatus();
// 初始化基础组件日志、崩溃处理、Toast
initCoreComponents();
// 初始化服务器地址(从 SP 读取到内存,提高后续访问效率)
initWinbollHost();
LogUtils.d(TAG, "GlobalApplication 初始化完成,单例实例已创建");
LogUtils.d(TAG, "GlobalApplication 初始化完成,单例实例已创建");
} catch (Throwable e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
pw.close();
String stackTraceStr = sw.toString();
CrashHandleNotifyUtils.handleUncaughtException(
this,
getPackageName(),
stackTraceStr,
CrashHandler.CrashActivity.class
);
}
}
/**
@@ -190,7 +209,7 @@ public class GlobalApplication extends Application {
*/
public static String getAppName(Context context) {
if (context == null) {
LogUtils.w(TAG, "getAppName: 上下文为空,返回 null");
Log.w(TAG, "getAppName: 上下文为空,返回 null");
return null;
}
PackageManager packageManager = context.getPackageManager();
@@ -206,8 +225,7 @@ public class GlobalApplication extends Application {
return appName;
} catch (NameNotFoundException e) {
// 包名不存在(理论上不会发生,捕获异常避免崩溃)
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
//LogUtils.e(TAG, "获取应用名称失败:包名不存在", e);
Log.e(TAG, "获取应用名称失败:包名不存在", e);
e.printStackTrace();
}
return null;

View File

@@ -59,7 +59,7 @@ public class DebugSwitchInfoImageView extends ImageView {
final AlertDialog dialog = new AlertDialog.Builder(getContext()).create();
dialog.setTitle("调试Token");
dialog.setMessage(getDebugToken());
dialog.setCanceledOnTouchOutside(true);
dialog.setCanceledOnTouchOutside(false);
dialog.setButton(DialogInterface.BUTTON_POSITIVE, "复制到剪贴板", (DialogInterface.OnClickListener) null);
dialog.setButton(DialogInterface.BUTTON_NEUTRAL, "重置", (DialogInterface.OnClickListener) null);
dialog.setButton(DialogInterface.BUTTON_NEGATIVE, "关闭", (DialogInterface.OnClickListener) null);