Merge remote-tracking branch 'origin/yijianlian_NewUI' into yijianlian_NewUI
# Conflicts: # app/src/main/java/com/yingmao/clash/act/SplashActivity.kt
This commit is contained in:
commit
079aecd4aa
|
|
@ -31,9 +31,6 @@ import com.cncat.vpn.service.remote.IClashManager
|
|||
import com.cncat.vpn.service.remote.wrap
|
||||
import com.github.gzuliyujiang.oaid.DeviceID
|
||||
import com.github.gzuliyujiang.oaid.DeviceIdentifier
|
||||
import com.google.firebase.Firebase
|
||||
import com.google.firebase.analytics.analytics
|
||||
import com.google.firebase.analytics.logEvent
|
||||
import com.google.gson.JsonObject
|
||||
import com.tencent.mmkv.MMKV
|
||||
import com.yingmao.clash.BuildConfig
|
||||
|
|
@ -199,7 +196,7 @@ class SplashActivity : BaseActivity() {
|
|||
}
|
||||
// //对源地址加密操作
|
||||
// val byteArrayToHexStr =
|
||||
// AESUtil.byteArrayToHexStr(AESUtil.encrypt("https://api2.yijianlianjsq.com+https://api2.onetouchjsq.com"))
|
||||
// AESUtil.byteArrayToHexStr(AESUtil.encrypt("https://api.yijianlianjsq.com+https://api.onetouchjsq.com+https://yjlapi.anxuan009.com"))
|
||||
// android.util.Log.i("AAAAAAAAAAA","data:::"+byteArrayToHexStr)
|
||||
}
|
||||
|
||||
|
|
@ -392,6 +389,7 @@ class SplashActivity : BaseActivity() {
|
|||
HttpReqType.REGISTER -> {
|
||||
dialogDoMainChoose?.dismiss()
|
||||
with(httpStatus.rsp as RegisterRsp) {
|
||||
AppLog.i("SplashActivity", "注册请求接口code:${code}")
|
||||
if (code == "10000" || code == "200") {
|
||||
if (data != null) {
|
||||
if (!data.phoneNumber.isNullOrEmpty()) {
|
||||
|
|
@ -418,6 +416,7 @@ class SplashActivity : BaseActivity() {
|
|||
if (decodeBool) {
|
||||
MMKV.defaultMMKV().encode(BZYConstants.INITIALIZATION, true)
|
||||
}
|
||||
AppLog.i("SplashActivity", "注册接口调用登录前: phoneNumber${data?.phoneNumber} defaultPassword${BZYConstants.defaultPassword}")
|
||||
splashAtyVM.login(encryName, encryPsw)
|
||||
} else if (code == "20062") {
|
||||
message?.let {
|
||||
|
|
@ -433,16 +432,19 @@ class SplashActivity : BaseActivity() {
|
|||
} else {
|
||||
MMKV.defaultMMKV().encode(MMKV_KEY_REMEMBER_USERNAME, username)
|
||||
}
|
||||
AppLog.i("SplashActivity", "注册接口调用返回20062: message${message}")
|
||||
val intent = Intent(this@SplashActivity, LoginActivity::class.java)
|
||||
startActivity(intent)
|
||||
finish()
|
||||
} else if (code == "403") {
|
||||
AppLog.i("SplashActivity", "注册接口调用返回403: message${message}")
|
||||
pbWeb.visibility = View.INVISIBLE
|
||||
message?.let {
|
||||
RxToast.error(it)
|
||||
}
|
||||
webView?.setOnTouchListener { _, _ -> false }
|
||||
} else {
|
||||
AppLog.i("SplashActivity", "注册接口调用返回未知数据: code:${code}")
|
||||
MaterialDialog(this@SplashActivity).show {
|
||||
message(text = initErrMsg)
|
||||
positiveButton(R.string.retry) {
|
||||
|
|
@ -460,6 +462,7 @@ class SplashActivity : BaseActivity() {
|
|||
HttpReqType.LOGIN -> {
|
||||
val rsp = httpStatus.rsp
|
||||
if (rsp is LoginRsp) {
|
||||
AppLog.i("SplashActivity", "HttpReqType.LOGIN rsp.code ${rsp.code }")
|
||||
if (rsp.code == "1000") {
|
||||
val mmkv = MMKV.defaultMMKV()
|
||||
com.cncat.vpn.common.log.Log.i(" HttpReqType.LOGIN token ==> ${rsp.data.vpnToken}")
|
||||
|
|
@ -491,6 +494,8 @@ class SplashActivity : BaseActivity() {
|
|||
HttpReqType.CHECK_LOGIN -> {
|
||||
dialogDoMainChoose?.dismiss()
|
||||
(httpStatus.rsp as CheckLoginRsp).let { checkLoginRsp ->
|
||||
|
||||
AppLog.i("SplashActivity", "HttpReqType.CHECK_LOGIN checkLoginRsp ${checkLoginRsp.code }")
|
||||
if (checkLoginRsp.code == 0) {
|
||||
com.cncat.vpn.common.log.Log.d("splash CHECK_LOGIN==>")
|
||||
checkLoginRsp.data?.let { MainApplication.setUserInfo(it) }
|
||||
|
|
@ -515,6 +520,7 @@ class SplashActivity : BaseActivity() {
|
|||
}
|
||||
HttpReqType.App_VERION_CHECK -> {
|
||||
(httpStatus.rsp as AppVersionCheckRsp).let { avcr ->
|
||||
AppLog.i("SplashActivity", " HttpReqType.App_VERION_CHECK avcr ${avcr}")
|
||||
com.cncat.vpn.common.log.Log.i("App_VERION_CHECK ==>$avcr")
|
||||
if (avcr.code == 200) {
|
||||
avcr.data?.let { md ->
|
||||
|
|
@ -552,6 +558,7 @@ class SplashActivity : BaseActivity() {
|
|||
rlPb.visibility = View.GONE
|
||||
pbWeb.visibility = View.INVISIBLE
|
||||
com.cncat.vpn.common.log.Log.d("httpFailure HttpReqType.REGISTER")
|
||||
AppLog.i("SplashActivity", "httpFailure HttpReqType.REGISTER ${httpStatus.msg}")
|
||||
if (super.switchServer2()) {//切换服务器并直接重试
|
||||
doRegisterByEncryption()
|
||||
} else {
|
||||
|
|
@ -569,6 +576,7 @@ class SplashActivity : BaseActivity() {
|
|||
}
|
||||
|
||||
HttpReqType.LOGIN -> {
|
||||
AppLog.i("SplashActivity", "httpFailure HttpReqType.LOGIN ${httpStatus.msg}")
|
||||
MaterialDialog(this@SplashActivity).show {
|
||||
message(text = initErrMsg)
|
||||
positiveButton(R.string.confirm) {
|
||||
|
|
@ -589,6 +597,7 @@ class SplashActivity : BaseActivity() {
|
|||
|
||||
HttpReqType.CHECK_LOGIN -> {
|
||||
com.cncat.vpn.common.log.Log.d("httpFailure HttpReqType.CHECK_LOGIN")
|
||||
AppLog.i("SplashActivity", "httpFailure HttpReqType.CHECK_LOGIN ${httpStatus.msg}")
|
||||
RxToast.error("检测到网络异常,请尝试切换其他地址.")
|
||||
if (super.switchServer2()) {
|
||||
splashAtyVM.checkLogin()
|
||||
|
|
|
|||
Loading…
Reference in New Issue