diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/HostMappingsListFragment.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/HostMappingsListFragment.kt index cd458678c..de565d4bf 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/HostMappingsListFragment.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/HostMappingsListFragment.kt @@ -35,7 +35,6 @@ import android.widget.* import android.widget.AbsListView.MultiChoiceModeListener import android.widget.CompoundButton.OnCheckedChangeListener import kotlinx.android.synthetic.main.fragment_content_listview.* -import org.apache.commons.lang3.StringUtils import org.mariotaku.twidere.Constants import org.mariotaku.twidere.R import org.mariotaku.twidere.TwidereConstants.HOST_MAPPING_PREFERENCES_NAME @@ -108,7 +107,7 @@ class HostMappingsListFragment : AbsContentListViewFragment { - val mentionList = StringUtils.split(link, "/") + val mentionList = link.split("/") if (mentionList.size != 2) { return false } diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/util/net/TwidereDns.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/util/net/TwidereDns.kt index f5fa14d7b..83bc0aab8 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/util/net/TwidereDns.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/util/net/TwidereDns.kt @@ -24,7 +24,6 @@ import android.content.SharedPreferences import android.util.Log import android.util.TimingLogger import okhttp3.Dns -import org.apache.commons.lang3.StringUtils import org.mariotaku.ktextension.toIntOr import org.mariotaku.twidere.BuildConfig import org.mariotaku.twidere.TwidereConstants.HOST_MAPPING_PREFERENCES_NAME @@ -233,7 +232,7 @@ class TwidereDns(context: Context, private val preferences: SharedPreferences) : private fun hostMatches(host: String?, rule: String?): Boolean { if (rule == null || host == null) return false - if (rule.startsWith(".")) return StringUtils.endsWithIgnoreCase(host, rule) + if (rule.startsWith(".")) return host.endsWith(rule, ignoreCase = true) return host.equals(rule, ignoreCase = true) }