Skip to content

Commit

Permalink
6.8.3 (#1116)
Browse files Browse the repository at this point in the history
* Remove unsafe send error email for EmbraceAutomaticVerification (#1049)

(cherry picked from commit 612354b)

* Update version
  • Loading branch information
priettt authored Jul 17, 2024
1 parent b0a2127 commit d575762
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.app.Activity
import android.app.AlertDialog
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Handler
import android.os.Looper
import android.widget.Toast
Expand Down Expand Up @@ -55,7 +54,6 @@ internal class EmbraceAutomaticVerification(
companion object {
internal const val TAG = "[EmbraceVerification]"
private const val ON_FOREGROUND_DELAY = 5000L
private const val EMBRACE_CONTACT_EMAIL = "support@embrace.io"
private const val VERIFY_INTEGRATION_DELAY = 200L
private const val ON_FOREGROUND_TIMEOUT = 5000L
internal val instance = EmbraceAutomaticVerification()
Expand Down Expand Up @@ -294,10 +292,6 @@ internal class EmbraceAutomaticVerification(
.setTitle(activity.getString(R.string.automatic_verification_error_title))
.setMessage(errorString)
.setCancelable(true)
.setNegativeButton(activity.getString(R.string.send_error_log)) { dialog, _ ->
sendErrorLog(activity, errorString)
dialog.dismiss()
}
.setPositiveButton(activity.getString(R.string.close)) { dialog, _ ->
dialog.dismiss()
}
Expand All @@ -307,28 +301,6 @@ internal class EmbraceAutomaticVerification(
}
}

private fun sendErrorLog(activity: Activity, errorMessage: String) {
val errorLog = generateErrorLog(errorMessage)
val selectorIntent = Intent(Intent.ACTION_SENDTO).setData(Uri.parse("mailto:$EMBRACE_CONTACT_EMAIL"))

val emailIntent = Intent(Intent.ACTION_SEND).apply {
putExtra(Intent.EXTRA_EMAIL, arrayOf(EMBRACE_CONTACT_EMAIL))
putExtra(Intent.EXTRA_SUBJECT, "Android Verification Log")
putExtra(Intent.EXTRA_TEXT, errorLog)
selector = selectorIntent
}

activity.startActivity(Intent.createChooser(emailIntent, "Send Email"))
}

private fun generateErrorLog(errorMessage: String): String {
var errorLog = "App ID: ${Embrace.getImpl().metadataService?.getAppId()}\n" +
"App Version: ${Embrace.getImpl().metadataService?.getAppVersionName()}"
errorLog += "\n\n-----------------\n\n"
errorLog += errorMessage
return errorLog
}

private fun logInfo(message: String) {
Embrace.getInstance().internalInterface.logInfo("$TAG $message", null)
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx4g -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
version = 6.8.2
version = 6.8.3
android.useAndroidX=true
# Enable adding baseline-prof.txt files to AAR artifacts.
android.experimental.enableArtProfiles=true
Expand Down

0 comments on commit d575762

Please sign in to comment.