isSecure method
Determines if the device is secure based on the provided config.
Returns true if the device passes all configured checks.
Implementation
bool isSecure([IntegrityCheckConfig config = const IntegrityCheckConfig()]) {
// Check Root/Jailbreak
if (config.blockIfRootedOrJailbroken && (isRooted || isJailbroken)) {
return false;
}
// Check Developer Mode
if (config.blockIfDeveloperMode && isDeveloperModeEnabled) {
return false;
}
// Check Emulator/Simulator
if (config.blockIfEmulatorOrSimulator && (isEmulator || !isRealDevice)) {
return false;
}
// Check Dangerous Apps
if (hasPotentiallyDangerousApps) {
return false;
}
// Check Play Integrity (if enabled in config)
if (config.usePlayIntegrity && !wasPlayIntegritySuccessful) {
return false;
}
return true;
}