Removed Firebase Crash deps, updated retrofit (with fixes) and disabled minification.

This commit is contained in:
Amine 2017-05-28 18:18:15 +02:00
parent 35ef798279
commit ddf790bfe1
15 changed files with 26 additions and 32 deletions

View File

@ -38,7 +38,7 @@ android {
} }
buildTypes { buildTypes {
release { release {
minifyEnabled true minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro' 'proguard-rules.pro'
} }
@ -73,7 +73,6 @@ dependencies {
compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.android.support.constraint:constraint-layout:1.0.2'
// Firebase + crashlytics // Firebase + crashlytics
compile 'com.google.android.gms:play-services:10.2.6'
compile 'com.google.firebase:firebase-core:10.2.6' compile 'com.google.firebase:firebase-core:10.2.6'
compile 'com.google.firebase:firebase-config:10.2.6' compile 'com.google.firebase:firebase-config:10.2.6'
compile 'com.google.firebase:firebase-invites:10.2.6' compile 'com.google.firebase:firebase-invites:10.2.6'
@ -93,9 +92,9 @@ dependencies {
} }
// Retrofit + http logging + okhttp // Retrofit + http logging + okhttp
compile 'com.squareup.retrofit2:retrofit:2.1.0' compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1' compile 'com.squareup.okhttp3:logging-interceptor:3.8.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0' compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.burgstaller:okhttp-digest:1.12' compile 'com.burgstaller:okhttp-digest:1.12'
// Material-ish things // Material-ish things

View File

@ -50,6 +50,9 @@
-dontwarn retrofit2.Platform$Java8 -dontwarn retrofit2.Platform$Java8
-keepattributes Signature -keepattributes Signature
-keepattributes Exceptions -keepattributes Exceptions
-dontwarn okio.**
-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.ParametersAreNonnullByDefault
#Bottom bar lib #Bottom bar lib

View File

@ -68,7 +68,7 @@ class AddSourceActivity : AppCompatActivity() {
api.spouts().enqueue(object : Callback<Map<String, Spout>> { api.spouts().enqueue(object : Callback<Map<String, Spout>> {
override fun onResponse(call: Call<Map<String, Spout>>, response: Response<Map<String, Spout>>) { override fun onResponse(call: Call<Map<String, Spout>>, response: Response<Map<String, Spout>>) {
if (response.body() != null) { if (response.body() != null) {
items = response.body() items = response.body()!!
val itemsStrings = items.map { it.value.name } val itemsStrings = items.map { it.value.name }
for ((key, value) in items) { for ((key, value) in items) {
@ -106,7 +106,7 @@ class AddSourceActivity : AppCompatActivity() {
} else { } else {
api.createSource(title, url, mSpoutsValue!!, mTags.text.toString(), "").enqueue(object : Callback<SuccessResponse> { api.createSource(title, url, mSpoutsValue!!, mTags.text.toString(), "").enqueue(object : Callback<SuccessResponse> {
override fun onResponse(call: Call<SuccessResponse>, response: Response<SuccessResponse>) { override fun onResponse(call: Call<SuccessResponse>, response: Response<SuccessResponse>) {
if (response.body() != null && response.body().isSuccess) { if (response.body() != null && response.body()!!.isSuccess) {
finish() finish()
} else { } else {
Toast.makeText(this@AddSourceActivity, R.string.cant_create_source, Toast.LENGTH_SHORT).show() Toast.makeText(this@AddSourceActivity, R.string.cant_create_source, Toast.LENGTH_SHORT).show()

View File

@ -14,7 +14,6 @@ import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView
import android.support.v7.widget.StaggeredGridLayoutManager import android.support.v7.widget.StaggeredGridLayoutManager
import android.support.v7.widget.helper.ItemTouchHelper import android.support.v7.widget.helper.ItemTouchHelper
import android.util.Log
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.widget.Toast import android.widget.Toast
@ -36,7 +35,6 @@ import com.github.stkent.amplify.tracking.Amplify
import com.google.android.gms.appinvite.AppInviteInvitation import com.google.android.gms.appinvite.AppInviteInvitation
import com.google.android.gms.common.ConnectionResult import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.GoogleApiAvailability import com.google.android.gms.common.GoogleApiAvailability
import com.google.firebase.crash.FirebaseCrash
import com.google.firebase.remoteconfig.FirebaseRemoteConfig import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import com.mikepenz.aboutlibraries.Libs import com.mikepenz.aboutlibraries.Libs
import com.mikepenz.aboutlibraries.LibsBuilder import com.mikepenz.aboutlibraries.LibsBuilder
@ -188,8 +186,6 @@ class HomeActivity : AppCompatActivity() {
tabNew!!.setBadgeCount(items.size - 1) tabNew!!.setBadgeCount(items.size - 1)
} catch (e: IndexOutOfBoundsException) { } catch (e: IndexOutOfBoundsException) {
FirebaseCrash.logcat(Log.ERROR, "SWIPE ERROR", "Swipe index out of bound")
FirebaseCrash.report(e)
} }
} }
@ -247,7 +243,7 @@ class HomeActivity : AppCompatActivity() {
elementsShown = UNREAD_SHOWN elementsShown = UNREAD_SHOWN
api!!.unreadItems.enqueue(object : Callback<List<Item>> { api!!.unreadItems.enqueue(object : Callback<List<Item>> {
override fun onResponse(call: Call<List<Item>>, response: Response<List<Item>>) { override fun onResponse(call: Call<List<Item>>, response: Response<List<Item>>) {
if (response.body() != null && response.body().isNotEmpty()) { if (response.body() != null && response.body()!!.isNotEmpty()) {
items = response.body() as ArrayList<Item> items = response.body() as ArrayList<Item>
} else { } else {
items = ArrayList() items = ArrayList()
@ -267,7 +263,7 @@ class HomeActivity : AppCompatActivity() {
elementsShown = READ_SHOWN elementsShown = READ_SHOWN
api!!.readItems.enqueue(object : Callback<List<Item>> { api!!.readItems.enqueue(object : Callback<List<Item>> {
override fun onResponse(call: Call<List<Item>>, response: Response<List<Item>>) { override fun onResponse(call: Call<List<Item>>, response: Response<List<Item>>) {
if (response.body() != null && response.body().isNotEmpty()) { if (response.body() != null && response.body()!!.isNotEmpty()) {
items = response.body() as ArrayList<Item> items = response.body() as ArrayList<Item>
} else { } else {
items = ArrayList() items = ArrayList()
@ -287,7 +283,7 @@ class HomeActivity : AppCompatActivity() {
elementsShown = FAV_SHOWN elementsShown = FAV_SHOWN
api!!.starredItems.enqueue(object : Callback<List<Item>> { api!!.starredItems.enqueue(object : Callback<List<Item>> {
override fun onResponse(call: Call<List<Item>>, response: Response<List<Item>>) { override fun onResponse(call: Call<List<Item>>, response: Response<List<Item>>) {
if (response.body() != null && response.body().isNotEmpty()) { if (response.body() != null && response.body()!!.isNotEmpty()) {
items = response.body() as ArrayList<Item> items = response.body() as ArrayList<Item>
} else { } else {
items = ArrayList() items = ArrayList()
@ -360,7 +356,7 @@ class HomeActivity : AppCompatActivity() {
api!!.readAll(ids).enqueue(object : Callback<SuccessResponse> { api!!.readAll(ids).enqueue(object : Callback<SuccessResponse> {
override fun onResponse(call: Call<SuccessResponse>, response: Response<SuccessResponse>) { override fun onResponse(call: Call<SuccessResponse>, response: Response<SuccessResponse>) {
if (response.body() != null && response.body().isSuccess) { if (response.body() != null && response.body()!!.isSuccess) {
Toast.makeText(this@HomeActivity, R.string.all_posts_read, Toast.LENGTH_SHORT).show() Toast.makeText(this@HomeActivity, R.string.all_posts_read, Toast.LENGTH_SHORT).show()
} else { } else {
Toast.makeText(this@HomeActivity, R.string.all_posts_not_read, Toast.LENGTH_SHORT).show() Toast.makeText(this@HomeActivity, R.string.all_posts_not_read, Toast.LENGTH_SHORT).show()
@ -432,10 +428,10 @@ class HomeActivity : AppCompatActivity() {
api!!.stats.enqueue(object : Callback<Stats> { api!!.stats.enqueue(object : Callback<Stats> {
override fun onResponse(call: Call<Stats>, response: Response<Stats>) { override fun onResponse(call: Call<Stats>, response: Response<Stats>) {
if (response.body() != null) { if (response.body() != null) {
tabNew!!.setBadgeCount(response.body().unread) tabNew!!.setBadgeCount(response.body()!!.unread)
if (displayAllCount) { if (displayAllCount) {
tabArchive!!.setBadgeCount(response.body().total) tabArchive!!.setBadgeCount(response.body()!!.total)
tabStarred!!.setBadgeCount(response.body().starred) tabStarred!!.setBadgeCount(response.body()!!.starred)
} else { } else {
tabArchive!!.removeBadge() tabArchive!!.removeBadge()
tabStarred!!.removeBadge() tabStarred!!.removeBadge()

View File

@ -203,7 +203,7 @@ class LoginActivity : AppCompatActivity() {
} }
override fun onResponse(call: Call<SuccessResponse>, response: Response<SuccessResponse>) { override fun onResponse(call: Call<SuccessResponse>, response: Response<SuccessResponse>) {
if (response.body() != null && response.body().isSuccess) { if (response.body() != null && response.body()!!.isSuccess) {
mFirebaseAnalytics!!.logEvent(FirebaseAnalytics.Event.LOGIN, Bundle()) mFirebaseAnalytics!!.logEvent(FirebaseAnalytics.Event.LOGIN, Bundle())
goToMain() goToMain()
} else { } else {

View File

@ -53,12 +53,12 @@ class ReaderActivity : DragDismissActivity() {
parser.parseUrl(url).enqueue(object : Callback<ParsedContent> { parser.parseUrl(url).enqueue(object : Callback<ParsedContent> {
override fun onResponse(call: Call<ParsedContent>, response: Response<ParsedContent>) { override fun onResponse(call: Call<ParsedContent>, response: Response<ParsedContent>) {
if (response.body() != null) { if (response.body() != null) {
source.text = response.body().domain source.text = response.body()!!.domain
title.text = response.body().title title.text = response.body()!!.title
if (response.body().content != null && !response.body().content.isEmpty()) if (response.body()!!.content != null && !response.body()!!.content.isEmpty())
content.setHtml(response.body().content, HtmlHttpImageGetter(content, null, true)) content.setHtml(response.body()!!.content, HtmlHttpImageGetter(content, null, true))
if (response.body().lead_image_url != null && !response.body().lead_image_url.isEmpty()) if (response.body()!!.lead_image_url != null && !response.body()!!.lead_image_url.isEmpty())
Glide.with(applicationContext).load(response.body().lead_image_url).asBitmap().fitCenter().into(image) Glide.with(applicationContext).load(response.body()!!.lead_image_url).asBitmap().fitCenter().into(image)
hideProgressBar() hideProgressBar()
} else { } else {
errorAfterMercuryCall() errorAfterMercuryCall()

View File

@ -36,7 +36,7 @@ class SourcesActivity : AppCompatActivity() {
api.sources.enqueue(object : Callback<List<Sources>> { api.sources.enqueue(object : Callback<List<Sources>> {
override fun onResponse(call: Call<List<Sources>>, response: Response<List<Sources>>) { override fun onResponse(call: Call<List<Sources>>, response: Response<List<Sources>>) {
if (response.body() != null && response.body().isNotEmpty()) { if (response.body() != null && response.body()!!.isNotEmpty()) {
items = response.body() as ArrayList<Sources> items = response.body() as ArrayList<Sources>
} }
val mAdapter = SourcesListAdapter(this@SourcesActivity, items, api) val mAdapter = SourcesListAdapter(this@SourcesActivity, items, api)

View File

@ -84,7 +84,7 @@ class SourcesListAdapter(private val app: Activity, private val items: ArrayList
val (id) = items[adapterPosition] val (id) = items[adapterPosition]
api.deleteSource(id).enqueue(object : Callback<SuccessResponse> { api.deleteSource(id).enqueue(object : Callback<SuccessResponse> {
override fun onResponse(call: Call<SuccessResponse>, response: Response<SuccessResponse>) { override fun onResponse(call: Call<SuccessResponse>, response: Response<SuccessResponse>) {
if (response.body() != null && response.body().isSuccess) { if (response.body() != null && response.body()!!.isSuccess) {
items.removeAt(adapterPosition) items.removeAt(adapterPosition)
notifyItemRemoved(adapterPosition) notifyItemRemoved(adapterPosition)
notifyItemRangeChanged(adapterPosition, itemCount) notifyItemRangeChanged(adapterPosition, itemCount)

View File

@ -6,11 +6,9 @@ import android.content.SharedPreferences
import android.net.Uri import android.net.Uri
import android.support.v7.app.AlertDialog import android.support.v7.app.AlertDialog
import android.text.TextUtils import android.text.TextUtils
import android.util.Log
import android.util.Patterns import android.util.Patterns
import apps.amine.bou.readerforselfoss.BuildConfig import apps.amine.bou.readerforselfoss.BuildConfig
import apps.amine.bou.readerforselfoss.R import apps.amine.bou.readerforselfoss.R
import com.google.firebase.crash.FirebaseCrash
import com.google.firebase.remoteconfig.FirebaseRemoteConfig import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import okhttp3.HttpUrl import okhttp3.HttpUrl
@ -57,8 +55,6 @@ fun checkApkVersion(settings: SharedPreferences, editor: SharedPreferences.Edito
if (task.isSuccessful) { if (task.isSuccessful) {
mFirebaseRemoteConfig.activateFetched() mFirebaseRemoteConfig.activateFetched()
} else { } else {
FirebaseCrash.logcat(Log.DEBUG, "CONFIG FETCH", "remote config task unsuccessful")
FirebaseCrash.report(Exception(task.exception))
} }
isThereAnUpdate(settings, editor, context, mFirebaseRemoteConfig) isThereAnUpdate(settings, editor, context, mFirebaseRemoteConfig)

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -10,7 +10,7 @@
<item <item
android:id="@+id/refresh" android:id="@+id/refresh"
android:icon="@drawable/quantum_ic_refresh_white_24" android:icon="@drawable/ic_refresh"
android:orderInCategory="99" android:orderInCategory="99"
android:title="@string/menu_home_refresh" android:title="@string/menu_home_refresh"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />