Skip to content

Commit

Permalink
turned of minifyEnabled and Shirking of resources and fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Itsydv committed Oct 4, 2022
1 parent 1f6cb11 commit bd2e986
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 15 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ android {
applicationId "io.itsydv.vcriatequiz"
minSdk 23
targetSdk 33
versionCode 1
versionName "0.1"
versionCode 2
versionName "0.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled true
shrinkResources true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
Expand Down
16 changes: 15 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,18 @@
# Same story for the standard library's SafeContinuation that also uses AtomicReferenceFieldUpdater
-keepclassmembers class kotlin.coroutines.SafeContinuation {
volatile <fields>;
}
}

# Firebase
-keep class com.firebase.** { *; }
-keep class org.apache.** { *; }
-keepnames class com.fasterxml.jackson.** { *; }
-keepnames class javax.servlet.** { *; }
-keepnames class org.ietf.jgss.** { *; }
-dontwarn org.w3c.dom.**
-dontwarn org.joda.time.**
-dontwarn org.shaded.apache.**
-dontwarn org.ietf.jgss.**

# Only necessary if you downloaded the SDK jar directly instead of from maven.
-keep class com.shaded.fasterxml.jackson.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ class QuestionFragment : Fragment() {
}

override fun onDestroyView() {
timer.cancel()
if (this::timer.isInitialized) {
timer.cancel()
}
super.onDestroyView()
_binding = null
}
Expand Down
22 changes: 14 additions & 8 deletions app/src/main/java/io/itsydv/vcriatequiz/splash/LoginFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.itsydv.vcriatequiz.splash
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -89,16 +90,21 @@ class LoginFragment : Fragment() {
val account = task.getResult(ApiException::class.java)
if (account != null) {
val credential = GoogleAuthProvider.getCredential(account.idToken, null)
auth.signInWithCredential(credential).addOnCompleteListener { firebaseTask ->
if (firebaseTask.isSuccessful) {
val intent = Intent(requireActivity(), MainActivity::class.java)
startActivity(intent)
requireActivity().finish()
} else {
// If sign in fails, display a message to the user.
auth.signInWithCredential(credential)
.addOnCompleteListener { firebaseTask ->
if (firebaseTask.isSuccessful) {
val intent = Intent(requireActivity(), MainActivity::class.java)
startActivity(intent)
requireActivity().finish()
} else {
// If sign in fails, display a message to the user.
Toast.makeText(requireContext(), "Authentication Failed", Toast.LENGTH_SHORT).show()
}
}
.addOnFailureListener {
Toast.makeText(requireContext(), "Authentication Failed", Toast.LENGTH_SHORT).show()
it.printStackTrace()
}
}
}
} catch (e: ApiException) {
Toast.makeText(requireContext(), e.toString(), Toast.LENGTH_SHORT).show()
Expand Down

0 comments on commit bd2e986

Please sign in to comment.