From c44a942fb75830f435d010f4e898ea9c4f7efff3 Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Sat, 19 Oct 2019 22:28:01 +0200 Subject: [PATCH] Added entry for safetynet attestation --- .../magisk/model/navigation/Navigation.kt | 5 ++ .../redesign/safetynet/SafetynetFragment.kt | 5 ++ .../redesign/superuser/SuperuserViewModel.kt | 1 + .../res/layout/fragment_superuser_md2.xml | 50 +++++++++++++++++++ app/src/main/res/values/strings_md2.xml | 2 + 5 files changed, 63 insertions(+) diff --git a/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt b/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt index 15a03c094..6e2b76aba 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt @@ -6,6 +6,7 @@ import android.os.Build import com.topjohnwu.magisk.ClassMap import com.topjohnwu.magisk.Config import com.topjohnwu.magisk.Const +import com.topjohnwu.magisk.redesign.safetynet.SafetynetFragment import com.topjohnwu.magisk.ui.MainActivity import com.topjohnwu.magisk.ui.hide.MagiskHideFragment import com.topjohnwu.magisk.ui.home.HomeFragment @@ -70,6 +71,10 @@ object Navigation { } } + fun safetynet() = MagiskNavigationEvent { + navDirections { destination = SafetynetFragment::class } + } + fun log() = MagiskNavigationEvent { navDirections { destination = when { diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/safetynet/SafetynetFragment.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/safetynet/SafetynetFragment.kt index 419bbcd41..44e83d184 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/safetynet/SafetynetFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/safetynet/SafetynetFragment.kt @@ -10,4 +10,9 @@ class SafetynetFragment : CompatFragment() + override fun onStart() { + super.onStart() + activity.setTitle(R.string.safetyNet) + } + } \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/superuser/SuperuserViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/superuser/SuperuserViewModel.kt index 3baf7b305..82ac3c0de 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/superuser/SuperuserViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/superuser/SuperuserViewModel.kt @@ -66,6 +66,7 @@ class SuperuserViewModel( // --- + fun safetynetPressed() = Navigation.safetynet().publish() fun hidePressed() = Navigation.hide().publish() fun deletePressed(item: PolicyRvItem) { diff --git a/app/src/main/res/layout/fragment_superuser_md2.xml b/app/src/main/res/layout/fragment_superuser_md2.xml index f019e71a4..8c690eba3 100644 --- a/app/src/main/res/layout/fragment_superuser_md2.xml +++ b/app/src/main/res/layout/fragment_superuser_md2.xml @@ -77,6 +77,56 @@ + + + + + + + + + + + + + + Source XDA + SafetyNet + \ No newline at end of file