Skip to content

Commit

Permalink
[Fix]: 修复DNS崩溃问题
Browse files Browse the repository at this point in the history
  • Loading branch information
why committed Apr 11, 2024
1 parent 2c7177a commit e892854
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
13 changes: 0 additions & 13 deletions app/src/main/java/com/xiaoyv/bangumi/ui/profile/ProfileFragment.kt
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
package com.xiaoyv.bangumi.ui.profile

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.LayoutInflater
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.widget.PopupMenu
import androidx.core.graphics.Insets
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import androidx.lifecycle.LifecycleOwner
import com.blankj.utilcode.util.BarUtils
import com.google.android.material.badge.BadgeDrawable
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import com.xiaoyv.bangumi.databinding.FragmentProfileBinding
import com.xiaoyv.bangumi.helper.RouteHelper
import com.xiaoyv.blueprint.base.mvvm.normal.BaseViewModelFragment
import com.xiaoyv.blueprint.kts.launchUI
import com.xiaoyv.common.config.annotation.LocalCollectionType
import com.xiaoyv.common.currentApplication
import com.xiaoyv.common.helper.ConfigHelper
import com.xiaoyv.common.helper.UserHelper
import com.xiaoyv.common.kts.CommonDrawable
import com.xiaoyv.common.kts.CommonId
import com.xiaoyv.common.kts.debugLog
import com.xiaoyv.common.kts.forceFitStatusBar
import com.xiaoyv.common.kts.loadImageAnimate
import com.xiaoyv.common.kts.loadImageBlur
import com.xiaoyv.common.kts.setBadgeNumber
import com.xiaoyv.widget.callback.setOnFastLimitClickListener
import com.xiaoyv.widget.kts.adjustScrollSensitivity
import com.xiaoyv.widget.kts.dpi
import com.xiaoyv.widget.kts.toast
import kotlinx.coroutines.delay
import kotlin.math.abs


Expand Down
4 changes: 3 additions & 1 deletion lib-common/src/main/java/com/xiaoyv/common/api/dns/BgmDns.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class BgmDns : Dns {
val addresses = lookupInHostsFile(hostname)
if (addresses.isEmpty()) {
// 如果 hosts 文件中没有找到,则使用系统默认的 DNS 解析
return Dns.SYSTEM.lookup(hostname)
runCatching {
return Dns.SYSTEM.lookup(hostname)
}
}

return addresses
Expand Down

0 comments on commit e892854

Please sign in to comment.