mirror of
https://github.com/yggdrasil-network/crispa-android.git
synced 2025-01-22 16:06:30 +00:00
1. Added ACRA lib for crash reports
This commit is contained in:
parent
41d498fdfe
commit
f60536a72b
@ -7,8 +7,8 @@ android {
|
|||||||
applicationId "io.github.chronosx88.yggdrasil"
|
applicationId "io.github.chronosx88.yggdrasil"
|
||||||
minSdkVersion 15
|
minSdkVersion 15
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 20
|
versionCode 23
|
||||||
versionName "2.0"
|
versionName "2.0.3"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
setProperty("archivesBaseName", project.getParent().name+"-"+versionName)
|
setProperty("archivesBaseName", project.getParent().name+"-"+versionName)
|
||||||
}
|
}
|
||||||
@ -62,12 +62,15 @@ gradle.projectsEvaluated {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
|
implementation 'ch.acra:acra-http:5.8.3'
|
||||||
|
implementation 'ch.acra:acra-dialog:5.8.3'
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation project(path: ':yggdrasil')
|
implementation project(path: ':yggdrasil')
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.3.0'
|
implementation 'androidx.appcompat:appcompat:1.3.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
implementation "androidx.preference:preference-ktx:1.1.1"
|
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
|
|
||||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
android:name=".YggApplication"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
package io.github.chronosx88.yggdrasil
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import android.content.Context
|
||||||
|
import org.acra.config.dialog
|
||||||
|
import org.acra.config.httpSender
|
||||||
|
import org.acra.data.StringFormat
|
||||||
|
import org.acra.ktx.initAcra
|
||||||
|
import org.acra.sender.HttpSender
|
||||||
|
|
||||||
|
class YggApplication : Application() {
|
||||||
|
override fun attachBaseContext(base: Context) {
|
||||||
|
super.attachBaseContext(base)
|
||||||
|
|
||||||
|
initAcra {
|
||||||
|
//core configuration:
|
||||||
|
buildConfigClass = BuildConfig::class.java
|
||||||
|
reportFormat = StringFormat.JSON
|
||||||
|
//each plugin you chose above can be configured in a block like this:
|
||||||
|
httpSender {
|
||||||
|
uri = "http://<host>/report"
|
||||||
|
basicAuthLogin="***"
|
||||||
|
basicAuthPassword = "***"
|
||||||
|
httpMethod = HttpSender.Method.POST
|
||||||
|
}
|
||||||
|
dialog {
|
||||||
|
//required
|
||||||
|
text = getString(R.string.report_dialog_text)
|
||||||
|
//optional, enables the dialog title
|
||||||
|
title = getString(R.string.app_name)
|
||||||
|
//defaults to android.R.string.ok
|
||||||
|
positiveButtonText = getString(android.R.string.ok)
|
||||||
|
//defaults to android.R.string.cancel
|
||||||
|
negativeButtonText = getString(android.R.string.cancel)
|
||||||
|
//optional, enables the comment input
|
||||||
|
commentPrompt = getString(R.string.report_dialog_comment)
|
||||||
|
//optional, enables the email input
|
||||||
|
//emailPrompt = getString(R.string.report_dialog_email)
|
||||||
|
//defaults to android.R.drawable.ic_dialog_alert
|
||||||
|
resIcon = android.R.drawable.ic_dialog_alert
|
||||||
|
//optional, defaults to @android:style/Theme.Dialog
|
||||||
|
resTheme = R.style.Theme_AppCompat_Dialog
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -145,7 +145,6 @@ class YggdrasilTunService : VpnService() {
|
|||||||
convertPeer2PeerStringList(meshPeers)
|
convertPeer2PeerStringList(meshPeers)
|
||||||
);
|
);
|
||||||
pi?.send(this, MainActivity.STATUS_PEERS_UPDATE, intent)
|
pi?.send(this, MainActivity.STATUS_PEERS_UPDATE, intent)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun fixConfig(
|
private fun fixConfig(
|
||||||
|
@ -3,6 +3,7 @@ package io.github.chronosx88.yggdrasil.models.config
|
|||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import io.github.chronosx88.yggdrasil.models.DNSInfo
|
import io.github.chronosx88.yggdrasil.models.DNSInfo
|
||||||
import io.github.chronosx88.yggdrasil.models.PeerInfo
|
import io.github.chronosx88.yggdrasil.models.PeerInfo
|
||||||
|
import org.acra.ACRA
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
import java.net.InetSocketAddress
|
import java.net.InetSocketAddress
|
||||||
import java.net.Socket
|
import java.net.Socket
|
||||||
@ -113,6 +114,7 @@ class Utils {
|
|||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun deserializePeerStringList2PeerInfoSet(list: List<String>?): MutableSet<PeerInfo> {
|
fun deserializePeerStringList2PeerInfoSet(list: List<String>?): MutableSet<PeerInfo> {
|
||||||
var gson = Gson()
|
var gson = Gson()
|
||||||
|
ACRA.errorReporter.putCustomData("Peer list", gson.toJson(list))
|
||||||
var out = mutableSetOf<PeerInfo>()
|
var out = mutableSetOf<PeerInfo>()
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
for(s in list) {
|
for(s in list) {
|
||||||
|
@ -9,4 +9,6 @@
|
|||||||
<string name="schema">Schema</string>
|
<string name="schema">Schema</string>
|
||||||
<string name="title_activity_about">Yggdrasil</string>
|
<string name="title_activity_about">Yggdrasil</string>
|
||||||
<string name="title_activity_copy_local_node_info">Node info</string>
|
<string name="title_activity_copy_local_node_info">Node info</string>
|
||||||
|
<string name="report_dialog_text">Sorry, the application crashed.</string>
|
||||||
|
<string name="report_dialog_comment">Please describe what were you doing when the app crashed:</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user