From 98e18635b564c1720de5c135280da68baf2e0274 Mon Sep 17 00:00:00 2001 From: Matthieu <24-artectrex@users.noreply.shinice.net> Date: Thu, 10 Sep 2020 22:47:04 +0200 Subject: [PATCH] Add crash report using TraceDroid --- app/build.gradle | 3 +++ app/src/main/java/com/h/pixeldroid/MainActivity.kt | 4 ++++ app/src/main/java/com/h/pixeldroid/Pixeldroid.kt | 2 ++ 3 files changed, 9 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 38f98fb5..7baebb32 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -152,6 +152,9 @@ dependencies { implementation 'com.karumi:dexter:6.2.1' implementation 'com.google.android:flexbox:2.0.1' + implementation 'com.github.ligi.tracedroid:lib:3.0' + implementation 'com.github.ligi.tracedroid:supportemail:3.0' + androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' diff --git a/app/src/main/java/com/h/pixeldroid/MainActivity.kt b/app/src/main/java/com/h/pixeldroid/MainActivity.kt index b981fcad..0edbbdc8 100644 --- a/app/src/main/java/com/h/pixeldroid/MainActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/MainActivity.kt @@ -36,6 +36,7 @@ import com.mikepenz.materialdrawer.util.AbstractDrawerImageLoader import com.mikepenz.materialdrawer.util.DrawerImageLoader import com.mikepenz.materialdrawer.widget.AccountHeaderView import kotlinx.android.synthetic.main.activity_main.* +import org.ligi.tracedroid.sending.TraceDroidEmailSender import retrofit2.Call import retrofit2.Callback import retrofit2.Response @@ -61,6 +62,9 @@ class MainActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) + + TraceDroidEmailSender.sendStackTraces("contact@pixeldroid.org", this) + (this.application as Pixeldroid).getAppComponent().inject(this) //get the currently active user diff --git a/app/src/main/java/com/h/pixeldroid/Pixeldroid.kt b/app/src/main/java/com/h/pixeldroid/Pixeldroid.kt index 4d33f08b..84d242e5 100644 --- a/app/src/main/java/com/h/pixeldroid/Pixeldroid.kt +++ b/app/src/main/java/com/h/pixeldroid/Pixeldroid.kt @@ -4,6 +4,7 @@ import android.app.Application import androidx.preference.PreferenceManager import com.h.pixeldroid.di.* import com.h.pixeldroid.utils.ThemeUtils +import org.ligi.tracedroid.TraceDroid class Pixeldroid: Application() { @@ -12,6 +13,7 @@ class Pixeldroid: Application() { override fun onCreate() { super.onCreate() + TraceDroid.init(this) val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this) ThemeUtils.setThemeFromPreferences(sharedPreferences, resources)