feat: error analysis
This commit is contained in:
parent
249de62988
commit
4c1e7d8e61
|
|
@ -14,3 +14,5 @@
|
|||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
revoltbuild.properties
|
||||
sentry.properties
|
||||
|
|
@ -4,10 +4,26 @@ plugins {
|
|||
id 'org.jetbrains.kotlin.plugin.serialization'
|
||||
id 'com.mikepenz.aboutlibraries.plugin'
|
||||
id 'com.google.dagger.hilt.android'
|
||||
id "io.sentry.android.gradle" version "3.4.2"
|
||||
|
||||
id 'kotlin-kapt'
|
||||
}
|
||||
|
||||
def property(String fileName, String propertyName) {
|
||||
def propsFile = rootProject.file(fileName)
|
||||
if (propsFile.exists()) {
|
||||
def props = new Properties()
|
||||
props.load(new FileInputStream(propsFile))
|
||||
if (props[propertyName] != null) {
|
||||
return props[propertyName]
|
||||
} else {
|
||||
throw new GradleException("'" + propertyName + "' not found in '" + fileName + "'")
|
||||
}
|
||||
} else {
|
||||
throw new GradleException("'" + fileName + "' not found in app/, please create it from '" + fileName + ".example'")
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 33
|
||||
|
||||
|
|
@ -29,6 +45,11 @@ android {
|
|||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
buildConfigField "String", "SENTRY_DSN", "\"${property('revoltbuild.properties', 'sentry.dsn')}\""
|
||||
}
|
||||
|
||||
debug {
|
||||
buildConfigField "String", "SENTRY_DSN", "\"${property('revoltbuild.properties', 'sentry.dsn')}\""
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
android:name=".RevoltApplication"
|
||||
android:theme="@style/Theme.Revolt"
|
||||
tools:targetApi="31">
|
||||
<meta-data
|
||||
android:name="io.sentry.auto-init"
|
||||
android:value="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
|
|
|
|||
|
|
@ -30,11 +30,20 @@ import com.google.accompanist.navigation.animation.AnimatedNavHost
|
|||
import com.google.accompanist.navigation.animation.composable
|
||||
import com.google.accompanist.navigation.animation.rememberAnimatedNavController
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import io.sentry.android.core.SentryAndroid
|
||||
|
||||
@AndroidEntryPoint
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
SentryAndroid.init(this) { options ->
|
||||
options.dsn = BuildConfig.SENTRY_DSN
|
||||
options.isDebug = BuildConfig.DEBUG
|
||||
options.environment = BuildConfig.BUILD_TYPE
|
||||
options.release = BuildConfig.VERSION_NAME
|
||||
}
|
||||
|
||||
setContent {
|
||||
AppEntrypoint()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import androidx.compose.ui.focus.FocusRequester
|
|||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.input.VisualTransformation
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
|
|
@ -111,6 +112,7 @@ fun MessageField(
|
|||
onAddAttachment()
|
||||
}
|
||||
.padding(4.dp)
|
||||
.testTag("add_attachment")
|
||||
)
|
||||
},
|
||||
trailingIcon = {
|
||||
|
|
@ -132,6 +134,7 @@ fun MessageField(
|
|||
.size(32.dp)
|
||||
.clickable { onSendMessage() }
|
||||
.padding(4.dp)
|
||||
.testTag("send_message")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,9 +23,10 @@ import androidx.compose.ui.unit.dp
|
|||
fun SheetClickable(
|
||||
icon: @Composable (Modifier) -> Unit,
|
||||
label: @Composable (TextStyle) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
onClick: () -> Unit,
|
||||
) {
|
||||
Box(modifier = Modifier.padding(vertical = 4.dp)) {
|
||||
Box(modifier = modifier.padding(vertical = 4.dp)) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.clip(MaterialTheme.shapes.medium)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.platform.ClipboardManager
|
||||
import androidx.compose.ui.platform.LocalClipboardManager
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.AnnotatedString
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
|
|
@ -173,7 +174,9 @@ fun AboutScreen(
|
|||
) {
|
||||
ElevatedButton(
|
||||
onClick = { navController.navigate("about/oss") },
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.testTag("view_oss_attribution")
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.oss_attribution))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import androidx.compose.runtime.*
|
|||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
|
|
@ -185,16 +186,22 @@ fun ReportMessageDialog(
|
|||
}
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = {
|
||||
navController.popBackStack()
|
||||
}) {
|
||||
TextButton(
|
||||
onClick = {
|
||||
navController.popBackStack()
|
||||
},
|
||||
modifier = Modifier.testTag("report_cancel")
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.report_cancel))
|
||||
}
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(onClick = {
|
||||
state.value = ReportingState.Sending
|
||||
}) {
|
||||
TextButton(
|
||||
onClick = {
|
||||
state.value = ReportingState.Sending
|
||||
},
|
||||
modifier = Modifier.testTag("report_send")
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.report_submit))
|
||||
}
|
||||
}
|
||||
|
|
@ -284,19 +291,25 @@ fun ReportMessageDialog(
|
|||
}
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = {
|
||||
navController.popBackStack()
|
||||
}) {
|
||||
TextButton(
|
||||
onClick = {
|
||||
navController.popBackStack()
|
||||
},
|
||||
modifier = Modifier.testTag("report_block_no")
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.report_block_no))
|
||||
}
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(onClick = {
|
||||
scope.launch {
|
||||
blockUser(message.author ?: return@launch)
|
||||
}
|
||||
navController.popBackStack()
|
||||
}) {
|
||||
TextButton(
|
||||
onClick = {
|
||||
scope.launch {
|
||||
blockUser(message.author ?: return@launch)
|
||||
}
|
||||
navController.popBackStack()
|
||||
},
|
||||
modifier = Modifier.testTag("report_block_yes")
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.report_block_yes))
|
||||
}
|
||||
}
|
||||
|
|
@ -331,9 +344,12 @@ fun ReportMessageDialog(
|
|||
}
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = {
|
||||
navController.popBackStack()
|
||||
}) {
|
||||
TextButton(
|
||||
onClick = {
|
||||
navController.popBackStack()
|
||||
},
|
||||
modifier = Modifier.testTag("report_error_ok")
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.ok))
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import androidx.compose.material.icons.filled.Settings
|
|||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.SpanStyle
|
||||
import androidx.compose.ui.text.buildAnnotatedString
|
||||
|
|
@ -53,14 +54,17 @@ fun HomeScreen(navController: NavController, viewModel: HomeScreenViewModel = hi
|
|||
inclusive = true
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
modifier = Modifier.testTag("logout_from_home")
|
||||
)
|
||||
|
||||
LinkOnHome(
|
||||
heading = stringResource(id = R.string.settings),
|
||||
icon = Icons.Default.Settings,
|
||||
onClick = {
|
||||
navController.navigate("settings")
|
||||
})
|
||||
}
|
||||
)
|
||||
Text(buildAnnotatedString {
|
||||
withStyle(style = SpanStyle(fontWeight = FontWeight.Bold)) {
|
||||
append("Note: ")
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import androidx.compose.ui.Alignment
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
|
|
@ -103,14 +104,18 @@ fun GreeterScreen(navController: NavController) {
|
|||
) {
|
||||
ElevatedButton(
|
||||
onClick = { navController.navigate("about/placeholder") },
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.testTag("view_signup_page_button")
|
||||
) {
|
||||
Text(text = stringResource(R.string.signup))
|
||||
}
|
||||
|
||||
Button(
|
||||
onClick = { navController.navigate("login/login") },
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.testTag("view_login_page_button")
|
||||
) {
|
||||
Text(text = stringResource(R.string.login))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import androidx.compose.material3.Text
|
|||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
|
|
@ -205,24 +206,31 @@ fun LoginScreen(
|
|||
Weblink(
|
||||
text = stringResource(R.string.password_manager_hint),
|
||||
url = "$REVOLT_SUPPORT/kb/interface/android/using-a-password-manager",
|
||||
modifier = Modifier.testTag("password_manager_kb_link")
|
||||
)
|
||||
|
||||
AnyLink(
|
||||
text = stringResource(R.string.resend_verification),
|
||||
action = { navController.navigate("about/placeholder") },
|
||||
modifier = Modifier.padding(vertical = 7.dp)
|
||||
modifier = Modifier
|
||||
.padding(vertical = 7.dp)
|
||||
.testTag("resend_verification_link")
|
||||
)
|
||||
|
||||
ElevatedButton(
|
||||
onClick = { navController.popBackStack() },
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.testTag("exit_login_page_button")
|
||||
) {
|
||||
Text(text = stringResource(R.string.back))
|
||||
}
|
||||
|
||||
Button(
|
||||
onClick = { viewModel.doLogin() },
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.testTag("do_login_button")
|
||||
) {
|
||||
Text(text = stringResource(R.string.login))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import androidx.compose.material3.Text
|
|||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
|
|
@ -225,6 +226,7 @@ fun MfaScreen(
|
|||
modifier = Modifier
|
||||
.padding(horizontal = 20.dp, vertical = 10.dp)
|
||||
.fillMaxWidth()
|
||||
.testTag("do_totp_button")
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(R.string.next),
|
||||
|
|
@ -264,6 +266,7 @@ fun MfaScreen(
|
|||
modifier = Modifier
|
||||
.padding(horizontal = 20.dp, vertical = 10.dp)
|
||||
.fillMaxWidth()
|
||||
.testTag("do_mfa_recovery_button")
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(R.string.next),
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.ViewModel
|
||||
|
|
@ -83,7 +84,7 @@ fun AppearanceSettingsScreen(
|
|||
color = Color(0xff1c243c),
|
||||
text = stringResource(id = R.string.settings_appearance_theme_revolt),
|
||||
selected = GlobalState.theme == Theme.Revolt,
|
||||
modifier = Modifier.weight(1f),
|
||||
modifier = Modifier.weight(1f).testTag("set_theme_revolt"),
|
||||
) {
|
||||
setNewTheme(Theme.Revolt)
|
||||
}
|
||||
|
|
@ -92,7 +93,7 @@ fun AppearanceSettingsScreen(
|
|||
color = Color(0xfff7f7f7),
|
||||
text = stringResource(id = R.string.settings_appearance_theme_light),
|
||||
selected = GlobalState.theme == Theme.Light,
|
||||
modifier = Modifier.weight(1f),
|
||||
modifier = Modifier.weight(1f).testTag("set_theme_light"),
|
||||
) {
|
||||
setNewTheme(Theme.Light)
|
||||
}
|
||||
|
|
@ -101,7 +102,7 @@ fun AppearanceSettingsScreen(
|
|||
color = Color(0xff000000),
|
||||
text = stringResource(id = R.string.settings_appearance_theme_amoled),
|
||||
selected = GlobalState.theme == Theme.Amoled,
|
||||
modifier = Modifier.weight(1f),
|
||||
modifier = Modifier.weight(1f).testTag("set_theme_amoled"),
|
||||
) {
|
||||
setNewTheme(Theme.Amoled)
|
||||
}
|
||||
|
|
@ -110,7 +111,7 @@ fun AppearanceSettingsScreen(
|
|||
color = if (isSystemInDarkTheme()) Color(0xff1c243c) else Color(0xfff7f7f7),
|
||||
text = stringResource(id = R.string.settings_appearance_theme_none),
|
||||
selected = GlobalState.theme == Theme.None,
|
||||
modifier = Modifier.weight(1f),
|
||||
modifier = Modifier.weight(1f).testTag("set_theme_none"),
|
||||
) {
|
||||
setNewTheme(Theme.None)
|
||||
}
|
||||
|
|
@ -120,7 +121,7 @@ fun AppearanceSettingsScreen(
|
|||
color = dynamicDarkColorScheme(LocalContext.current).primary,
|
||||
text = stringResource(id = R.string.settings_appearance_theme_m3dynamic),
|
||||
selected = GlobalState.theme == Theme.M3Dynamic,
|
||||
modifier = Modifier.weight(1f),
|
||||
modifier = Modifier.weight(1f).testTag("set_theme_m3dynamic"),
|
||||
) {
|
||||
setNewTheme(Theme.M3Dynamic)
|
||||
}
|
||||
|
|
@ -129,7 +130,7 @@ fun AppearanceSettingsScreen(
|
|||
color = Color(0xffa0a0a0),
|
||||
text = stringResource(id = R.string.settings_appearance_theme_m3dynamic_unsupported),
|
||||
selected = false,
|
||||
modifier = Modifier.weight(1f),
|
||||
modifier = Modifier.weight(1f).testTag("set_theme_m3dynamic_unsupported"),
|
||||
) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import androidx.compose.material3.Icon
|
|||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
|
@ -51,8 +52,9 @@ fun SettingsScreen(
|
|||
text = stringResource(id = R.string.settings_appearance),
|
||||
style = textStyle
|
||||
)
|
||||
})
|
||||
{
|
||||
},
|
||||
modifier = Modifier.testTag("settings_view_appearance")
|
||||
) {
|
||||
navController.navigate("settings/appearance")
|
||||
}
|
||||
|
||||
|
|
@ -66,8 +68,9 @@ fun SettingsScreen(
|
|||
},
|
||||
label = { textStyle ->
|
||||
Text(text = stringResource(id = R.string.about), style = textStyle)
|
||||
})
|
||||
{
|
||||
},
|
||||
modifier = Modifier.testTag("settings_view_about")
|
||||
) {
|
||||
navController.navigate("about")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
sentry.dsn=
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
defaults.url=https://sentry.actual.tld
|
||||
defaults.project=not-revolt
|
||||
defaults.org=generic-chat-platform-inc
|
||||
auth.token=
|
||||
Loading…
Reference in New Issue