-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,11 @@ import android.content.Context | |
import androidx.multidex.MultiDex | ||
import com.sdex.activityrunner.preferences.AppPreferences | ||
import dagger.hilt.android.HiltAndroidApp | ||
import org.acra.ReportField | ||
import org.acra.config.dialog | ||
import org.acra.config.mailSender | ||
import org.acra.data.StringFormat | ||
import org.acra.ktx.initAcra | ||
import timber.log.Timber | ||
|
||
@HiltAndroidApp | ||
|
@@ -23,5 +28,28 @@ class ActivityManagerApplication : Application() { | |
override fun attachBaseContext(base: Context) { | ||
super.attachBaseContext(base) | ||
MultiDex.install(this) | ||
|
||
initAcra { | ||
buildConfigClass = BuildConfig::class.java | ||
reportFormat = StringFormat.JSON | ||
reportContent = listOf( | ||
ReportField.APP_VERSION_CODE, | ||
ReportField.APP_VERSION_NAME, | ||
ReportField.ANDROID_VERSION, | ||
ReportField.PHONE_MODEL, | ||
ReportField.STACK_TRACE, | ||
) | ||
mailSender { | ||
mailTo = "[email protected]" | ||
subject = "Activity Manager crash report" | ||
} | ||
dialog { | ||
title = "Crash report" | ||
text = "App crashed. Do you want to send the email report?" | ||
resTheme = R.style.AppDialogTheme | ||
positiveButtonText = "Yes" | ||
negativeButtonText = "No" | ||
} | ||
} | ||
} | ||
} |