diff --git a/java_module/app/src/main/java/dev/kdrag0n/safetynetriru/BuildHooks.kt b/java_module/app/src/main/java/dev/kdrag0n/safetynetriru/BuildHooks.kt new file mode 100644 index 0000000..8e9f082 --- /dev/null +++ b/java_module/app/src/main/java/dev/kdrag0n/safetynetriru/BuildHooks.kt @@ -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 + " ") + } + } +} diff --git a/java_module/app/src/main/java/dev/kdrag0n/safetynetriru/EntryPoint.kt b/java_module/app/src/main/java/dev/kdrag0n/safetynetriru/EntryPoint.kt index 625487a..baf294a 100644 --- a/java_module/app/src/main/java/dev/kdrag0n/safetynetriru/EntryPoint.kt +++ b/java_module/app/src/main/java/dev/kdrag0n/safetynetriru/EntryPoint.kt @@ -5,8 +5,9 @@ object EntryPoint { @JvmStatic fun init() { runCatching { - logDebug("Entry point: Initializing SafetyNet patch") + logDebug("Entry point: Initializing SafetyNet patches") SecurityBridge.init() + BuildHooks.init() }.recoverCatching { e -> // Throwing an exception would require the JNI code to handle exceptions, so just catch // everything here.