From 710c5ca67b1c2e658ec5495c01136540fcfd21c3 Mon Sep 17 00:00:00 2001
From: lmw <125975490@qq.com>
Date: 星期五, 21 四月 2023 10:07:22 +0800
Subject: [PATCH] 登录添加用户协议

---
 app/src/main/java/com/fuban/driver/base/MyApplication.kt |   56 +-------------------------------------------------------
 1 files changed, 1 insertions(+), 55 deletions(-)

diff --git a/app/src/main/java/com/fuban/driver/base/MyApplication.kt b/app/src/main/java/com/fuban/driver/base/MyApplication.kt
index 396e58a..83b5079 100644
--- a/app/src/main/java/com/fuban/driver/base/MyApplication.kt
+++ b/app/src/main/java/com/fuban/driver/base/MyApplication.kt
@@ -6,8 +6,6 @@
 import android.os.*
 import android.util.Log
 import androidx.annotation.RequiresApi
-import cn.jpush.android.api.JPushInterface
-import cn.jpush.android.api.TagAliasCallback
 import cn.sinata.rxnetty.NettyClient
 import cn.sinata.xldutils.BaseApplication
 import cn.sinata.xldutils.utils.sysErr
@@ -33,7 +31,6 @@
 import com.fuban.driver.utils.Cache.CacheUtil
 import com.fuban.driver.utils.LogUtils
 import com.google.gson.Gson
-import com.tencent.bugly.crashreport.CrashReport
 import com.umeng.commonsdk.UMConfigure
 import com.umeng.socialize.PlatformConfig
 import com.xuexiang.xui.XUI
@@ -88,62 +85,11 @@
         )
         PlatformConfig.setWeixin("wx19a713b4943f9568", "5d4ca951a855b1e2c86a844cd42fd133")
         PlatformConfig.setQQZone("1112151767", "5viZ7mQkNkYtUr7b") //qq互联
-        JPushInterface.setDebugMode(true)
-        JPushInterface.init(this)
-        setAlisa()
     }
 
-    public fun setAlisa() {
-        if (CacheKey.getUserId().isNotEmpty()) {
-            var alisa = "DRIVER" + CacheKey.getUserId()
-            sysErr(alisa)
-            mHandler.sendMessage(mHandler.obtainMessage(MSG_SET_ALIAS, alisa))
-        }
-    }
 
-    private val MSG_SET_ALIAS = 1001
-    private val mHandler: Handler = object : Handler() {
-        override fun handleMessage(msg: Message) {
-            super.handleMessage(msg)
-            when (msg.what) {
-                MSG_SET_ALIAS -> {
-                    Log.d(TAG, "Set alias in handler.")
-                    // 调用 JPush 接口来设置别名。
-                    JPushInterface.setAliasAndTags(
-                        applicationContext,
-                        msg.obj as String,
-                        null,
-                        mAliasCallback
-                    )
-                }
-                else -> Log.i(TAG, "Unhandled msg - " + msg.what)
-            }
-        }
-    }
 
-    private val mAliasCallback =
-        TagAliasCallback { code, alias, tags ->
-            val logs: String
-            when (code) {
-                0 -> {
-                    logs = "Set tag and alias success"
-                    Log.i("TAG", logs)
-                }
-                6002 -> {
-                    logs = "Failed to set alias and tags due to timeout. Try again after 60s."
-                    Log.i("TAG", logs)
-                    // 延迟 60 秒来调用 Handler 设置别名
-                    var alisa = "DRIVER" + CacheKey.getUserId()
-                    Handler().postDelayed({
-                        JPushInterface.setAliasAndTags(this, alisa, null, null)
-                    }, 60 * 1000)
-                }
-                else -> {
-                    logs = "Failed with errorCode = $code"
-                    Log.e("TAG", logs)
-                }
-            }
-        }
+
 
     private fun initSocket() {
         NettyClient.getInstance().init(this, Api.SOCKET_SERVER, Api.SOCKET_PORT, true)

--
Gitblit v1.7.1