From 8cb9ea5caedbb7e4e7c8f314250dca9bae2e8f0c Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Sun, 17 May 2026 20:07:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E6=BA=90=E7=A0=81=E5=86=97?= =?UTF-8?q?=E4=BD=99=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 35 -- debugtemp/README.md | 37 -- debugtemp/app_update_description.txt | 1 - debugtemp/build.gradle | 59 --- debugtemp/build.properties | 8 - debugtemp/proguard-rules.pro | 137 ------- debugtemp/src/beta/AndroidManifest.xml | 12 - debugtemp/src/beta/res/values/strings.xml | 6 - debugtemp/src/main/AndroidManifest.xml | 37 -- .../java/cc/winboll/studio/debugtemp/App.java | 340 ------------------ .../studio/debugtemp/MainActivity.java | 38 -- .../drawable-v24/ic_launcher_foreground.xml | 34 -- .../res/drawable/ic_launcher_background.xml | 170 --------- .../src/main/res/layout/activity_main.xml | 57 --- .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 - .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3056 -> 0 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 5024 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2096 -> 0 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 2858 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4569 -> 0 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 7098 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 6464 -> 0 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 10676 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 9250 -> 0 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 15523 -> 0 bytes debugtemp/src/main/res/values/colors.xml | 6 - debugtemp/src/main/res/values/strings.xml | 4 - debugtemp/src/main/res/values/styles.xml | 11 - debugtemp/src/stage/AndroidManifest.xml | 12 - debugtemp/src/stage/res/values/strings.xml | 6 - libdebugtemp/.gitignore | 1 - libdebugtemp/build.gradle | 24 -- libdebugtemp/build.properties | 8 - libdebugtemp/proguard-rules.pro | 17 - libdebugtemp/src/main/AndroidManifest.xml | 13 - .../cc/winboll/studio/LibraryActivity.java | 12 - .../main/res/drawable-hdpi/ic_launcher.png | Bin 9397 -> 0 bytes .../main/res/drawable-mdpi/ic_launcher.png | Bin 5237 -> 0 bytes .../main/res/drawable-xhdpi/ic_launcher.png | Bin 14383 -> 0 bytes .../main/res/drawable-xxhdpi/ic_launcher.png | Bin 19388 -> 0 bytes libdebugtemp/src/main/res/layout/library.xml | 11 - .../src/main/res/values-v21/styles.xml | 5 - libdebugtemp/src/main/res/values/strings.xml | 8 - libdebugtemp/src/main/res/values/styles.xml | 5 - 45 files changed, 1124 deletions(-) delete mode 100644 debugtemp/README.md delete mode 100644 debugtemp/app_update_description.txt delete mode 100644 debugtemp/build.gradle delete mode 100644 debugtemp/build.properties delete mode 100644 debugtemp/proguard-rules.pro delete mode 100644 debugtemp/src/beta/AndroidManifest.xml delete mode 100644 debugtemp/src/beta/res/values/strings.xml delete mode 100644 debugtemp/src/main/AndroidManifest.xml delete mode 100644 debugtemp/src/main/java/cc/winboll/studio/debugtemp/App.java delete mode 100644 debugtemp/src/main/java/cc/winboll/studio/debugtemp/MainActivity.java delete mode 100644 debugtemp/src/main/res/drawable-v24/ic_launcher_foreground.xml delete mode 100644 debugtemp/src/main/res/drawable/ic_launcher_background.xml delete mode 100644 debugtemp/src/main/res/layout/activity_main.xml delete mode 100644 debugtemp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml delete mode 100644 debugtemp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml delete mode 100644 debugtemp/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 debugtemp/src/main/res/mipmap-hdpi/ic_launcher_round.png delete mode 100644 debugtemp/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 debugtemp/src/main/res/mipmap-mdpi/ic_launcher_round.png delete mode 100644 debugtemp/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 debugtemp/src/main/res/mipmap-xhdpi/ic_launcher_round.png delete mode 100644 debugtemp/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 debugtemp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png delete mode 100644 debugtemp/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 debugtemp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png delete mode 100644 debugtemp/src/main/res/values/colors.xml delete mode 100644 debugtemp/src/main/res/values/strings.xml delete mode 100644 debugtemp/src/main/res/values/styles.xml delete mode 100644 debugtemp/src/stage/AndroidManifest.xml delete mode 100644 debugtemp/src/stage/res/values/strings.xml delete mode 100644 libdebugtemp/.gitignore delete mode 100644 libdebugtemp/build.gradle delete mode 100644 libdebugtemp/build.properties delete mode 100644 libdebugtemp/proguard-rules.pro delete mode 100644 libdebugtemp/src/main/AndroidManifest.xml delete mode 100644 libdebugtemp/src/main/java/cc/winboll/studio/LibraryActivity.java delete mode 100644 libdebugtemp/src/main/res/drawable-hdpi/ic_launcher.png delete mode 100644 libdebugtemp/src/main/res/drawable-mdpi/ic_launcher.png delete mode 100644 libdebugtemp/src/main/res/drawable-xhdpi/ic_launcher.png delete mode 100644 libdebugtemp/src/main/res/drawable-xxhdpi/ic_launcher.png delete mode 100644 libdebugtemp/src/main/res/layout/library.xml delete mode 100644 libdebugtemp/src/main/res/values-v21/styles.xml delete mode 100644 libdebugtemp/src/main/res/values/strings.xml delete mode 100644 libdebugtemp/src/main/res/values/styles.xml diff --git a/.gitignore b/.gitignore index 48be184..eaa5efa 100644 --- a/.gitignore +++ b/.gitignore @@ -99,38 +99,3 @@ lint-results.html /local.properties /settings.gradle /gradle.properties - -## WinBoLL-Demo 项目配置 -#.git -#.gitignore -#.gitmodules -#.winboll -#GenKeyStore -#LICENSE -#LICENSE-Private-Demo -#LICENSE-Private-Demo_docs -#README.md -#aes -#appbase -autonfc -#build.gradle -contacts -#debugtemp -gallery -gpsrelaysentinel -#gradle -#gradle.properties-android-demo -#gradle.properties-androidx-demo -#gradlew -#libaes -#libappbase -#libdebugtemp -libgpsrelaysentinel -libwinboll -#local.properties-demo -mymessagemanager -positions -powerbell -#settings.gradle-demo -winboll -#winboll.properties-demo diff --git a/debugtemp/README.md b/debugtemp/README.md deleted file mode 100644 index 070f4b4..0000000 --- a/debugtemp/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# WinBoLL - -#### 介绍 -WinBoLL 应用编译功能临时调试项目 - -#### 软件架构 -适配安卓应用 [AIDE Pro] 的 Gradle 编译结构。 -也适配安卓应用 [AndroidIDE] 的 Gradle 编译结构。 - - -#### Gradle 编译说明 -调试版编译命令 :gradle assembleBetaDebug -阶段版编译命令 :bash .winboll/bashPublishAPKAddTag.sh debugtemp - -#### 使用说明 -3. Termux应用配置: -- 已安装Termux(包名 com.termux ); -- 执行  echo "allow-external-apps = true" > ~/.termux/termux.properties - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 : ZhanGSKen(ZhanGSKen) -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) - -#### 参考文档 diff --git a/debugtemp/app_update_description.txt b/debugtemp/app_update_description.txt deleted file mode 100644 index 8b13789..0000000 --- a/debugtemp/app_update_description.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/debugtemp/build.gradle b/debugtemp/build.gradle deleted file mode 100644 index 570ffed..0000000 --- a/debugtemp/build.gradle +++ /dev/null @@ -1,59 +0,0 @@ -apply plugin: 'com.android.application' -apply from: '../.winboll/winboll_app_build.gradle' -apply from: '../.winboll/winboll_lint_build.gradle' - -def genVersionName(def versionName){ - // 检查编译标志位配置 - assert (winbollBuildProps['stageCount'] != null) - assert (winbollBuildProps['baseVersion'] != null) - // 保存基础版本号 - winbollBuildProps.setProperty("baseVersion", "${versionName}"); - //保存编译标志配置 - FileOutputStream fos = new FileOutputStream(winbollBuildPropsFile) - winbollBuildProps.store(fos, "${winbollBuildPropsDesc}"); - fos.close(); - - // 返回编译版本号 - return "${versionName}." + winbollBuildProps['stageCount'] -} - -android { - // 适配MIUI12 - compileSdkVersion 30 - buildToolsVersion "30.0.3" - - defaultConfig { - applicationId "cc.winboll.studio.debugtemp" - minSdkVersion 26 - // 适配MIUI12 - targetSdkVersion 30 - versionCode 1 - // versionName 更新后需要手动设置 - // .winboll/winbollBuildProps.properties 文件的 stageCount=0 - // Gradle编译环境下合起来的 versionName 就是 "${versionName}.0" - versionName "15.20" - if(true) { - versionName = genVersionName("${versionName}") - } - } - - // 确保 Java 7 兼容性(已适配项目技术栈) - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - } -} - -dependencies { - api project(':libdebugtemp') - - // WinBoLL库 nexus.winboll.cc 地址 - api 'cc.winboll.studio:libaes:15.20.3' - api 'cc.winboll.studio:libappbase:15.20.9' - - // WinBoLL备用库 jitpack.io 地址 - //api 'com.github.ZhanGSKen:AES:aes-v15.20.3' - //api 'com.github.ZhanGSKen:APPBase:appbase-v15.20.9' - - api fileTree(dir: 'libs', include: ['*.jar']) -} diff --git a/debugtemp/build.properties b/debugtemp/build.properties deleted file mode 100644 index 95ee400..0000000 --- a/debugtemp/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -#Created by .winboll/winboll_app_build.gradle -#Fri May 01 17:09:11 HKT 2026 -stageCount=0 -libraryProject=libdebugtemp -baseVersion=15.20 -publishVersion=15.20.0 -buildCount=0 -baseBetaVersion=15.20.1 diff --git a/debugtemp/proguard-rules.pro b/debugtemp/proguard-rules.pro deleted file mode 100644 index a18de74..0000000 --- a/debugtemp/proguard-rules.pro +++ /dev/null @@ -1,137 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in C:\tools\adt-bundle-windows-x86_64-20131030\sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# ============================== 基础通用规则 ============================== -# 保留系统组件 --keep public class * extends android.app.Activity --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference - -# 保留 WinBoLL 核心包及子类(合并简化规则) --keep class cc.winboll.studio.** { *; } --keepclassmembers class cc.winboll.studio.** { *; } - -# 保留所有类中的 public static final String TAG 字段(便于日志定位) --keepclassmembers class * { - public static final java.lang.String TAG; -} - -# 保留序列化类(避免Parcelable/Gson解析异常) --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} --keepclassmembers class * implements java.io.Serializable { - static final long serialVersionUID; - private static final java.io.ObjectStreamField[] serialPersistentFields; - private void writeObject(java.io.ObjectOutputStream); - private void readObject(java.io.ObjectInputStream); - java.lang.Object writeReplace(); - java.lang.Object readResolve(); -} - -# 保留 R 文件(避免资源ID混淆) --keepclassmembers class **.R$* { - public static ; -} - -# 保留 native 方法(避免JNI调用失败) --keepclasseswithmembernames class * { - native ; -} - -# 保留注解和泛型(避免反射/序列化异常) --keepattributes *Annotation* --keepattributes Signature - -# 屏蔽 Java 8+ 警告(适配 Java 7 语法) --dontwarn java.lang.invoke.* --dontwarn android.support.v8.renderscript.* --dontwarn java.util.function.** - -# ============================== 第三方框架专项规则 ============================== -# OkHttp 4.4.1(米盟广告请求依赖,完善Lambda兼容) --keep class okhttp3.** { *; } --keep interface okhttp3.** { *; } --keep class okhttp3.internal.** { *; } --keep class okio.** { *; } --dontwarn okhttp3.internal.platform.** --dontwarn okio.** - -# Glide 4.9.0(米盟广告图片加载依赖) --keep public class * implements com.bumptech.glide.module.GlideModule --keep public class * extends com.bumptech.glide.module.AppGlideModule --keep public enum com.bumptech.glide.load.ImageHeaderParser$ImageType { - **[] $VALUES; - public *; -} --keepclassmembers class * implements com.bumptech.glide.module.AppGlideModule { - (); -} --dontwarn com.bumptech.glide.** - -# Gson 2.8.5(米盟广告数据序列化依赖) --keep class com.google.gson.** { *; } --keep interface com.google.gson.** { *; } --keepclassmembers class * { - @com.google.gson.annotations.SerializedName ; -} - -# 米盟 SDK(核心广告组件,完整保留避免加载失败) --keep class com.miui.zeus.** { *; } --keep interface com.miui.zeus.** { *; } -# 保留米盟日志字段(便于广告加载失败排查) --keepclassmembers class com.miui.zeus.mimo.sdk.** { - public static final java.lang.String TAG; -} - -# RecyclerView 1.0.0(米盟广告布局渲染依赖) --keep class androidx.recyclerview.** { *; } --keep interface androidx.recyclerview.** { *; } --keepclassmembers class androidx.recyclerview.widget.RecyclerView$Adapter { - public *; -} - -# 其他第三方框架(按引入依赖保留,无则可删除) -# XXPermissions 18.63 --keep class com.hjq.permissions.** { *; } --keep interface com.hjq.permissions.** { *; } - -# ZXing 二维码(核心解析组件) --keep class com.google.zxing.** { *; } --keep class com.journeyapps.zxing.** { *; } - -# Jsoup HTML解析 --keep class org.jsoup.** { *; } - -# Pinyin4j 拼音搜索 --keep class net.sourceforge.pinyin4j.** { *; } - -# JSch SSH组件 --keep class com.jcraft.jsch.** { *; } - -# AndroidX 基础组件 --keep class androidx.appcompat.** { *; } --keep interface androidx.appcompat.** { *; } - -# ============================== 优化与调试配置 ============================== -# 优化级别(平衡混淆效果与性能) --optimizationpasses 5 --optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/* - -# 调试辅助(保留行号便于崩溃定位) --verbose --dontpreverify --dontusemixedcaseclassnames --keepattributes SourceFile,LineNumberTable - diff --git a/debugtemp/src/beta/AndroidManifest.xml b/debugtemp/src/beta/AndroidManifest.xml deleted file mode 100644 index ee78d9f..0000000 --- a/debugtemp/src/beta/AndroidManifest.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - diff --git a/debugtemp/src/beta/res/values/strings.xml b/debugtemp/src/beta/res/values/strings.xml deleted file mode 100644 index c7757f1..0000000 --- a/debugtemp/src/beta/res/values/strings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - DebugTemp☆ - - diff --git a/debugtemp/src/main/AndroidManifest.xml b/debugtemp/src/main/AndroidManifest.xml deleted file mode 100644 index 9056a79..0000000 --- a/debugtemp/src/main/AndroidManifest.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/debugtemp/src/main/java/cc/winboll/studio/debugtemp/App.java b/debugtemp/src/main/java/cc/winboll/studio/debugtemp/App.java deleted file mode 100644 index a2d9d99..0000000 --- a/debugtemp/src/main/java/cc/winboll/studio/debugtemp/App.java +++ /dev/null @@ -1,340 +0,0 @@ -package cc.winboll.studio.debugtemp; - -import android.app.Activity; -import android.content.ClipData; -import android.content.ClipboardManager; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageInfo; -import android.content.res.Resources; -import android.graphics.Typeface; -import android.os.Build; -import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; -import android.text.TextUtils; -import android.util.Log; -import android.view.Gravity; -import android.view.Menu; -import android.view.MenuItem; -import android.view.ViewGroup; -import android.widget.HorizontalScrollView; -import android.widget.ScrollView; -import android.widget.TextView; -import android.widget.Toast; -import cc.winboll.studio.libappbase.GlobalApplication; -import cc.winboll.studio.libappbase.ToastUtils; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.lang.Thread.UncaughtExceptionHandler; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -public class App extends GlobalApplication { - - private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper()); - - @Override - public void onCreate() { - super.onCreate(); - - // 初始化 Toast 框架 - ToastUtils.init(this); - - //CrashHandler.getInstance().registerGlobal(this); - //CrashHandler.getInstance().registerPart(this); - } - - public static void write(InputStream input, OutputStream output) throws IOException { - byte[] buf = new byte[1024 * 8]; - int len; - while ((len = input.read(buf)) != -1) { - output.write(buf, 0, len); - } - } - - public static void write(File file, byte[] data) throws IOException { - File parent = file.getParentFile(); - if (parent != null && !parent.exists()) parent.mkdirs(); - - ByteArrayInputStream input = new ByteArrayInputStream(data); - FileOutputStream output = new FileOutputStream(file); - try { - write(input, output); - } finally { - closeIO(input, output); - } - } - - public static String toString(InputStream input) throws IOException { - ByteArrayOutputStream output = new ByteArrayOutputStream(); - write(input, output); - try { - return output.toString("UTF-8"); - } finally { - closeIO(input, output); - } - } - - public static void closeIO(Closeable... closeables) { - for (Closeable closeable : closeables) { - try { - if (closeable != null) closeable.close(); - } catch (IOException ignored) {} - } - } - - public static class CrashHandler { - - public static final UncaughtExceptionHandler DEFAULT_UNCAUGHT_EXCEPTION_HANDLER = Thread.getDefaultUncaughtExceptionHandler(); - - private static CrashHandler sInstance; - - private PartCrashHandler mPartCrashHandler; - - public static CrashHandler getInstance() { - if (sInstance == null) { - sInstance = new CrashHandler(); - } - return sInstance; - } - - public void registerGlobal(Context context) { - registerGlobal(context, null); - } - - public void registerGlobal(Context context, String crashDir) { - Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandlerImpl(context.getApplicationContext(), crashDir)); - } - - public void unregister() { - Thread.setDefaultUncaughtExceptionHandler(DEFAULT_UNCAUGHT_EXCEPTION_HANDLER); - } - - public void registerPart(Context context) { - unregisterPart(context); - mPartCrashHandler = new PartCrashHandler(context.getApplicationContext()); - MAIN_HANDLER.postAtFrontOfQueue(mPartCrashHandler); - } - - public void unregisterPart(Context context) { - if (mPartCrashHandler != null) { - mPartCrashHandler.isRunning.set(false); - mPartCrashHandler = null; - } - } - - private static class PartCrashHandler implements Runnable { - - private final Context mContext; - - public AtomicBoolean isRunning = new AtomicBoolean(true); - - public PartCrashHandler(Context context) { - this.mContext = context; - } - - @Override - public void run() { - while (isRunning.get()) { - try { - Looper.loop(); - } catch (final Throwable e) { - e.printStackTrace(); - if (isRunning.get()) { - MAIN_HANDLER.post(new Runnable(){ - - @Override - public void run() { - Toast.makeText(mContext, e.toString(), Toast.LENGTH_LONG).show(); - } - }); - } else { - if (e instanceof RuntimeException) { - throw (RuntimeException)e; - } else { - throw new RuntimeException(e); - } - } - } - } - } - } - - private static class UncaughtExceptionHandlerImpl implements UncaughtExceptionHandler { - - private static DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy_MM_dd-HH_mm_ss"); - - private final Context mContext; - - private final File mCrashDir; - - public UncaughtExceptionHandlerImpl(Context context, String crashDir) { - this.mContext = context; - this.mCrashDir = TextUtils.isEmpty(crashDir) ? new File(mContext.getExternalCacheDir(), "crash") : new File(crashDir); - } - - @Override - public void uncaughtException(Thread thread, Throwable throwable) { - try { - - String log = buildLog(throwable); - writeLog(log); - - try { - Intent intent = new Intent(mContext, CrashActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.putExtra(Intent.EXTRA_TEXT, log); - mContext.startActivity(intent); - } catch (Throwable e) { - e.printStackTrace(); - writeLog(e.toString()); - } - - throwable.printStackTrace(); - android.os.Process.killProcess(android.os.Process.myPid()); - System.exit(0); - - } catch (Throwable e) { - if (DEFAULT_UNCAUGHT_EXCEPTION_HANDLER != null) DEFAULT_UNCAUGHT_EXCEPTION_HANDLER.uncaughtException(thread, throwable); - } - } - - private String buildLog(Throwable throwable) { - String time = DATE_FORMAT.format(new Date()); - - String versionName = "unknown"; - long versionCode = 0; - try { - PackageInfo packageInfo = mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0); - versionName = packageInfo.versionName; - versionCode = Build.VERSION.SDK_INT >= 28 ? packageInfo.getLongVersionCode() : packageInfo.versionCode; - } catch (Throwable ignored) {} - - LinkedHashMap head = new LinkedHashMap(); - head.put("Time Of Crash", time); - head.put("Device", String.format("%s, %s", Build.MANUFACTURER, Build.MODEL)); - head.put("Android Version", String.format("%s (%d)", Build.VERSION.RELEASE, Build.VERSION.SDK_INT)); - head.put("App Version", String.format("%s (%d)", versionName, versionCode)); - head.put("Kernel", getKernel()); - head.put("Support Abis", Build.VERSION.SDK_INT >= 21 && Build.SUPPORTED_ABIS != null ? Arrays.toString(Build.SUPPORTED_ABIS): "unknown"); - head.put("Fingerprint", Build.FINGERPRINT); - - StringBuilder builder = new StringBuilder(); - - for (String key : head.keySet()) { - if (builder.length() != 0) builder.append("\n"); - builder.append(key); - builder.append(" : "); - builder.append(head.get(key)); - } - - builder.append("\n\n"); - builder.append(Log.getStackTraceString(throwable)); - - return builder.toString(); - } - - private void writeLog(String log) { - String time = DATE_FORMAT.format(new Date()); - File file = new File(mCrashDir, "crash_" + time + ".txt"); - try { - write(file, log.getBytes("UTF-8")); - } catch (Throwable e) { - e.printStackTrace(); - } - } - - private static String getKernel() { - try { - return App.toString(new FileInputStream("/proc/version")).trim(); - } catch (Throwable e) { - return e.getMessage(); - } - } - } - } - - public static final class CrashActivity extends Activity { - - private String mLog; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - setTheme(android.R.style.Theme_DeviceDefault); - setTitle("App Crash"); - - mLog = getIntent().getStringExtra(Intent.EXTRA_TEXT); - - ScrollView contentView = new ScrollView(this); - contentView.setFillViewport(true); - - HorizontalScrollView horizontalScrollView = new HorizontalScrollView(this); - - TextView textView = new TextView(this); - int padding = dp2px(16); - textView.setPadding(padding, padding, padding, padding); - textView.setText(mLog); - textView.setTextIsSelectable(true); - textView.setTypeface(Typeface.DEFAULT); - textView.setLinksClickable(true); - - horizontalScrollView.addView(textView); - contentView.addView(horizontalScrollView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); - - setContentView(contentView); - } - - private void restart() { - Intent intent = getPackageManager().getLaunchIntentForPackage(getPackageName()); - if (intent != null) { - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); - } - finish(); - android.os.Process.killProcess(android.os.Process.myPid()); - System.exit(0); - } - - private static int dp2px(float dpValue) { - final float scale = Resources.getSystem().getDisplayMetrics().density; - return (int) (dpValue * scale + 0.5f); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - menu.add(0, android.R.id.copy, 0, android.R.string.copy) - .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); - return super.onCreateOptionsMenu(menu); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.copy: - ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); - cm.setPrimaryClip(ClipData.newPlainText(getPackageName(), mLog)); - return true; - } - return super.onOptionsItemSelected(item); - } - - @Override - public void onBackPressed() { - restart(); - } - } -} diff --git a/debugtemp/src/main/java/cc/winboll/studio/debugtemp/MainActivity.java b/debugtemp/src/main/java/cc/winboll/studio/debugtemp/MainActivity.java deleted file mode 100644 index 4f5927b..0000000 --- a/debugtemp/src/main/java/cc/winboll/studio/debugtemp/MainActivity.java +++ /dev/null @@ -1,38 +0,0 @@ -package cc.winboll.studio.debugtemp; - -import android.content.Intent; -import android.os.Bundle; -import android.view.View; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; -import cc.winboll.studio.LibraryActivity; -import cc.winboll.studio.libappbase.LogView; -import cc.winboll.studio.libappbase.ToastUtils; - -public class MainActivity extends AppCompatActivity { - - LogView mLogView; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - mLogView = findViewById(R.id.logview); - - ToastUtils.show("onCreate"); - } - - @Override - protected void onResume() { - super.onResume(); - mLogView.start(); - } - - public void onLibraryActivity(View view) { - startActivity(new Intent(this, LibraryActivity.class)); - } -} diff --git a/debugtemp/src/main/res/drawable-v24/ic_launcher_foreground.xml b/debugtemp/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index c7bd21d..0000000 --- a/debugtemp/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/debugtemp/src/main/res/drawable/ic_launcher_background.xml b/debugtemp/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index d5fccc5..0000000 --- a/debugtemp/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/debugtemp/src/main/res/layout/activity_main.xml b/debugtemp/src/main/res/layout/activity_main.xml deleted file mode 100644 index ee193ec..0000000 --- a/debugtemp/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - -