diff --git a/ios/Classes/FlutterTalsecConfig.swift b/ios/Classes/FlutterTalsecConfig.swift index 6d261b0..1887363 100644 --- a/ios/Classes/FlutterTalsecConfig.swift +++ b/ios/Classes/FlutterTalsecConfig.swift @@ -5,9 +5,10 @@ struct FlutterTalsecConfig : Decodable { let watcherMail: String let iosConfig: IOSConfig let isProd: Bool + let killOnBypass: Bool func toNativeConfig() -> TalsecConfig { - return TalsecConfig(appBundleIds: iosConfig.bundleIds, appTeamId: iosConfig.teamId, watcherMailAddress: watcherMail, isProd: isProd) + return TalsecConfig(appBundleIds: iosConfig.bundleIds, appTeamId: iosConfig.teamId, watcherMailAddress: watcherMail, isProd: isProd, killOnBypass: killOnBypass) } } diff --git a/lib/src/models/talsec_config.g.dart b/lib/src/models/talsec_config.g.dart index abbdfe3..3507cc8 100644 --- a/lib/src/models/talsec_config.g.dart +++ b/lib/src/models/talsec_config.g.dart @@ -9,6 +9,7 @@ part of 'talsec_config.dart'; TalsecConfig _$TalsecConfigFromJson(Map json) => TalsecConfig( watcherMail: json['watcherMail'] as String, isProd: json['isProd'] as bool? ?? true, + killOnBypass: json['killOnBypass'] as bool? ?? false, androidConfig: json['androidConfig'] == null ? null : AndroidConfig.fromJson( @@ -31,5 +32,6 @@ Map _$TalsecConfigToJson(TalsecConfig instance) { writeNotNull('iosConfig', instance.iosConfig?.toJson()); val['watcherMail'] = instance.watcherMail; val['isProd'] = instance.isProd; + val['killOnBypass'] = instance.killOnBypass; return val; } diff --git a/test/src/utils/config_verifier_test.dart b/test/src/utils/config_verifier_test.dart index fb84b34..41a5575 100644 --- a/test/src/utils/config_verifier_test.dart +++ b/test/src/utils/config_verifier_test.dart @@ -76,7 +76,7 @@ void main() { test('Should encode TalsecConfig to String', () { // Arrange const expectedString = - '{"androidConfig":{"packageName":"com.aheaditec.freeraspExample","signingCertHashes":["AKoRuyLMM91E7lX/Zqp3u4jMmd0A7hH/Iqozu0TMVd0="],"supportedStores":["com.sec.android.app.samsungapps"]},"iosConfig":{"bundleIds":["com.aheaditec.freeraspExample"],"teamId":"M8AK35..."},"watcherMail":"test_mail@example.com","isProd":false}'; + '{"androidConfig":{"packageName":"com.aheaditec.freeraspExample","signingCertHashes":["AKoRuyLMM91E7lX/Zqp3u4jMmd0A7hH/Iqozu0TMVd0="],"supportedStores":["com.sec.android.app.samsungapps"]},"iosConfig":{"bundleIds":["com.aheaditec.freeraspExample"],"teamId":"M8AK35..."},"watcherMail":"test_mail@example.com","isProd":false,"killOnBypass":true}'; final config = TalsecConfig( androidConfig: AndroidConfig( packageName: 'com.aheaditec.freeraspExample', @@ -89,6 +89,7 @@ void main() { ), watcherMail: 'test_mail@example.com', isProd: false, + killOnBypass: true, ); // Act & Assert @@ -112,10 +113,11 @@ void main() { ), watcherMail: 'test_mail@example.com', isProd: false, + killOnBypass: true, ); const config = - '{"androidConfig":{"packageName":"com.aheaditec.freeraspExample","signingCertHashes":["AKoRuyLMM91E7lX/Zqp3u4jMmd0A7hH/Iqozu0TMVd0="],"supportedStores":["com.sec.android.app.samsungapps"]},"iosConfig":{"bundleIds":["com.aheaditec.freeraspExample"],"teamId":"M8AK35..."},"watcherMail":"test_mail@example.com","isProd":false}'; + '{"androidConfig":{"packageName":"com.aheaditec.freeraspExample","signingCertHashes":["AKoRuyLMM91E7lX/Zqp3u4jMmd0A7hH/Iqozu0TMVd0="],"supportedStores":["com.sec.android.app.samsungapps"]},"iosConfig":{"bundleIds":["com.aheaditec.freeraspExample"],"teamId":"M8AK35..."},"watcherMail":"test_mail@example.com","isProd":false,"killOnBypass":true}'; // Act final actualConfig =