diff --git a/app/src/main/java/com/yingmao/clash/act/SplashActivity.kt b/app/src/main/java/com/yingmao/clash/act/SplashActivity.kt index 642f1ed..5b1af30 100644 --- a/app/src/main/java/com/yingmao/clash/act/SplashActivity.kt +++ b/app/src/main/java/com/yingmao/clash/act/SplashActivity.kt @@ -71,8 +71,12 @@ import com.yingmao.clash.view.dialog.DialogAppVersion import com.yingmao.clash.view.dialog.DialogDoMainChoose import com.yingmao.clash.view.dialog.RxDialogSureCancel import com.yingmao.clash.vm.SplashAtyVM +import kotlinx.coroutines.DelicateCoroutinesApi +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.MainScope import kotlinx.coroutines.async +import kotlinx.coroutines.delay import kotlinx.coroutines.launch import java.io.File import java.util.Locale @@ -183,6 +187,9 @@ class SplashActivity : BaseActivity() { // val Sgtr= AESUtil.decrypt("6A9E6037E4E31FDFE8E09A79FAD64B5CE7AA2D6C0DF34000998651C877C8005AD68274B63FCB1FC35DAFAD278B3EF19B79E83738A3AD5DB70D9601E43050BE0E") // println("Sgtr==>$Sgtr") +// val Sgtr= AESUtil.Registerdecrypt("" +// , registerKey, registerIV2) +//com.cncat.vpn.common.log.Log.d("Sgtr==>$Sgtr") // OpenInstall.getWakeUp(intent, wakeUpAdapter) // OpenInstall.getInstall { appData, error -> // var appData = appData @@ -340,13 +347,20 @@ class SplashActivity : BaseActivity() { startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(registerHost))) } } + } + @SuppressLint("JavascriptInterface") private fun setWebView() { rlPb.visibility = View.INVISIBLE webView.visibility = View.VISIBLE - but_skip.visibility = View.VISIBLE + lifecycleScope.launch(Dispatchers.Main) { + delay(3000) // 延迟3秒 + com.cncat.vpn.common.log.Log.d("setWebView delay") + but_skip.visibility = View.VISIBLE + but_register.visibility = View.VISIBLE + } // WebView设置 val webSettings = webView.settings // 可选,设置开启Chrome调试 @@ -379,7 +393,7 @@ class SplashActivity : BaseActivity() { @JavascriptInterface public fun getVerifyResult(verifyResult: String): Boolean { -// com.cncat.vpn.common.log.Log.d("verifyResult==>${verifyResult}") + com.cncat.vpn.common.log.Log.d("verifyResult==>${verifyResult}") captchaInfo = verifyResult launch { @@ -503,6 +517,7 @@ class SplashActivity : BaseActivity() { if (MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_IS_REGISTER, false)) { rlPb.visibility = View.VISIBLE but_skip.visibility = View.INVISIBLE + but_register.visibility = View.INVISIBLE splashAtyVM.checkLogin() } else { // doRegister() @@ -519,6 +534,7 @@ class SplashActivity : BaseActivity() { ll_action.visibility = View.VISIBLE rlPb.visibility = View.INVISIBLE but_skip.visibility = View.INVISIBLE + but_register.visibility = View.INVISIBLE if (MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_IS_REGISTER, false)) { if (token != null && token.isNotEmpty()) { diff --git a/app/src/main/java/com/yingmao/clash/net/http/HttpApi.kt b/app/src/main/java/com/yingmao/clash/net/http/HttpApi.kt index 2ccc784..36a3b81 100644 --- a/app/src/main/java/com/yingmao/clash/net/http/HttpApi.kt +++ b/app/src/main/java/com/yingmao/clash/net/http/HttpApi.kt @@ -54,11 +54,12 @@ interface HttpApi { ) @GET("/netbarcloud/open/startImg") suspend fun splashBg(): StartingBeans + @Headers( "User-Agent: Octopus_Android" ) @POST("/netbarcloud/vpn/phLogin.do") - fun login2(@QueryMap params: Map): Call + fun login2(@QueryMap params: Map): Call //检查登录 : http://10.10.23.115:8020/netbarcloud/api/userinfo @Headers( @@ -87,7 +88,12 @@ interface HttpApi { "User-Agent: Octopus_Android" ) @POST("/netbarcloud/vpn/appRegister2") - suspend fun encryptionRegister(@QueryMap params: Map): RegisterRsp + suspend fun encryptionRegister( + + @Body requestBody: RequestBody, + ): RegisterRsp + + //显示赠送时长 : @Headers( @@ -147,7 +153,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): String //心跳 http://10.10.23.115:8020/netbarcloud/api/heartbeat @@ -160,7 +166,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): String // @GET("/darkSuperman/lazy/blob/master/fire.json") @@ -169,40 +175,56 @@ interface HttpApi { //影猫 @GET("/host_ym.txt") suspend fun getHost(): String + @GET("/host_ym.txt") suspend fun getHostAWS(): String + @GET("/ym-source/ym/main/host_ym.txt") suspend fun getHostGithub(): String + //八爪鱼 @GET("/hostdef.txt") suspend fun getBzyHostDef(): String + @GET("/hostdef.txt") suspend fun getBzyHostAWS(): String + @GET("/ym-source/ym/main/hostdef.txt") suspend fun getBzyHostGithub(): String + //太子 @GET("/hosttaizi.txt") suspend fun getTzHostTZ(): String + @GET("/hosttaizi.txt") suspend fun getTzHostAWS(): String + @GET("/ym-source/ym/main/hosttaizi.txt") suspend fun getTzHostGithub(): String + //云梯 @GET("/host_yunti.txt") suspend fun getYunTiHost(): String + @GET("/host_yunti.txt") suspend fun getYunTiHostAWS(): String + @GET("/ym-source/ym/main/host_yunti.txt") suspend fun getYunTiHostGithub(): String + //注册链接 @GET("/ymregister.txt") suspend fun getYmRegister(): String + @GET("/taiziregister.txt") suspend fun getTzRegister(): String + @GET("/bzyregister.txt") suspend fun getBzyRegister(): String + @GET("/yunti_register.txt") suspend fun getYuntiRegister(): String + //客服链接 @GET("/ymkefu.txt") suspend fun getYingMaoKefuHost(): String @@ -256,9 +278,10 @@ interface HttpApi { ) @POST("/netbarcloud/upload/uploadRequestLogs") suspend fun uploadRequestLogs( - @Body param: RequestBody, @Header("token") string: String = MMKV.defaultMMKV().decodeString( + @Body param: RequestBody, + @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): NormalRsp @@ -269,7 +292,7 @@ interface HttpApi { suspend fun getDomain( @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): String //http://10.10.23.115:8020/netbarcloud/vpn/getPointCardSurplus.do @@ -279,7 +302,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): NormalRsp //http://10.10.23.115:8020/netbarcloud/vpn/phRechargeInfo.do @@ -296,7 +319,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): RechargeInfoRsp //http://10.10.23.115:8020/netbarcloud/vpn/phPay.do @@ -308,7 +331,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): PayRsp @@ -317,7 +340,7 @@ interface HttpApi { @QueryMap params: HashMap, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): PayRsp //http://10.10.23.115:8020/netbarcloud/vpn/appAliPay.do @@ -329,7 +352,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): NormalRsp //汇旺财二维码支付 @@ -341,7 +364,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): QRPayRsp //汇旺财二维码支付结果 @@ -353,7 +376,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): QRPayStatusRsp @@ -366,7 +389,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): WXPayRsp //http://10.10.23.115:8020/netbarcloud/vpn/pcPayStatus.do @@ -378,7 +401,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): NormalRsp //http://10.10.23.115:8020/netbarcloud/vpn/phOrderList.do @@ -390,7 +413,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): ExpensesRecordRsp //http://10.10.23.115:8020/netbarcloud/vpn/pointCardSurplusRecharge.do @@ -402,7 +425,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): NormalMessageRsp //http://10.10.23.115:8020/netbarcloud/vpn/appPcPointCardPay.do @@ -414,7 +437,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): NormalMessageRsp @Headers( @@ -425,7 +448,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): BiLaiNormalRsp @Headers( @@ -436,7 +459,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): BiLaiNormalRsp @Headers( @@ -447,7 +470,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): PhDownloadUrlRsp @Headers( @@ -458,7 +481,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): BiLaiPayStatusRsp @@ -470,7 +493,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): SubscriptionRsp //网页支付统一订单查询 @@ -482,7 +505,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): NormalMessageRsp @Headers( @@ -493,7 +516,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): AppVersionCheckRsp @Headers( @@ -501,7 +524,7 @@ interface HttpApi { ) @GET("/netbarcloud/vpn/upgradeVersion") suspend fun upgradeVersion( - @QueryMap params: Map + @QueryMap params: Map, ): AppVersionCheckRsp //忘记密码 @@ -522,7 +545,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): SendSmsRsp //会员签到 @@ -534,7 +557,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): VipSignRsp //会员签到 @@ -546,7 +569,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): GetActivityRsp //获取阿里云上传数据 @@ -558,7 +581,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): UploadParamData @Headers( @@ -570,7 +593,7 @@ interface HttpApi { @Body requestBody: RequestBody, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): PayUploadParamData @Headers( @@ -581,7 +604,7 @@ interface HttpApi { @QueryMap params: Map, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): AppStartupStatus @Headers( @@ -593,7 +616,7 @@ interface HttpApi { @Body requestBody: RequestBody, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): AppStopStatus @Headers( @@ -605,6 +628,6 @@ interface HttpApi { @Body requestBody: RequestBody, @Header("token") string: String = MMKV.defaultMMKV().decodeString( BZYConstants.MMKV_KEY_TOKEN - ).toString() + ).toString(), ): AppStopStatus } \ No newline at end of file diff --git a/app/src/main/java/com/yingmao/clash/vm/SplashAtyVM.kt b/app/src/main/java/com/yingmao/clash/vm/SplashAtyVM.kt index bc6ec8d..e14cab3 100644 --- a/app/src/main/java/com/yingmao/clash/vm/SplashAtyVM.kt +++ b/app/src/main/java/com/yingmao/clash/vm/SplashAtyVM.kt @@ -2,6 +2,7 @@ package com.yingmao.clash.vm import android.text.TextUtils import android.util.Log +import com.google.gson.Gson import com.orhanobut.logger.Logger import com.tencent.mmkv.MMKV @@ -20,6 +21,9 @@ import com.yingmao.clash.net.http.NetService import com.yingmao.clash.util.AESUtil import kotlinx.coroutines.Job +import okhttp3.MediaType.Companion.toMediaType +import okhttp3.RequestBody +import okhttp3.RequestBody.Companion.toRequestBody class SplashAtyVM : PublicViewMode() { @@ -82,8 +86,12 @@ class SplashAtyVM : PublicViewMode() { fun registerByEncryption(params: Map) { Log.e("data", "register ....") val httpApi = NetService.instances.createHttps(HttpApi::class.java) + + val gson = Gson() + val jsonString = gson.toJson(params) + val requestBody: RequestBody = jsonString.toRequestBody("application/json; charset=utf-8".toMediaType()) doAsync(HttpReqType.REGISTER) { - httpApi.encryptionRegister(params) + httpApi.encryptionRegister(requestBody) } } diff --git a/app/src/main/res/layout/layout_splash_activity.xml b/app/src/main/res/layout/layout_splash_activity.xml index 85d3ab0..d842bda 100644 --- a/app/src/main/res/layout/layout_splash_activity.xml +++ b/app/src/main/res/layout/layout_splash_activity.xml @@ -55,7 +55,7 @@ android:layout_weight="1" android:background="@drawable/login_btn_bg_selector" android:text="@string/skip" - android:visibility="visible"> + android:visibility="invisible"> diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 33c2be7..1896975 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -338,15 +338,15 @@ 每天 熱門應用 熱門應用導航 - "建議重啓 " - "重啓 " + "建議重啓" + "重啓" 線路測速 同意 不同意 直接登入 雲梯加速器 - 郵箱註冊 + 手動注册 充值會員 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 93a9bf0..b4fcc26 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -337,15 +337,14 @@ 每天 熱門應用 熱門應用導航 - "建議重啓 " - "重啓 " + "建議重啓" + "重啓" 線路測速 同意 不同意 直接登入 雲梯加速器 - 郵箱註冊 - + 手動注册 充值會員 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4cf520d..a36634c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -366,7 +366,7 @@ 直接登录 云梯加速器 - 邮箱注册 + 手动注册 充值会员 \ No newline at end of file