宙连相关更改
This commit is contained in:
parent
337f57506d
commit
efd13191ad
|
|
@ -136,10 +136,6 @@
|
|||
android:name=".act.ChangeNodeActivity"
|
||||
android:process=":background"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".act.ChangeNodeTzActivity"
|
||||
android:process=":background"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".act.ForGetPwdActivity"
|
||||
android:process=":background"
|
||||
|
|
|
|||
|
|
@ -26,22 +26,22 @@
|
|||
|
||||
<p class="font_content">a) Our goal is to provide quality service to all customers. Please read these terms of service carefully before you access the site or the service. <br/>
|
||||
</p>
|
||||
<p class="font_content">b) These Terms of Service (“the Terms”) govern your use of the 马上连加速器 and the associated website domains (the “Site”) and related service (the “Services”), which are owned and operated by the 马上连加速器 Team (“马上连加速器,” “our”, “we” or “us”). The Terms constitute a legally binding agreement (the “Agreement”) between you and the 马上连 加速器 Team.</p>
|
||||
<p class="font_content">b) These Terms of Service (“the Terms”) govern your use of the 宙连加速器 and the associated website domains (the “Site”) and related service (the “Services”), which are owned and operated by the 宙连加速器 Team (“宙连加速器,” “our”, “we” or “us”). The Terms constitute a legally binding agreement (the “Agreement”) between you and the 宙连 加速器 Team.</p>
|
||||
<p class="font_subtitle">
|
||||
马上连加速器 Service
|
||||
宙连加速器 Service
|
||||
</p>
|
||||
<p class="font_content">a) You understand that we are providing you with a virtual private network (or "加速器") service, which includes, but is not limited to, the use of servers, transport, routers, IP addresses and other equipment and protocols to transmit information over our network (the "System"). You agree to abide by the Terms with respect to your use of the Service.</p>
|
||||
<p class="font_subtitle">
|
||||
Usage Policy
|
||||
</p>
|
||||
<p class="font_content">a) BY USING 马上连 加速器 SERVICE (the "Service") YOU AGREE:</p>
|
||||
<p class="font_content">a) BY USING 宙连 加速器 SERVICE (the "Service") YOU AGREE:</p>
|
||||
<p class="font_content">a) NOT to use the system for sending spam, port scanning, scanning for open proxies or open relays, sending opt-in email, unsolicited email or any type or version of email sent in large quantities even if the email is ultimately sent off of another server.</p>
|
||||
<p class="font_content">b) NOT to launch any pop-ups from our service.</p>
|
||||
<p class="font_content">c) NOT to attack in any way shape or form any other computer or network while on our service.</p>
|
||||
<p class="font_content">d) NOT to use the service for things that could hurt our network or other people.</p>
|
||||
<p class="font_content">b) It is the user responsibility to know and comprehend any and all relevant laws related to any jurisdiction or venue that concerns you and your actions. 马上连 加速器 is not liable in any way or form for actions done by its users including a criminal liability and a civil liability for harm executed or not executed beyond any money paid to 马上连 加速器 for its services by a concrete individual.</p>
|
||||
<p class="font_content">c) Violations of this Usage Policy or the Terms may result in termination of your account, without any refund of amounts previously paid for the Service. Additionally, you may be held responsible for any and all damages incurred to 马上连 加速器, including any amounts charged by any outside entity due to said violation(s), including attorney’s fees and costs without limitation.</p>
|
||||
<p class="font_content">d) 马上连 加速器 enables you to download software, software updates or patches, or other utilities and tools onto your mobile phones or Internet-enabled device. 马上连 加速器 ("the Software") grants to you a nonexclusive, limited license to use the Software solely for the purpose stated by 马上连 加速器 at the time the Software is made available to you and in accordance with these Terms. Modifying, distributing to unauthorized parties, reverse engineering, or otherwise using the Software in any way not expressly authorized by 马上连 加速器, is strictly prohibited.</p>
|
||||
<p class="font_content">b) It is the user responsibility to know and comprehend any and all relevant laws related to any jurisdiction or venue that concerns you and your actions. 宙连 加速器 is not liable in any way or form for actions done by its users including a criminal liability and a civil liability for harm executed or not executed beyond any money paid to 宙连 加速器 for its services by a concrete individual.</p>
|
||||
<p class="font_content">c) Violations of this Usage Policy or the Terms may result in termination of your account, without any refund of amounts previously paid for the Service. Additionally, you may be held responsible for any and all damages incurred to 宙连 加速器, including any amounts charged by any outside entity due to said violation(s), including attorney’s fees and costs without limitation.</p>
|
||||
<p class="font_content">d) 宙连 加速器 enables you to download software, software updates or patches, or other utilities and tools onto your mobile phones or Internet-enabled device. 宙连 加速器 ("the Software") grants to you a nonexclusive, limited license to use the Software solely for the purpose stated by 宙连 加速器 at the time the Software is made available to you and in accordance with these Terms. Modifying, distributing to unauthorized parties, reverse engineering, or otherwise using the Software in any way not expressly authorized by 宙连 加速器, is strictly prohibited.</p>
|
||||
<p class="font_subtitle">
|
||||
Disclaimers
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class AgreementAndPrivacyActivity : BaseActivity() {
|
|||
|
||||
fun loadAgreeHtml(){
|
||||
if (BuildConfig.is_ym){
|
||||
webView.loadUrl("https://www.mslgood.cc/agreement.html")
|
||||
webView.loadUrl("https://pub-files.markoctopus.cc/html/zuolian/agreement.html")
|
||||
}else{
|
||||
webView.loadUrl("file:android_asset/agreement.html")
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ class AgreementAndPrivacyActivity : BaseActivity() {
|
|||
|
||||
fun loadPriHtml(){
|
||||
if (BuildConfig.is_ym){
|
||||
webView.loadUrl("https://www.mslgood.cc/privacy.html")
|
||||
webView.loadUrl("https://pub-files.markoctopus.cc/html/zuolian/privacy.html")
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -96,7 +96,7 @@ class AgreementAndPrivacyActivity : BaseActivity() {
|
|||
val language = config.locale.language
|
||||
val country = config.locale.country
|
||||
if (language.equals("en")) {
|
||||
webView.loadUrl("https://www.mslgood.cc/agreement.html")
|
||||
webView.loadUrl("https://pub-files.markoctopus.cc/html/zuolian/agreement.html")
|
||||
} else if (language.equals("zh") && country.equals("HK")) {
|
||||
loadAgreeHtml()
|
||||
} else {
|
||||
|
|
@ -113,7 +113,7 @@ class AgreementAndPrivacyActivity : BaseActivity() {
|
|||
}
|
||||
|
||||
"English" -> {
|
||||
webView.loadUrl("https://www.mslgood.cc/agreement.html")
|
||||
webView.loadUrl("https://pub-files.markoctopus.cc/html/zuolian/agreement.html")
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ class AgreementAndPrivacyActivity : BaseActivity() {
|
|||
val language = config.locale.language
|
||||
val country = config.locale.country
|
||||
if (language.equals("en")) {
|
||||
webView.loadUrl("https://www.mslgood.cc/privacy.html")
|
||||
webView.loadUrl("https://pub-files.markoctopus.cc/html/zuolian/privacy.html")
|
||||
} else if (language.equals("zh") && country.equals("HK")) {
|
||||
loadPriHtml()
|
||||
} else {
|
||||
|
|
@ -143,7 +143,7 @@ class AgreementAndPrivacyActivity : BaseActivity() {
|
|||
}
|
||||
|
||||
"English" -> {
|
||||
webView.loadUrl("https://www.mslgood.cc/privacy.html")
|
||||
webView.loadUrl("https://pub-files.markoctopus.cc/html/zuolian/privacy.html")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import android.os.Build
|
|||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.ProgressBar
|
||||
|
|
@ -52,6 +53,7 @@ import com.yingmao.clash.R
|
|||
import com.yingmao.clash.app.MainApplication
|
||||
import com.yingmao.clash.base.BaseActivity
|
||||
import com.yingmao.clash.conf.BZYConstants
|
||||
import com.yingmao.clash.conf.BZYConstants.Companion.ScreenFlag
|
||||
import com.yingmao.clash.conf.Conf
|
||||
import com.yingmao.clash.entity.CheckLoginRsp
|
||||
import com.yingmao.clash.fragment.NewAccFragment
|
||||
|
|
@ -65,12 +67,14 @@ import com.yingmao.clash.net.http.entity.ExpensesRecordRsp
|
|||
import com.yingmao.clash.net.http.entity.GetActivityRsp
|
||||
import com.yingmao.clash.net.http.entity.HeartBeatRsp
|
||||
import com.yingmao.clash.net.http.entity.PhDownloadUrlRsp
|
||||
import com.yingmao.clash.net.http.entity.ShowNode
|
||||
import com.yingmao.clash.net.http.entity.SubscriptionRsp
|
||||
import com.yingmao.clash.net.http.entity.VipSignRsp
|
||||
import com.yingmao.clash.remote.Remote
|
||||
import com.yingmao.clash.util.AESUtil
|
||||
import com.yingmao.clash.util.CommonUtils
|
||||
import com.yingmao.clash.util.Utils
|
||||
import com.yingmao.clash.util.stopClashService
|
||||
import com.yingmao.clash.view.RxToast
|
||||
import com.yingmao.clash.view.adapter.MainVPAdapter
|
||||
import com.yingmao.clash.view.dialog.ActivityViewDialog
|
||||
|
|
@ -82,6 +86,7 @@ import com.yingmao.clash.view.dialog.RxDialogShapeLoading
|
|||
import com.yingmao.clash.vm.MainAtyVM
|
||||
import com.yingmao.clash.webview.BZYWebViewKeFu
|
||||
import com.yingmao.clash.webview.BZYWebViewNormal
|
||||
import com.yingmao.clash.webview.CustomerServiceWebView
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.Job
|
||||
|
|
@ -127,6 +132,7 @@ class NewMainActivity : BaseActivity() {
|
|||
@SuppressLint("SimpleDateFormat")
|
||||
private val dateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
|
||||
|
||||
private lateinit var clExit:ConstraintLayout
|
||||
companion object {
|
||||
//记录心跳失败次数
|
||||
var HEART_BEAT_FAILURE_FREQUENCY = 0
|
||||
|
|
@ -296,25 +302,18 @@ class NewMainActivity : BaseActivity() {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
mainAtyVM = ViewModelProvider(this).get(MainAtyVM::class.java)
|
||||
initViews()
|
||||
mainAtyVM = ViewModelProvider(this)[MainAtyVM::class.java]
|
||||
observe(this, mainAtyVM)
|
||||
|
||||
mainAtyVM.getRuningNoticeInfo()
|
||||
mainAtyVM.startHeartBeat()
|
||||
initViews()
|
||||
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
||||
mainAtyVM.appCheck()
|
||||
mainAtyVM.getAirNodes()
|
||||
mainAtyVM.getExpensesRecord(mPageInfo)
|
||||
|
||||
val isGlobal = MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
||||
// val uc = MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_VPN_UserCommand, "")
|
||||
// Log.i("newMainActGlo isGlobal==>${isGlobal}, uc==>${uc}")
|
||||
newMainActGlo = isGlobal
|
||||
|
||||
startLog()
|
||||
// showBindAccount()
|
||||
firstEntry()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
val requestPermissionLauncher =
|
||||
|
|
@ -330,6 +329,8 @@ class NewMainActivity : BaseActivity() {
|
|||
requestPermissionLauncher.launch(android.Manifest.permission.POST_NOTIFICATIONS)
|
||||
}
|
||||
}
|
||||
//判断节点是否可以选择
|
||||
mainAtyVM.getSelectNodeInfo()
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -610,6 +611,29 @@ class NewMainActivity : BaseActivity() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}else if(httpStatus.reqType == HttpReqType.SelectNode){
|
||||
(httpStatus.rsp as ShowNode).let {
|
||||
if (it.code == 200) {
|
||||
val screenshotFlag = it.data?.screenshotFlag
|
||||
screenshotFlag.let {
|
||||
if (screenshotFlag == true) {
|
||||
// 在 Activity 中取消禁止截屏/录屏
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
|
||||
MMKV.defaultMMKV().encode(
|
||||
ScreenFlag,screenshotFlag
|
||||
)
|
||||
}else{
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_SECURE,
|
||||
WindowManager.LayoutParams.FLAG_SECURE
|
||||
)
|
||||
MMKV.defaultMMKV().encode(
|
||||
ScreenFlag,screenshotFlag!!
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -688,12 +712,14 @@ class NewMainActivity : BaseActivity() {
|
|||
MMKV.defaultMMKV().removeValueForKey(BZYConstants.MMKV_KEY_Switch_Finsh_Set)
|
||||
Log.d("cleanUserInfo clashRunning==>${clashRunning}")
|
||||
if (clashRunning) {
|
||||
fragments.filterIsInstance<NewAccFragment>().forEach { it.stopClash() }
|
||||
stopClashService()
|
||||
}
|
||||
stopUploadTimer()
|
||||
mainAtyVM.stopHeartBeat()
|
||||
cleanProfile()
|
||||
startActivity(Intent(CommonUtils.getApp(), LoginActivity::class.java))
|
||||
val intent = Intent(this, LoginActivity::class.java)
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
|
||||
startActivity(intent)
|
||||
finish()
|
||||
}
|
||||
|
||||
|
|
@ -718,6 +744,11 @@ class NewMainActivity : BaseActivity() {
|
|||
tv_username = findViewById(R.id.tv_username)
|
||||
iv_slider = findViewById(R.id.iv_slider)
|
||||
ll_slider = findViewById(R.id.ll_slider)
|
||||
clExit=findViewById(R.id.clExit)
|
||||
clExit.setOnClickListener {
|
||||
cleanUserInfo()
|
||||
}
|
||||
|
||||
ivTor.setOnClickListener {
|
||||
startActivity(Intent(this@NewMainActivity, PersonalCenter::class.java))
|
||||
drawer.close()
|
||||
|
|
@ -790,8 +821,7 @@ class NewMainActivity : BaseActivity() {
|
|||
drawer.close()
|
||||
}
|
||||
findViewById<ConstraintLayout>(R.id.clCustomerService).setOnClickListener {//客服
|
||||
startActivity(Intent(this, BZYWebViewKeFu::class.java))
|
||||
|
||||
startActivity(Intent(this, CustomerServiceWebView::class.java))
|
||||
drawer.close()
|
||||
}
|
||||
drawer = findViewById(R.id.drawer)
|
||||
|
|
@ -999,7 +1029,7 @@ class NewMainActivity : BaseActivity() {
|
|||
}else if(requestCode == CHECK_NODE_REQUEST_CODE){
|
||||
fragments.filterIsInstance<NewAccFragment>().forEach { it.nodeChooseBase(data) }
|
||||
val selectedName =
|
||||
MMKV.defaultMMKV().decodeString(BZYConstants.NODE_SELECTED_NAME_KEY, "")
|
||||
MMKV.defaultMMKV().decodeString(BZYConstants.NODE_SELECTED_NAME_KEY, "自动选择")
|
||||
tvNetStr.text=selectedName
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ import com.yingmao.clash.net.http.entity.UploadParamData
|
|||
import com.yingmao.clash.util.CommonUtils
|
||||
import com.yingmao.clash.util.DataUtils
|
||||
import com.yingmao.clash.util.DataUtils.getAllFilePath
|
||||
import com.yingmao.clash.util.stopClashService
|
||||
import com.yingmao.clash.view.RxToast
|
||||
import com.yingmao.clash.view.adapter.LanguageAdapter
|
||||
import com.yingmao.clash.view.dialog.RxDialogShapeLoading
|
||||
|
|
@ -583,9 +584,11 @@ class SettingActivity : BaseActivity() {
|
|||
MMKV.defaultMMKV().removeValueForKey(BZYConstants.MMKV_KEY_VPN_UserCommand)
|
||||
MMKV.defaultMMKV().removeValueForKey(BZYConstants.NODE_All_ITEM_NAME_KEY)
|
||||
MMKV.defaultMMKV().removeValueForKey(BZYConstants.PROFILE_SUB_URL)
|
||||
MMKV.defaultMMKV().removeValueForKey(BZYConstants.MMKV_KEY_Switch_Finsh_Set)
|
||||
Log.d("cleanUserInfo clashRunning==>$clashRunning")
|
||||
cleanNodeMmkv()
|
||||
if (clashRunning) {
|
||||
NewAccFragment().stopClash()
|
||||
stopClashService()
|
||||
}
|
||||
mainAtyVM.stopHeartBeat()
|
||||
cleanProfile()
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import android.text.TextUtils
|
|||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.*
|
||||
import androidx.annotation.RequiresApi
|
||||
|
|
@ -35,6 +36,7 @@ import com.yingmao.clash.net.http.HttpStatus
|
|||
import com.yingmao.clash.remote.Broadcasts
|
||||
import com.yingmao.clash.remote.Remote
|
||||
import com.cncat.vpn.service.store.ServiceStore
|
||||
import com.yingmao.clash.conf.BZYConstants.Companion.ScreenFlag
|
||||
import com.yingmao.clash.util.ApplicationObserver
|
||||
import com.yingmao.clash.util.StatusBarUtils
|
||||
import com.yingmao.clash.util.UiStore
|
||||
|
|
@ -75,10 +77,20 @@ open class BaseActivity : AppCompatActivity(), CoroutineScope by MainScope(), Br
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; //竖屏
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT //竖屏
|
||||
StatusBarUtils.with(this).init()
|
||||
window.decorView.systemUiVisibility =
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
|
||||
val decodeBool = MMKV.defaultMMKV().decodeBool(ScreenFlag, false)
|
||||
if(decodeBool){
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
|
||||
|
||||
}else{
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_SECURE,
|
||||
WindowManager.LayoutParams.FLAG_SECURE
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setContentView(layoutResID: Int) {
|
||||
|
|
|
|||
|
|
@ -329,4 +329,45 @@ open class PublicViewMode : BaseViewMode() {
|
|||
}
|
||||
}
|
||||
}
|
||||
fun getLocalHost(callback: AsyncBodyCallback) {
|
||||
val baseUrl=BuildConfig.service_url+"/oss/kf/"
|
||||
val rt = NetService.instances.createFreeBaseUrl(baseUrl)
|
||||
doAsyncNoNeedReturn(HttpReqType.GET_HOST) {
|
||||
try {
|
||||
var host = rt.getLocalKefuHost()
|
||||
callback.suc(host)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
callback.err()
|
||||
}
|
||||
}
|
||||
}
|
||||
fun getCustomServiceNet(callback: AsyncBodyCallback) {
|
||||
val rt =
|
||||
NetService.instances.createFreeBaseUrl("https://pubtofilegz.oss-rg-china-mainland.aliyuncs.com/kf/")
|
||||
doAsyncNoNeedReturn(HttpReqType.GET_HOST) {
|
||||
try {
|
||||
val host = rt.getKklNetHost()
|
||||
android.util.Log.i("getCustomServiceHost","Kf host::"+host)
|
||||
callback.suc(host)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
callback.err()
|
||||
}
|
||||
}
|
||||
}
|
||||
fun getCustomServiceNetS3(callback: AsyncBodyCallback) {
|
||||
val rt =
|
||||
NetService.instances.createFreeBaseUrl("https://wfjsq.s3.ap-east-1.amazonaws.com/")
|
||||
doAsyncNoNeedReturn(HttpReqType.GET_HOST) {
|
||||
try {
|
||||
val host = rt.getKklNetS3()
|
||||
android.util.Log.i("getCustomServiceHost","Kf host::"+host)
|
||||
callback.suc(host)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
callback.err()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -123,5 +123,7 @@ class BZYConstants {
|
|||
const val CONNECTID = "connectId"
|
||||
const val is_splash_first = "is_splash_first"
|
||||
const val ORDER_NUMBER = "orderNumber"
|
||||
const val ScreenFlag="screenshotFlag"
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ class Conf {
|
|||
return context?.getString(R.string.app_name_taizi)!!
|
||||
} else {
|
||||
if (BuildConfig.is_ym) {
|
||||
return context?.getString(R.string.app_name_gz)!!
|
||||
return context?.getString(R.string.zlApiPort)!!
|
||||
} else {
|
||||
return context?.getString(R.string.app_name)!!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
|
|||
if (checkExpire()) {
|
||||
if (isAdded) {
|
||||
MaterialDialog(requireContext()).show {
|
||||
this.cancelable(false)
|
||||
this.cancelable(true)
|
||||
cornerRadius(res = R.dimen.dp_10)
|
||||
customView(
|
||||
R.layout.expired_recharge__layout,
|
||||
|
|
@ -405,7 +405,6 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
|
|||
}
|
||||
}
|
||||
// File("${Core.deviceStorage.noBackupFilesDir}/${BaseService.CONFIG_FILE}").delete()
|
||||
accelerateViewModel.appStartupStatus()
|
||||
}
|
||||
|
||||
Clash_Stop -> {
|
||||
|
|
|
|||
|
|
@ -238,6 +238,14 @@ interface HttpApi {
|
|||
suspend fun getYuntiRegister(): String
|
||||
|
||||
//客服链接
|
||||
@GET("gz_kefu.txt")
|
||||
suspend fun getLocalKefuHost(): String
|
||||
|
||||
@GET("gz_kefu.txt")
|
||||
suspend fun getKklNetHost(): String
|
||||
|
||||
@GET("gz_kefu.txt")
|
||||
suspend fun getKklNetS3(): String
|
||||
@GET("/msl_kefu.txt")
|
||||
suspend fun getYingMaoKefuHost(): String
|
||||
|
||||
|
|
|
|||
|
|
@ -249,5 +249,7 @@ data class ShowNode(
|
|||
) : BaseRsp
|
||||
data class ShowNodeInfo(
|
||||
@field:SerializedName("countryFlag")
|
||||
val countryFlag: Boolean
|
||||
val countryFlag: Boolean,
|
||||
@field:SerializedName("screenshotFlag")
|
||||
val screenshotFlag: Boolean
|
||||
)
|
||||
|
|
@ -168,6 +168,7 @@ class MainAtyVM : PublicViewMode() {
|
|||
val params = mutableMapOf(
|
||||
"phToken" to token,
|
||||
"phoneNumber" to phoneNumber,
|
||||
"version" to BuildConfig.VERSION_CODE.toString()
|
||||
)
|
||||
Log.d("new main getAirportNode")
|
||||
doAsync(HttpReqType.GET_AIRNODES) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
package com.yingmao.clash.webview
|
||||
import android.util.Log
|
||||
import com.yingmao.clash.base.PublicViewMode
|
||||
import com.yingmao.clash.listener.AsyncBodyCallback
|
||||
|
||||
class CustomServiceHelper(private val splashAtyVM: PublicViewMode) {
|
||||
|
||||
fun getHostWithFallback(callback: (String) -> Unit) {
|
||||
tryGetHost(
|
||||
{ splashAtyVM.getLocalHost(it) },
|
||||
{ splashAtyVM.getCustomServiceNet(it) },
|
||||
{ splashAtyVM.getCustomServiceNetS3(it) },
|
||||
callback
|
||||
)
|
||||
}
|
||||
|
||||
private fun tryGetHost(
|
||||
first: (AsyncBodyCallback) -> Unit,
|
||||
second: (AsyncBodyCallback) -> Unit,
|
||||
third: (AsyncBodyCallback) -> Unit,
|
||||
callback: (String) -> Unit
|
||||
) {
|
||||
first(createCallback("getLocalHost method success", "getLocalHost method failed", callback) {
|
||||
second(createCallback("getCustomServiceNet method success", "getCustomServiceNet method failed", callback) {
|
||||
third(createCallback("getCustomServiceNetS3 method success", "getCustomServiceNetS3 methods failed", callback) {
|
||||
callback("") // 所有方法都失败
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
private fun createCallback(
|
||||
successLog: String,
|
||||
errorLog: String,
|
||||
callback: (String) -> Unit,
|
||||
onFailure: () -> Unit
|
||||
): AsyncBodyCallback {
|
||||
return object : AsyncBodyCallback {
|
||||
override suspend fun suc(str: String) {
|
||||
Log.e("data", successLog)
|
||||
callback(str) // 成功时回调
|
||||
}
|
||||
|
||||
override fun err() {
|
||||
Log.e("data", errorLog)
|
||||
onFailure() // 失败时尝试下一个方法
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -23,11 +23,15 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
|||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.cncat.vpn.common.log.Log
|
||||
import com.tencent.mmkv.MMKV
|
||||
import com.yingmao.clash.BuildConfig
|
||||
import com.yingmao.clash.R
|
||||
import com.yingmao.clash.base.BaseActivity
|
||||
import com.yingmao.clash.conf.BZYConstants
|
||||
import com.yingmao.clash.listener.AsyncBodyCallback
|
||||
import com.yingmao.clash.view.RxToast
|
||||
import com.yingmao.clash.vm.WebViewAtyVM
|
||||
import kotlinx.coroutines.MainScope
|
||||
import kotlinx.coroutines.launch
|
||||
import java.net.URLEncoder
|
||||
import kotlin.math.log
|
||||
|
||||
|
|
@ -38,6 +42,7 @@ class CustomerServiceWebView:BaseActivity() {
|
|||
private lateinit var rootView: LinearLayout
|
||||
private lateinit var webViewVM: WebViewAtyVM
|
||||
// private var fileChooserCallback: ValueCallback<Array<Uri>>? = null
|
||||
private var customerServiceHost = ""
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
@ -93,41 +98,28 @@ class CustomerServiceWebView:BaseActivity() {
|
|||
val userName = MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_REMEMBER_USERNAME, "")
|
||||
val enName = URLEncoder.encode(userName, "UTF-8")
|
||||
Log.d("getCustomerServiceUrl enName==>${enName}")
|
||||
if (TextUtils.isEmpty(customerServiceHost)) {
|
||||
val mmkvHost = MMKV.defaultMMKV()
|
||||
.decodeString(BZYConstants.MMKV_KEY_KEFU_HOST, "")
|
||||
webViewVM.getYmKefuHost(object : AsyncBodyCallback {
|
||||
override suspend fun suc(str: String) {
|
||||
|
||||
CustomServiceHelper(webViewVM).getHostWithFallback { str ->
|
||||
if(str.isEmpty()){
|
||||
RxToast.info("客服地址获取失败!")
|
||||
return@getHostWithFallback
|
||||
}
|
||||
MainScope().launch {
|
||||
if (str != mmkvHost) {
|
||||
MMKV.defaultMMKV()
|
||||
.encode(BZYConstants.MMKV_KEY_KEFU_HOST, str)
|
||||
}
|
||||
val loadUrl=str+"&app_account=${enName}"
|
||||
csWebView.loadUrl(loadUrl)
|
||||
customerServiceHost = str
|
||||
csWebView.loadUrl(str+"&app_account=${enName}"+"&app_t=${resources.getString(R.string.ConnectImmediately)}"+"&app_v=${BuildConfig.VERSION_NAME}."+ BuildConfig.productId)
|
||||
|
||||
}
|
||||
|
||||
override fun err() {
|
||||
webViewVM.getCustomServiceHost(object : AsyncBodyCallback {
|
||||
override suspend fun suc(str: String) {
|
||||
if (str != mmkvHost) {
|
||||
MMKV.defaultMMKV()
|
||||
.encode(BZYConstants.MMKV_KEY_KEFU_HOST, str)
|
||||
}
|
||||
val loadUrl=str+"&app_account=${enName}"
|
||||
csWebView.loadUrl(loadUrl)
|
||||
}
|
||||
|
||||
override fun err() {
|
||||
if (!TextUtils.isEmpty(mmkvHost)) {
|
||||
val loadUrl=mmkvHost+"&app_account=${enName}"
|
||||
csWebView.loadUrl(loadUrl)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
} else {
|
||||
csWebView.loadUrl(customerServiceHost+"&app_account=${enName}"+"&app_t=${resources.getString(R.string.ConnectImmediately)}"+"&app_v=${BuildConfig.VERSION_NAME}."+ BuildConfig.productId)
|
||||
}
|
||||
initKeyboardListener()
|
||||
}
|
||||
private fun initKeyboardListener() {
|
||||
|
|
|
|||
|
|
@ -254,8 +254,8 @@
|
|||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clPrivacyPolicy"
|
||||
android:layout_width="347dp"
|
||||
android:layout_height="49dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvStart"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
>
|
||||
<com.airbnb.lottie.LottieAnimationView
|
||||
android:id="@+id/lottieView"
|
||||
|
|
|
|||
|
|
@ -35,10 +35,11 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/iv_slider"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:contentDescription="@string/binding"
|
||||
android:padding="5dp"
|
||||
android:src="@mipmap/home_setting"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
@ -51,7 +52,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/zl"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:textColor="#FAC24C"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textStyle="bold"
|
||||
|
|
@ -91,9 +92,9 @@
|
|||
android:id="@+id/ll_activity"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:orientation="vertical"
|
||||
|
|
@ -167,7 +168,7 @@
|
|||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginTop="48dp"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
|
|
@ -467,12 +468,12 @@
|
|||
android:id="@+id/clExit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/clSetting">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
|
|
@ -485,7 +486,9 @@
|
|||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_eemp" />
|
||||
app:srcCompat="@drawable/ic_exit"
|
||||
android:tint="#FF6863"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvExit"
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@
|
|||
<string name="vertify_failed">验证失败,还剩%d次机会</string>
|
||||
<string name="aggregatePayment">聚合支付(推荐)</string>
|
||||
<string name="quickPayment">快捷支付</string>
|
||||
<string name="firstEntry">免费时长已赠送,如果出现初始化,请等待一分钟后关闭app重新打开.</string>
|
||||
<string name="firstEntry">如果出现初始化,请等待一分钟后关闭app重新打开.</string>
|
||||
<string name="determine">确定</string>
|
||||
<string name="reminder">温馨提示</string>
|
||||
<string name="UploadErrorLog">上传错误日志</string>
|
||||
|
|
@ -381,7 +381,7 @@
|
|||
<string name="latestVersion">已经是最新版本</string>
|
||||
|
||||
|
||||
<string name="ConnectImmediately">马上连加速器app</string>
|
||||
<string name="ConnectImmediately">宙连加速器app</string>
|
||||
<string name="Renewal">续费</string>
|
||||
<string name="MembershipExpiration">会员已到期</string>
|
||||
<string name="OpenConnection">开启连接</string>
|
||||
|
|
@ -401,7 +401,7 @@
|
|||
|
||||
<string name="ServiceDescription">服务说明</string>
|
||||
<string name="ServiceDescriptionOne">1:点击购买表示您已同意</string>
|
||||
<string name="ServiceDescriptionTwo">2:马上连仅支持境内能访问的境外网络加速</string>
|
||||
<string name="ServiceDescriptionTwo">2:宙连仅支持境内能访问的境外网络加速</string>
|
||||
<string name="BuyItNow">立即购买</string>
|
||||
<string name="Switching">切换中,请稍后</string>
|
||||
<string name="DeleteStr">删除账号</string>
|
||||
|
|
@ -413,4 +413,5 @@
|
|||
<string name="tooFast">应用初始化中,请等待1~2秒后重试</string>
|
||||
<string name="Starting">启动中</string>
|
||||
<string name="WFApiPort">网飞666</string>
|
||||
<string name="zlApiPort">宇连366</string>
|
||||
</resources>
|
||||
|
|
@ -71,8 +71,8 @@ subprojects {
|
|||
minSdk = 21
|
||||
//noinspection ExpiredTargetSdkVersion
|
||||
targetSdk = 34
|
||||
versionName = "1.0.3.9"
|
||||
versionCode = 1039
|
||||
versionName = "1.0.4.8"
|
||||
versionCode = 1048
|
||||
resValue("string", "release_name", "v$versionName")
|
||||
resValue("integer", "release_code", "$versionCode")
|
||||
externalNativeBuild {
|
||||
|
|
@ -100,7 +100,7 @@ subprojects {
|
|||
}
|
||||
productFlavors {
|
||||
flavorDimensions("feature")
|
||||
create("1001") {
|
||||
create("1002") {
|
||||
isDefault = true
|
||||
dimension = flavorDimensionList[0]
|
||||
buildConfigField("boolean", "PREMIUM", "Boolean.parseBoolean(\"false\")")
|
||||
|
|
@ -111,7 +111,7 @@ subprojects {
|
|||
buildConfigField("String", "applicationId", "\"com.yingmao.clash\"")
|
||||
buildConfigField("String", "service_url", "\"https://api.readzhe.top\"")
|
||||
buildConfigField("boolean", "is_free", "false")
|
||||
buildConfigField("String", "productId", "\"1001\"")
|
||||
buildConfigField("String", "productId", "\"1002\"")
|
||||
manifestPlaceholders(
|
||||
mapOf(
|
||||
"APP_NAME" to "@string/zl",
|
||||
|
|
@ -121,7 +121,7 @@ subprojects {
|
|||
}
|
||||
}
|
||||
sourceSets {
|
||||
getByName("1001") {
|
||||
getByName("1002") {
|
||||
java.srcDirs("src/foss/java")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
keystore.path=/Users/pc/open_v/v_clash_android/octopus_clash.jks
|
||||
keystore.password=123456
|
||||
key.alias=key0
|
||||
key.password=123456
|
||||
Loading…
Reference in New Issue