Worklog, anti geo spoofing and UI Polish
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:safe_device/safe_device.dart';
|
||||
|
||||
/// Returns true if the device appears compromised for attendance purposes:
|
||||
/// rooted (Android) / jailbroken (iOS), or developer mode enabled.
|
||||
/// Returns false on any error so a detection failure never blocks a valid user.
|
||||
Future<bool> isDeviceCompromised() async {
|
||||
if (!Platform.isAndroid && !Platform.isIOS) return false;
|
||||
try {
|
||||
final isJailBroken = await SafeDevice.isJailBroken;
|
||||
final isDeveloperMode = await SafeDevice.isDevelopmentModeEnable;
|
||||
return isJailBroken || isDeveloperMode;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user