package com.margelo.nitro.co.zyke.dfu import android.app.Activity import no.nordicsemi.android.dfu.DfuBaseService class DfuService : DfuBaseService() { override fun getNotificationTarget(): Class? { // Try to resolve the main activity from the host app return try { val context = applicationContext val intent = context.packageManager.getLaunchIntentForPackage(context.packageName) intent?.component?.let { Class.forName(it.className) as Class } } catch (_: Exception) { null } } override fun isDebug(): Boolean = BuildConfig.DEBUG }