Updated on 2026-08-14
This commit is contained in:
parent
47a7c02d29
commit
f89ab30e5a
1 changed files with 13 additions and 3 deletions
|
|
@ -2,12 +2,22 @@ package com.tangem.tap.core.security
|
|||
|
||||
import com.dexprotector.rtc.RtcStatus
|
||||
import com.tangem.security.DeviceSecurityInfoProvider
|
||||
import timber.log.Timber
|
||||
|
||||
internal class DefaultDeviceSecurityInfoProvider : DeviceSecurityInfoProvider {
|
||||
override val isRooted: Boolean
|
||||
get() = RtcStatus.getRtcStatus().root
|
||||
get() = getRtcStatusSafely()?.root == true
|
||||
override val isBootloaderUnlocked: Boolean
|
||||
get() = RtcStatus.getRtcStatus().unlockedBootloader
|
||||
get() = getRtcStatusSafely()?.unlockedBootloader == true
|
||||
override val isXposed: Boolean
|
||||
get() = RtcStatus.getRtcStatus().xposed
|
||||
get() = getRtcStatusSafely()?.xposed == true
|
||||
|
||||
private fun getRtcStatusSafely(): RtcStatus? {
|
||||
return try {
|
||||
RtcStatus.getRtcStatus()
|
||||
} catch (e: Throwable) {
|
||||
Timber.e(e)
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue