mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-02 17:07:41 +08:00
修复:不能退出纯客户端模式
This commit is contained in:
parent
5f55d20c83
commit
5387202e36
@ -38,7 +38,6 @@ import com.xuexiang.xui.widget.dialog.materialdialog.MaterialDialog
|
||||
import com.xuexiang.xutil.XUtil
|
||||
import com.xuexiang.xutil.data.ConvertTools
|
||||
|
||||
|
||||
@Suppress("PrivatePropertyName", "PropertyName")
|
||||
@Page(name = "主动控制·客户端")
|
||||
class ClientFragment : BaseFragment<FragmentClientBinding?>(), View.OnClickListener, RecyclerViewHolder.OnItemClickListener<PageInfo> {
|
||||
@ -88,7 +87,12 @@ class ClientFragment : BaseFragment<FragmentClientBinding?>(), View.OnClickListe
|
||||
override fun performAction(view: View) {
|
||||
XToastUtils.success(getString(R.string.exit_pure_client_mode))
|
||||
SettingUtils.enablePureClientMode = false
|
||||
XUtil.exitApp()
|
||||
try {
|
||||
Thread.sleep(500) //延迟500毫秒,避免退出时enablePureClientMode还没保存
|
||||
XUtil.exitApp()
|
||||
} catch (e: InterruptedException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@ -290,9 +294,7 @@ class ClientFragment : BaseFragment<FragmentClientBinding?>(), View.OnClickListe
|
||||
var requestMsg: String = Gson().toJson(msgMap)
|
||||
Log.i(TAG, "requestMsg:$requestMsg")
|
||||
|
||||
val postRequest = XHttp.post(requestUrl)
|
||||
.keepJson(true)
|
||||
.timeOut((SettingUtils.requestTimeout * 1000).toLong()) //超时时间10s
|
||||
val postRequest = XHttp.post(requestUrl).keepJson(true).timeOut((SettingUtils.requestTimeout * 1000).toLong()) //超时时间10s
|
||||
.cacheMode(CacheMode.NO_CACHE).timeStamp(true)
|
||||
|
||||
when (HttpServerUtils.clientSafetyMeasures) {
|
||||
|
@ -25,7 +25,7 @@ class HttpServerUtils private constructor() {
|
||||
companion object {
|
||||
|
||||
//是否启用HttpServer开机自启
|
||||
var enableServerAutorun: Boolean by SharedPreference(SP_ENABLE_SERVER_AUTORUN, true)
|
||||
var enableServerAutorun: Boolean by SharedPreference(SP_ENABLE_SERVER_AUTORUN, false)
|
||||
|
||||
//服务端签名密钥
|
||||
var serverSignKey: String by SharedPreference(SP_SERVER_SIGN_KEY, "")
|
||||
@ -49,7 +49,7 @@ class HttpServerUtils private constructor() {
|
||||
var serverWebPath: String by SharedPreference(SP_SERVER_WEB_PATH, "")
|
||||
|
||||
//服务地址
|
||||
var serverAddress: String by SharedPreference(SP_SERVER_ADDRESS, "")
|
||||
var serverAddress: String by SharedPreference(SP_SERVER_ADDRESS, "http://127.0.0.1:5000")
|
||||
|
||||
//服务地址历史记录
|
||||
var serverHistory: String by SharedPreference(SP_SERVER_HISTORY, "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user