mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2026-05-09 18:11:26 +08:00
remove geoip embed and sideload
we had geoip.metadb and geosite.dat in asserts
This commit is contained in:
@@ -5,7 +5,6 @@ import android.view.View
|
||||
import com.github.kr328.clash.core.model.ConfigurationOverride
|
||||
import com.github.kr328.clash.core.model.LogMessage
|
||||
import com.github.kr328.clash.core.model.TunnelState
|
||||
import com.github.kr328.clash.design.adapter.SideloadProviderAdapter
|
||||
import com.github.kr328.clash.design.databinding.DesignSettingsOverideBinding
|
||||
import com.github.kr328.clash.design.databinding.DialogPreferenceListBinding
|
||||
import com.github.kr328.clash.design.dialog.FullScreenDialog
|
||||
@@ -23,7 +22,7 @@ class OverrideSettingsDesign(
|
||||
configuration: ConfigurationOverride
|
||||
) : Design<OverrideSettingsDesign.Request>(context) {
|
||||
enum class Request {
|
||||
ResetOverride, EditSideloadGeoip
|
||||
ResetOverride
|
||||
}
|
||||
|
||||
private val binding = DesignSettingsOverideBinding
|
||||
@@ -52,49 +51,6 @@ class OverrideSettingsDesign(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun requestSelectSideload(initial: String, apps: List<AppInfo>): String =
|
||||
withContext(Dispatchers.Main) {
|
||||
suspendCancellableCoroutine { ctx ->
|
||||
val binding = DialogPreferenceListBinding
|
||||
.inflate(context.layoutInflater, context.root, false)
|
||||
val adapter = SideloadProviderAdapter(context, apps, initial)
|
||||
val dialog = FullScreenDialog(context)
|
||||
|
||||
dialog.setContentView(binding.root)
|
||||
|
||||
binding.surface = dialog.surface
|
||||
|
||||
binding.titleView.text = context.getString(R.string.sideload_geoip)
|
||||
|
||||
binding.newView.visibility = View.INVISIBLE
|
||||
|
||||
binding.mainList.applyLinearAdapter(context, adapter)
|
||||
|
||||
binding.resetView.setOnClickListener {
|
||||
ctx.resume("")
|
||||
|
||||
dialog.dismiss()
|
||||
}
|
||||
|
||||
binding.cancelView.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
}
|
||||
|
||||
binding.okView.setOnClickListener {
|
||||
ctx.resume(adapter.selectedPackageName)
|
||||
|
||||
dialog.dismiss()
|
||||
}
|
||||
|
||||
dialog.setOnDismissListener {
|
||||
if (!ctx.isCompleted)
|
||||
ctx.resume(initial)
|
||||
}
|
||||
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
binding.self = this
|
||||
|
||||
@@ -247,15 +203,6 @@ class OverrideSettingsDesign(
|
||||
placeholder = R.string.dont_modify,
|
||||
)
|
||||
|
||||
clickable(
|
||||
title = R.string.sideload_geoip,
|
||||
summary = R.string.sideload_geoip_summary
|
||||
) {
|
||||
clicked {
|
||||
requests.trySend(Request.EditSideloadGeoip)
|
||||
}
|
||||
}
|
||||
|
||||
category(R.string.dns)
|
||||
|
||||
val dnsDependencies: MutableList<Preference> = mutableListOf()
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.github.kr328.clash.design.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.kr328.clash.design.databinding.AdapterSideloadProviderBinding
|
||||
import com.github.kr328.clash.design.model.AppInfo
|
||||
import com.github.kr328.clash.design.util.layoutInflater
|
||||
import com.github.kr328.clash.design.util.root
|
||||
|
||||
class SideloadProviderAdapter(
|
||||
private val context: Context,
|
||||
private val apps: List<AppInfo>,
|
||||
var selectedPackageName: String
|
||||
) : RecyclerView.Adapter<SideloadProviderAdapter.Holder>() {
|
||||
class Holder(val binding: AdapterSideloadProviderBinding) :
|
||||
RecyclerView.ViewHolder(binding.root)
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): Holder {
|
||||
return Holder(
|
||||
AdapterSideloadProviderBinding
|
||||
.inflate(context.layoutInflater, context.root, false)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: Holder, position: Int) {
|
||||
val current = apps[position]
|
||||
|
||||
holder.binding.appInfo = current
|
||||
|
||||
holder.binding.selected = selectedPackageName == current.packageName
|
||||
|
||||
holder.binding.root.setOnClickListener {
|
||||
val index = apps.indexOfFirst { it.packageName == selectedPackageName }
|
||||
|
||||
selectedPackageName = current.packageName
|
||||
|
||||
if (index >= 0)
|
||||
notifyItemChanged(index)
|
||||
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return apps.size
|
||||
}
|
||||
}
|
||||
@@ -119,8 +119,6 @@
|
||||
<string name="log_level">ログレベル</string>
|
||||
<string name="ipv6">IPv6</string>
|
||||
<string name="hosts">ホスト</string>
|
||||
<string name="sideload_geoip">GeoIPを読み込み中</string>
|
||||
<string name="sideload_geoip_summary">外部のGeoIPデータベース</string>
|
||||
<string name="_new">新規</string>
|
||||
<string name="value">値</string>
|
||||
<string name="strategy">ポリシー</string>
|
||||
|
||||
@@ -119,8 +119,6 @@
|
||||
<string name="log_level">로그 레벨</string>
|
||||
<string name="ipv6">IPv6</string>
|
||||
<string name="hosts">호스트</string>
|
||||
<string name="sideload_geoip">Sideload GEOIP</string>
|
||||
<string name="sideload_geoip_summary">외부 GEOIP 데이터베이스</string>
|
||||
<string name="_new">신규</string>
|
||||
<string name="value">값</string>
|
||||
<string name="strategy">정책</string>
|
||||
|
||||
@@ -145,8 +145,6 @@
|
||||
<string name="log_level">Уровень логов</string>
|
||||
<string name="ipv6">IPv6</string>
|
||||
<string name="hosts">Hosts</string>
|
||||
<string name="sideload_geoip">Загрузить GeoIP</string>
|
||||
<string name="sideload_geoip_summary">Внешняя база GeoIP</string>
|
||||
<string name="_new">Новый</string>
|
||||
<string name="value">Значение</string>
|
||||
|
||||
|
||||
@@ -175,8 +175,6 @@
|
||||
<string name="format_fetching_provider">正在下載外部資源 %s</string>
|
||||
<string name="initializing">正在初始化</string>
|
||||
<string name="verifying">正在校驗</string>
|
||||
<string name="sideload_geoip">旁加載 GEOIP</string>
|
||||
<string name="sideload_geoip_summary">外部 GEOIP 數據庫</string>
|
||||
<string name="force_enable">強制啓用</string>
|
||||
<string name="document">文檔</string>
|
||||
<string name="clash_wiki">Clash Wiki</string>
|
||||
|
||||
@@ -175,8 +175,6 @@
|
||||
<string name="format_fetching_provider">正在下載外部資源 %s</string>
|
||||
<string name="initializing">正在初始化</string>
|
||||
<string name="verifying">正在校驗</string>
|
||||
<string name="sideload_geoip">旁載入 GEOIP</string>
|
||||
<string name="sideload_geoip_summary">外部 GEOIP 資料庫</string>
|
||||
<string name="force_enable">強制啟用</string>
|
||||
<string name="document">文件</string>
|
||||
<string name="clash_wiki">Clash Wiki</string>
|
||||
|
||||
@@ -176,8 +176,6 @@
|
||||
<string name="format_fetching_provider">正在下载外部资源 %s</string>
|
||||
<string name="initializing">正在初始化</string>
|
||||
<string name="verifying">正在校验</string>
|
||||
<string name="sideload_geoip">旁加载 GEOIP</string>
|
||||
<string name="sideload_geoip_summary">外部 GEOIP 数据库</string>
|
||||
<string name="force_enable">强制启用</string>
|
||||
<string name="document">文档</string>
|
||||
<string name="clash_wiki">Clash Wiki</string>
|
||||
|
||||
@@ -149,8 +149,6 @@
|
||||
<string name="external_controller">External Controller</string>
|
||||
<string name="secret">Secret</string>
|
||||
<string name="hosts">Hosts</string>
|
||||
<string name="sideload_geoip">Sideload GEOIP</string>
|
||||
<string name="sideload_geoip_summary">External GEOIP database</string>
|
||||
<string name="_new">New</string>
|
||||
<string name="value">Value</string>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user