Removed security note

Note, and the backdrop, has been removed, since users which have chosen device that doesn't receive security updates in, at least 2 months, are getting triggered by their own choices (:
This commit is contained in:
wiki de pasquale 2020-01-30 21:12:49 +01:00 committed by GitHub
parent cf918e7df8
commit 0783d385d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 48 deletions

View File

@ -42,7 +42,6 @@ import com.topjohnwu.superuser.ShellUtils
import java.io.File
import java.io.FileNotFoundException
import java.text.SimpleDateFormat
import java.util.*
import java.lang.reflect.Array as JArray
val packageName: String get() = get<Context>().packageName
@ -325,23 +324,6 @@ private val securityLevelFormatter get() = SimpleDateFormat("yyyy-MM-dd",
currentLocale
)
/** Friendly reminder to seek newer roms or install oem updates. */
val isDeviceSecure: Boolean
get() {
val latestPermittedTime = Calendar.getInstance().apply {
time = securityLevelDate
add(Calendar.MONTH, 2)
}.time.time
return now in 0..latestPermittedTime
}
val securityLevelDate get() = securityLevelFormatter.parseOrNull(securityLevel) ?: Date(0)
val securityLevel
get() = if (SDK_INT >= Build.VERSION_CODES.M) {
Build.VERSION.SECURITY_PATCH
} else {
null
} ?: "1970-01-01" //never
val isSAR
get() = ShellUtils
.fastCmd("grep_prop ro.build.system_root_image")

View File

@ -107,18 +107,6 @@
android:background="@drawable/bg_card"
android:orientation="horizontal">
<View
gone="@{XAndroidKt.isDeviceSecure()}"
android:layout_width="0dp"
android:layout_height="0dp"
android:alpha=".15"
android:background="?colorError"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/home_device_overview"
android:layout_width="wrap_content"
@ -196,29 +184,12 @@
app:layout_constraintStart_toEndOf="@+id/home_device_overview"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/home_device_extra_security_title"
style="@style/W.Home.Extra.Title"
android:text="@string/home_device_security"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/home_device_extra_security_value"
style="@style/W.Home.Extra.Value"
android:text="@{XAndroidKt.isDeviceSecure() ? @string/home_device_security_secure : @string/home_device_security_outdated}"
app:layout_constraintBottom_toBottomOf="@+id/home_device_extra_security_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/home_device_extra_security_title"
app:layout_constraintTop_toTopOf="@+id/home_device_extra_security_title"
tools:text="@string/home_device_security_secure" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/home_device_extra_version_title"
style="@style/W.Home.Extra.Title"
android:text="@string/home_device_system"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_device_extra_security_title" />
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/home_device_extra_version_value"