1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-1380 Settings | Enhancement | Add device id to the tech info output (#54)

This commit is contained in:
Evgenii Kozlov 2023-06-12 17:31:13 +02:00 committed by GitHub
parent 1a90f9173e
commit a62765ad79
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 7 deletions

View file

@ -58,6 +58,7 @@ class AboutAppFragment : BaseBottomSheetComposeFragment() {
libraryVersion = vm.libraryVersion.collectAsState().value,
accountId = vm.accountId.collectAsState().value,
analyticsId = vm.analyticsId.collectAsState().value,
deviceId = vm.deviceId.collectAsState().value,
onMetaClicked = { copyMetaToClipboard() },
onContactUsClicked = {
proceedWithAction(
@ -68,7 +69,8 @@ class AboutAppFragment : BaseBottomSheetComposeFragment() {
version = getVersionText(),
library = vm.libraryVersion.value,
os = getOsVersion(),
device = getDevice()
device = getDevice(),
deviceId = vm.deviceId.value,
)
)
)
@ -168,6 +170,7 @@ class AboutAppFragment : BaseBottomSheetComposeFragment() {
version: String,
library: String,
analytics: Id,
deviceId: Id,
os: String
) : String {
return "mailto:support@anytype.io" +
@ -178,6 +181,7 @@ class AboutAppFragment : BaseBottomSheetComposeFragment() {
"%0D%0AApp%20version%3A%20$version" +
"%0D%0ALibrary%20version%3A%20$library" +
"%0D%0AAccount%20ID%3A%20$account" +
"%0D%0ADevice%20ID%3A%20$deviceId" +
"%0D%0AAnalytics%20ID%3A%20$analytics"
}

View file

@ -13,5 +13,6 @@ data class Config(
val gateway: Url,
val workspace: Id,
val widgets: Id,
val analytics: Id
val analytics: Id,
val device: Id
)

View file

@ -29,7 +29,8 @@ fun Rpc.Account.Create.Response.toAccountSetup() : AccountSetup {
gateway = info.gatewayUrl,
workspace = info.accountSpaceId,
widgets = info.widgetsId,
analytics = info.analyticsId
analytics = info.analyticsId,
device = info.deviceId
),
status = status?.core() ?: AccountStatus.Unknown
)
@ -56,7 +57,8 @@ fun Rpc.Account.Select.Response.toAccountSetup(): AccountSetup {
gateway = info.gatewayUrl,
workspace = info.accountSpaceId,
widgets = info.widgetsId,
analytics = info.analyticsId
analytics = info.analyticsId,
device = info.deviceId
),
status = status?.core() ?: AccountStatus.Unknown
)

View file

@ -32,14 +32,16 @@ fun StubConfig(
gateway: Url = MockDataFactory.randomUuid(),
workspace: Id = MockDataFactory.randomUuid(),
widgets: Id = MockDataFactory.randomUuid(),
analytics: Id = MockDataFactory.randomUuid()
analytics: Id = MockDataFactory.randomUuid(),
device: Id = MockDataFactory.randomUuid()
) : Config = Config(
home = home,
profile = profile,
gateway = gateway,
workspace = workspace,
widgets = widgets,
analytics = analytics
analytics = analytics,
device = device
)
fun StubFeatureConfig(

View file

@ -28,6 +28,7 @@ fun AboutAppScreen(
libraryVersion: String,
accountId: String,
analyticsId: String,
deviceId: String,
version: String,
buildNumber: Int,
onMetaClicked: () -> Unit,
@ -110,6 +111,7 @@ fun AboutAppScreen(
buildNumber,
libraryVersion,
accountId,
deviceId,
analyticsId
),
style = Caption2Regular.copy(
@ -164,6 +166,7 @@ fun PreviewAboutAppScreen() {
libraryVersion = "1.0.0",
accountId = "1234567890",
analyticsId = "1234567890",
deviceId = "123132323",
version = "1.0.0",
buildNumber = 1,
onMetaClicked = {},

View file

@ -45,6 +45,7 @@ class AboutAppViewModel(
val libraryVersion = MutableStateFlow("")
val accountId = MutableStateFlow("")
val analyticsId = MutableStateFlow("")
val deviceId = MutableStateFlow("")
init {
viewModelScope.launch {
@ -58,6 +59,7 @@ class AboutAppViewModel(
viewModelScope.launch {
val config = configStorage.get()
analyticsId.value = config.analytics
deviceId.value = config.device
}
viewModelScope.launch {
getLibraryVersion(BaseUseCase.None).process(

View file

@ -52,7 +52,7 @@
<string name="about_terms_and_conditions_link">https://anytype.io/terms.pdf</string>
<string name="about_privacy_policy_link">https://anytype.io/privacy_policy.html</string>
<string name="about_meta_info">App version: %1$s\nBuild number: %2$d\nLibrary version: %3$s\nAccount\u00A0ID:\u00A0%4$s\nAnalytics\u00A0ID:\u00A0%5$s</string>
<string name="about_meta_info">App version: %1$s\nBuild number: %2$d\nLibrary version: %3$s\nAccount\u00A0ID:\u00A0%4$s\nDevice\u00A0ID:\u00A0%5$s\nAnalytics\u00A0ID:\u00A0%6$s</string>
<string name="about_meta_info_for_copy">Device: %1$s\nAndroid version: %2$d\nApp version: %3$s\nBuild number: %4$d\nLibrary version: %5$s\nAccount\u00A0ID:\u00A0%6$s\nAnalytics\u00A0ID:\u00A0%7$s</string>
<string name="space_name">Space name</string>
<string name="personal_space">Personal Space</string>