parent
6ae7d3c546
commit
91ec4dfb83
|
|
@ -128,7 +128,6 @@ class MainActivity : BaseActivity() {
|
||||||
var clashBinder: IClashManager? = null
|
var clashBinder: IClashManager? = null
|
||||||
private var mainBroadcastReceiver: BroadcastReceiver? = null
|
private var mainBroadcastReceiver: BroadcastReceiver? = null
|
||||||
val trafficStatisticsData = MutableLiveData<String>()
|
val trafficStatisticsData = MutableLiveData<String>()
|
||||||
var subLinkCode: Int=200
|
|
||||||
suspend fun setSub2(url: String) {
|
suspend fun setSub2(url: String) {
|
||||||
profileBinder?.let { pm ->
|
profileBinder?.let { pm ->
|
||||||
pm.queryAll().forEach { itemPro ->
|
pm.queryAll().forEach { itemPro ->
|
||||||
|
|
@ -199,7 +198,6 @@ class MainActivity : BaseActivity() {
|
||||||
mainAtyVM.startHeartBeat()
|
mainAtyVM.startHeartBeat()
|
||||||
mainAtyVM.getAirNodes()
|
mainAtyVM.getAirNodes()
|
||||||
val intentFilter = IntentFilter(Intents.ACTION_NODE_LIST)
|
val intentFilter = IntentFilter(Intents.ACTION_NODE_LIST)
|
||||||
intentFilter.addAction(Intents.ACTION_SUB_HTTP_STATUS)
|
|
||||||
mainBroadcastReceiver = NodeListBR()
|
mainBroadcastReceiver = NodeListBR()
|
||||||
if (Build.VERSION.SDK_INT >= 34 && applicationInfo.targetSdkVersion >= 34) {
|
if (Build.VERSION.SDK_INT >= 34 && applicationInfo.targetSdkVersion >= 34) {
|
||||||
registerReceiver(
|
registerReceiver(
|
||||||
|
|
@ -228,15 +226,6 @@ class MainActivity : BaseActivity() {
|
||||||
val userTraffic=serStore.userTraffic
|
val userTraffic=serStore.userTraffic
|
||||||
userTrafficMethod(userTraffic)
|
userTrafficMethod(userTraffic)
|
||||||
}
|
}
|
||||||
Intents.ACTION_SUB_HTTP_STATUS->{
|
|
||||||
val codeMsg= intent.getIntExtra("code",200)
|
|
||||||
val exceptionStr = intent.getSerializableExtra("exception")
|
|
||||||
Log.i("ACTION_SUB_HTTP_STATUS codeMsg::${codeMsg} exceptionStr::${exceptionStr}")
|
|
||||||
subLinkCode=codeMsg
|
|
||||||
if(codeMsg!=200){
|
|
||||||
RxToast.info(resources.getString(R.string.SubscriptionlinkTop))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else -> {
|
else -> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,26 +39,21 @@ import com.google.gson.JsonParser
|
||||||
import com.orhanobut.logger.Logger
|
import com.orhanobut.logger.Logger
|
||||||
import com.tencent.mmkv.MMKV
|
import com.tencent.mmkv.MMKV
|
||||||
import com.yingmao.clash.R
|
import com.yingmao.clash.R
|
||||||
import com.yingmao.clash.act.ChangeNodeActivity
|
|
||||||
import com.yingmao.clash.act.ChangeNodeActivity.ProxyMode
|
import com.yingmao.clash.act.ChangeNodeActivity.ProxyMode
|
||||||
import com.yingmao.clash.act.ExpensesRecordActivity
|
|
||||||
import com.yingmao.clash.act.MainActivity
|
import com.yingmao.clash.act.MainActivity
|
||||||
import com.yingmao.clash.act.MainActivity.Companion.clashBinder
|
import com.yingmao.clash.act.MainActivity.Companion.clashBinder
|
||||||
import com.yingmao.clash.act.MainActivity.Companion.isSubbed
|
import com.yingmao.clash.act.MainActivity.Companion.isSubbed
|
||||||
import com.yingmao.clash.act.MainActivity.Companion.newMainActGlo
|
import com.yingmao.clash.act.MainActivity.Companion.newMainActGlo
|
||||||
import com.yingmao.clash.act.MainActivity.Companion.newUuid
|
import com.yingmao.clash.act.MainActivity.Companion.newUuid
|
||||||
import com.yingmao.clash.act.MainActivity.Companion.profileBinder
|
import com.yingmao.clash.act.MainActivity.Companion.profileBinder
|
||||||
import com.yingmao.clash.act.MainActivity.Companion.subLinkCode
|
|
||||||
import com.yingmao.clash.act.MainActivity.Companion.subUrl
|
import com.yingmao.clash.act.MainActivity.Companion.subUrl
|
||||||
import com.yingmao.clash.act.NodeGroupActivity
|
import com.yingmao.clash.act.NodeGroupActivity
|
||||||
import com.yingmao.clash.conf.BZYConstants
|
import com.yingmao.clash.conf.BZYConstants
|
||||||
import com.yingmao.clash.conf.BZYConstants.Companion.ScreenFlag
|
import com.yingmao.clash.conf.BZYConstants.Companion.ScreenFlag
|
||||||
import com.yingmao.clash.conf.Conf
|
import com.yingmao.clash.conf.Conf
|
||||||
import com.yingmao.clash.entity.ClashNodebBean
|
|
||||||
import com.yingmao.clash.entity.NodeGroupItem
|
import com.yingmao.clash.entity.NodeGroupItem
|
||||||
import com.yingmao.clash.fragment.AccelerateViewModel
|
import com.yingmao.clash.fragment.AccelerateViewModel
|
||||||
import com.yingmao.clash.fragment.BaseFragment
|
import com.yingmao.clash.fragment.BaseFragment
|
||||||
import com.yingmao.clash.listener.AsyncCallBackListener
|
|
||||||
import com.yingmao.clash.net.http.HttpReqType
|
import com.yingmao.clash.net.http.HttpReqType
|
||||||
import com.yingmao.clash.net.http.HttpStatus
|
import com.yingmao.clash.net.http.HttpStatus
|
||||||
import com.yingmao.clash.net.http.entity.AppStartupStatus
|
import com.yingmao.clash.net.http.entity.AppStartupStatus
|
||||||
|
|
@ -66,7 +61,6 @@ import com.yingmao.clash.net.http.entity.ExpensesRecordRsp
|
||||||
import com.yingmao.clash.net.http.entity.ShowNode
|
import com.yingmao.clash.net.http.entity.ShowNode
|
||||||
import com.yingmao.clash.util.ActivityResultLifecycle
|
import com.yingmao.clash.util.ActivityResultLifecycle
|
||||||
import com.yingmao.clash.util.CommonUtils
|
import com.yingmao.clash.util.CommonUtils
|
||||||
import com.yingmao.clash.util.Utils
|
|
||||||
import com.yingmao.clash.util.startClashService
|
import com.yingmao.clash.util.startClashService
|
||||||
import com.yingmao.clash.util.stopClashService
|
import com.yingmao.clash.util.stopClashService
|
||||||
import com.yingmao.clash.view.RxToast
|
import com.yingmao.clash.view.RxToast
|
||||||
|
|
@ -80,11 +74,9 @@ import kotlinx.coroutines.coroutineScope
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import okhttp3.Response
|
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import java.util.concurrent.atomic.AtomicInteger
|
import java.util.concurrent.atomic.AtomicInteger
|
||||||
import kotlin.collections.get
|
|
||||||
import kotlin.coroutines.resume
|
import kotlin.coroutines.resume
|
||||||
import kotlin.coroutines.suspendCoroutine
|
import kotlin.coroutines.suspendCoroutine
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue