File tree Expand file tree Collapse file tree
CSGuard/src/main/kotlin/com/csguard Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,10 +27,13 @@ object ProviderSanitizer {
2727 sanitizeAllProviders()
2828
2929 if (policy.watchdogEnabled && ! InstrumentationHook .isHookIntact()) {
30- Log .w (TAG , " Watchdog detected unhooked Instrumentation! Re-installing.. ." )
31- InstrumentationHook .install { policy }
30+ Log .e (TAG , " FATAL: Watchdog detected unhooked Instrumentation! A malicious plugin is actively trying to disable CSGuard ." )
31+ throw RuntimeException ( " CSGuard SECURITY BREACH: Unauthorized tampering with Instrumentation hook detected. Terminating application immediately to protect user data. " )
3232 }
3333 } catch (t: Throwable ) {
34+ if (t.message?.contains(" SECURITY BREACH" ) == true ) {
35+ throw t // Force fatal crash
36+ }
3437 Log .e(TAG , " Sanitizer poll failed" , t)
3538 }
3639 if (running) {
You can’t perform that action at this time.
0 commit comments