mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-09 07:43:38 +00:00
240 lines
12 KiB
XML
240 lines
12 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
xmlns:tools="http://schemas.android.com/tools">
|
|
|
|
<data>
|
|
|
|
<import type="android.os.Build" />
|
|
<import type="com.topjohnwu.magisk.core.Info" />
|
|
|
|
<import type="com.topjohnwu.magisk.BuildConfig" />
|
|
|
|
<variable
|
|
name="viewModel"
|
|
type="com.topjohnwu.magisk.ui.safetynet.SafetynetViewModel" />
|
|
|
|
</data>
|
|
|
|
|
|
<androidx.core.widget.NestedScrollView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:clipToPadding="false"
|
|
android:fillViewport="true"
|
|
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}"
|
|
android:paddingBottom="@{viewModel.insets.bottom}"
|
|
tools:paddingBottom="48dp"
|
|
tools:paddingTop="24dp">
|
|
|
|
<FrameLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent">
|
|
|
|
<TextView
|
|
invisibleUnless="@{viewModel.checking}"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center"
|
|
android:text="@string/safetynet_attest_loading"
|
|
android:textAppearance="@style/AppearanceFoundation.Title" />
|
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
invisibleUnless="@{viewModel.success || viewModel.failed}"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:paddingTop="@dimen/l1"
|
|
android:paddingBottom="@dimen/l1">
|
|
|
|
<com.google.android.material.card.MaterialCardView
|
|
android:id="@+id/safetynet_attestation"
|
|
style="@style/WidgetFoundation.Card.Elevated"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="@dimen/l1"
|
|
android:layout_marginTop="@dimen/l2"
|
|
android:layout_marginEnd="@dimen/l1"
|
|
app:cardCornerRadius="@dimen/l1"
|
|
app:cardElevation="@dimen/l1"
|
|
app:layout_constraintHorizontal_chainStyle="packed"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
app:layout_constraintVertical_bias=".35"
|
|
app:layout_constraintWidth_max="300dp">
|
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content">
|
|
|
|
<View
|
|
goneUnless="@{viewModel.failed}"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
android:alpha=".5"
|
|
android:background="?colorError"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
|
<View
|
|
goneUnless="@{viewModel.success}"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
android:alpha=".5"
|
|
android:background="?colorPrimary"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
|
<TextView
|
|
android:id="@+id/safetynet_title"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="@dimen/l1"
|
|
android:layout_marginTop="@dimen/l2"
|
|
android:layout_marginEnd="@dimen/l1"
|
|
android:gravity="center"
|
|
android:text="@{viewModel.safetyNetTitle}"
|
|
android:textAppearance="@style/AppearanceFoundation.Display.OnPrimary"
|
|
android:textStyle="bold"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintHorizontal_chainStyle="packed"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
tools:text="@string/safetynet_attest_success" />
|
|
|
|
<View
|
|
android:id="@+id/safetynet_divider"
|
|
android:layout_width="50dp"
|
|
android:layout_height="4dp"
|
|
android:layout_marginTop="@dimen/l2"
|
|
android:background="@drawable/bg_divider_rounded_on_primary"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/safetynet_title" />
|
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:id="@+id/checkbox_layout"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:paddingBottom="@dimen/l1"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/safetynet_divider">
|
|
|
|
<TextView
|
|
android:id="@+id/basic_text"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center_vertical"
|
|
android:gravity="start"
|
|
android:text="basicIntegrity"
|
|
android:textAppearance="@style/AppearanceFoundation.Body.OnPrimary"
|
|
android:textStyle="bold"
|
|
android:layout_marginTop="@dimen/l2"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintEnd_toEndOf="@id/snet_barrier"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
tools:ignore="HardcodedText" />
|
|
|
|
<TextView
|
|
android:id="@+id/cts_text"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center_vertical"
|
|
android:gravity="start"
|
|
android:text="ctsProfile"
|
|
android:textAppearance="@style/AppearanceFoundation.Body.OnPrimary"
|
|
android:textStyle="bold"
|
|
android:layout_marginTop="@dimen/l2"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintEnd_toEndOf="@id/snet_barrier"
|
|
app:layout_constraintTop_toBottomOf="@id/basic_text"
|
|
tools:ignore="HardcodedText" />
|
|
|
|
<androidx.constraintlayout.widget.Barrier
|
|
android:id="@+id/snet_barrier"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
app:barrierDirection="end"
|
|
app:constraint_referenced_ids="basic_text,cts_text"/>
|
|
|
|
<ImageView
|
|
style="@style/WidgetFoundation.Icon.OnPrimary"
|
|
isSelected="@{viewModel.basicIntegrityState}"
|
|
android:layout_gravity="center"
|
|
app:srcCompat="@drawable/ic_check_circle_md2"
|
|
app:layout_constraintStart_toEndOf="@id/snet_barrier"
|
|
app:layout_constraintTop_toTopOf="@id/basic_text"
|
|
app:layout_constraintBottom_toBottomOf="@id/basic_text"/>
|
|
|
|
<ImageView
|
|
style="@style/WidgetFoundation.Icon.OnPrimary"
|
|
isSelected="@{viewModel.ctsState}"
|
|
android:layout_gravity="center"
|
|
app:srcCompat="@drawable/ic_check_circle_md2"
|
|
app:layout_constraintStart_toEndOf="@id/snet_barrier"
|
|
app:layout_constraintTop_toTopOf="@id/cts_text"
|
|
app:layout_constraintBottom_toBottomOf="@id/cts_text"/>
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
|
<LinearLayout
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:paddingBottom="@dimen/l2"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/checkbox_layout">
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center_vertical"
|
|
android:gravity="start"
|
|
android:text="evalType"
|
|
android:textAppearance="@style/AppearanceFoundation.Body.OnPrimary"
|
|
android:textStyle="bold"
|
|
tools:ignore="HardcodedText" />
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center_vertical"
|
|
android:textAppearance="@style/AppearanceFoundation.Body.OnPrimary"
|
|
android:textStyle="bold"
|
|
android:layout_marginStart="@dimen/l1"
|
|
android:text="@{viewModel.evalType}"
|
|
tools:text="HARDWARE"/>
|
|
|
|
</LinearLayout>
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
|
</com.google.android.material.card.MaterialCardView>
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
style="@style/WidgetFoundation.Button.Text"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="@dimen/l1"
|
|
android:layout_marginBottom="@dimen/l1"
|
|
android:onClick="@{() -> viewModel.reset()}"
|
|
android:text="@string/safetynet_attest_restart"
|
|
android:textAllCaps="false"
|
|
android:textColor="?colorOnSurfaceVariant"
|
|
app:icon="@drawable/ic_refresh_safetynet_md2"
|
|
app:iconTint="?colorOnSurfaceVariant"
|
|
app:layout_constraintEnd_toEndOf="@+id/safetynet_attestation"
|
|
app:layout_constraintTop_toBottomOf="@+id/safetynet_attestation" />
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
|
</FrameLayout>
|
|
|
|
|
|
</androidx.core.widget.NestedScrollView>
|
|
|
|
</layout>
|