From 80ecd906e731b14b276944fb3ee07578fd079822 Mon Sep 17 00:00:00 2001 From: HeCodes2Much Date: Fri, 7 Jun 2024 21:49:56 +0100 Subject: [PATCH] Fix: fixed proguard building Signed-off-by: HeCodes2Much --- app/proguard-rules.pro | 32 ++++++++----------- .../launcher/ui/widgets/WidgetFragment.kt | 2 +- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index ff59496..4abcee7 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,21 +1,17 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html +# Keep the WeatherResponse and its nested classes +-keep class com.github.droidworksstudio.launcher.helper.weather.WeatherResponse { *; } +-keep class com.github.droidworksstudio.launcher.helper.weather.Wind { *; } +-keep class com.github.droidworksstudio.launcher.helper.weather.Main { *; } +-keep class com.github.droidworksstudio.launcher.helper.weather.Weather { *; } -# 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 *; -#} +# Keep all model classes and their fields that Gson might use for serialization/deserialization +-keep class com.github.droidworksstudio.launcher.helper.weather.** { *; } -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable +# Keep Gson specific annotations +-keepattributes Signature +-keepattributes *Annotation* -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +# Keep the default constructor of the data classes +-keepclassmembers class com.github.droidworksstudio.launcher.helper.weather.** { + public (...); +} diff --git a/app/src/main/java/com/github/droidworksstudio/launcher/ui/widgets/WidgetFragment.kt b/app/src/main/java/com/github/droidworksstudio/launcher/ui/widgets/WidgetFragment.kt index 23393d7..14706e8 100644 --- a/app/src/main/java/com/github/droidworksstudio/launcher/ui/widgets/WidgetFragment.kt +++ b/app/src/main/java/com/github/droidworksstudio/launcher/ui/widgets/WidgetFragment.kt @@ -115,7 +115,7 @@ class WidgetFragment : Fragment(), binding.weatherPressure.text = getString(R.string.widget_weather_pressure, weatherResponse.main.pressure) - val weatherWidgetDrawable = binding.weatherButtonRefresh.background + val weatherWidgetDrawable = binding.weatherRoot.background if (weatherWidgetDrawable is GradientDrawable) { weatherWidgetDrawable.setColor(preferenceHelper.widgetBackgroundColor) }