diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/build.gradle | 11 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt | 13 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt | 3 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt | 2 |
4 files changed, 21 insertions, 8 deletions
diff --git a/app/build.gradle b/app/build.gradle index 281799ef..80895f6e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,11 +2,14 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'io.fabric' -def fabricProps = new Properties() -file("../fabric.properties").withInputStream { - stream -> fabricProps.load(stream) +def FABRIC_API_KEY = System.env.FABRIC_API_KEY +if (FABRIC_API_KEY == null) { + def fabricProps = new Properties() + file("../fabric.properties").withInputStream { + stream -> fabricProps.load(stream) + } + FABRIC_API_KEY = fabricProps.getProperty('FABRIC_API_KEY', 'empty') } -def FABRIC_API_KEY = System.env.FABRIC_API_KEY ?: fabricProps.getProperty('FABRIC_API_KEY', 'empty') println 'Fabric ' + FABRIC_API_KEY android { compileSdkVersion Integer.parseInt(project.TARGET_SDK) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt index 4c34ccfc..9cfe5618 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt @@ -7,6 +7,9 @@ import android.net.Uri import android.widget.ImageView import com.bumptech.glide.Glide import com.bumptech.glide.request.RequestOptions +import com.crashlytics.android.Crashlytics +import com.crashlytics.android.answers.Answers +import com.crashlytics.android.core.CrashlyticsCore import com.mikepenz.materialdrawer.util.AbstractDrawerImageLoader import com.mikepenz.materialdrawer.util.DrawerImageLoader import com.mikepenz.materialdrawer.util.DrawerUIUtils @@ -15,17 +18,25 @@ import com.pitchedapps.frost.utils.CrashReportingTree import com.pitchedapps.frost.utils.Prefs import com.raizlabs.android.dbflow.config.FlowConfig import com.raizlabs.android.dbflow.config.FlowManager +import io.fabric.sdk.android.Fabric import timber.log.Timber import timber.log.Timber.DebugTree + /** * Created by Allan Wang on 2017-05-28. */ class FrostApp : Application() { override fun onCreate() { + val core = CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build() + Fabric.with(this, core, Answers()) if (BuildConfig.DEBUG) Timber.plant(DebugTree()) - else Timber.plant(CrashReportingTree()) + else { + + Fabric.with(this, Crashlytics()) + Timber.plant(CrashReportingTree()) + } FlowManager.init(FlowConfig.Builder(this).build()) Prefs(this) FbCookie() diff --git a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt index 2f81d387..04056043 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt @@ -2,11 +2,9 @@ package com.pitchedapps.frost import android.os.Bundle import android.support.v7.app.AppCompatActivity -import com.crashlytics.android.Crashlytics import com.pitchedapps.frost.dbflow.loadFbCookiesAsync import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.launchNewTask -import io.fabric.sdk.android.Fabric /** * Created by Allan Wang on 2017-05-28. @@ -15,7 +13,6 @@ class StartActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - Fabric.with(this, Crashlytics()) L.d("Load cookies ${System.currentTimeMillis()}") loadFbCookiesAsync { cookies -> diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt index 2465980d..690f967c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt @@ -1,6 +1,7 @@ package com.pitchedapps.frost.utils import android.util.Log +import com.crashlytics.android.Crashlytics import timber.log.Timber @@ -20,6 +21,7 @@ internal class CrashReportingTree : Timber.Tree() { if (priority == Log.VERBOSE || priority == Log.DEBUG) return Log.println(priority, tag, message) + Crashlytics.log(priority, tag, message) // FakeCrashLibrary.log(priority, tag, message) // if (t != null) { |