Commit 7740bd9e authored by liusheng's avatar liusheng

修复了未加速状态下,丢包率为100%的显示问题

parent 8286a5df
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
<package android:name="io.kkzs" /> <package android:name="io.kkzs" />
<package android:name="com.eg.android.AlipayGphone" /> <package android:name="com.eg.android.AlipayGphone" />
<package android:name="com.pearlabyss.blackdesertm"/> <package android:name="com.pearlabyss.blackdesertm"/>
<package android:name="com.wemade.mir4global"/>
</queries> </queries>
<application <application
......
...@@ -62,8 +62,8 @@ class AccelertorFragment : XPageFragment() { ...@@ -62,8 +62,8 @@ class AccelertorFragment : XPageFragment() {
binding.preDelay2Unit.visibility = View.VISIBLE binding.preDelay2Unit.visibility = View.VISIBLE
} else { //无网络 } else { //无网络
binding.preDelay1.setText("--") binding.preDelay1.setText("__")
binding.preDelay2.setText("--") binding.preDelay2.setText("__")
binding.preDelay1Unit.visibility = View.GONE binding.preDelay1Unit.visibility = View.GONE
binding.preDelay2Unit.visibility = View.GONE binding.preDelay2Unit.visibility = View.GONE
} }
...@@ -80,7 +80,7 @@ class AccelertorFragment : XPageFragment() { ...@@ -80,7 +80,7 @@ class AccelertorFragment : XPageFragment() {
binding.netDelay2Unit.visibility = View.GONE binding.netDelay2Unit.visibility = View.GONE
} }
if (!it.lossRate.isEmpty()) { if (!it.lossRate.isEmpty()&&state == BaseService.State.Connected) {
binding.netLost1.setText(it.lossRate) binding.netLost1.setText(it.lossRate)
binding.netLost2.setText(it.lossRate) binding.netLost2.setText(it.lossRate)
binding.netLost1Unit.visibility = View.VISIBLE binding.netLost1Unit.visibility = View.VISIBLE
......
...@@ -213,7 +213,6 @@ object AcceleratorUtils { ...@@ -213,7 +213,6 @@ object AcceleratorUtils {
private val shadowsocksConnection = object : ShadowsocksConnection.Callback { private val shadowsocksConnection = object : ShadowsocksConnection.Callback {
override fun stateChanged(state: BaseService.State, profileName: String?, msg: String?) { override fun stateChanged(state: BaseService.State, profileName: String?, msg: String?) {
AcceleratorUtils.state = state AcceleratorUtils.state = state
Log.e("stateChanged","====="+state.toString())
stateListener(state, getAccTime(), null) stateListener(state, getAccTime(), null)
if (state == BaseService.State.Stopped && !msg.isNullOrBlank()) { if (state == BaseService.State.Stopped && !msg.isNullOrBlank()) {
if("vip到期".equals(msg)||(msg!=null&&msg.startsWith("vip已到期"))){ if("vip到期".equals(msg)||(msg!=null&&msg.startsWith("vip已到期"))){
......
...@@ -160,11 +160,11 @@ object PhoneUtils { ...@@ -160,11 +160,11 @@ object PhoneUtils {
) )
.setAppPrivacyOne( .setAppPrivacyOne(
"《用户协议》", "《用户协议》",
HttpConfig.url_user_agreement HttpConfig.url_user_agreement_no_title
) )
.setAppPrivacyTwo( .setAppPrivacyTwo(
"《隐私政策》", "《隐私政策》",
HttpConfig.url_privacy_policy HttpConfig.url_privacy_policy_no_title
) //设置隐私条款2名称和URL(名称,url) ) //设置隐私条款2名称和URL(名称,url)
//设置协议外部文字描述 //设置协议外部文字描述
.setPrivacyText("你已阅读并同意", "、", "和", "", "") .setPrivacyText("你已阅读并同意", "、", "和", "", "")
......
...@@ -53,14 +53,12 @@ object HttpGo { ...@@ -53,14 +53,12 @@ object HttpGo {
LoginUtils.token?.let { LoginUtils.token?.let {
request.addHeader("Authorization", it) request.addHeader("Authorization", it)
} }
Timber.i("======getSync.token:"+LoginUtils.token)
Timber.i("%s%s", url, request.toString()) Timber.i("%s%s", url, request.toString())
val call = okHttpClient.newCall(request.build()) val call = okHttpClient.newCall(request.build())
val response: Response = call.execute() val response: Response = call.execute()
if (response.isSuccessful) { if (response.isSuccessful) {
val type = object : TypeToken<BaseModel<T>>() {}.type val type = object : TypeToken<BaseModel<T>>() {}.type
val string = response.body?.string() val string = response.body?.string()
Timber.i("========%s%s", url, string.toString())
val result : BaseModel<T>? = gson.fromJson(string, type) val result : BaseModel<T>? = gson.fromJson(string, type)
return result return result
} else if (response.code == 401){ } else if (response.code == 401){
...@@ -92,13 +90,12 @@ object HttpGo { ...@@ -92,13 +90,12 @@ object HttpGo {
LoginUtils.token?.let { LoginUtils.token?.let {
request.addHeader("Authorization", it) request.addHeader("Authorization", it)
} }
Timber.i("======postSync.token:"+LoginUtils.token)
Timber.i(request.toString()) Timber.i(request.toString())
val call = okHttpClient.newCall(request.build()) val call = okHttpClient.newCall(request.build())
val response: Response = call.execute() val response: Response = call.execute()
if (response.isSuccessful) { if (response.isSuccessful) {
val string = response.body?.string() val string = response.body?.string()
Timber.i("======postSync:"+string.toString()) Timber.i("postSync:"+string.toString())
val type = object : TypeToken<BaseModel<T>>() {}.type val type = object : TypeToken<BaseModel<T>>() {}.type
val result : BaseModel<T>? = gson.fromJson(string, type) val result : BaseModel<T>? = gson.fromJson(string, type)
result?.let { result?.let {
......
...@@ -818,7 +818,7 @@ ...@@ -818,7 +818,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:text="0" android:text="__"
android:textColor="#FFFFFFFF" android:textColor="#FFFFFFFF"
android:textSize="16sp" /> android:textSize="16sp" />
......
...@@ -161,16 +161,12 @@ object AuthManager { ...@@ -161,16 +161,12 @@ object AuthManager {
token?.let { token?.let {
request.addHeader("Authorization", it) request.addHeader("Authorization", it)
} }
Log.e("postSync","===authToken:"+authToken)
Log.e("postSync","===loginAuthToken:"+loginAuthToken)
val call = okHttpClient.newCall(request.build()) val call = okHttpClient.newCall(request.build())
val resultType = object : TypeToken<ApiResult<T>>() {}.type val resultType = object : TypeToken<ApiResult<T>>() {}.type
try { try {
call.execute().use { response -> call.execute().use { response ->
val string = response.body?.string() val string = response.body?.string()
println(string) println(string)
Log.e("postSync","===url:"+HttpConfig.baseUrl + url)
Log.e("postSync","===result:"+string)
return gson.fromJson(string, resultType) return gson.fromJson(string, resultType)
} }
} catch (e: IOException) { } catch (e: IOException) {
......
...@@ -24,6 +24,11 @@ object HttpConfig { ...@@ -24,6 +24,11 @@ object HttpConfig {
//隐私政策 //隐私政策
val url_privacy_policy="https://sdk-static.srccwl.com/tt_html/private.html" val url_privacy_policy="https://sdk-static.srccwl.com/tt_html/private.html"
//用户协议
val url_user_agreement_no_title="https://sdk-static.srccwl.com/tt_html_n/service.html"
//隐私政策
val url_privacy_policy_no_title="https://sdk-static.srccwl.com/tt_html_n/private.html"
val UI_MESSAGE_URL = "/message" val UI_MESSAGE_URL = "/message"
val UI_GAME_URL = "/game" val UI_GAME_URL = "/game"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment