|
|
|
@ -59,8 +59,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
bool? isAppOpenBySystem;
|
|
|
|
bool? isAppOpenBySystem;
|
|
|
|
|
|
|
|
|
|
|
|
bool isJailBroken = false;
|
|
|
|
bool isJailBroken = false;
|
|
|
|
bool isRealDevice = false;
|
|
|
|
bool isRealDevice = true;
|
|
|
|
bool isOnExternalStorage = false;
|
|
|
|
|
|
|
|
bool isDevelopmentModeEnable = false;
|
|
|
|
bool isDevelopmentModeEnable = false;
|
|
|
|
|
|
|
|
|
|
|
|
BasicMemberInformationModel? _basicMemberInformation;
|
|
|
|
BasicMemberInformationModel? _basicMemberInformation;
|
|
|
|
@ -78,16 +77,20 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void checkDeviceSafety() async {
|
|
|
|
void checkDeviceSafety() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
isJailBroken = await SafeDevice.isJailBroken;
|
|
|
|
SafeDevice.isJailBroken.then((bool value) {
|
|
|
|
isRealDevice = await SafeDevice.isRealDevice;
|
|
|
|
isJailBroken = value;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
SafeDevice.isRealDevice.then((value) {
|
|
|
|
|
|
|
|
isRealDevice = value;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
isOnExternalStorage = await SafeDevice.isOnExternalStorage;
|
|
|
|
// isOnExternalStorage = await SafeDevice.isOnExternalStorage;
|
|
|
|
isDevelopmentModeEnable = await SafeDevice.isDevelopmentModeEnable;
|
|
|
|
SafeDevice.isDevelopmentModeEnable.then((value) {
|
|
|
|
}
|
|
|
|
isDevelopmentModeEnable = value;
|
|
|
|
if (isJailBroken || !isRealDevice || isOnExternalStorage || isDevelopmentModeEnable) {
|
|
|
|
});
|
|
|
|
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.unsafeDeviceScreen, (_) => false);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (error) {
|
|
|
|
} catch (error) {
|
|
|
|
print(error);
|
|
|
|
print(error);
|
|
|
|
@ -123,7 +126,14 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
firebaseToken = "";
|
|
|
|
firebaseToken = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AppNotifications().init(firebaseToken, context);
|
|
|
|
AppNotifications().init(firebaseToken, context);
|
|
|
|
checkLoginInfo();
|
|
|
|
|
|
|
|
|
|
|
|
if (isJailBroken || !isRealDevice || isDevelopmentModeEnable) {
|
|
|
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
|
|
|
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.unsafeDeviceScreen, (_) => false);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
checkLoginInfo();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
|
|
|
|
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
@ -201,6 +211,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Utils.saveStringFromPrefs(SharedPrefsConsts.password, password.text);
|
|
|
|
Utils.saveStringFromPrefs(SharedPrefsConsts.password, password.text);
|
|
|
|
} catch (ex) {
|
|
|
|
} catch (ex) {
|
|
|
|
|
|
|
|
print(ex);
|
|
|
|
|
|
|
|
print(ex.toString());
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
Utils.handleException(ex, context, (msg) {
|
|
|
|
Utils.handleException(ex, context, (msg) {
|
|
|
|
Utils.confirmDialog(
|
|
|
|
Utils.confirmDialog(
|
|
|
|
|