Added entry for safetynet attestation

This commit is contained in:
Viktor De Pasquale 2019-10-19 22:28:01 +02:00
parent d713ad3499
commit c44a942fb7
5 changed files with 63 additions and 0 deletions

View File

@ -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 {

View File

@ -10,4 +10,9 @@ class SafetynetFragment : CompatFragment<SafetynetViewModel, FragmentSafetynetMd
override val layoutRes = R.layout.fragment_safetynet_md2
override val viewModel by viewModel<SafetynetViewModel>()
override fun onStart() {
super.onStart()
activity.setTitle(R.string.safetyNet)
}
}

View File

@ -66,6 +66,7 @@ class SuperuserViewModel(
// ---
fun safetynetPressed() = Navigation.safetynet().publish()
fun hidePressed() = Navigation.hide().publish()
fun deletePressed(item: PolicyRvItem) {

View File

@ -77,6 +77,56 @@
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
style="?styleCardNormal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:layout_marginTop="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:onClick="@{() -> viewModel.safetynetPressed()}"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/superuser_safetynet_icon"
style="?styleIconNormal"
android:background="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_safetynet" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:text="@string/safetyNet"
android:textAppearance="?appearanceTextBodyNormal"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/superuser_safetynet_icon_pointer"
app:layout_constraintStart_toEndOf="@+id/superuser_safetynet_icon"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/superuser_safetynet_icon_pointer"
style="?styleIconNormal"
android:background="@null"
android:rotation="180"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_back_md2" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<androidx.recyclerview.widget.RecyclerView
dividerHorizontal="@{R.drawable.divider_l1}"
dividerVertical="@{R.drawable.divider_l1}"

View File

@ -25,4 +25,6 @@
<string name="home_item_source">Source</string>
<string name="home_item_xda">XDA</string>
<string name="safetyNet">SafetyNet</string>
</resources>