Update acra configuration
This commit is contained in:
@@ -11,6 +11,7 @@ import androidx.work.WorkManager
|
||||
import dagger.hilt.android.HiltAndroidApp
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.acra.ACRA
|
||||
import org.acra.ReportField
|
||||
import org.acra.config.dialog
|
||||
@@ -63,10 +64,15 @@ open class BaseApp : Application(), Configuration.Provider {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
ACRA.errorReporter.putCustomData("isOriginalApp", appValidator.isOriginalApp.toString())
|
||||
AppCompatDelegate.setDefaultNightMode(settings.theme)
|
||||
AppCompatDelegate.setApplicationLocales(settings.appLocales)
|
||||
setupActivityLifecycleCallbacks()
|
||||
processLifecycleScope.launch {
|
||||
val isOriginalApp = withContext(Dispatchers.Default) {
|
||||
appValidator.isOriginalApp
|
||||
}
|
||||
ACRA.errorReporter.putCustomData("isOriginalApp", isOriginalApp.toString())
|
||||
}
|
||||
processLifecycleScope.launch(Dispatchers.Default) {
|
||||
setupDatabaseObservers()
|
||||
}
|
||||
@@ -79,13 +85,6 @@ open class BaseApp : Application(), Configuration.Provider {
|
||||
initAcra {
|
||||
buildConfigClass = BuildConfig::class.java
|
||||
reportFormat = StringFormat.JSON
|
||||
excludeMatchingSharedPreferencesKeys = listOf(
|
||||
"sources_\\w+",
|
||||
AppSettings.KEY_APP_PASSWORD,
|
||||
AppSettings.KEY_PROXY_LOGIN,
|
||||
AppSettings.KEY_PROXY_ADDRESS,
|
||||
AppSettings.KEY_PROXY_PASSWORD,
|
||||
)
|
||||
httpSender {
|
||||
uri = getString(R.string.url_error_report)
|
||||
basicAuthLogin = getString(R.string.acra_login)
|
||||
@@ -102,7 +101,6 @@ open class BaseApp : Application(), Configuration.Provider {
|
||||
ReportField.STACK_TRACE,
|
||||
ReportField.CRASH_CONFIGURATION,
|
||||
ReportField.CUSTOM_DATA,
|
||||
ReportField.SHARED_PREFERENCES,
|
||||
)
|
||||
|
||||
dialog {
|
||||
|
||||
@@ -449,17 +449,6 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) {
|
||||
return result
|
||||
}
|
||||
|
||||
@SuppressLint("ApplySharedPref")
|
||||
private inline fun SharedPreferences.editAsync(
|
||||
action: SharedPreferences.Editor.() -> Unit
|
||||
) {
|
||||
val editor = edit()
|
||||
action(editor)
|
||||
processLifecycleScope.launch(Dispatchers.IO, CoroutineStart.ATOMIC) {
|
||||
editor.commit()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
const val PAGE_SWITCH_TAPS = "taps"
|
||||
|
||||
@@ -7,8 +7,10 @@ import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.TooltipCompat
|
||||
import androidx.core.net.toUri
|
||||
import androidx.core.view.forEach
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceViewHolder
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.databinding.PreferenceAboutLinksBinding
|
||||
|
||||
@@ -27,12 +29,7 @@ class AboutLinksPreference @JvmOverloads constructor(
|
||||
super.onBindViewHolder(holder)
|
||||
|
||||
val binding = PreferenceAboutLinksBinding.bind(holder.itemView)
|
||||
arrayOf(
|
||||
binding.btn4pda,
|
||||
binding.btnDiscord,
|
||||
binding.btnGithub,
|
||||
binding.btnTelegram,
|
||||
).forEach { button ->
|
||||
binding.root.forEach { button ->
|
||||
TooltipCompat.setTooltipText(button, button.contentDescription)
|
||||
button.setOnClickListener(this)
|
||||
}
|
||||
@@ -40,16 +37,15 @@ class AboutLinksPreference @JvmOverloads constructor(
|
||||
|
||||
override fun onClick(v: View) {
|
||||
val urlResId = when (v.id) {
|
||||
R.id.btn_4pda -> R.string.url_forpda
|
||||
R.id.btn_discord -> R.string.url_discord
|
||||
R.id.btn_telegram -> R.string.url_telegram
|
||||
R.id.btn_github -> R.string.url_github
|
||||
else -> return
|
||||
}
|
||||
openLink(v.context.getString(urlResId), v.contentDescription)
|
||||
openLink(v, v.context.getString(urlResId), v.contentDescription)
|
||||
}
|
||||
|
||||
private fun openLink(url: String, title: CharSequence?) {
|
||||
private fun openLink(v: View, url: String, title: CharSequence?) {
|
||||
val intent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
try {
|
||||
context.startActivity(
|
||||
@@ -60,6 +56,7 @@ class AboutLinksPreference @JvmOverloads constructor(
|
||||
},
|
||||
)
|
||||
} catch (_: ActivityNotFoundException) {
|
||||
Snackbar.make(v, R.string.operation_not_supported, Snackbar.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M426.1,112 L112,545.6l0,247.7l486.7,0l0,118.8l313.3,0L912,112ZM599.5,312L599.5,577.6L390.1,577.6Z" />
|
||||
</vector>
|
||||
@@ -40,15 +40,4 @@
|
||||
app:tint="?attr/colorAccent"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_4pda"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="4PDA"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/ic_4pda"
|
||||
app:tint="?attr/colorAccent"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<resources>
|
||||
<string name="url_github" translatable="false">https://github.com/KotatsuApp/Kotatsu</string>
|
||||
<string name="url_discord" translatable="false">https://discord.gg/NNJ5RgVBC5</string>
|
||||
<string name="url_forpda" translatable="false">https://4pda.to/forum/index.php?showtopic=697669</string>
|
||||
<string name="url_telegram" translatable="false">https://t.me/kotatsuapp</string>
|
||||
<string name="url_weblate" translatable="false">https://hosted.weblate.org/engage/kotatsu</string>
|
||||
<string name="url_error_report" translatable="false">https://acra.kotatsu.app/report</string>
|
||||
@@ -13,8 +12,8 @@
|
||||
<string name="anilist_clientId" translatable="false">9887</string>
|
||||
<string name="anilist_clientSecret" translatable="false">wrMqFosItQWsmB8dtAHfIFPDt15FfQi2ZGiKkJoW</string>
|
||||
<string name="mal_clientId" translatable="false">6cd8e6349e9a36bc1fc1ab97703c9fd1</string>
|
||||
<string name="acra_login" translatable="false">LxUiQIbVgKv1pdtM</string>
|
||||
<string name="acra_password" translatable="false">gtG6y1MpEPHrdV1z</string>
|
||||
<string name="acra_login" translatable="false">zPALLBPdpn5mnCB4</string>
|
||||
<string name="acra_password" translatable="false">kgpuhoNJpSsQDCwu</string>
|
||||
<string name="sync_authority_history" translatable="false">org.koitharu.kotatsu.history</string>
|
||||
<string name="sync_authority_favourites" translatable="false">org.koitharu.kotatsu.favourites</string>
|
||||
<string-array name="values_theme" translatable="false">
|
||||
|
||||
Reference in New Issue
Block a user