support enterprise roots
This commit is contained in:
@@ -118,6 +118,22 @@ class DeveloperSettingsScreen extends HookConsumerWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
SwitchListTile.adaptive(
|
||||
title: const Text('Use third party CA certificates'),
|
||||
subtitle: const Text(
|
||||
'Allows the use of third party certificates from the Android CA store',
|
||||
),
|
||||
secondary: const Icon(MdiIcons.certificate),
|
||||
value: engineSettings.enterpriseRootsEnabled,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(saveEngineSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) => currentSettings.copyWith
|
||||
.enterpriseRootsEnabled(value),
|
||||
);
|
||||
},
|
||||
),
|
||||
CustomListTile(
|
||||
title: 'Error Logs',
|
||||
subtitle: 'Copy logs for issue reporting',
|
||||
|
||||
@@ -53,6 +53,8 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
||||
@override
|
||||
WebContentIsolationStrategy get webContentIsolationStrategy =>
|
||||
super.webContentIsolationStrategy!;
|
||||
@override
|
||||
bool get enterpriseRootsEnabled => super.enterpriseRootsEnabled!;
|
||||
|
||||
final QueryParameterStripping queryParameterStripping;
|
||||
|
||||
@@ -80,6 +82,7 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
||||
required super.cookieBannerHandlingGlobalRulesSubFrames,
|
||||
required super.webContentIsolationStrategy,
|
||||
required super.userAgent,
|
||||
required super.enterpriseRootsEnabled,
|
||||
required this.queryParameterStripping,
|
||||
required this.bounceTrackingProtectionMode,
|
||||
});
|
||||
@@ -98,6 +101,7 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
||||
QueryParameterStripping? queryParameterStripping,
|
||||
BounceTrackingProtectionMode? bounceTrackingProtectionMode,
|
||||
super.userAgent,
|
||||
bool? enterpriseRootsEnabled,
|
||||
}) : queryParameterStripping =
|
||||
queryParameterStripping ?? QueryParameterStripping.disabled,
|
||||
bounceTrackingProtectionMode =
|
||||
@@ -122,6 +126,7 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
||||
webContentIsolationStrategy:
|
||||
webContentIsolationStrategy ??
|
||||
WebContentIsolationStrategy.isolateHighValue,
|
||||
enterpriseRootsEnabled: enterpriseRootsEnabled ?? false,
|
||||
);
|
||||
|
||||
factory EngineSettings.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -144,5 +149,6 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
||||
super.userAgent,
|
||||
queryParameterStripping,
|
||||
bounceTrackingProtectionMode,
|
||||
super.enterpriseRootsEnabled,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ abstract class _$EngineSettingsCWProxy {
|
||||
|
||||
EngineSettings userAgent(String? userAgent);
|
||||
|
||||
EngineSettings enterpriseRootsEnabled(bool? enterpriseRootsEnabled);
|
||||
|
||||
EngineSettings queryParameterStripping(
|
||||
QueryParameterStripping queryParameterStripping,
|
||||
);
|
||||
@@ -67,6 +69,7 @@ abstract class _$EngineSettingsCWProxy {
|
||||
bool? cookieBannerHandlingGlobalRulesSubFrames,
|
||||
WebContentIsolationStrategy? webContentIsolationStrategy,
|
||||
String? userAgent,
|
||||
bool? enterpriseRootsEnabled,
|
||||
QueryParameterStripping queryParameterStripping,
|
||||
BounceTrackingProtectionMode bounceTrackingProtectionMode,
|
||||
});
|
||||
@@ -134,6 +137,10 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
|
||||
@override
|
||||
EngineSettings userAgent(String? userAgent) => this(userAgent: userAgent);
|
||||
|
||||
@override
|
||||
EngineSettings enterpriseRootsEnabled(bool? enterpriseRootsEnabled) =>
|
||||
this(enterpriseRootsEnabled: enterpriseRootsEnabled);
|
||||
|
||||
@override
|
||||
EngineSettings queryParameterStripping(
|
||||
QueryParameterStripping queryParameterStripping,
|
||||
@@ -165,6 +172,7 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
|
||||
const $CopyWithPlaceholder(),
|
||||
Object? webContentIsolationStrategy = const $CopyWithPlaceholder(),
|
||||
Object? userAgent = const $CopyWithPlaceholder(),
|
||||
Object? enterpriseRootsEnabled = const $CopyWithPlaceholder(),
|
||||
Object? queryParameterStripping = const $CopyWithPlaceholder(),
|
||||
Object? bounceTrackingProtectionMode = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
@@ -223,6 +231,11 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
|
||||
? _value.userAgent
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: userAgent as String?,
|
||||
enterpriseRootsEnabled:
|
||||
enterpriseRootsEnabled == const $CopyWithPlaceholder()
|
||||
? _value.enterpriseRootsEnabled
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: enterpriseRootsEnabled as bool?,
|
||||
queryParameterStripping:
|
||||
queryParameterStripping == const $CopyWithPlaceholder()
|
||||
? _value.queryParameterStripping
|
||||
@@ -288,6 +301,7 @@ EngineSettings _$EngineSettingsFromJson(Map<String, dynamic> json) =>
|
||||
json['bounceTrackingProtectionMode'],
|
||||
),
|
||||
userAgent: json['userAgent'] as String?,
|
||||
enterpriseRootsEnabled: json['enterpriseRootsEnabled'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$EngineSettingsToJson(
|
||||
@@ -311,6 +325,7 @@ Map<String, dynamic> _$EngineSettingsToJson(
|
||||
'webContentIsolationStrategy':
|
||||
_$WebContentIsolationStrategyEnumMap[instance
|
||||
.webContentIsolationStrategy]!,
|
||||
'enterpriseRootsEnabled': instance.enterpriseRootsEnabled,
|
||||
'queryParameterStripping':
|
||||
_$QueryParameterStrippingEnumMap[instance.queryParameterStripping]!,
|
||||
'bounceTrackingProtectionMode':
|
||||
|
||||
@@ -90,6 +90,10 @@ class EngineSettingsRepository extends _$EngineSettingsRepository {
|
||||
),
|
||||
'bounceTrackingProtectionMode': settings['bounceTrackingProtectionMode']
|
||||
?.readAs(DriftSqlType.string, db.typeMapping),
|
||||
'enterpriseRootsEnabled': settings['enterpriseRootsEnabled']?.readAs(
|
||||
DriftSqlType.bool,
|
||||
db.typeMapping,
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ final engineSettingsWithDefaultsProvider =
|
||||
// ignore: unused_element
|
||||
typedef EngineSettingsWithDefaultsRef = AutoDisposeProviderRef<EngineSettings>;
|
||||
String _$engineSettingsRepositoryHash() =>
|
||||
r'aa522c35377280c451f6ac9e5f7063eab7ba6efc';
|
||||
r'd0c2fbe060b5eaee7189f6cb0dd58c97cf5987b5';
|
||||
|
||||
/// See also [EngineSettingsRepository].
|
||||
@ProviderFor(EngineSettingsRepository)
|
||||
|
||||
+7
@@ -129,6 +129,9 @@ class GeckoEngineSettingsApiImpl : GeckoEngineSettingsApi {
|
||||
|
||||
//TODO: Add bounce tracking protection when available
|
||||
}
|
||||
if(settings.enterpriseRootsEnabled != null) {
|
||||
components.core.engineSettings.enterpriseRootsEnabled = settings.enterpriseRootsEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateRuntimeSettings(settings: GeckoEngineSettings) {
|
||||
@@ -197,6 +200,10 @@ class GeckoEngineSettingsApiImpl : GeckoEngineSettingsApi {
|
||||
|
||||
reloadSession = true
|
||||
}
|
||||
if(settings.enterpriseRootsEnabled != null) {
|
||||
components.core.engine.settings.enterpriseRootsEnabled = components.core.engineSettings.enterpriseRootsEnabled
|
||||
reloadSession = true
|
||||
}
|
||||
|
||||
if(reloadSession) {
|
||||
components.useCases.sessionUseCases.reload()
|
||||
|
||||
+6
-3
@@ -1,4 +1,4 @@
|
||||
// Autogenerated from Pigeon (v26.0.0), do not edit directly.
|
||||
// Autogenerated from Pigeon (v26.0.1), do not edit directly.
|
||||
// See also: https://pub.dev/packages/pigeon
|
||||
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
||||
|
||||
@@ -1542,7 +1542,8 @@ data class GeckoEngineSettings (
|
||||
val cookieBannerHandlingGlobalRulesSubFrames: Boolean? = null,
|
||||
val webContentIsolationStrategy: WebContentIsolationStrategy? = null,
|
||||
val userAgent: String? = null,
|
||||
val contentBlocking: ContentBlocking? = null
|
||||
val contentBlocking: ContentBlocking? = null,
|
||||
val enterpriseRootsEnabled: Boolean? = null
|
||||
)
|
||||
{
|
||||
companion object {
|
||||
@@ -1559,7 +1560,8 @@ data class GeckoEngineSettings (
|
||||
val webContentIsolationStrategy = pigeonVar_list[9] as WebContentIsolationStrategy?
|
||||
val userAgent = pigeonVar_list[10] as String?
|
||||
val contentBlocking = pigeonVar_list[11] as ContentBlocking?
|
||||
return GeckoEngineSettings(javascriptEnabled, trackingProtectionPolicy, httpsOnlyMode, globalPrivacyControlEnabled, preferredColorScheme, cookieBannerHandlingMode, cookieBannerHandlingModePrivateBrowsing, cookieBannerHandlingGlobalRules, cookieBannerHandlingGlobalRulesSubFrames, webContentIsolationStrategy, userAgent, contentBlocking)
|
||||
val enterpriseRootsEnabled = pigeonVar_list[12] as Boolean?
|
||||
return GeckoEngineSettings(javascriptEnabled, trackingProtectionPolicy, httpsOnlyMode, globalPrivacyControlEnabled, preferredColorScheme, cookieBannerHandlingMode, cookieBannerHandlingModePrivateBrowsing, cookieBannerHandlingGlobalRules, cookieBannerHandlingGlobalRulesSubFrames, webContentIsolationStrategy, userAgent, contentBlocking, enterpriseRootsEnabled)
|
||||
}
|
||||
}
|
||||
fun toList(): List<Any?> {
|
||||
@@ -1576,6 +1578,7 @@ data class GeckoEngineSettings (
|
||||
webContentIsolationStrategy,
|
||||
userAgent,
|
||||
contentBlocking,
|
||||
enterpriseRootsEnabled,
|
||||
)
|
||||
}
|
||||
override fun equals(other: Any?): Boolean {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Autogenerated from Pigeon (v26.0.0), do not edit directly.
|
||||
// Autogenerated from Pigeon (v26.0.1), do not edit directly.
|
||||
// See also: https://pub.dev/packages/pigeon
|
||||
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers
|
||||
|
||||
@@ -1880,6 +1880,7 @@ class GeckoEngineSettings {
|
||||
this.webContentIsolationStrategy,
|
||||
this.userAgent,
|
||||
this.contentBlocking,
|
||||
this.enterpriseRootsEnabled,
|
||||
});
|
||||
|
||||
bool? javascriptEnabled;
|
||||
@@ -1906,6 +1907,8 @@ class GeckoEngineSettings {
|
||||
|
||||
ContentBlocking? contentBlocking;
|
||||
|
||||
bool? enterpriseRootsEnabled;
|
||||
|
||||
List<Object?> _toList() {
|
||||
return <Object?>[
|
||||
javascriptEnabled,
|
||||
@@ -1920,6 +1923,7 @@ class GeckoEngineSettings {
|
||||
webContentIsolationStrategy,
|
||||
userAgent,
|
||||
contentBlocking,
|
||||
enterpriseRootsEnabled,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1941,6 +1945,7 @@ class GeckoEngineSettings {
|
||||
webContentIsolationStrategy: result[9] as WebContentIsolationStrategy?,
|
||||
userAgent: result[10] as String?,
|
||||
contentBlocking: result[11] as ContentBlocking?,
|
||||
enterpriseRootsEnabled: result[12] as bool?,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -592,6 +592,7 @@ class GeckoEngineSettings {
|
||||
final WebContentIsolationStrategy? webContentIsolationStrategy;
|
||||
final String? userAgent;
|
||||
final ContentBlocking? contentBlocking;
|
||||
final bool? enterpriseRootsEnabled;
|
||||
|
||||
GeckoEngineSettings(
|
||||
this.javascriptEnabled,
|
||||
@@ -606,6 +607,7 @@ class GeckoEngineSettings {
|
||||
this.webContentIsolationStrategy,
|
||||
this.userAgent,
|
||||
this.contentBlocking,
|
||||
this.enterpriseRootsEnabled,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user