From eaf16f1a41095a8065f3f939126bf6bce3b992ab Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Tue, 9 Dec 2025 20:15:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=9F=BA=E6=9C=AC=E7=B1=BB?= =?UTF-8?q?=E5=BA=93=E7=89=88=E6=9C=AC=EF=BC=8C=E8=B0=83=E6=95=B4=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=9F=BA=E7=A1=80=E7=89=88=E6=9C=AC=E5=8F=B7=E3=80=82?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=B1=BB=E5=BC=95=E7=94=A8=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- timestamp/build.gradle | 26 ++- timestamp/build.properties | 12 +- timestamp/proguard-rules.pro | 164 +++++++++++++++--- .../java/cc/winboll/studio/timestamp/App.java | 11 +- .../studio/timestamp/MainActivity.java | 4 +- 5 files changed, 165 insertions(+), 52 deletions(-) diff --git a/timestamp/build.gradle b/timestamp/build.gradle index e8099f7..2b59205 100644 --- a/timestamp/build.gradle +++ b/timestamp/build.gradle @@ -29,26 +29,14 @@ android { // versionName 更新后需要手动设置 // .winboll/winbollBuildProps.properties 文件的 stageCount=0 // Gradle编译环境下合起来的 versionName 就是 "${versionName}.0" - versionName "15.1" + versionName "15.12" if(true) { versionName = genVersionName("${versionName}") } } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } } dependencies { - api fileTree(dir: 'libs', include: ['*.jar']) - api 'cc.winboll.studio:libaes:15.6.0' - api 'cc.winboll.studio:libapputils:15.3.4' - api 'cc.winboll.studio:libappbase:15.7.6' - // SSH api 'com.jcraft:jsch:0.1.55' // Html 解析 @@ -58,8 +46,6 @@ dependencies { api 'com.journeyapps:zxing-android-embedded:3.6.0' // 应用介绍页类库 api 'io.github.medyo:android-about-page:2.0.0' - // 吐司类库 - api 'com.github.getActivity:ToastUtils:10.5' // 网络连接类库 api 'com.squareup.okhttp3:okhttp:4.4.1' // AndroidX 类库 @@ -69,4 +55,14 @@ dependencies { //api 'androidx.vectordrawable:vectordrawable:1.1.0' //api 'androidx.vectordrawable:vectordrawable-animated:1.1.0' //api 'androidx.fragment:fragment:1.1.0' + + // WinBoLL库 nexus.winboll.cc 地址 + //api 'cc.winboll.studio:libaes:15.12.0' + //api 'cc.winboll.studio:libappbase:15.12.2' + + // WinBoLL备用库 jitpack.io 地址 + api 'com.github.ZhanGSKen:AES:aes-v15.12.4' + api 'com.github.ZhanGSKen:APPBase:appbase-v15.12.2' + + api fileTree(dir: 'libs', include: ['*.jar']) } diff --git a/timestamp/build.properties b/timestamp/build.properties index 87e1d46..48433fa 100644 --- a/timestamp/build.properties +++ b/timestamp/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Sun Sep 28 13:16:52 HKT 2025 -stageCount=5 +#Tue Dec 09 12:14:13 GMT 2025 +stageCount=0 libraryProject= -baseVersion=15.1 -publishVersion=15.1.4 -buildCount=0 -baseBetaVersion=15.1.5 +baseVersion=15.12 +publishVersion=15.12.0 +buildCount=3 +baseBetaVersion=15.12.1 diff --git a/timestamp/proguard-rules.pro b/timestamp/proguard-rules.pro index 64b4a05..855b18a 100644 --- a/timestamp/proguard-rules.pro +++ b/timestamp/proguard-rules.pro @@ -1,21 +1,143 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +# 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.** +# ============================== 必要补充规则 ============================== +# OkHttp 4.4.1 补充规则(Java 7 兼容) +-keep class okhttp3.internal.concurrent.** { *; } +-keep class okhttp3.internal.connection.** { *; } +-dontwarn okhttp3.internal.concurrent.TaskRunner +-dontwarn okhttp3.internal.connection.RealCall + +# 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/timestamp/src/main/java/cc/winboll/studio/timestamp/App.java b/timestamp/src/main/java/cc/winboll/studio/timestamp/App.java index 4b2651e..eebf27e 100644 --- a/timestamp/src/main/java/cc/winboll/studio/timestamp/App.java +++ b/timestamp/src/main/java/cc/winboll/studio/timestamp/App.java @@ -14,7 +14,6 @@ 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; @@ -22,9 +21,9 @@ import android.widget.HorizontalScrollView; import android.widget.ScrollView; import android.widget.TextView; import android.widget.Toast; -import cc.winboll.studio.timestamp.R; import cc.winboll.studio.libappbase.GlobalApplication; -import com.hjq.toast.ToastUtils; +import cc.winboll.studio.libappbase.ToastUtils; +import cc.winboll.studio.timestamp.R; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.Closeable; @@ -52,11 +51,7 @@ public class App extends GlobalApplication { // 初始化 Toast 框架 ToastUtils.init(this); - // 设置 Toast 布局样式 - //ToastUtils.setView(R.layout.view_toast); - //ToastUtils.setStyle(new WhiteToastStyle()); - ToastUtils.setGravity(Gravity.BOTTOM, 0, 200); - + //CrashHandler.getInstance().registerGlobal(this); //CrashHandler.getInstance().registerPart(this); } diff --git a/timestamp/src/main/java/cc/winboll/studio/timestamp/MainActivity.java b/timestamp/src/main/java/cc/winboll/studio/timestamp/MainActivity.java index efec018..aface49 100644 --- a/timestamp/src/main/java/cc/winboll/studio/timestamp/MainActivity.java +++ b/timestamp/src/main/java/cc/winboll/studio/timestamp/MainActivity.java @@ -10,12 +10,12 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import cc.winboll.studio.libappbase.LogUtils; import cc.winboll.studio.libappbase.LogView; +import cc.winboll.studio.libappbase.ToastUtils; import cc.winboll.studio.timestamp.MainService; import cc.winboll.studio.timestamp.R; import cc.winboll.studio.timestamp.utils.AppConfigsUtil; import cc.winboll.studio.timestamp.utils.ClipboardUtil; import cc.winboll.studio.timestamp.utils.TimeStampUtil; -import com.hjq.toast.ToastUtils; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; @@ -56,7 +56,7 @@ public class MainActivity extends AppCompatActivity { mLogView = findViewById(R.id.logview); - ToastUtils.show("onCreate"); + //ToastUtils.show("onCreate"); }