parent
2feb4d7ead
commit
c431c95516
|
|
@ -118,8 +118,8 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
private fun initViews() {
|
private fun initViews() {
|
||||||
aiBack = findViewById(R.id.aiBack)
|
aiBack = findViewById(R.id.aiBack)
|
||||||
tvProA = findViewById(R.id.tvProA)
|
tvProA = findViewById(R.id.smartMode)
|
||||||
tvProj = findViewById(R.id.tvProj)
|
tvProj = findViewById(R.id.globalMOde)
|
||||||
|
|
||||||
val isGlobal = MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
val isGlobal = MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
||||||
var px: ProxyMode
|
var px: ProxyMode
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ import com.yingmao.clash.base.BaseActivity
|
||||||
import com.yingmao.clash.conf.BZYConstants
|
import com.yingmao.clash.conf.BZYConstants
|
||||||
import com.yingmao.clash.conf.Conf
|
import com.yingmao.clash.conf.Conf
|
||||||
import com.yingmao.clash.entity.CheckLoginRsp
|
import com.yingmao.clash.entity.CheckLoginRsp
|
||||||
|
import com.yingmao.clash.entity.NodeGroupItem
|
||||||
import com.yingmao.clash.fragment.vip.vipFragment
|
import com.yingmao.clash.fragment.vip.vipFragment
|
||||||
import com.yingmao.clash.fragment.home.HomeFragment
|
import com.yingmao.clash.fragment.home.HomeFragment
|
||||||
import com.yingmao.clash.fragment.setting.SettingFragment
|
import com.yingmao.clash.fragment.setting.SettingFragment
|
||||||
|
|
@ -109,6 +110,8 @@ class MainActivity : BaseActivity() {
|
||||||
private var checkBindAccountDia: MaterialDialog? = null
|
private var checkBindAccountDia: MaterialDialog? = null
|
||||||
|
|
||||||
private val mPageInfo = ExpensesRecordActivity.PageInfo()
|
private val mPageInfo = ExpensesRecordActivity.PageInfo()
|
||||||
|
|
||||||
|
private var MainActCurrentNode: MutableList<NodeGroupItem> = mutableListOf()
|
||||||
companion object {
|
companion object {
|
||||||
var isVip:Boolean=false
|
var isVip:Boolean=false
|
||||||
//记录心跳失败次数
|
//记录心跳失败次数
|
||||||
|
|
@ -223,10 +226,24 @@ class MainActivity : BaseActivity() {
|
||||||
override fun onReceive(context: Context?, intent: Intent?) {
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
when (intent?.action) {
|
when (intent?.action) {
|
||||||
Intents.ACTION_NODE_LIST -> {
|
Intents.ACTION_NODE_LIST -> {
|
||||||
Log.d("ACTION_NODE_LIST ACTION_NODE_LIST")
|
Log.i("MainActivity ACTION_NODE_LIST")
|
||||||
val userTraffic=serStore.userTraffic
|
val userTraffic=serStore.userTraffic
|
||||||
Log.d("userTraffic::::${userTraffic}")
|
Log.d("userTraffic::::${userTraffic}")
|
||||||
userTrafficMethod(userTraffic)
|
userTrafficMethod(userTraffic)
|
||||||
|
val selectedName =
|
||||||
|
MMKV.defaultMMKV()
|
||||||
|
.decodeString(BZYConstants.NODE_SELECTED_NAME_KEY, "")
|
||||||
|
if(TextUtils.isEmpty(selectedName)){
|
||||||
|
val json = serStore.nodes
|
||||||
|
val nodesInfo = getNodesInfo(json)
|
||||||
|
val proxies = nodesInfo[0].proxies[0]
|
||||||
|
Log.i("MainActivity baseChoose::${proxies} true:${proxies.isNotEmpty()}")
|
||||||
|
if(proxies.isNotEmpty()){
|
||||||
|
MMKV.defaultMMKV().encode(BZYConstants.NODE_All_ITEM_NAME_KEY, json)
|
||||||
|
MMKV.defaultMMKV().encode(BZYConstants.NODE_SELECTED_NAME_KEY, proxies)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (TextUtils.isEmpty(userTraffic)) {
|
if (TextUtils.isEmpty(userTraffic)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -790,4 +807,17 @@ class MainActivity : BaseActivity() {
|
||||||
// REQUEST_CODE_PAY_WEB_VIEW_ACTIVITY
|
// REQUEST_CODE_PAY_WEB_VIEW_ACTIVITY
|
||||||
// )
|
// )
|
||||||
}
|
}
|
||||||
|
private fun getNodesInfo(json: String): MutableList<NodeGroupItem> {
|
||||||
|
val mList: MutableList<NodeGroupItem> = mutableListOf()
|
||||||
|
if (TextUtils.isEmpty(json)) {
|
||||||
|
return mList
|
||||||
|
}
|
||||||
|
val gson = Gson()
|
||||||
|
val jsonArray = JsonParser.parseString(json).asJsonArray
|
||||||
|
for (i in 0 until jsonArray.size()) {
|
||||||
|
val bean = gson.fromJson(jsonArray.get(i).asString, NodeGroupItem::class.java)
|
||||||
|
mList.add(bean)
|
||||||
|
}
|
||||||
|
return mList
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -433,14 +433,14 @@ class MemberRechargeActivity : BaseActivity() {
|
||||||
index.payChannel!!,
|
index.payChannel!!,
|
||||||
index.payParam!!,
|
index.payParam!!,
|
||||||
index.payType!!,
|
index.payType!!,
|
||||||
index.payOrder!!
|
index.payOrder!!,
|
||||||
|
index.sort
|
||||||
)
|
)
|
||||||
payList.add(rme)
|
payList.add(rme)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// payList.sortBy { item -> item.payModel }
|
//根据sort字段排序
|
||||||
//7是快捷支付排第一
|
payList.sortBy{it.sort}
|
||||||
payList.sortBy { if (it.payModel == 7) 0 else 1 }
|
|
||||||
val groupBy = payList.groupBy { item -> item.payModel }
|
val groupBy = payList.groupBy { item -> item.payModel }
|
||||||
val rcmAdapter = RechargeModelAdapter()
|
val rcmAdapter = RechargeModelAdapter()
|
||||||
rvPay.layoutManager = LinearLayoutManager(this@MemberRechargeActivity)
|
rvPay.layoutManager = LinearLayoutManager(this@MemberRechargeActivity)
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
import com.cncat.vpn.common.constants.Intents
|
import com.cncat.vpn.common.constants.Intents
|
||||||
import com.cncat.vpn.common.log.Log
|
import com.cncat.vpn.common.log.Log
|
||||||
|
import com.cncat.vpn.core.Clash
|
||||||
|
import com.cncat.vpn.core.model.TunnelState
|
||||||
import com.cncat.vpn.service.model.Profile
|
import com.cncat.vpn.service.model.Profile
|
||||||
import com.cncat.vpn.service.remote.IRemoteService
|
import com.cncat.vpn.service.remote.IRemoteService
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
|
|
@ -25,6 +27,8 @@ import com.google.gson.JsonParser
|
||||||
import com.tencent.mmkv.MMKV
|
import com.tencent.mmkv.MMKV
|
||||||
import com.yingmao.clash.BuildConfig
|
import com.yingmao.clash.BuildConfig
|
||||||
import com.yingmao.clash.R
|
import com.yingmao.clash.R
|
||||||
|
import com.yingmao.clash.act.ChangeNodeActivity.ProxyMode
|
||||||
|
import com.yingmao.clash.act.MainActivity.Companion.clashBinder
|
||||||
import com.yingmao.clash.act.MainActivity.Companion.profileBinder
|
import com.yingmao.clash.act.MainActivity.Companion.profileBinder
|
||||||
import com.yingmao.clash.act.MainActivity.Companion.setSub2
|
import com.yingmao.clash.act.MainActivity.Companion.setSub2
|
||||||
import com.yingmao.clash.act.MainActivity.Companion.subUrl
|
import com.yingmao.clash.act.MainActivity.Companion.subUrl
|
||||||
|
|
@ -33,23 +37,19 @@ import com.yingmao.clash.base.BaseActivity
|
||||||
import com.yingmao.clash.conf.BZYConstants
|
import com.yingmao.clash.conf.BZYConstants
|
||||||
import com.yingmao.clash.conf.Conf
|
import com.yingmao.clash.conf.Conf
|
||||||
import com.yingmao.clash.entity.NodeGroupItem
|
import com.yingmao.clash.entity.NodeGroupItem
|
||||||
import com.yingmao.clash.fragment.home.HomeFragment
|
|
||||||
import com.yingmao.clash.fragment.home.HomeFragment.Companion.CHECK_NODE_REQUEST_CODE
|
import com.yingmao.clash.fragment.home.HomeFragment.Companion.CHECK_NODE_REQUEST_CODE
|
||||||
|
import com.yingmao.clash.fragment.home.HomeFragment.Companion.clashRunning
|
||||||
|
import com.yingmao.clash.fragment.home.HomeFragment.Companion.isGlo
|
||||||
import com.yingmao.clash.remote.Resource
|
import com.yingmao.clash.remote.Resource
|
||||||
import com.yingmao.clash.view.RxToast
|
import com.yingmao.clash.view.RxToast
|
||||||
import com.yingmao.clash.view.adapter.NodeGroupAdapter
|
import com.yingmao.clash.view.adapter.NodeGroupAdapter
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.GlobalScope
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
|
import kotlinx.coroutines.coroutineScope
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
import kotlin.collections.forEach
|
|
||||||
import kotlin.collections.withIndex
|
|
||||||
import kotlin.jvm.java
|
|
||||||
import kotlin.let
|
|
||||||
import kotlin.ranges.until
|
|
||||||
import kotlin.text.isNotEmpty
|
|
||||||
import kotlin.text.replace
|
|
||||||
|
|
||||||
class NodeGroupActivity : BaseActivity(){
|
class NodeGroupActivity : BaseActivity(){
|
||||||
private var currentNode: MutableList<NodeGroupItem> = mutableListOf()
|
private var currentNode: MutableList<NodeGroupItem> = mutableListOf()
|
||||||
|
|
@ -58,6 +58,8 @@ class NodeGroupActivity : BaseActivity(){
|
||||||
private lateinit var nodeListRv: RecyclerView
|
private lateinit var nodeListRv: RecyclerView
|
||||||
private lateinit var aiBack: AppCompatImageView
|
private lateinit var aiBack: AppCompatImageView
|
||||||
private var broadcastReceiver: BroadcastReceiver? = null
|
private var broadcastReceiver: BroadcastReceiver? = null
|
||||||
|
private lateinit var smartMode:TextView
|
||||||
|
private lateinit var globalMOde:TextView
|
||||||
private var cacheNodeStr: String? = ""
|
private var cacheNodeStr: String? = ""
|
||||||
private lateinit var userTrafficTv: TextView
|
private lateinit var userTrafficTv: TextView
|
||||||
private var uuid: UUID? = null
|
private var uuid: UUID? = null
|
||||||
|
|
@ -68,7 +70,6 @@ class NodeGroupActivity : BaseActivity(){
|
||||||
var getNodeTimeOutNum = 5
|
var getNodeTimeOutNum = 5
|
||||||
var isRunning = false
|
var isRunning = false
|
||||||
var nowSubUrl: String = ""
|
var nowSubUrl: String = ""
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_change_node)
|
setContentView(R.layout.activity_change_node)
|
||||||
|
|
@ -112,6 +113,38 @@ class NodeGroupActivity : BaseActivity(){
|
||||||
swipeLayout = findViewById(R.id.swipeLayout)
|
swipeLayout = findViewById(R.id.swipeLayout)
|
||||||
nodeListRv = findViewById(R.id.rv_node_list)
|
nodeListRv = findViewById(R.id.rv_node_list)
|
||||||
userTrafficTv= findViewById(R.id.node_user_traffic)
|
userTrafficTv= findViewById(R.id.node_user_traffic)
|
||||||
|
smartMode=findViewById(R.id.smartMode)
|
||||||
|
globalMOde=findViewById(R.id.globalMOde)
|
||||||
|
val isGlobal = MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
||||||
|
var px: ProxyMode
|
||||||
|
if (isGlobal) {
|
||||||
|
px = ProxyMode.GLOBAL
|
||||||
|
} else {
|
||||||
|
px = ProxyMode.PAC
|
||||||
|
}
|
||||||
|
setBackground(px)
|
||||||
|
smartMode.setOnClickListener {
|
||||||
|
val getIsGlo= MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
||||||
|
Log.d("clIntelligentMode ==>${getIsGlo}")
|
||||||
|
if(getIsGlo){
|
||||||
|
setBackground(ProxyMode.PAC)
|
||||||
|
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
globalMOde.setOnClickListener {
|
||||||
|
if (!clashRunning) {
|
||||||
|
RxToast.info(resources.getString(R.string.OpenSwitchingSourceModel))
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
|
|
||||||
|
val getIsGlo= MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
||||||
|
Log.d("clGlobalModel ==>${getIsGlo}")
|
||||||
|
if (!getIsGlo) {
|
||||||
|
setBackground(ProxyMode.GLOBAL)
|
||||||
|
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_GLOBAL_MODEL, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
aiBack.setOnClickListener {
|
aiBack.setOnClickListener {
|
||||||
onBackPressed()
|
onBackPressed()
|
||||||
}
|
}
|
||||||
|
|
@ -389,7 +422,156 @@ class NodeGroupActivity : BaseActivity(){
|
||||||
currentHost?.let { changeSubUrl(oldUrl, it) }
|
currentHost?.let { changeSubUrl(oldUrl, it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setBackground(proxyMode: ProxyMode) {
|
||||||
|
|
||||||
|
when (proxyMode) {
|
||||||
|
ProxyMode.PAC -> {
|
||||||
|
|
||||||
|
isGlo = false
|
||||||
|
smartMode.setBackgroundResource(R.drawable.yil_node_proxy_choose_bg)
|
||||||
|
globalMOde.setBackgroundResource(0)
|
||||||
|
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
||||||
|
sendMode(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
ProxyMode.GLOBAL -> {
|
||||||
|
isGlo = true
|
||||||
|
smartMode.setBackgroundResource(0)
|
||||||
|
globalMOde.setBackgroundResource(R.drawable.yil_node_proxy_choose_bg)
|
||||||
|
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_GLOBAL_MODEL, true)
|
||||||
|
sendMode(true)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fun sendMode(type: Boolean) {
|
||||||
|
val intent = Intent(Intents.ACTION_Glo_Mode)
|
||||||
|
intent.putExtra("mode", type)
|
||||||
|
sendBroadcast(
|
||||||
|
intent.setPackage(this.packageName)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkGlo() {
|
||||||
|
val isGlobal = isGlo
|
||||||
|
val isGlobal2 = MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
||||||
|
Log.i("checkGlo isGlobal==>${isGlobal}, isGlobal2==>${isGlobal2}")
|
||||||
|
val px: ProxyMode = if (isGlobal2) {
|
||||||
|
ProxyMode.GLOBAL
|
||||||
|
} else {
|
||||||
|
ProxyMode.PAC
|
||||||
|
}
|
||||||
|
setBackground(px)
|
||||||
|
|
||||||
|
launch(Dispatchers.IO) {
|
||||||
|
if (isGlobal) {
|
||||||
|
if (clashRunning) {
|
||||||
|
getNodes()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (clashRunning) {
|
||||||
|
delay(1000)
|
||||||
|
clashBinder?.let { cm ->
|
||||||
|
val names = cm.queryProxyGroupNames(false)
|
||||||
|
Log.i("checkGlo names==>${names}")
|
||||||
|
if (names.isNotEmpty()) {
|
||||||
|
val selectedName =
|
||||||
|
MMKV.defaultMMKV()
|
||||||
|
.decodeString(BZYConstants.NODE_SELECTED_NAME_KEY, "");
|
||||||
|
Log.i("selected_name ==>${selectedName}")
|
||||||
|
if (!TextUtils.isEmpty(selectedName)) {
|
||||||
|
val o = cm.queryOverride(Clash.OverrideSlot.Session)
|
||||||
|
o.mode = TunnelState.Mode.Rule
|
||||||
|
cm.patchOverride(Clash.OverrideSlot.Session, o)
|
||||||
|
delay(500)
|
||||||
|
var gName = names[0]
|
||||||
|
//全局模式下 names[0]会自动添加一个 "GLOBAL" 组
|
||||||
|
if (names.size >= 2) {
|
||||||
|
if ("GLOBAL" == gName) {
|
||||||
|
//names[0] 为 "GLOBAL" //names[1]才是规则模式下的组名,所以需要手动赋值
|
||||||
|
gName = names[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cm.patchSelector(gName, selectedName!!)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private suspend fun getNodes() {
|
||||||
|
coroutineScope {
|
||||||
|
val selectedName =
|
||||||
|
MMKV.defaultMMKV().decodeString(BZYConstants.NODE_SELECTED_NAME_KEY, "")
|
||||||
|
Log.d("getNodes selected_name==>${selectedName}")
|
||||||
|
if (TextUtils.isEmpty(selectedName)) {
|
||||||
|
subUrl?.let {
|
||||||
|
val json = serStore.nodes
|
||||||
|
Log.d("getNodes json==>${json}")
|
||||||
|
currentNode=getNodesInfo(json)
|
||||||
|
Log.d("getNodes currentNode==>${currentNode} dataname:${currentNode[0].proxies[0]}")
|
||||||
|
val baseNodeName=currentNode[0].proxies[0]
|
||||||
|
|
||||||
|
if (!TextUtils.isEmpty(baseNodeName)) {
|
||||||
|
GlobalScope.launch(Dispatchers.IO) {
|
||||||
|
clashBinder?.let { cm ->
|
||||||
|
|
||||||
|
val o = cm.queryOverride(Clash.OverrideSlot.Session)
|
||||||
|
o.mode = TunnelState.Mode.Global
|
||||||
|
cm.patchOverride(Clash.OverrideSlot.Session, o)
|
||||||
|
delay(3000)
|
||||||
|
//等待全局模式生效
|
||||||
|
var maxIndex = 0
|
||||||
|
while (true) {
|
||||||
|
if (maxIndex > 3) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
val names = cm.queryProxyGroupNames(false)
|
||||||
|
if (names.isNotEmpty()) {
|
||||||
|
if (names[0] == "GLOBAL") {
|
||||||
|
Log.d("repeat end")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.d("repeat agent")
|
||||||
|
maxIndex++
|
||||||
|
delay(1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.patchSelector("GLOBAL", baseNodeName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
clashBinder?.let { cm ->
|
||||||
|
val o = cm.queryOverride(Clash.OverrideSlot.Session)
|
||||||
|
o.mode = TunnelState.Mode.Global
|
||||||
|
cm.patchOverride(Clash.OverrideSlot.Session, o)
|
||||||
|
delay(3000)
|
||||||
|
//等待全局
|
||||||
|
var maxIndex = 0
|
||||||
|
while (true) {
|
||||||
|
if (maxIndex > 3) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
val names = cm.queryProxyGroupNames(false)
|
||||||
|
if (names.isNotEmpty()) {
|
||||||
|
if (names[0] == "GLOBAL") {
|
||||||
|
Log.d("repeat end")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.d("repeat agent")
|
||||||
|
maxIndex++
|
||||||
|
delay(1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.patchSelector("GLOBAL", selectedName!!)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,6 @@ data class RechargeModelEntity(
|
||||||
val payChannel: String,//支付渠道名称
|
val payChannel: String,//支付渠道名称
|
||||||
val payParam:String,//支付参数
|
val payParam:String,//支付参数
|
||||||
var payType:Int,//支付类型
|
var payType:Int,//支付类型
|
||||||
var payOrder:Int//支付编号
|
var payOrder:Int,//支付编号
|
||||||
|
var sort: Int//排序字段
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,11 @@ open class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispa
|
||||||
RxToast.info(resources.getString(R.string.AccountExpired))
|
RxToast.info(resources.getString(R.string.AccountExpired))
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
|
val getIsGlo= MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
||||||
|
if(getIsGlo){
|
||||||
|
RxToast.info(resources.getString(R.string.GolbalModeNoChoose))
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
val intent = Intent(CommonUtils.getApp(), NodeGroupActivity::class.java)
|
val intent = Intent(CommonUtils.getApp(), NodeGroupActivity::class.java)
|
||||||
if (!TextUtils.isEmpty(newUuid)) {
|
if (!TextUtils.isEmpty(newUuid)) {
|
||||||
intent.putExtra(BZYConstants.MMKV_KEY_CURRENT_NODE, newUuid)
|
intent.putExtra(BZYConstants.MMKV_KEY_CURRENT_NODE, newUuid)
|
||||||
|
|
@ -256,7 +261,7 @@ open class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispa
|
||||||
}
|
}
|
||||||
tvGlobalMode.setOnClickListener {
|
tvGlobalMode.setOnClickListener {
|
||||||
if (!clashRunning) {
|
if (!clashRunning) {
|
||||||
RxToast.info(resources.getString(R.string.SwitchingSourceModel))
|
RxToast.info(resources.getString(R.string.OpenSwitchingSourceModel))
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -562,7 +567,7 @@ open class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispa
|
||||||
|
|
||||||
@Deprecated("Deprecated in Java")
|
@Deprecated("Deprecated in Java")
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
if (requestCode == 2) {
|
if (requestCode == CHECK_NODE_REQUEST_CODE) {
|
||||||
nodeChooseBase(data)
|
nodeChooseBase(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -668,7 +673,6 @@ open class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispa
|
||||||
launch(Dispatchers.IO) {
|
launch(Dispatchers.IO) {
|
||||||
if (isGlobal) {
|
if (isGlobal) {
|
||||||
if (clashRunning) {
|
if (clashRunning) {
|
||||||
Log.i("AAAAAAAAAAAAAA innner to==>")
|
|
||||||
getNodes()
|
getNodes()
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -694,7 +698,6 @@ open class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cm.patchSelector(gName, selectedName!!)
|
cm.patchSelector(gName, selectedName!!)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -905,7 +908,6 @@ open class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispa
|
||||||
tvIntelligentMode.setTextColor("#FF006AFB".toColorInt())
|
tvIntelligentMode.setTextColor("#FF006AFB".toColorInt())
|
||||||
tvGlobalMode.setTextColor("#FF000000".toColorInt())
|
tvGlobalMode.setTextColor("#FF000000".toColorInt())
|
||||||
sendMode(false)
|
sendMode(false)
|
||||||
checkGlo()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyMode.GLOBAL -> {
|
ProxyMode.GLOBAL -> {
|
||||||
|
|
@ -916,7 +918,6 @@ open class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispa
|
||||||
tvIntelligentMode.setTextColor("#FF000000".toColorInt())
|
tvIntelligentMode.setTextColor("#FF000000".toColorInt())
|
||||||
tvGlobalMode.setTextColor("#FF006AFB".toColorInt())
|
tvGlobalMode.setTextColor("#FF006AFB".toColorInt())
|
||||||
sendMode(true)
|
sendMode(true)
|
||||||
checkGlo()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -469,14 +469,13 @@ class vipFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatchers
|
||||||
index.payChannel!!,
|
index.payChannel!!,
|
||||||
index.payParam!!,
|
index.payParam!!,
|
||||||
index.payType!!,
|
index.payType!!,
|
||||||
index.payOrder!!
|
index.payOrder!!,
|
||||||
|
index.sort
|
||||||
)
|
)
|
||||||
payList.add(rme)
|
payList.add(rme)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// payList.sortBy { item -> item.payModel }
|
payList.sortBy { it.sort }
|
||||||
//7是快捷支付排第一
|
|
||||||
payList.sortBy { if (it.payModel == 7) 0 else 1 }
|
|
||||||
val groupBy = payList.groupBy { item -> item.payModel }
|
val groupBy = payList.groupBy { item -> item.payModel }
|
||||||
val rcmAdapter = RechargeModelAdapter()
|
val rcmAdapter = RechargeModelAdapter()
|
||||||
rvPay.layoutManager = LinearLayoutManager(requireContext())
|
rvPay.layoutManager = LinearLayoutManager(requireContext())
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,8 @@ data class PayType(
|
||||||
var payParam: String? = null,
|
var payParam: String? = null,
|
||||||
@field:SerializedName("payOrder")
|
@field:SerializedName("payOrder")
|
||||||
var payOrder: Int? = null,
|
var payOrder: Int? = null,
|
||||||
|
@field:SerializedName("sort")
|
||||||
|
var sort: Int = 0,
|
||||||
)
|
)
|
||||||
//汇旺财
|
//汇旺财
|
||||||
data class QRPayRsp(@field:SerializedName("msg")
|
data class QRPayRsp(@field:SerializedName("msg")
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,12 @@ class NodeGroupAdapter : RecyclerView.Adapter<NodeGroupAdapter.NodeGroupAdapterV
|
||||||
listener?.onItemClick(nodeGroupList[position],position)
|
listener?.onItemClick(nodeGroupList[position],position)
|
||||||
}
|
}
|
||||||
holder.nodeName.text = nodeGroupList[position]
|
holder.nodeName.text = nodeGroupList[position]
|
||||||
holder.chekImg.isSelected = holder.layoutPosition == selectedPosition
|
if (holder.layoutPosition == selectedPosition) {
|
||||||
|
holder.chekImg.setImageResource(R.drawable.check_img_select)
|
||||||
|
} else {
|
||||||
|
holder.chekImg.setImageResource(R.drawable.check_img)
|
||||||
|
}
|
||||||
|
|
||||||
val nodeGroupName = nodeGroupList[position]
|
val nodeGroupName = nodeGroupList[position]
|
||||||
|
|
||||||
if(nodeGroupName.contains("中国")){
|
if(nodeGroupName.contains("中国")){
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
android:background="@drawable/yil_node_proxy_bg"
|
android:background="@drawable/yil_node_proxy_bg"
|
||||||
>
|
>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvProA"
|
android:id="@+id/smartMode"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/yil_node_proxy_choose_bg"
|
android:background="@drawable/yil_node_proxy_choose_bg"
|
||||||
|
|
@ -82,7 +82,7 @@
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvProj"
|
android:id="@+id/globalMOde"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
|
|
||||||
|
|
@ -422,4 +422,8 @@ In order to implement and strengthen awareness of personal information security
|
||||||
<string name="MembershipValidityPeriod">Membership Validity Period:</string>
|
<string name="MembershipValidityPeriod">Membership Validity Period:</string>
|
||||||
<string name="Gift">Gift</string>
|
<string name="Gift">Gift</string>
|
||||||
<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="GolbalModeNoChoose">Switching nodes is not currently supported in global mode. Please switch to smart mode!</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -414,4 +414,6 @@
|
||||||
<string name="MembershipValidityPeriod">會員有效期限:</string>
|
<string name="MembershipValidityPeriod">會員有效期限:</string>
|
||||||
<string name="Gift">禮品</string>
|
<string name="Gift">禮品</string>
|
||||||
<string name="closeRunningChoose">請斷開連線後在進行模式切換</string>
|
<string name="closeRunningChoose">請斷開連線後在進行模式切換</string>
|
||||||
|
<string name="OpenSwitchingSourceModel">請開啟加速後在進行全域模式切換</string>
|
||||||
|
<string name="GolbalModeNoChoose">全域模式下暫不支援切換節點,請切換至智慧型模式!</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -412,4 +412,6 @@
|
||||||
<string name="MembershipValidityPeriod">會員有效期限:</string>
|
<string name="MembershipValidityPeriod">會員有效期限:</string>
|
||||||
<string name="Gift">禮品</string>
|
<string name="Gift">禮品</string>
|
||||||
<string name="closeRunningChoose">請斷開連線後在進行模式切換</string>
|
<string name="closeRunningChoose">請斷開連線後在進行模式切換</string>
|
||||||
|
<string name="OpenSwitchingSourceModel">請開啟加速後在進行全域模式切換</string>
|
||||||
|
<string name="GolbalModeNoChoose">全域模式下暫不支援切換節點,請切換至智慧型模式!</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -480,4 +480,5 @@
|
||||||
您可以获得30天会员(仅限新用户订购有效)</string>
|
您可以获得30天会员(仅限新用户订购有效)</string>
|
||||||
<string name="LinkSharetxt">点击分享</string>
|
<string name="LinkSharetxt">点击分享</string>
|
||||||
<string name="OpenSwitchingSourceModel">请开启加速后在进行全局模式切换</string>
|
<string name="OpenSwitchingSourceModel">请开启加速后在进行全局模式切换</string>
|
||||||
|
<string name="GolbalModeNoChoose">全局模式下暂不支持切换节点,请切换至智能模式!</string>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in New Issue