From 3f1bd7b9b72f82e401ef3ba1e99c520c0eed6e2e Mon Sep 17 00:00:00 2001 From: HuanCheng65 <22636177+HuanCheng65@users.noreply.github.com> Date: Fri, 22 Sep 2023 19:16:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Release=20=E5=8C=85=E4=B8=AD=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E9=9D=A2=E9=A2=84=E5=8A=A0=E8=BD=BD=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/proguard-rules.pro | 13 ++++++++++--- .../huanchengfly/tieba/post/utils/ImageCacheUtil.kt | 2 +- .../tieba/post/utils/preload/PreloadUtil.java | 2 +- app/src/main/res/layout/fragment_photo_view.xml | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 21e0753c..f5cab367 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -267,13 +267,20 @@ -keep,allowobfuscation,allowshrinking class com.huanchengfly.tieba.post.api.retrofit.ApiResult -keep,allowobfuscation,allowshrinking class * extends com.huanchengfly.tieba.post.api.retrofit.ApiResult - -keep,allowobfuscation,allowshrinking interface retrofit2.Call - -keep,allowobfuscation,allowshrinking class retrofit2.Response +-keep,allowobfuscation,allowshrinking interface retrofit2.Call +-keep,allowobfuscation,allowshrinking class retrofit2.Response -keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation # Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher. -keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken -keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken +-keep,allowobfuscation,allowshrinking class com.billy.android.preloader.** { *; } +-keep,allowobfuscation,allowshrinking class com.huanchengfly.tieba.post.utils.preload.** { *; } + -if interface * { @retrofit2.http.* ; } --keep,allowobfuscation interface <1> \ No newline at end of file +-keep,allowobfuscation interface <1> + +-keepclassmembers,allowobfuscation class * { + @com.google.gson.annotations.SerializedName ; +} \ No newline at end of file diff --git a/app/src/main/java/com/huanchengfly/tieba/post/utils/ImageCacheUtil.kt b/app/src/main/java/com/huanchengfly/tieba/post/utils/ImageCacheUtil.kt index 8a5a1656..1307671e 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/utils/ImageCacheUtil.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/utils/ImageCacheUtil.kt @@ -104,7 +104,7 @@ object ImageCacheUtil { private fun getFolderSize(file: File): Long { var size: Long = 0 try { - val fileList = file.listFiles() + val fileList = file.listFiles() ?: return 0 for (aFileList in fileList) { size = if (aFileList.isDirectory) { size + getFolderSize(aFileList) diff --git a/app/src/main/java/com/huanchengfly/tieba/post/utils/preload/PreloadUtil.java b/app/src/main/java/com/huanchengfly/tieba/post/utils/preload/PreloadUtil.java index 80212e4c..8168a68d 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/utils/preload/PreloadUtil.java +++ b/app/src/main/java/com/huanchengfly/tieba/post/utils/preload/PreloadUtil.java @@ -10,7 +10,7 @@ import com.billy.android.preloader.interfaces.DataLoader; public final class PreloadUtil { public static final String EXTRA_PRELOAD_ID = "preload_id"; - public static void startActivityWithPreload(Context context, Intent intent, DataLoader dataLoader) { + public static void startActivityWithPreload(Context context, Intent intent, DataLoader dataLoader) { context.startActivity(intent.putExtra(EXTRA_PRELOAD_ID, PreLoader.preLoad(dataLoader))); } diff --git a/app/src/main/res/layout/fragment_photo_view.xml b/app/src/main/res/layout/fragment_photo_view.xml index 1054267b..af90c788 100644 --- a/app/src/main/res/layout/fragment_photo_view.xml +++ b/app/src/main/res/layout/fragment_photo_view.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".fragments.PhotoViewFragment"> -