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:
11111 2026-01-16 12:21:41 +08:00
commit 079aecd4aa
1 changed files with 13 additions and 4 deletions

View File

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