File tree Expand file tree Collapse file tree
main/kotlin/com/getcode/utils
test/kotlin/com/getcode/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,4 +31,7 @@ dependencies {
3131 implementation(libs.androidx.annotation)
3232 implementation(libs.grpc.kotlin)
3333 implementation(project(" :libs:messaging" ))
34+
35+ implementation(libs.ocp.client.protocol)
36+ implementation(libs.flipcash2.client.protocol)
3437}
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import android.content.Context
44import android.content.pm.PackageManager
55import android.os.Build
66import android.util.Log
7+ import com.codeinc.flipcash.gen.Flipcash2ContractInfo
8+ import com.codeinc.opencode.gen.OcpContractInfo
79import kotlinx.coroutines.ExperimentalCoroutinesApi
810import kotlinx.coroutines.channels.BufferOverflow
911import kotlinx.coroutines.flow.MutableSharedFlow
@@ -146,6 +148,8 @@ private fun buildDeviceHeader(context: Context): String {
146148 appendLine(" =" .repeat(60 ))
147149 appendLine(" App Version: $versionName ($versionCode )" )
148150 appendLine(" Package: ${context.packageName} " )
151+ appendLine(" OCP Contract: ${OcpContractInfo .VERSION } (${OcpContractInfo .shortProtoCommit} )" )
152+ appendLine(" FC2 Contract: ${Flipcash2ContractInfo .VERSION } (${Flipcash2ContractInfo .shortProtoCommit} )" )
149153 appendLine(" User ID: ${userId ? : " not set" } " )
150154 appendLine(" Device: ${Build .MANUFACTURER } ${Build .MODEL } " )
151155 appendLine(" Android: ${Build .VERSION .RELEASE } (API ${Build .VERSION .SDK_INT } )" )
Original file line number Diff line number Diff line change @@ -263,4 +263,12 @@ class FileTreeTest {
263263 assertTrue(content.contains(" Android:" ))
264264 assertTrue(content.contains(" Exported:" ))
265265 }
266+
267+ @Test
268+ fun `exported log file names both contract packages` () {
269+ Timber .d(" contract check" )
270+ val content = fileTree.getLogFile()!! .readText()
271+ assertTrue(content.contains(" OCP Contract:" ), " header has no OCP contract line" )
272+ assertTrue(content.contains(" FC2 Contract:" ), " header has no flipcash2 contract line" )
273+ }
266274}
You can’t perform that action at this time.
0 commit comments