yellowbluesky / PixivforMuzei3

Best Pixiv plugin for Muzei 3
GNU General Public License v3.0
176 stars 15 forks source link

fix: OkHttpClient Instance didn't update in time when pref_enableNetworkBypass change. #162 #164

Closed mslxl closed 3 years ago

mslxl commented 3 years ago

Hi! This is a fix of issue https://github.com/yellowbluesky/PixivforMuzei3/issues/162

I found this bug is caused by the OKHttpClient instance is a singleton and it can not be changed by any preferences after the app was started. I fix it by setting the instance to null after preferences changed so the instance will be applied with sslSocketFactory and dns method on the next request.