parent
71e496fa4e
commit
05ee01c7d4
|
|
@ -375,29 +375,36 @@ open class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispa
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun startClash(isStart: Boolean) {
|
private fun startClash(isStart: Boolean) {
|
||||||
launch {
|
val nodeJson=serStore.nodes
|
||||||
profileBinder?.let { pm ->
|
Log.d("nodeJson: ${nodeJson.isEmpty()}")
|
||||||
val active = pm.queryActive()
|
if(nodeJson.isEmpty()){
|
||||||
if (active == null) {
|
RxToast.info(resources.getString(R.string.GetNodesAgined))
|
||||||
if (isStart) {
|
refreshNode()
|
||||||
delay(2000)
|
hideLoading()
|
||||||
}
|
}else{
|
||||||
Log.d("startClash: 未选择")
|
launch {
|
||||||
val pro = pm.queryAll().find {
|
profileBinder?.let { pm ->
|
||||||
it.name == Conf.getClashConfName(this@HomeFragment.context)
|
val active = pm.queryActive()
|
||||||
}
|
if (active == null) {
|
||||||
|
if (isStart) {
|
||||||
|
delay(2000)
|
||||||
|
}
|
||||||
|
Log.d("startClash: 未选择")
|
||||||
|
val pro = pm.queryAll().find {
|
||||||
|
it.name == Conf.getClashConfName(this@HomeFragment.context)
|
||||||
|
}
|
||||||
|
|
||||||
pro?.let { profile ->
|
pro?.let { profile ->
|
||||||
Log.d("new setactive name " + profile.name)
|
Log.d("new setactive name " + profile.name)
|
||||||
pm.setActive(profile)
|
|
||||||
|
|
||||||
newUuid = profile.uuid.toString()
|
|
||||||
isSubbed = true
|
|
||||||
} ?: run {
|
|
||||||
//为空的情况下选择第一个
|
|
||||||
pm.queryAll().forEach { profile ->
|
|
||||||
pm.setActive(profile)
|
pm.setActive(profile)
|
||||||
|
|
||||||
|
newUuid = profile.uuid.toString()
|
||||||
|
isSubbed = true
|
||||||
|
} ?: run {
|
||||||
|
//为空的情况下选择第一个
|
||||||
|
pm.queryAll().forEach { profile ->
|
||||||
|
pm.setActive(profile)
|
||||||
|
|
||||||
newUuid = profile.uuid.toString()
|
newUuid = profile.uuid.toString()
|
||||||
isSubbed = true
|
isSubbed = true
|
||||||
return@forEach
|
return@forEach
|
||||||
|
|
@ -431,11 +438,13 @@ open class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispa
|
||||||
ivAccelerate.setImageResource(R.mipmap.yjl_home_clink_select_bg)
|
ivAccelerate.setImageResource(R.mipmap.yjl_home_clink_select_bg)
|
||||||
hideLoading()
|
hideLoading()
|
||||||
// checkGlo()
|
// checkGlo()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private val nextRequestKey = AtomicInteger(0)
|
private val nextRequestKey = AtomicInteger(0)
|
||||||
|
|
@ -748,6 +757,9 @@ open class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispa
|
||||||
cm.patchSelector("GLOBAL", baseNodeName)
|
cm.patchSelector("GLOBAL", baseNodeName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
RxToast.info(resources.getString(R.string.GetNodesAgined))
|
||||||
|
refreshNode()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -424,4 +424,5 @@ In order to implement and strengthen awareness of personal information security
|
||||||
<string name="closeRunningChoose">Please disconnect and switch modes</string>
|
<string name="closeRunningChoose">Please disconnect and switch modes</string>
|
||||||
<string name="OpenSwitchingSourceModel">Please enable acceleration before switching to global mode</string>
|
<string name="OpenSwitchingSourceModel">Please enable acceleration before switching to global mode</string>
|
||||||
<string name="GolbalModeNoChoose">Switching nodes is not currently supported in global acceleration mode. Please switch to smart mode!</string>
|
<string name="GolbalModeNoChoose">Switching nodes is not currently supported in global acceleration mode. Please switch to smart mode!</string>
|
||||||
|
<string name="GetNodesAgined">Getting nodes, please click to speed up later</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -416,4 +416,5 @@
|
||||||
<string name="closeRunningChoose">請斷開連線後在進行模式切換</string>
|
<string name="closeRunningChoose">請斷開連線後在進行模式切換</string>
|
||||||
<string name="OpenSwitchingSourceModel">請開啟加速後在進行全域模式切換</string>
|
<string name="OpenSwitchingSourceModel">請開啟加速後在進行全域模式切換</string>
|
||||||
<string name="GolbalModeNoChoose">全域模式加速下暫不支援切換節點,請切換至智慧模式!</string>
|
<string name="GolbalModeNoChoose">全域模式加速下暫不支援切換節點,請切換至智慧模式!</string>
|
||||||
|
<string name="GetNodesAgined">取得節點中,請稍後點選加速</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -414,4 +414,5 @@
|
||||||
<string name="closeRunningChoose">請斷開連線後在進行模式切換</string>
|
<string name="closeRunningChoose">請斷開連線後在進行模式切換</string>
|
||||||
<string name="OpenSwitchingSourceModel">請開啟加速後在進行全域模式切換</string>
|
<string name="OpenSwitchingSourceModel">請開啟加速後在進行全域模式切換</string>
|
||||||
<string name="GolbalModeNoChoose">全域模式加速下暫不支援切換節點,請切換至智慧模式!</string>
|
<string name="GolbalModeNoChoose">全域模式加速下暫不支援切換節點,請切換至智慧模式!</string>
|
||||||
|
<string name="GetNodesAgined">取得節點中,請稍後點選加速</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -481,4 +481,5 @@
|
||||||
<string name="LinkSharetxt">点击分享</string>
|
<string name="LinkSharetxt">点击分享</string>
|
||||||
<string name="OpenSwitchingSourceModel">请开启加速后在进行全局模式切换</string>
|
<string name="OpenSwitchingSourceModel">请开启加速后在进行全局模式切换</string>
|
||||||
<string name="GolbalModeNoChoose">全局模式加速下暂不支持切换节点,请切换至智能模式!</string>
|
<string name="GolbalModeNoChoose">全局模式加速下暂不支持切换节点,请切换至智能模式!</string>
|
||||||
|
<string name="GetNodesAgined">获取节点中,请稍后点击加速</string>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in New Issue