File tree Expand file tree Collapse file tree 13 files changed +41
-3
lines changed Expand file tree Collapse file tree 13 files changed +41
-3
lines changed Original file line number Diff line number Diff line change @@ -11,5 +11,6 @@ data class SubscriptionItem(
11
11
var prevProfile : String? = null ,
12
12
var nextProfile : String? = null ,
13
13
var filter : String? = null ,
14
+ var allowInsecureUrl : Boolean = false ,
14
15
)
15
16
Original file line number Diff line number Diff line change @@ -419,8 +419,10 @@ object AngConfigManager {
419
419
if (! Utils .isValidUrl(url)) {
420
420
return 0
421
421
}
422
- if (! Utils .isValidSubUrl(url)) {
423
- return 0
422
+ if (! it.second.allowInsecureUrl) {
423
+ if (! Utils .isValidSubUrl(url)) {
424
+ return 0
425
+ }
424
426
}
425
427
Log .i(AppConfig .TAG , url)
426
428
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ class SubEditActivity : BaseActivity() {
46
46
binding.etFilter.text = Utils .getEditable(subItem.filter)
47
47
binding.chkEnable.isChecked = subItem.enabled
48
48
binding.autoUpdateCheck.isChecked = subItem.autoUpdate
49
+ binding.allowInsecureUrl.isChecked = subItem.allowInsecureUrl
49
50
binding.etPreProfile.text = Utils .getEditable(subItem.prevProfile)
50
51
binding.etNextProfile.text = Utils .getEditable(subItem.nextProfile)
51
52
return true
@@ -77,6 +78,7 @@ class SubEditActivity : BaseActivity() {
77
78
subItem.autoUpdate = binding.autoUpdateCheck.isChecked
78
79
subItem.prevProfile = binding.etPreProfile.text.toString()
79
80
subItem.nextProfile = binding.etNextProfile.text.toString()
81
+ subItem.allowInsecureUrl = binding.allowInsecureUrl.isChecked
80
82
81
83
if (TextUtils .isEmpty(subItem.remarks)) {
82
84
toast(R .string.sub_setting_remarks)
@@ -90,7 +92,9 @@ class SubEditActivity : BaseActivity() {
90
92
91
93
if (! Utils .isValidSubUrl(subItem.url)) {
92
94
toast(R .string.toast_insecure_url_protocol)
93
- return false
95
+ if (! subItem.allowInsecureUrl) {
96
+ return false
97
+ }
94
98
}
95
99
}
96
100
Original file line number Diff line number Diff line change 138
138
139
139
</LinearLayout >
140
140
141
+ <LinearLayout
142
+ android : layout_width =" match_parent"
143
+ android : layout_height =" wrap_content"
144
+ android : layout_marginTop =" @dimen/padding_spacing_dp16"
145
+ android : orientation =" horizontal" >
146
+
147
+ <TextView
148
+ android : layout_width =" 0dp"
149
+ android : layout_height =" wrap_content"
150
+ android : layout_weight =" 1.0"
151
+ android : text =" @string/sub_allow_insecure_url" />
152
+
153
+ <androidx .appcompat.widget.SwitchCompat
154
+ android : id =" @+id/allow_insecure_url"
155
+ android : layout_width =" wrap_content"
156
+ android : layout_height =" wrap_content"
157
+ android : paddingStart =" @dimen/padding_spacing_dp16"
158
+ android : paddingEnd =" @dimen/padding_spacing_dp16"
159
+ app : theme =" @style/BrandedSwitch" />
160
+
161
+ </LinearLayout >
162
+
141
163
<LinearLayout
142
164
android : layout_width =" match_parent"
143
165
android : layout_height =" wrap_content"
Original file line number Diff line number Diff line change 258
258
<string name =" sub_setting_filter" >Remarks regular filter</string >
259
259
<string name =" sub_setting_enable" >تفعيل التحديث</string >
260
260
<string name =" sub_auto_update" >تفعيل التحديث التلقائي</string >
261
+ <string name =" sub_allow_insecure_url" >Allow insecure HTTP address</string >
261
262
<string name =" sub_setting_pre_profile" >Previous proxy configuration remarks</string >
262
263
<string name =" sub_setting_next_profile" >Next proxy configuration remarks</string >
263
264
<string name =" sub_setting_pre_profile_tip" >The configuration remarks exists and is unique</string >
Original file line number Diff line number Diff line change 258
258
<string name =" sub_setting_filter" >Remarks regular filter</string >
259
259
<string name =" sub_setting_enable" >আপডেট সক্রিয় করুন</string >
260
260
<string name =" sub_auto_update" >স্বয়ংক্রিয় আপডেট সক্রিয় করুন</string >
261
+ <string name =" sub_allow_insecure_url" >Allow insecure HTTP address</string >
261
262
<string name =" sub_setting_pre_profile" >Previous proxy configuration remarks</string >
262
263
<string name =" sub_setting_next_profile" >Next proxy configuration remarks</string >
263
264
<string name =" sub_setting_pre_profile_tip" >The configuration remarks exists and is unique</string >
Original file line number Diff line number Diff line change 258
258
<string name =" sub_setting_filter" >نوم موستعار فیلتر</string >
259
259
<string name =" sub_setting_enable" >فعال بیڌن ورۊ کردن</string >
260
260
<string name =" sub_auto_update" >فعال بیڌن ورۊ کردن خوتکار</string >
261
+ <string name =" sub_allow_insecure_url" >Allow insecure HTTP address</string >
261
262
<string name =" sub_setting_pre_profile" >نوم موستعار پروکسی دیندایی</string >
262
263
<string name =" sub_setting_next_profile" >نوم موستعار پروکسی نیایی</string >
263
264
<string name =" sub_setting_pre_profile_tip" >موتمعن بۊ ک نوم موستعار هڌس وو جۊرس نی</string >
Original file line number Diff line number Diff line change 255
255
<string name =" sub_setting_filter" >نام مستعار فیلتر</string >
256
256
<string name =" sub_setting_enable" >فعال کردن بهروزرسانی</string >
257
257
<string name =" sub_auto_update" >فعال سازی بهروزرسانی خودکار</string >
258
+ <string name =" sub_allow_insecure_url" >Allow insecure HTTP address</string >
258
259
<string name =" sub_setting_pre_profile" >نام مستعار پروکسی قبلی</string >
259
260
<string name =" sub_setting_next_profile" >نام مستعار پروکسی بعدی</string >
260
261
<string name =" sub_setting_pre_profile_tip" >لطفاً مطمئن شوید که نام مستعار وجود دارد و منحصر به فرد است</string >
Original file line number Diff line number Diff line change 257
257
<string name =" sub_setting_filter" >Название фильтра</string >
258
258
<string name =" sub_setting_enable" >Использовать обновление</string >
259
259
<string name =" sub_auto_update" >Использовать автообновление</string >
260
+ <string name =" sub_allow_insecure_url" >Allow insecure HTTP address</string >
260
261
<string name =" sub_setting_pre_profile" >Предыдущая конфигурация прокси</string >
261
262
<string name =" sub_setting_next_profile" >Следующая конфигурация прокси</string >
262
263
<string name =" sub_setting_pre_profile_tip" >Конфигурация должна быть уникальной</string >
Original file line number Diff line number Diff line change 258
258
<string name =" sub_setting_filter" >Remarks regular filter</string >
259
259
<string name =" sub_setting_enable" >Sử dụng gói đăng ký này</string >
260
260
<string name =" sub_auto_update" >Bật tự động cập nhật</string >
261
+ <string name =" sub_allow_insecure_url" >Allow insecure HTTP address</string >
261
262
<string name =" sub_setting_pre_profile" >Previous proxy configuration remarks</string >
262
263
<string name =" sub_setting_next_profile" >Next proxy configuration remarks</string >
263
264
<string name =" sub_setting_pre_profile_tip" >The configuration remarks exists and is unique</string >
Original file line number Diff line number Diff line change 255
255
<string name =" sub_setting_filter" >别名正则过滤</string >
256
256
<string name =" sub_setting_enable" >启用更新</string >
257
257
<string name =" sub_auto_update" >启用自动更新</string >
258
+ <string name =" sub_allow_insecure_url" >允许不安全的 HTTP 地址</string >
258
259
<string name =" sub_setting_pre_profile" >前置代理配置文件别名</string >
259
260
<string name =" sub_setting_next_profile" >落地代理配置文件別名</string >
260
261
<string name =" sub_setting_pre_profile_tip" >请确保配置文件别名存在并唯一</string >
Original file line number Diff line number Diff line change 256
256
<string name =" sub_setting_filter" >別名正規過濾</string >
257
257
<string name =" sub_setting_enable" >啟用更新</string >
258
258
<string name =" sub_auto_update" >啟用自動更新</string >
259
+ <string name =" sub_allow_insecure_url" >允許不安全的 HTTP 位址</string >
259
260
<string name =" sub_setting_pre_profile" >前置代理設定檔别名</string >
260
261
<string name =" sub_setting_next_profile" >落地代理設定檔別名</string >
261
262
<string name =" sub_setting_pre_profile_tip" >请确保設定檔别名存在并唯一</string >
Original file line number Diff line number Diff line change 259
259
<string name =" sub_setting_filter" >Remarks regular filter</string >
260
260
<string name =" sub_setting_enable" >Enable update</string >
261
261
<string name =" sub_auto_update" >Enable automatic update</string >
262
+ <string name =" sub_allow_insecure_url" >Allow insecure HTTP address</string >
262
263
<string name =" sub_setting_pre_profile" >Previous proxy configuration remarks</string >
263
264
<string name =" sub_setting_next_profile" >Next proxy configuration remarks</string >
264
265
<string name =" sub_setting_pre_profile_tip" >The configuration remarks exists and is unique</string >
You can’t perform that action at this time.
0 commit comments