添加太子182269注册链接
This commit is contained in:
parent
59fa21ed14
commit
c93b1a065e
|
|
@ -600,7 +600,7 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
|
|||
var mmkvHost = MMKV.defaultMMKV()
|
||||
.decodeString(BZYConstants.MMKV_KEY_REGISTER_HOST, "")
|
||||
// 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) {
|
||||
// com.cncat.vpn.common.log.Log.d("str==>${str}")
|
||||
if (str != mmkvHost) {
|
||||
|
|
|
|||
|
|
@ -834,7 +834,7 @@ class NewMainActivity : BaseActivity() {
|
|||
drawer.openDrawer(GravityCompat.START)
|
||||
}
|
||||
}
|
||||
if (BuildConfig.is_tz && BuildConfig.productId == "182268") {
|
||||
if (BuildConfig.is_tz && BuildConfig.productId == "182269") {
|
||||
telegramBtn.visibility = View.INVISIBLE
|
||||
fds_view.visibility = View.INVISIBLE
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ class SplashActivity : BaseActivity() {
|
|||
private val Captcha_REQUEST_CODE = 3333
|
||||
private lateinit var rlPb: View
|
||||
private lateinit var ll_action: View
|
||||
private var but_skip: Button? = null
|
||||
private var but_register: Button? = null
|
||||
private var but_skip: Button? = null
|
||||
private var but_register: Button? = null
|
||||
|
||||
private lateinit var rlMain: RelativeLayout
|
||||
|
||||
|
|
@ -130,8 +130,7 @@ class SplashActivity : BaseActivity() {
|
|||
}
|
||||
}
|
||||
initWebView()
|
||||
if (BuildConfig.productId == "182268") {
|
||||
|
||||
if (BuildConfig.productId == "182269") {
|
||||
initAgreementPrivacy()
|
||||
} else {
|
||||
//隐私政策先授权后获取权限
|
||||
|
|
@ -233,9 +232,9 @@ class SplashActivity : BaseActivity() {
|
|||
var ss2 = cb.getSS2(si)
|
||||
registerKey = cb.getRegisterKey(si)
|
||||
registerIV2 = cb.getRegisterKiv(si)
|
||||
// com.cncat.vpn.common.log.Log.d("si==>${si}, ss1==>${ss1}, ss2==>${ss2}")
|
||||
AESUtil.KEY2 = ss1
|
||||
AESUtil.IV2 = ss2
|
||||
com.cncat.vpn.common.log.Log.d("si==>${si}, ss1==>${ss1}, ss2==>${ss2}")
|
||||
MainApplication.KEY2 = ss1
|
||||
MainApplication.IV2 = ss2
|
||||
// 太子
|
||||
// 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("")))
|
||||
|
|
@ -280,14 +279,14 @@ class SplashActivity : BaseActivity() {
|
|||
// OpenInstall.getWakeUp(intent, wakeUpAdapter)
|
||||
}
|
||||
|
||||
private lateinit var webView: WebView
|
||||
private var webView: WebView? = null
|
||||
private lateinit var pb_web: ProgressBar
|
||||
var dialogAgreementPrivacyChoose: DialogAgreementPrivacyChoose? = null
|
||||
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)) {
|
||||
rlPb.visibility = View.VISIBLE
|
||||
webView.visibility = View.GONE
|
||||
webView?.visibility = View.GONE
|
||||
initApplication(false)
|
||||
} else {
|
||||
setWebView()
|
||||
|
|
@ -357,7 +356,7 @@ class SplashActivity : BaseActivity() {
|
|||
@SuppressLint("JavascriptInterface")
|
||||
private fun setWebView() {
|
||||
rlPb.visibility = View.INVISIBLE
|
||||
webView.visibility = View.VISIBLE
|
||||
webView?.visibility = View.VISIBLE
|
||||
lifecycleScope.launch(Dispatchers.Main) {
|
||||
delay(3000) // 延迟3秒
|
||||
com.cncat.vpn.common.log.Log.d("setWebView delay")
|
||||
|
|
@ -365,30 +364,30 @@ class SplashActivity : BaseActivity() {
|
|||
but_register?.visibility = View.VISIBLE
|
||||
}
|
||||
// WebView设置
|
||||
val webSettings = webView.settings
|
||||
val webSettings = webView?.settings
|
||||
// 可选,设置开启Chrome调试
|
||||
WebView.setWebContentsDebuggingEnabled(true)
|
||||
// 设置屏幕自适应
|
||||
webSettings.useWideViewPort = true
|
||||
webSettings.loadWithOverviewMode = true
|
||||
webSettings?.useWideViewPort = true
|
||||
webSettings?.loadWithOverviewMode = true
|
||||
// 建议禁止缓存加载,以确保在攻击发生时可快速获取最新的阿里云验证码2.0进行对抗
|
||||
webSettings.cacheMode = WebSettings.LOAD_NO_CACHE
|
||||
webSettings?.cacheMode = WebSettings.LOAD_NO_CACHE
|
||||
// 设置WebView组件支持加载JavaScript
|
||||
webSettings.javaScriptEnabled = true
|
||||
webSettings.domStorageEnabled = true
|
||||
webSettings?.javaScriptEnabled = true
|
||||
webSettings?.domStorageEnabled = true
|
||||
|
||||
|
||||
// 设置不使用默认浏览器,而直接使用WebView组件加载页面
|
||||
webView.webViewClient = object : WebViewClient() {
|
||||
webView?.webViewClient = object : WebViewClient() {
|
||||
override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
|
||||
view.loadUrl(url)
|
||||
return true
|
||||
}
|
||||
}
|
||||
webView.addJavascriptInterface(CaptchaJsInterface(), "CaptchaJsInterface")
|
||||
webView?.addJavascriptInterface(CaptchaJsInterface(), "CaptchaJsInterface")
|
||||
// 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")
|
||||
}
|
||||
|
||||
|
|
@ -400,7 +399,7 @@ class SplashActivity : BaseActivity() {
|
|||
captchaInfo = verifyResult
|
||||
|
||||
launch {
|
||||
webView.setOnTouchListener { _, _ -> true }
|
||||
webView?.setOnTouchListener { _, _ -> true }
|
||||
pb_web.visibility = View.VISIBLE
|
||||
}
|
||||
doRegisterByEncryption()
|
||||
|
|
@ -418,7 +417,7 @@ class SplashActivity : BaseActivity() {
|
|||
|
||||
private fun setLocalLanguage() {
|
||||
var defLan = ""
|
||||
if (BuildConfig.is_tz && BuildConfig.productId != "182268") {
|
||||
if (BuildConfig.is_tz && BuildConfig.productId != "182269") {
|
||||
defLan = "Chinese-HK"
|
||||
}
|
||||
val decodeString = MMKV.defaultMMKV().decodeString(BZYConstants.languageInfo, defLan)
|
||||
|
|
@ -757,7 +756,7 @@ class SplashActivity : BaseActivity() {
|
|||
message?.let {
|
||||
RxToast.error(it)
|
||||
}
|
||||
webView.setOnTouchListener { _, _ -> false }
|
||||
webView?.setOnTouchListener { _, _ -> false }
|
||||
} else {
|
||||
MaterialDialog(this@SplashActivity).show {
|
||||
message(text = initErrMsg)
|
||||
|
|
@ -1291,7 +1290,7 @@ class SplashActivity : BaseActivity() {
|
|||
var mmkvHost = MMKV.defaultMMKV()
|
||||
.decodeString(BZYConstants.MMKV_KEY_REGISTER_HOST, "")
|
||||
// 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) {
|
||||
// com.cncat.vpn.common.log.Log.d("str==>${str}")
|
||||
if (str != mmkvHost) {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ class MainApplication : Application() {
|
|||
private const val RESULT_CHANNEL = "profile_result_channel"
|
||||
|
||||
public var OAID = ""
|
||||
|
||||
public var KEY2 = ""
|
||||
public var IV2 = ""
|
||||
fun getUserInfo(): UserData? {
|
||||
return userBean
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,12 +261,17 @@ open class PublicViewMode : BaseViewMode() {
|
|||
}
|
||||
}
|
||||
}
|
||||
fun getTzRegisterHost(callback: AsyncBodyCallback) {
|
||||
fun getTzRegisterHost(pId:String,callback: AsyncBodyCallback) {
|
||||
val rt =
|
||||
NetService.instances.createFreeBaseUrl("https://yingmao.oss-cn-hongkong.aliyuncs.com/")
|
||||
doAsyncNoNeedReturn(HttpReqType.GET_HOST) {
|
||||
try { //TODO bug 会引起崩溃
|
||||
var host = rt.getTzRegister()
|
||||
var host = ""
|
||||
if (pId=="182269") {
|
||||
host = rt.getTz182269Register()
|
||||
}else{
|
||||
host = rt.getTzRegister()
|
||||
}
|
||||
callback.suc(host)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatcher
|
|||
llLine = view.findViewById(R.id.llLine)
|
||||
clActivity = view.findViewById(R.id.clActivity)
|
||||
clMember = view.findViewById(R.id.clMember)
|
||||
if (BuildConfig.productId=="182268"&&BuildConfig.is_tz){
|
||||
if (BuildConfig.productId=="182269"&&BuildConfig.is_tz){
|
||||
clActivity.visibility=View.INVISIBLE
|
||||
}
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatcher
|
|||
return@setOnClickListener
|
||||
}
|
||||
var intent: Intent? = null
|
||||
if (BuildConfig.is_tz) {
|
||||
if (BuildConfig.is_tz&&BuildConfig.productId=="182269") {
|
||||
intent = Intent(CommonUtils.getApp(), ChangeNodeTzActivity::class.java)
|
||||
} else {
|
||||
intent = Intent(CommonUtils.getApp(), ChangeNodeActivity::class.java)
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ class SettingFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatc
|
|||
tvVersion = view.findViewById(R.id.tvVersion)
|
||||
clFire = view.findViewById(R.id.clFire)
|
||||
|
||||
if (BuildConfig.productId=="182268" && BuildConfig.is_tz){
|
||||
if (BuildConfig.productId=="182269" && BuildConfig.is_tz){
|
||||
clFire.visibility=View.GONE
|
||||
clTelegraph.visibility=View.GONE
|
||||
clPreventLoss.visibility=View.INVISIBLE
|
||||
|
|
|
|||
|
|
@ -218,7 +218,8 @@ interface HttpApi {
|
|||
|
||||
@GET("/taiziregister.txt")
|
||||
suspend fun getTzRegister(): String
|
||||
|
||||
@GET("/taiziregister_182269.txt")
|
||||
suspend fun getTz182269Register(): String
|
||||
@GET("/bzyregister.txt")
|
||||
suspend fun getBzyRegister(): String
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import android.content.pm.PackageManager;
|
|||
import android.content.pm.Signature;
|
||||
import android.telephony.TelephonyManager;
|
||||
|
||||
import com.yingmao.clash.app.MainApplication;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
|
|
@ -252,9 +254,7 @@ public class AESUtil {
|
|||
private static final String KEY_ALGORITHM = "AES";
|
||||
private static final String DEFAULT_CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding";//默认的加密算法
|
||||
// private static final String KEY = "";//默认的加密算法
|
||||
public static String KEY2 = "";//默认的加密算法
|
||||
// private static final String IV = "";//默认的加密算法
|
||||
public static String IV2 = "";//默认的加密算法
|
||||
|
||||
/**
|
||||
* AES 加密操作
|
||||
*
|
||||
|
|
@ -267,10 +267,10 @@ public class AESUtil {
|
|||
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
|
||||
|
||||
//密码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
|
||||
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);
|
||||
|
|
@ -371,10 +371,10 @@ public class AESUtil {
|
|||
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
|
||||
|
||||
//密码key
|
||||
SecretKeySpec keySpec = new SecretKeySpec(KEY2.getBytes("utf-8"), KEY_ALGORITHM);
|
||||
SecretKeySpec keySpec = new SecretKeySpec(MainApplication.Companion.getKEY2().getBytes("utf-8"), KEY_ALGORITHM);
|
||||
|
||||
//向量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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue