From f5dde5f0cc65af63f9a09166008504101887c208 Mon Sep 17 00:00:00 2001 From: faisalcodes Date: Tue, 23 May 2023 11:47:58 +0530 Subject: [PATCH 1/2] Preparing for patch release "2023.05.23.3" --- app/build.gradle | 4 +- app/proguard-rules.pro | 11 ++++- app/src/main/assets/science/index.json | 48 +++++++++---------- .../reference/ActivityQuranScience.kt | 33 ++++++++++--- 4 files changed, 63 insertions(+), 33 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3a08550b..bd3ca3f8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,8 +15,8 @@ android { targetSdkVersion 33 // I don't know why I've used such a weird versioning scheme in the beginning, // but I can't change it now as the app is already in the Play Store - versionCode 23_05_22_001 - versionName "2023.05.22.1" + versionCode 23_05_23_003 + versionName "2023.05.23.3" resValue "string", "app_name", "QuranApp" diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 414b166f..ca273180 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -25,4 +25,13 @@ # Keep custom exceptions. -keep public class * extends java.lang.Exception # Keep all api models --keep class com.quranapp.android.api.models.** { *; } \ No newline at end of file +-keep class com.quranapp.android.api.models.** { *; } + +# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items). +-keep,allowobfuscation,allowshrinking interface retrofit2.Call +-keep,allowobfuscation,allowshrinking class retrofit2.Response + + # With R8 full mode generic signatures are stripped for classes that are not + # kept. Suspend functions are wrapped in continuations where the type argument + # is used. +-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation \ No newline at end of file diff --git a/app/src/main/assets/science/index.json b/app/src/main/assets/science/index.json index c4fb4311..1e6aa5dd 100644 --- a/app/src/main/assets/science/index.json +++ b/app/src/main/assets/science/index.json @@ -1,74 +1,74 @@ [ { + "id": 1, "title": "Astronomy", "referencesCount": 16, - "path": "astronomy.html", - "image": "ic_science_astronomy" + "path": "astronomy.html" }, { + "id": 2, "title": "Physics", "referencesCount": 2, - "path": "physics.html", - "image": "ic_science_physics" + "path": "physics.html" }, { + "id": 3, "title": "Geography", "referencesCount": 17, - "path": "geography.html", - "image": "ic_science_geography" + "path": "geography.html" }, { + "id": 4, "title": "Geology", "referencesCount": 6, - "path": "geology.html", - "image": "ic_science_geology" + "path": "geology.html" }, { + "id": 5, "title": "Oceanography", "referencesCount": 3, - "path": "oceanography.html", - "image": "ic_science_oceanography" + "path": "oceanography.html" }, { + "id": 6, "title": "Biology", "referencesCount": 3, - "path": "biology.html", - "image": "ic_science_biology" + "path": "biology.html" }, { + "id": 7, "title": "Botany", "referencesCount": 2, - "path": "botany.html", - "image": "ic_science_botany" + "path": "botany.html" }, { + "id": 8, "title": "Zoology", "referencesCount": 7, - "path": "zoology.html", - "image": "ic_science_zoology" + "path": "zoology.html" }, { + "id": 9, "title": "Medicine", "referencesCount": 2, - "path": "medicine.html", - "image": "ic_science_medicine" + "path": "medicine.html" }, { + "id": 10, "title": "Physiology", "referencesCount": 1, - "path": "physiology.html", - "image": "ic_science_physiology" + "path": "physiology.html" }, { + "id": 11, "title": "Embryology", "referencesCount": 28, - "path": "embryology.html", - "image": "ic_science_embryology" + "path": "embryology.html" }, { + "id": 12, "title": "General Science", "referencesCount": 3, - "path": "general.html", - "image": "ic_science_general" + "path": "general.html" } ] \ No newline at end of file diff --git a/app/src/main/java/com/quranapp/android/activities/reference/ActivityQuranScience.kt b/app/src/main/java/com/quranapp/android/activities/reference/ActivityQuranScience.kt index 6068a2b3..11268d0f 100644 --- a/app/src/main/java/com/quranapp/android/activities/reference/ActivityQuranScience.kt +++ b/app/src/main/java/com/quranapp/android/activities/reference/ActivityQuranScience.kt @@ -18,6 +18,7 @@ class ActivityQuranScience : BaseActivity() { override fun getLayoutResource() = R.layout.activity_exclusive_verses override fun shouldInflateAsynchronously() = true + @SuppressLint("DiscouragedApi") override fun onActivityInflated(activityView: View, savedInstanceState: Bundle?) { val binding = ActivityExclusiveVersesBinding.bind(activityView) @@ -46,12 +47,14 @@ class ActivityQuranScience : BaseActivity() { for (i in 0 until jsonArray.length()) { val obj = jsonArray.getJSONObject(i) - items.add(QuranScienceItem( - obj.getString("title"), - obj.getInt("referencesCount"), - obj.getString("path"), - resources.getIdentifier(obj.getString("image"), "drawable", packageName) - )) + items.add( + QuranScienceItem( + obj.getString("title"), + obj.getInt("referencesCount"), + obj.getString("path"), + getDrawableRes(obj.getInt("id")) + ) + ) } } @@ -60,6 +63,24 @@ class ActivityQuranScience : BaseActivity() { binding.list.adapter = ADPQuranScience(items) } + private fun getDrawableRes(id: Int): Int { + return when (id) { + 1 -> R.drawable.ic_science_astronomy + 2 -> R.drawable.ic_science_physics + 3 -> R.drawable.ic_science_geography + 4 -> R.drawable.ic_science_geology + 5 -> R.drawable.ic_science_oceanography + 6 -> R.drawable.ic_science_biology + 7 -> R.drawable.ic_science_botany + 8 -> R.drawable.ic_science_zoology + 9 -> R.drawable.ic_science_medicine + 10 -> R.drawable.ic_science_physiology + 11 -> R.drawable.ic_science_embryology + 12 -> R.drawable.ic_science_general + else -> 0 + } + } + private fun showInfoDialog() { PeaceDialog.newBuilder(this) .setTitle("About this page") From 8a7ffbec2fe0814513ead77a2c611e55d4e490ce Mon Sep 17 00:00:00 2001 From: Faisal Khan Date: Tue, 23 May 2023 11:55:19 +0530 Subject: [PATCH 2/2] Update app_updates.json --- inventory/versions/app_updates.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inventory/versions/app_updates.json b/inventory/versions/app_updates.json index e1bb54af..7616e5f7 100644 --- a/inventory/versions/app_updates.json +++ b/inventory/versions/app_updates.json @@ -22,5 +22,9 @@ { "version": 230522001, "updatePriority": 3 + }, + { + "version": 230523003, + "updatePriority": 3 } ]