improve hardening options

This commit is contained in:
Fabian Freund
2025-06-28 20:41:08 +02:00
parent e538d25776
commit 14db60c0ff
4 changed files with 52 additions and 9 deletions
@@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:flutter_mozilla_components/src/pigeons/gecko.g.dart';
final _apiInstance = GeckoPrefApi();
@@ -16,7 +18,7 @@ class GeckoPrefService {
final value = switch (pref.value) {
final bool x => '$x',
final int x => '$x',
final String x => "'$x'", //Use single ticks to allow json
final String x => jsonEncode(x),
_ => throw Exception('Unknow pref type'),
};