mirror of
https://github.com/kdrag0n/safetynet-fix.git
synced 2024-10-04 13:49:51 +00:00
java: Append space character to device model name
This bypasses Google's new device-based hardware attestation enforcement as of September 2, 2021.
This commit is contained in:
parent
35d705eb8a
commit
2f56b7320c
@ -0,0 +1,13 @@
|
|||||||
|
package dev.kdrag0n.safetynetriru
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
|
|
||||||
|
internal object BuildHooks {
|
||||||
|
fun init() {
|
||||||
|
// Append a space to the device model name
|
||||||
|
Build::class.java.getDeclaredField("MODEL").let { field ->
|
||||||
|
field.isAccessible = true
|
||||||
|
field.set(null, Build.MODEL + " ")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,8 +5,9 @@ object EntryPoint {
|
|||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun init() {
|
fun init() {
|
||||||
runCatching {
|
runCatching {
|
||||||
logDebug("Entry point: Initializing SafetyNet patch")
|
logDebug("Entry point: Initializing SafetyNet patches")
|
||||||
SecurityBridge.init()
|
SecurityBridge.init()
|
||||||
|
BuildHooks.init()
|
||||||
}.recoverCatching { e ->
|
}.recoverCatching { e ->
|
||||||
// Throwing an exception would require the JNI code to handle exceptions, so just catch
|
// Throwing an exception would require the JNI code to handle exceptions, so just catch
|
||||||
// everything here.
|
// everything here.
|
||||||
|
Loading…
Reference in New Issue
Block a user