diff --git a/app/build.gradle b/app/build.gradle index 653f6280..64b2f61a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { applicationId "com.starry.greenstash" minSdk 24 targetSdk 34 - versionCode 27 - versionName "2.7.0" + versionCode 28 + versionName "2.8.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { @@ -82,7 +82,7 @@ dependencies { // Android core components. implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2' - implementation 'androidx.activity:activity-compose:1.7.2' + implementation 'androidx.activity:activity-compose:1.8.0' implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.6.2" implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2" // Jetpack compose. @@ -96,7 +96,7 @@ dependencies { implementation "com.google.accompanist:accompanist-systemuicontroller:0.28.0" implementation "com.google.accompanist:accompanist-navigation-animation:0.33.1-alpha" // Material theme for main activity. - implementation 'com.google.android.material:material:1.9.0' + implementation 'com.google.android.material:material:1.10.0' // Android 12+ splash API. implementation 'androidx.core:core-splashscreen:1.0.1' // Room database diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 481bb434..4d58af0f 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -18,4 +18,22 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +# Keep all data classes. +# +# Rule explanation: +# 1. All data class has component1() method which returns data +# 2. All data class has at least one field. +# 3. Almost all the classes doesn’t satisfy criteria above. +-keepclasseswithmembers class com.starry.greenstash.** { + public ** component1(); + ; +} + +# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory, +# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) +-keep class * implements com.google.gson.TypeAdapter +-keep class * implements com.google.gson.TypeAdapterFactory +-keep class * implements com.google.gson.JsonSerializer +-keep class * implements com.google.gson.JsonDeserializer \ No newline at end of file diff --git a/app/src/main/java/com/starry/greenstash/backup/BackupManager.kt b/app/src/main/java/com/starry/greenstash/backup/BackupManager.kt index d5d9009b..d2cc3a95 100644 --- a/app/src/main/java/com/starry/greenstash/backup/BackupManager.kt +++ b/app/src/main/java/com/starry/greenstash/backup/BackupManager.kt @@ -4,6 +4,7 @@ import android.content.Context import android.content.Intent import android.graphics.Bitmap import android.util.Log +import androidx.annotation.Keep import androidx.core.content.FileProvider import com.google.gson.Gson import com.google.gson.GsonBuilder @@ -34,8 +35,10 @@ class BackupManager(private val context: Context, private val goalDao: GoalDao) companion object { /** Backup schema version. */ const val BACKUP_SCHEMA_VERSION = 1 + /** Authority for using file provider API. */ private const val FILE_PROVIDER_AUTHORITY = "${BuildConfig.APPLICATION_ID}.provider" + /** An ISO-8601 date format for Gson */ private const val ISO8601_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" } @@ -44,6 +47,7 @@ class BackupManager(private val context: Context, private val goalDao: GoalDao) * Model for backup json data, containing current schema version * and timestamp when backup was created. */ + @Keep data class BackupJsonModel( val version: Int = BACKUP_SCHEMA_VERSION, val timestamp: Long, diff --git a/fastlane/metadata/android/en-US/changelogs/28.txt b/fastlane/metadata/android/en-US/changelogs/28.txt new file mode 100644 index 00000000..37166117 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/28.txt @@ -0,0 +1,5 @@ +- Rewrote backup & restore backend from scratch to be more reliable & stable. +- Fixed notes field going below the keyboard as the user types. +- Added Chinese translation. +- Updated dependencies, gradle & kotlin version. +- Some other minor fixes & improvements. \ No newline at end of file