diff --git a/app/src/main/java/com/topjohnwu/magisk/core/Hacks.kt b/app/src/main/java/com/topjohnwu/magisk/core/Hacks.kt index c67d3efa5..b2b31d9f5 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/Hacks.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/Hacks.kt @@ -139,7 +139,7 @@ private class JobSchedulerWrapper(private val base: JobScheduler) : JobScheduler } } -object ClassMap { +private object ClassMap { private val map = mapOf( App::class.java to a.e::class.java, diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt index 4871ebd8f..0e23cada2 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt @@ -1,8 +1,6 @@ package com.topjohnwu.magisk.ui.flash import android.annotation.SuppressLint -import android.app.Activity -import android.app.PendingIntent import android.content.Context import android.content.pm.ActivityInfo import android.net.Uri @@ -14,8 +12,8 @@ import android.view.View import androidx.core.net.toUri import androidx.navigation.NavDeepLinkBuilder import com.topjohnwu.magisk.R -import com.topjohnwu.magisk.core.ClassMap import com.topjohnwu.magisk.core.Const +import com.topjohnwu.magisk.core.cmp import com.topjohnwu.magisk.databinding.FragmentFlashMd2Binding import com.topjohnwu.magisk.ui.MainActivity import com.topjohnwu.magisk.ui.base.BaseUIActivity @@ -73,14 +71,13 @@ class FlashFragment : BaseUIFragment() companion object { - private fun createIntent(context: Context, args: args): PendingIntent { - return NavDeepLinkBuilder(context) + private fun createIntent(context: Context, args: args) = + NavDeepLinkBuilder(context) .setGraph(R.navigation.main) - .setComponentName(ClassMap[MainActivity::class.java] as Class) + .setComponentName(MainActivity::class.java.cmp(context.packageName)) .setDestination(R.id.flashFragment) .setArguments(args.toBundle()) .createPendingIntent() - } private fun flashType(isSecondSlot: Boolean) = if (isSecondSlot) Const.Value.FLASH_INACTIVE_SLOT else Const.Value.FLASH_MAGISK