diff --git a/sample/src/main/kotlin/com/infinum/sentinel/sample/SampleApplication.kt b/sample/src/main/kotlin/com/infinum/sentinel/sample/SampleApplication.kt index a1140b7..1ccedca 100644 --- a/sample/src/main/kotlin/com/infinum/sentinel/sample/SampleApplication.kt +++ b/sample/src/main/kotlin/com/infinum/sentinel/sample/SampleApplication.kt @@ -20,32 +20,23 @@ class SampleApplication : Application() { override fun onCreate() { super.onCreate() - Sentinel.watch( - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - setOf( - ChuckerTool(), - CollarTool(), - DbInspectorTool(), - LeakCanaryTool(), - AppGalleryTool(appId = "102016595"), - GooglePlayTool(), - ThimbleTool(), - TimberTool(allowedTags = listOf("Main")), - CertificateTool(userCertificates = loadDebugCertificates()) - ) - } else { - setOf( - ChuckerTool(), - CollarTool(), - DbInspectorTool(), - LeakCanaryTool(), - AppGalleryTool(appId = "102016595"), - GooglePlayTool(), - ThimbleTool(), - TimberTool(allowedTags = listOf("Main")) - ) - } - ) + Sentinel.watch(getWatchedTools()) + } + + private fun getWatchedTools(): Set { + val tools = mutableSetOf() + tools.add(ChuckerTool()) + tools.add(CollarTool()) + tools.add(DbInspectorTool()) + tools.add(LeakCanaryTool()) + tools.add(AppGalleryTool(appId = "102016595")) + tools.add(GooglePlayTool()) + tools.add(ThimbleTool()) + tools.add(TimberTool(allowedTags = listOf("Main"))) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + tools.add(CertificateTool(userCertificates = loadDebugCertificates())) + } + return tools } private fun loadDebugCertificates(): List {