This commit is contained in:
Pacalini
2024-12-31 08:54:01 +08:00
parent 68a203a1c1
commit 5be2dbcfd7
4 changed files with 0 additions and 28 deletions

View File

@@ -218,7 +218,6 @@
"Create Folder": "新建文件夹", "Create Folder": "新建文件夹",
"Select an image on screen": "选择屏幕上的图片", "Select an image on screen": "选择屏幕上的图片",
"Added @count comics to download queue.": "已添加 @count 本漫画到下载队列", "Added @count comics to download queue.": "已添加 @count 本漫画到下载队列",
"Ignore Certificate Errors": "忽略证书错误",
"Authorization Required": "需要身份验证", "Authorization Required": "需要身份验证",
"Sync": "同步", "Sync": "同步",
"The folder is Linked to @source": "文件夹已关联到 @source", "The folder is Linked to @source": "文件夹已关联到 @source",
@@ -481,7 +480,6 @@
"Create Folder": "新建文件夾", "Create Folder": "新建文件夾",
"Select an image on screen": "選擇屏幕上的圖片", "Select an image on screen": "選擇屏幕上的圖片",
"Added @count comics to download queue.": "已添加 @count 本漫畫到下載隊列", "Added @count comics to download queue.": "已添加 @count 本漫畫到下載隊列",
"Ignore Certificate Errors": "忽略證書錯誤",
"Authorization Required": "需要身份驗證", "Authorization Required": "需要身份驗證",
"Sync": "同步", "Sync": "同步",
"The folder is Linked to @source": "文件夾已關聯到 @source", "The folder is Linked to @source": "文件夾已關聯到 @source",

View File

@@ -122,7 +122,6 @@ class _Settings with ChangeNotifier {
'quickFavorite': null, 'quickFavorite': null,
'enableTurnPageByVolumeKey': true, 'enableTurnPageByVolumeKey': true,
'enableClockAndBatteryInfoInReader': true, 'enableClockAndBatteryInfoInReader': true,
'ignoreCertificateErrors': false,
'authorizationRequired': false, 'authorizationRequired': false,
'onClickFavorite': 'viewDetail', // viewDetail, read 'onClickFavorite': 'viewDetail', // viewDetail, read
'enableDnsOverrides': false, 'enableDnsOverrides': false,

View File

@@ -108,7 +108,6 @@ class MyLogInterceptor implements Interceptor {
class AppDio with DioMixin { class AppDio with DioMixin {
String? _proxy = proxy; String? _proxy = proxy;
static bool get ignoreCertificateErrors => appdata.settings['ignoreCertificateErrors'] == true;
AppDio([BaseOptions? options]) { AppDio([BaseOptions? options]) {
this.options = options ?? BaseOptions(); this.options = options ?? BaseOptions();
@@ -116,9 +115,6 @@ class AppDio with DioMixin {
proxySettings: proxy == null proxySettings: proxy == null
? const rhttp.ProxySettings.noProxy() ? const rhttp.ProxySettings.noProxy()
: rhttp.ProxySettings.proxy(proxy!), : rhttp.ProxySettings.proxy(proxy!),
tlsSettings: rhttp.TlsSettings(
verifyCertificates: !ignoreCertificateErrors,
),
)); ));
interceptors.add(CookieManagerSql(SingleInstanceCookieJar.instance!)); interceptors.add(CookieManagerSql(SingleInstanceCookieJar.instance!));
interceptors.add(NetworkCacheManager()); interceptors.add(NetworkCacheManager());
@@ -196,9 +192,6 @@ class AppDio with DioMixin {
proxySettings: proxy == null proxySettings: proxy == null
? const rhttp.ProxySettings.noProxy() ? const rhttp.ProxySettings.noProxy()
: rhttp.ProxySettings.proxy(proxy!), : rhttp.ProxySettings.proxy(proxy!),
tlsSettings: rhttp.TlsSettings(
verifyCertificates: !ignoreCertificateErrors,
),
)); ));
} }
try { try {
@@ -247,9 +240,6 @@ class RHttpAdapter implements HttpClientAdapter {
keepAlivePing: Duration(seconds: 30), keepAlivePing: Duration(seconds: 30),
), ),
throwOnStatusCode: false, throwOnStatusCode: false,
tlsSettings: rhttp.TlsSettings(
verifyCertificates: !AppDio.ignoreCertificateErrors,
),
dnsSettings: rhttp.DnsSettings.static(overrides: _getOverrides()), dnsSettings: rhttp.DnsSettings.static(overrides: _getOverrides()),
); );
} }

View File

@@ -46,7 +46,6 @@ class _ProxySettingViewState extends State<_ProxySettingView> {
String port = ''; String port = '';
String username = ''; String username = '';
String password = ''; String password = '';
bool ignoreCertificateErrors = false;
// USERNAME:PASSWORD@HOST:PORT // USERNAME:PASSWORD@HOST:PORT
String toProxyStr() { String toProxyStr() {
@@ -104,8 +103,6 @@ class _ProxySettingViewState extends State<_ProxySettingView> {
void initState() { void initState() {
var proxy = appdata.settings['proxy']; var proxy = appdata.settings['proxy'];
parseProxyString(proxy); parseProxyString(proxy);
ignoreCertificateErrors =
appdata.settings['ignoreCertificateErrors'] ?? false;
super.initState(); super.initState();
} }
@@ -151,18 +148,6 @@ class _ProxySettingViewState extends State<_ProxySettingView> {
}, },
), ),
if (type == 'manual') buildManualProxy(), if (type == 'manual') buildManualProxy(),
SwitchListTile(
title: Text("Ignore Certificate Errors".tl),
value: ignoreCertificateErrors,
onChanged: (v) {
setState(() {
ignoreCertificateErrors = v;
});
appdata.settings['ignoreCertificateErrors'] =
ignoreCertificateErrors;
appdata.saveData();
},
),
], ],
), ),
), ),