From 7911f4f3813e789f6a7bf6ecc4b8739f1a86a0b6 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Tue, 1 Sep 2020 15:24:56 +0800 Subject: Fix proguard for gson. Fix multireddit's info cannot be updated in minifiedRelease. Version 4.0.7. --- app/build.gradle | 4 ++-- app/proguard-rules.pro | 2 ++ .../infinityforreddit/MultiReddit/MultiRedditJSONModel.java | 10 ---------- .../infinityforreddit/MultiReddit/SubredditInMultiReddit.java | 11 +++++++++++ 4 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/SubredditInMultiReddit.java (limited to 'app') diff --git a/app/build.gradle b/app/build.gradle index 4ddca14a..0b2364f9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "ml.docilealligator.infinityforreddit" minSdkVersion 21 targetSdkVersion 29 - versionCode 42 - versionName "4.0.6" + versionCode 43 + versionName "4.0.7" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" javaCompileOptions { annotationProcessorOptions { diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index bccefb5b..d3f74dda 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -63,6 +63,8 @@ # Application classes that will be serialized/deserialized over Gson -keep class ml.docilealligator.infinityforreddit.CustomTheme.CustomTheme { ; } +-keep class ml.docilealligator.infinityforreddit.MultiReddit.MultiRedditJSONModel { ; } +-keep class ml.docilealligator.infinityforreddit.MultiReddit.SubredditInMultiReddit { ; } # Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory, # JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditJSONModel.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditJSONModel.java index df921d35..665a9092 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditJSONModel.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditJSONModel.java @@ -35,14 +35,4 @@ public class MultiRedditJSONModel { Gson gson = new Gson(); return gson.toJson(this); } - - class SubredditInMultiReddit { - String name; - - SubredditInMultiReddit() {} - - SubredditInMultiReddit(String subredditName) { - name = subredditName; - } - } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/SubredditInMultiReddit.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/SubredditInMultiReddit.java new file mode 100644 index 00000000..34a1e638 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/SubredditInMultiReddit.java @@ -0,0 +1,11 @@ +package ml.docilealligator.infinityforreddit.MultiReddit; + +public class SubredditInMultiReddit { + String name; + + SubredditInMultiReddit() {} + + SubredditInMultiReddit(String subredditName) { + name = subredditName; + } +} \ No newline at end of file -- cgit v1.2.3