Merge pull request #2440 from s-ayush2903/fix/s-ayush2903/#2258-DiagnosticReport-Integrity-is-not-Secured

fix: Appended Device Details in the logs file as well
This commit is contained in:
Seán Mac Gillicuddy 2020-10-21 09:59:36 +01:00 committed by GitHub
commit a3346c7d0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,6 +84,7 @@ open class ErrorActivity : BaseActivity() {
} }
private fun emailIntent(): Intent { private fun emailIntent(): Intent {
val emailBody = buildBody()
return Intent(Intent.ACTION_SEND).apply { return Intent(Intent.ACTION_SEND).apply {
type = "vnd.android.cursor.dir/email" type = "vnd.android.cursor.dir/email"
putExtra( putExtra(
@ -91,9 +92,10 @@ open class ErrorActivity : BaseActivity() {
arrayOf("android-crash-feedback@kiwix.org") arrayOf("android-crash-feedback@kiwix.org")
) )
putExtra(Intent.EXTRA_SUBJECT, subject) putExtra(Intent.EXTRA_SUBJECT, subject)
putExtra(Intent.EXTRA_TEXT, buildBody()) putExtra(Intent.EXTRA_TEXT, emailBody)
if (allowLogs.isChecked) { if (allowLogs.isChecked) {
val file = fileLogger.writeLogFile(this@ErrorActivity) val file = fileLogger.writeLogFile(this@ErrorActivity)
file.appendText(emailBody)
val path = val path =
FileProvider.getUriForFile( FileProvider.getUriForFile(
this@ErrorActivity, this@ErrorActivity,
@ -114,6 +116,7 @@ open class ErrorActivity : BaseActivity() {
${if (allowLanguage.isChecked) languageLocale() else ""} ${if (allowLanguage.isChecked) languageLocale() else ""}
${if (allowDeviceDetails.isChecked) deviceDetails() else ""} ${if (allowDeviceDetails.isChecked) deviceDetails() else ""}
${if (allowFileSystemDetails.isChecked) systemDetails() else ""} ${if (allowFileSystemDetails.isChecked) systemDetails() else ""}
""".trimIndent() """.trimIndent()
private fun exceptionDetails(): String = private fun exceptionDetails(): String =