添加太子182269注册链接

This commit is contained in:
cyh 2025-05-25 13:40:18 +08:00
parent 59fa21ed14
commit c93b1a065e
9 changed files with 46 additions and 40 deletions

View File

@ -600,7 +600,7 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
var mmkvHost = MMKV.defaultMMKV() var mmkvHost = MMKV.defaultMMKV()
.decodeString(BZYConstants.MMKV_KEY_REGISTER_HOST, "") .decodeString(BZYConstants.MMKV_KEY_REGISTER_HOST, "")
// com.cncat.vpn.common.log.Log.d("mmkvHost==>${mmkvHost}") // com.cncat.vpn.common.log.Log.d("mmkvHost==>${mmkvHost}")
loginViewMode.getTzRegisterHost(object : AsyncBodyCallback { loginViewMode.getTzRegisterHost(BuildConfig.productId,object : AsyncBodyCallback {
override suspend fun suc(str: String) { override suspend fun suc(str: String) {
// com.cncat.vpn.common.log.Log.d("str==>${str}") // com.cncat.vpn.common.log.Log.d("str==>${str}")
if (str != mmkvHost) { if (str != mmkvHost) {

View File

@ -834,7 +834,7 @@ class NewMainActivity : BaseActivity() {
drawer.openDrawer(GravityCompat.START) drawer.openDrawer(GravityCompat.START)
} }
} }
if (BuildConfig.is_tz && BuildConfig.productId == "182268") { if (BuildConfig.is_tz && BuildConfig.productId == "182269") {
telegramBtn.visibility = View.INVISIBLE telegramBtn.visibility = View.INVISIBLE
fds_view.visibility = View.INVISIBLE fds_view.visibility = View.INVISIBLE
} }

View File

@ -130,8 +130,7 @@ class SplashActivity : BaseActivity() {
} }
} }
initWebView() initWebView()
if (BuildConfig.productId == "182268") { if (BuildConfig.productId == "182269") {
initAgreementPrivacy() initAgreementPrivacy()
} else { } else {
//隐私政策先授权后获取权限 //隐私政策先授权后获取权限
@ -233,9 +232,9 @@ class SplashActivity : BaseActivity() {
var ss2 = cb.getSS2(si) var ss2 = cb.getSS2(si)
registerKey = cb.getRegisterKey(si) registerKey = cb.getRegisterKey(si)
registerIV2 = cb.getRegisterKiv(si) registerIV2 = cb.getRegisterKiv(si)
// com.cncat.vpn.common.log.Log.d("si==>${si}, ss1==>${ss1}, ss2==>${ss2}") com.cncat.vpn.common.log.Log.d("si==>${si}, ss1==>${ss1}, ss2==>${ss2}")
AESUtil.KEY2 = ss1 MainApplication.KEY2 = ss1
AESUtil.IV2 = ss2 MainApplication.IV2 = ss2
// 太子 // 太子
// com.cncat.vpn.common.log.Log.d("tz encrypt:"+ AESUtil.byteArrayToHexStr(AESUtil.encrypt(""))) // com.cncat.vpn.common.log.Log.d("tz encrypt:"+ AESUtil.byteArrayToHexStr(AESUtil.encrypt("")))
// 八爪鱼 com.cncat.vpn.common.log.Log.d("bzy encrypt:"+ AESUtil.byteArrayToHexStr(AESUtil.encrypt(""))) // 八爪鱼 com.cncat.vpn.common.log.Log.d("bzy encrypt:"+ AESUtil.byteArrayToHexStr(AESUtil.encrypt("")))
@ -280,14 +279,14 @@ class SplashActivity : BaseActivity() {
// OpenInstall.getWakeUp(intent, wakeUpAdapter) // OpenInstall.getWakeUp(intent, wakeUpAdapter)
} }
private lateinit var webView: WebView private var webView: WebView? = null
private lateinit var pb_web: ProgressBar private lateinit var pb_web: ProgressBar
var dialogAgreementPrivacyChoose: DialogAgreementPrivacyChoose? = null var dialogAgreementPrivacyChoose: DialogAgreementPrivacyChoose? = null
private fun initAgreementPrivacy() { private fun initAgreementPrivacy() {
if (BuildConfig.is_tz && BuildConfig.productId == "182268") { if (BuildConfig.is_tz && BuildConfig.productId == "182269") {
if (MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_IS_REGISTER, false)) { if (MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_IS_REGISTER, false)) {
rlPb.visibility = View.VISIBLE rlPb.visibility = View.VISIBLE
webView.visibility = View.GONE webView?.visibility = View.GONE
initApplication(false) initApplication(false)
} else { } else {
setWebView() setWebView()
@ -357,7 +356,7 @@ class SplashActivity : BaseActivity() {
@SuppressLint("JavascriptInterface") @SuppressLint("JavascriptInterface")
private fun setWebView() { private fun setWebView() {
rlPb.visibility = View.INVISIBLE rlPb.visibility = View.INVISIBLE
webView.visibility = View.VISIBLE webView?.visibility = View.VISIBLE
lifecycleScope.launch(Dispatchers.Main) { lifecycleScope.launch(Dispatchers.Main) {
delay(3000) // 延迟3秒 delay(3000) // 延迟3秒
com.cncat.vpn.common.log.Log.d("setWebView delay") com.cncat.vpn.common.log.Log.d("setWebView delay")
@ -365,30 +364,30 @@ class SplashActivity : BaseActivity() {
but_register?.visibility = View.VISIBLE but_register?.visibility = View.VISIBLE
} }
// WebView设置 // WebView设置
val webSettings = webView.settings val webSettings = webView?.settings
// 可选设置开启Chrome调试 // 可选设置开启Chrome调试
WebView.setWebContentsDebuggingEnabled(true) WebView.setWebContentsDebuggingEnabled(true)
// 设置屏幕自适应 // 设置屏幕自适应
webSettings.useWideViewPort = true webSettings?.useWideViewPort = true
webSettings.loadWithOverviewMode = true webSettings?.loadWithOverviewMode = true
// 建议禁止缓存加载以确保在攻击发生时可快速获取最新的阿里云验证码2.0进行对抗 // 建议禁止缓存加载以确保在攻击发生时可快速获取最新的阿里云验证码2.0进行对抗
webSettings.cacheMode = WebSettings.LOAD_NO_CACHE webSettings?.cacheMode = WebSettings.LOAD_NO_CACHE
// 设置WebView组件支持加载JavaScript // 设置WebView组件支持加载JavaScript
webSettings.javaScriptEnabled = true webSettings?.javaScriptEnabled = true
webSettings.domStorageEnabled = true webSettings?.domStorageEnabled = true
// 设置不使用默认浏览器而直接使用WebView组件加载页面 // 设置不使用默认浏览器而直接使用WebView组件加载页面
webView.webViewClient = object : WebViewClient() { webView?.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean { override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
view.loadUrl(url) view.loadUrl(url)
return true return true
} }
} }
webView.addJavascriptInterface(CaptchaJsInterface(), "CaptchaJsInterface") webView?.addJavascriptInterface(CaptchaJsInterface(), "CaptchaJsInterface")
// testWebview.addJavascriptInterface(new testJsInterface(), "testInterface"); // testWebview.addJavascriptInterface(new testJsInterface(), "testInterface");
// 加载业务页面 // 加载业务页面
webView.loadUrl("file:///android_asset/captcha.html") webView?.loadUrl("file:///android_asset/captcha.html")
// webView.loadUrl("https://api.yingmaovpnpro.win:18002/78zccgy0nsgknh9n4/captcha.html") // webView.loadUrl("https://api.yingmaovpnpro.win:18002/78zccgy0nsgknh9n4/captcha.html")
} }
@ -400,7 +399,7 @@ class SplashActivity : BaseActivity() {
captchaInfo = verifyResult captchaInfo = verifyResult
launch { launch {
webView.setOnTouchListener { _, _ -> true } webView?.setOnTouchListener { _, _ -> true }
pb_web.visibility = View.VISIBLE pb_web.visibility = View.VISIBLE
} }
doRegisterByEncryption() doRegisterByEncryption()
@ -418,7 +417,7 @@ class SplashActivity : BaseActivity() {
private fun setLocalLanguage() { private fun setLocalLanguage() {
var defLan = "" var defLan = ""
if (BuildConfig.is_tz && BuildConfig.productId != "182268") { if (BuildConfig.is_tz && BuildConfig.productId != "182269") {
defLan = "Chinese-HK" defLan = "Chinese-HK"
} }
val decodeString = MMKV.defaultMMKV().decodeString(BZYConstants.languageInfo, defLan) val decodeString = MMKV.defaultMMKV().decodeString(BZYConstants.languageInfo, defLan)
@ -757,7 +756,7 @@ class SplashActivity : BaseActivity() {
message?.let { message?.let {
RxToast.error(it) RxToast.error(it)
} }
webView.setOnTouchListener { _, _ -> false } webView?.setOnTouchListener { _, _ -> false }
} else { } else {
MaterialDialog(this@SplashActivity).show { MaterialDialog(this@SplashActivity).show {
message(text = initErrMsg) message(text = initErrMsg)
@ -1291,7 +1290,7 @@ class SplashActivity : BaseActivity() {
var mmkvHost = MMKV.defaultMMKV() var mmkvHost = MMKV.defaultMMKV()
.decodeString(BZYConstants.MMKV_KEY_REGISTER_HOST, "") .decodeString(BZYConstants.MMKV_KEY_REGISTER_HOST, "")
// com.cncat.vpn.common.log.Log.d("mmkvHost==>${mmkvHost}") // com.cncat.vpn.common.log.Log.d("mmkvHost==>${mmkvHost}")
splashAtyVM.getTzRegisterHost(object : AsyncBodyCallback { splashAtyVM.getTzRegisterHost(BuildConfig.productId,object : AsyncBodyCallback {
override suspend fun suc(str: String) { override suspend fun suc(str: String) {
// com.cncat.vpn.common.log.Log.d("str==>${str}") // com.cncat.vpn.common.log.Log.d("str==>${str}")
if (str != mmkvHost) { if (str != mmkvHost) {

View File

@ -54,7 +54,8 @@ class MainApplication : Application() {
private const val RESULT_CHANNEL = "profile_result_channel" private const val RESULT_CHANNEL = "profile_result_channel"
public var OAID = "" public var OAID = ""
public var KEY2 = ""
public var IV2 = ""
fun getUserInfo(): UserData? { fun getUserInfo(): UserData? {
return userBean return userBean
} }

View File

@ -261,12 +261,17 @@ open class PublicViewMode : BaseViewMode() {
} }
} }
} }
fun getTzRegisterHost(callback: AsyncBodyCallback) { fun getTzRegisterHost(pId:String,callback: AsyncBodyCallback) {
val rt = val rt =
NetService.instances.createFreeBaseUrl("https://yingmao.oss-cn-hongkong.aliyuncs.com/") NetService.instances.createFreeBaseUrl("https://yingmao.oss-cn-hongkong.aliyuncs.com/")
doAsyncNoNeedReturn(HttpReqType.GET_HOST) { doAsyncNoNeedReturn(HttpReqType.GET_HOST) {
try { //TODO bug 会引起崩溃 try { //TODO bug 会引起崩溃
var host = rt.getTzRegister() var host = ""
if (pId=="182269") {
host = rt.getTz182269Register()
}else{
host = rt.getTzRegister()
}
callback.suc(host) callback.suc(host)
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()

View File

@ -186,7 +186,7 @@ class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatcher
llLine = view.findViewById(R.id.llLine) llLine = view.findViewById(R.id.llLine)
clActivity = view.findViewById(R.id.clActivity) clActivity = view.findViewById(R.id.clActivity)
clMember = view.findViewById(R.id.clMember) clMember = view.findViewById(R.id.clMember)
if (BuildConfig.productId=="182268"&&BuildConfig.is_tz){ if (BuildConfig.productId=="182269"&&BuildConfig.is_tz){
clActivity.visibility=View.INVISIBLE clActivity.visibility=View.INVISIBLE
} }
@ -212,7 +212,7 @@ class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatcher
return@setOnClickListener return@setOnClickListener
} }
var intent: Intent? = null var intent: Intent? = null
if (BuildConfig.is_tz) { if (BuildConfig.is_tz&&BuildConfig.productId=="182269") {
intent = Intent(CommonUtils.getApp(), ChangeNodeTzActivity::class.java) intent = Intent(CommonUtils.getApp(), ChangeNodeTzActivity::class.java)
} else { } else {
intent = Intent(CommonUtils.getApp(), ChangeNodeActivity::class.java) intent = Intent(CommonUtils.getApp(), ChangeNodeActivity::class.java)

View File

@ -250,7 +250,7 @@ class SettingFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatc
tvVersion = view.findViewById(R.id.tvVersion) tvVersion = view.findViewById(R.id.tvVersion)
clFire = view.findViewById(R.id.clFire) clFire = view.findViewById(R.id.clFire)
if (BuildConfig.productId=="182268" && BuildConfig.is_tz){ if (BuildConfig.productId=="182269" && BuildConfig.is_tz){
clFire.visibility=View.GONE clFire.visibility=View.GONE
clTelegraph.visibility=View.GONE clTelegraph.visibility=View.GONE
clPreventLoss.visibility=View.INVISIBLE clPreventLoss.visibility=View.INVISIBLE

View File

@ -218,7 +218,8 @@ interface HttpApi {
@GET("/taiziregister.txt") @GET("/taiziregister.txt")
suspend fun getTzRegister(): String suspend fun getTzRegister(): String
@GET("/taiziregister_182269.txt")
suspend fun getTz182269Register(): String
@GET("/bzyregister.txt") @GET("/bzyregister.txt")
suspend fun getBzyRegister(): String suspend fun getBzyRegister(): String

View File

@ -6,6 +6,8 @@ import android.content.pm.PackageManager;
import android.content.pm.Signature; import android.content.pm.Signature;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import com.yingmao.clash.app.MainApplication;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.MessageDigest; import java.security.MessageDigest;
@ -252,9 +254,7 @@ public class AESUtil {
private static final String KEY_ALGORITHM = "AES"; private static final String KEY_ALGORITHM = "AES";
private static final String DEFAULT_CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding";//默认的加密算法 private static final String DEFAULT_CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding";//默认的加密算法
// private static final String KEY = "";//默认的加密算法 // private static final String KEY = "";//默认的加密算法
public static String KEY2 = "";//默认的加密算法
// private static final String IV = "";//默认的加密算法
public static String IV2 = "";//默认的加密算法
/** /**
* AES 加密操作 * AES 加密操作
* *
@ -267,10 +267,10 @@ public class AESUtil {
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM); Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
//密码key(超过16字节即128bit的key需要替换jre中的local_policy.jar和US_export_policy.jar否则报错Illegal key size) //密码key(超过16字节即128bit的key需要替换jre中的local_policy.jar和US_export_policy.jar否则报错Illegal key size)
SecretKeySpec keySpec = new SecretKeySpec(KEY2.getBytes(StandardCharsets.UTF_8), KEY_ALGORITHM); SecretKeySpec keySpec = new SecretKeySpec(MainApplication.Companion.getKEY2().getBytes(StandardCharsets.UTF_8), KEY_ALGORITHM);
//向量iv //向量iv
IvParameterSpec ivParameterSpec = new IvParameterSpec(IV2.getBytes(StandardCharsets.UTF_8)); IvParameterSpec ivParameterSpec = new IvParameterSpec(MainApplication.Companion.getIV2().getBytes(StandardCharsets.UTF_8));
//初始化为加密模式的密码器 //初始化为加密模式的密码器
cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivParameterSpec); cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivParameterSpec);
@ -371,10 +371,10 @@ public class AESUtil {
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM); Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
//密码key //密码key
SecretKeySpec keySpec = new SecretKeySpec(KEY2.getBytes("utf-8"), KEY_ALGORITHM); SecretKeySpec keySpec = new SecretKeySpec(MainApplication.Companion.getKEY2().getBytes("utf-8"), KEY_ALGORITHM);
//向量iv //向量iv
IvParameterSpec ivParameterSpec = new IvParameterSpec(IV2.getBytes("utf-8")); IvParameterSpec ivParameterSpec = new IvParameterSpec(MainApplication.Companion.getIV2().getBytes("utf-8"));
//初始化为解密模式的密码器 //初始化为解密模式的密码器
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivParameterSpec); cipher.init(Cipher.DECRYPT_MODE, keySpec, ivParameterSpec);