service 2-5-26-2
This commit is contained in:
32
lib/controller/functions/security_helper.dart
Normal file
32
lib/controller/functions/security_helper.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:service/print.dart';
|
||||
|
||||
class SecurityHelper {
|
||||
static const platform = MethodChannel('com.service_intaleq/security');
|
||||
|
||||
static Future<String?> getAppSignature() async {
|
||||
try {
|
||||
final String? signature = await platform.invokeMethod('getAppSignature');
|
||||
final mode = kDebugMode ? 'DEBUG' : 'RELEASE';
|
||||
Log.print('----------------------------------------------------');
|
||||
Log.print('🚀 APP SIGNATURE HASH ($mode): $signature');
|
||||
Log.print('----------------------------------------------------');
|
||||
return signature;
|
||||
|
||||
} on PlatformException catch (e) {
|
||||
Log.print('❌ Failed to get app signature: ${e.message}');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static Future<bool> isDeviceRooted() async {
|
||||
try {
|
||||
final bool isRooted = await platform.invokeMethod('isNativeRooted');
|
||||
return isRooted;
|
||||
} on PlatformException catch (e) {
|
||||
Log.print('❌ Failed to check root: ${e.message}');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user