checkOfflineIntegrity method
Checks the device integrity offline (Root, Jailbreak, Emulator, etc.).
Returns a DeviceIntegrityResult indicating the status.
Implementation
@override
Future<DeviceIntegrityResult> checkOfflineIntegrity() async {
// Invoke the native method to check for root/jailbreak offline
final result = await methodChannel.invokeMapMethod<String, dynamic>(
'checkOfflineIntegrity',
);
// Ensure we received a valid response from the native side
if (result == null) {
throw PlatformException(
code: 'UNAVAILABLE',
message: 'Native side returned null for offline check.',
);
}
// Convert the map result into a strongly-typed object
return DeviceIntegrityResult.fromOfflineMap(result);
}