Procházet zdrojové kódy

v1.0.0开发:打点问题修复

#Suyghur před 2 roky
rodič
revize
5623742954
47 změnil soubory, kde provedl 394 přidání a 215 odebrání
  1. 2 2
      channel_registry/channel_huawei2/build.gradle
  2. 1 1
      channel_registry/channel_huawei2/publish.gradle
  3. 3 2
      channel_registry/channel_huawei2/src/main/AndroidManifest.xml
  4. 2 0
      channel_registry/channel_huawei2/src/main/res/layout/yyxx_dialog_hw_link.xml
  5. 1 0
      channel_registry/channel_huawei2/src/main/res/values/strings.xml
  6. 1 1
      channel_registry/channel_oppo/publish.gradle
  7. binární
      demo/libs/library_comm-release.aar
  8. 4 0
      demo/src/main/AndroidManifest.xml
  9. 7 7
      demo/src/main/kotlin/com/eyuancomm/demo/CacheRoleInfo.kt
  10. 4 3
      library_comm/build.gradle
  11. 1 0
      library_comm/proguard-rules.pro
  12. 1 1
      library_comm/publish.gradle
  13. 1 1
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/Version.kt
  14. 5 6
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/EYuanCommInstaller.kt
  15. 16 2
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/entity/SdkLoginInfo.kt
  16. 5 4
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/entity/SdkRoleInfo.kt
  17. 16 3
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/impl/CommSdkDrive.kt
  18. 33 80
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/impl/CommSdkImpl.kt
  19. 14 2
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/network/SdkRequest.kt
  20. 3 3
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/network/VolleyRequest.kt
  21. 6 1
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/trace/TraceEventManager.kt
  22. 7 7
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/trace/channel/AdjustEventImpl.kt
  23. 7 7
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/trace/channel/FacebookEventImpl.kt
  24. 7 8
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/trace/channel/FirebaseEventImpl.kt
  25. 127 0
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/trace/channel/HiAnalyticsEventImpl.kt
  26. 1 1
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/utils/Logger.kt
  27. 15 2
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/utils/MMKVManager.kt
  28. 13 0
      library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/utils/ParamsUtils.kt
  29. 1 1
      library_impl/publish.gradle
  30. 1 1
      library_impl/src/main/java/cn/yyxx/eyuancomm/impl/channel/eyuangame/ChannelSdkEYuanGame.kt
  31. 9 4
      library_impl/src/main/java/cn/yyxx/eyuancomm/impl/channel/huawei/ChannelSdkHuawei.kt
  32. 15 0
      library_impl/src/main/java/cn/yyxx/eyuancomm/impl/channel/huawei/HuaweiLinkDialog.kt
  33. 1 1
      library_impl/src/main/java/cn/yyxx/eyuancomm/impl/channel/huawei/floatview/FloatCenterServiceManager.kt
  34. 1 1
      module_eyuan/library_eyuan/publish.gradle
  35. 4 4
      module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/EYuanGameSdk.kt
  36. 3 3
      module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/BindAccountContainer.kt
  37. 8 8
      module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/BindEmailContainer.kt
  38. 7 7
      module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/BindPhoneContainer.kt
  39. 10 10
      module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/HybridFeatureContainer.kt
  40. 5 5
      module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/MemberCenterContainer.kt
  41. 1 1
      module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/ModifyPwdContainer.kt
  42. 1 1
      module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/floatball/FloatCenterServiceManager.kt
  43. 18 18
      module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/login/UserSignInImpl.kt
  44. 1 1
      module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/network/SdkRequest.kt
  45. 3 3
      module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/utils/SessionUtils.kt
  46. 1 1
      module_eyuan/library_hk_language/publish.gradle
  47. 1 1
      module_eyuan/library_vn_language/publish.gradle

+ 2 - 2
channel_registry/channel_huawei2/build.gradle

@@ -45,7 +45,7 @@ dependencies {
     api 'com.huawei.hms:iap:6.3.0.300'
     api 'com.huawei.hms:game:6.2.0.300'
 
-    api 'com.huawei.hms:hianalytics:6.4.0.300'
+    api 'com.huawei.hms:hianalytics:6.5.0.300'
     api 'com.huawei.agconnect:agconnect-crash:1.6.4.300'
 
     api "com.huawei.agconnect:agconnect-auth:1.6.4.300"
@@ -54,7 +54,7 @@ dependencies {
     api "com.huawei.agconnect:agconnect-auth-google:1.6.4.300"
     api 'com.huawei.hms:hwid:6.4.0.300'
     api 'com.facebook.android:facebook-login:13.1.0'
-    api 'com.google.android.gms:play-services-auth:20.1.0'
+    api 'com.google.android.gms:play-services-auth:20.2.0'
 }
 
 apply from: 'publish.gradle'

+ 1 - 1
channel_registry/channel_huawei2/publish.gradle

@@ -4,7 +4,7 @@ apply plugin: 'signing'
 ext {
     PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
     PUBLISH_ARTIFACT_ID = 'eyuancomm-channel-lib-huawei'
-    PUBLISH_VERSION = '1.0.0-rc8'
+    PUBLISH_VERSION = '1.0.0-rc11'
 }
 
 Properties properties = new Properties()

+ 3 - 2
channel_registry/channel_huawei2/src/main/AndroidManifest.xml

@@ -16,8 +16,6 @@
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
 
-    <!--    &lt;!&ndash;    <uses-sdk tools:overrideLibrary="com.huawei.agconnect.credential,com.huawei.agconnect.core,com.huawei.agconnect.https,com.huawei.agconnect.datastore" />&ndash;&gt;-->
-
     <queries>
         <intent>
             <action android:name="com.apptouch.intent.action.update_hms" />
@@ -291,6 +289,9 @@
         <meta-data
             android:name="com.facebook.sdk.ApplicationId"
             android:value="@string/facebook_app_id" />
+        <meta-data
+            android:name="com.facebook.sdk.ClientToken"
+            android:value="@string/facebook_client_token" />
 
         <activity
             android:name="com.facebook.FacebookActivity"

+ 2 - 0
channel_registry/channel_huawei2/src/main/res/layout/yyxx_dialog_hw_link.xml

@@ -15,6 +15,7 @@
         android:layout_marginTop="10dp">
 
         <TextView
+            android:id="@+id/yyxx_link_tv_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center"
@@ -60,6 +61,7 @@
     </LinearLayout>
 
     <TextView
+        android:id="@+id/yyxx_link_tv_tips"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center_horizontal"

+ 1 - 0
channel_registry/channel_huawei2/src/main/res/values/strings.xml

@@ -2,4 +2,5 @@
 <resources>
     <string name="facebook_app_id" translatable="false" />
     <string name="fb_login_protocol_scheme" translatable="false" />
+    <string name="facebook_client_token" translatable="false" />
 </resources>

+ 1 - 1
channel_registry/channel_oppo/publish.gradle

@@ -4,7 +4,7 @@ apply plugin: 'signing'
 ext {
     PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
     PUBLISH_ARTIFACT_ID = 'eyuancomm-channel-lib-oppo'
-    PUBLISH_VERSION = '1.0.0-rc8'
+    PUBLISH_VERSION = '1.0.0-rc10'
 }
 
 Properties properties = new Properties()

binární
demo/libs/library_comm-release.aar


+ 4 - 0
demo/src/main/AndroidManifest.xml

@@ -2,6 +2,10 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.eyuancomm.demo">
 
+    <queries>
+        <provider android:authorities="com.facebook.katana.provider.PlatformProvider" />
+    </queries>
+
     <application
         android:name=".DemoApplication"
         android:allowBackup="true"

+ 7 - 7
demo/src/main/kotlin/com/eyuancomm/demo/CacheRoleInfo.kt

@@ -13,7 +13,7 @@ class CacheRoleInfo {
 
     data class RoleInfo(
         var roleId: String = "", var roleName: String = "", var roleLevel: String = "",
-        var rolePower: Int = 0, var roleGold: Int = 0, var roleChange: Int = 0,
+        var rolePower: String = "", var roleGold: String = "", var roleChange: String = "",
         var serverCode: String = "", var serverName: String = "", var vipLevel: String = "",
         var partyId: String = "", var partyName: String = "", var roleCTime: Long = 0
     ) {
@@ -48,9 +48,9 @@ class CacheRoleInfo {
                 roleId = "aaa$ts",
                 roleName = "角色名123",
                 roleLevel = "110",
-                rolePower = 100,
-                roleGold = 100,
-                roleChange = 100,
+                rolePower = "100",
+                roleGold = "100",
+                roleChange = "100",
                 serverCode = "333",
                 serverName = "服务器名333",
                 vipLevel = "1",
@@ -85,9 +85,9 @@ class CacheRoleInfo {
                         partyId = jsonObject.getString("party_id"),
                         partyName = jsonObject.getString("party_name"),
                         roleCTime = jsonObject.getLong("role_ctime"),
-                        rolePower = jsonObject.getInt("role_power"),
-                        roleGold = jsonObject.getInt("role_gold"),
-                        roleChange = jsonObject.getInt("role_change")
+                        rolePower = jsonObject.getString("role_power"),
+                        roleGold = jsonObject.getString("role_gold"),
+                        roleChange = jsonObject.getString("role_change")
                     )
                 }
 

+ 4 - 3
library_comm/build.gradle

@@ -61,16 +61,17 @@ android {
 dependencies {
     implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
     implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
-    implementation "androidx.core:core-ktx:1.7.0"
+    implementation "androidx.core:core-ktx:1.8.0"
     implementation 'com.android.installreferrer:installreferrer:2.2'
     // 日志采集框架
     api 'io.github.suyghur.dolin:zap:1.0.0'
-    //mmkv
+    // mmkv
     api 'com.tencent:mmkv-static:1.2.10'
 
     implementation 'com.adjust.sdk:adjust-android:4.28.2'
-    compileOnly 'com.google.firebase:firebase-analytics-ktx:20.1.2'
+    compileOnly 'com.google.firebase:firebase-analytics-ktx:21.0.0'
     compileOnly 'com.facebook.android:facebook-core:13.1.0'
+    compileOnly 'com.huawei.hms:hianalytics:6.5.0.300'
 
     api files("../libs/yyxx_support_1.0.2.jar")
     api files("../libs/oaid_sdk_1.0.25.jar")

+ 1 - 0
library_comm/proguard-rules.pro

@@ -157,6 +157,7 @@
 -keep class cn.yyxx.eyuancomm.comm.network.SdkRequest{public <fields>; public<methods>;}
 -keep class cn.yyxx.eyuancomm.comm.network.VolleyRequest{public <fields>; public<methods>;}
 -keep class cn.yyxx.eyuancomm.comm.internal.**{public <fields>; public <methods>;}
+-keep class cn.yyxx.eyuancomm.comm.impl.CommSdkDrive$Companion{public <fields>; public<methods>;}
 -keep class cn.yyxx.eyuancomm.comm.impl.CommSdkDrive{public <fields>; public <methods>;}
 -keep class cn.yyxx.eyuancomm.comm.ext.**{public <fields>; public <methods>;}
 -keep class cn.yyxx.eyuancomm.comm.utils.**{public <fields>; public <methods>;}

+ 1 - 1
library_comm/publish.gradle

@@ -4,7 +4,7 @@ apply plugin: 'signing'
 ext {
     PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
     PUBLISH_ARTIFACT_ID = 'eyuancomm-sdk-ktx-comm'
-    PUBLISH_VERSION = '1.0.0-rc8'
+    PUBLISH_VERSION = '1.0.0-rc10'
 }
 
 Properties properties = new Properties()

+ 1 - 1
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/Version.kt

@@ -5,7 +5,7 @@ package cn.yyxx.eyuancomm
  * Created on 2021/06/09
  */
 object Version {
-    const val VERSION_NAME = "1.0.0-rc8"
+    const val VERSION_NAME = "1.0.0-rc10"
     const val VERSION_CODE = 100
     const val SERVER_VERSION = "1.0.0"
 }

+ 5 - 6
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/EYuanCommInstaller.kt

@@ -7,7 +7,6 @@ import android.database.Cursor
 import android.net.Uri
 import cn.yyxx.eyuancomm.comm.impl.CommSdkDrive
 import cn.yyxx.eyuancomm.comm.network.Host
-import cn.yyxx.eyuancomm.comm.trace.TraceEventManager
 import cn.yyxx.eyuancomm.comm.utils.Logger
 import cn.yyxx.eyuancomm.comm.utils.MMKVManager
 import cn.yyxx.support.device.DeviceInfoUtils
@@ -27,9 +26,9 @@ internal class EYuanCommInstaller : ContentProvider() {
     override fun onCreate(): Boolean {
         val application = context!!.applicationContext as Application
         Logger.initZap(application)
-        CommSdkDrive.instance.initSdkDrive(application)
+        CommSdkDrive.getInstance().initSdkDrive(application)
         initGaid(application)
-        MMKVManager.instance.init(application)
+        MMKVManager.getInstance().init(application)
         Host.initHostModel(application)
         return true
     }
@@ -42,7 +41,7 @@ internal class EYuanCommInstaller : ContentProvider() {
                     initOaid(application)
                 } else {
                     Logger.i("谷歌框架可以访问,请求gaid")
-                    CommSdkDrive.instance.setCommParam("device_id", GAIDUtils.getGoogleAdid())
+                    CommSdkDrive.getInstance().setCommParam("device_id", GAIDUtils.getGoogleAdid())
                     hasReadDeviceId = true
                 }
             } else {
@@ -56,10 +55,10 @@ internal class EYuanCommInstaller : ContentProvider() {
         MsaDeviceIdsHandler.initMsaDeviceIds(application) { code, msg, _ ->
             if (code == 0) {
                 Logger.e("获取oaid成功,使用oaid替代")
-                CommSdkDrive.instance.setCommParam("device_id", MsaDeviceIdsHandler.oaid)
+                CommSdkDrive.getInstance().setCommParam("device_id", MsaDeviceIdsHandler.oaid)
             } else {
                 Logger.d("获取oaid失败,msg: $msg,使用android id替代")
-                CommSdkDrive.instance.setCommParam("device_id", DeviceInfoUtils.getAndroidDeviceId(application))
+                CommSdkDrive.getInstance().setCommParam("device_id", DeviceInfoUtils.getAndroidDeviceId(application))
             }
             hasReadDeviceId = true
         }

+ 16 - 2
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/entity/SdkLoginInfo.kt

@@ -1,5 +1,6 @@
 package cn.yyxx.eyuancomm.comm.entity
 
+import cn.yyxx.eyuancomm.comm.EYuanCommSdk
 import org.json.JSONException
 import org.json.JSONObject
 
@@ -10,8 +11,21 @@ import org.json.JSONObject
 class SdkLoginInfo private constructor() {
 
     companion object {
-        val instance: SdkLoginInfo by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
-            SdkLoginInfo()
+
+        @JvmStatic
+        fun getInstance(): SdkLoginInfo {
+            return SdkLoginInfoHolder.INSTANCE
+        }
+
+        private object SdkLoginInfoHolder {
+            val INSTANCE: SdkLoginInfo = SdkLoginInfo()
+        }
+
+        /**
+         * 防止单例对象在反序列化时重新生成对象
+         */
+        private fun readResolve(): Any {
+            return SdkLoginInfoHolder.INSTANCE
         }
     }
 

+ 5 - 4
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/entity/SdkRoleInfo.kt

@@ -11,16 +11,17 @@ class SdkRoleInfo {
     var roleName: String = ""
     var roleLevel: String = ""
     var roleCTime: Long = 0
-    var rolePower: Int = 0
-    var roleGold: Int = 0
-    var roleChange: Int = 0
+    var rolePower: String = ""
+    var roleGold: String = ""
+    var roleChange: String = ""
     var partyId: String = ""
     var partyName: String = ""
     var serverId: String = ""
     var serverName: String = ""
     var vipLevel: String = ""
 
+
     override fun toString(): String {
-        return "SdkRoleInfo(userId='$userId', roleId='$roleId', roleName='$roleName', roleLevel='$roleLevel', roleCTime=$roleCTime, rolePower=$rolePower, roleGold=$roleGold, roleChange=$roleChange, partyId='$partyId', partyName='$partyName', serverId='$serverId', serverName='$serverName', vipLevel='$vipLevel')"
+        return "SdkRoleInfo(userId='$userId', roleId='$roleId', roleName='$roleName', roleLevel='$roleLevel', roleCTime=$roleCTime, rolePower='$rolePower', roleGold='$roleGold', roleChange='$roleChange', partyId='$partyId', partyName='$partyName', serverId='$serverId', serverName='$serverName', vipLevel='$vipLevel')"
     }
 }

+ 16 - 3
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/impl/CommSdkDrive.kt

@@ -1,16 +1,29 @@
 package cn.yyxx.eyuancomm.comm.impl
 
 import android.content.Context
+import cn.yyxx.eyuancomm.comm.entity.SdkLoginInfo
 
 /**
  * @author #Suyghur.
  * Created on 2021/06/09
  */
-class CommSdkDrive {
+class CommSdkDrive private constructor() {
 
     companion object {
-        val instance: CommSdkDrive by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
-            CommSdkDrive()
+        @JvmStatic
+        fun getInstance(): CommSdkDrive {
+            return CommSdkDriveHolder.INSTANCE
+        }
+
+        private object CommSdkDriveHolder {
+            val INSTANCE: CommSdkDrive = CommSdkDrive()
+        }
+
+        /**
+         * 防止单例对象在反序列化时重新生成对象
+         */
+        private fun readResolve(): Any {
+            return CommSdkDriveHolder.INSTANCE
         }
     }
 

+ 33 - 80
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/impl/CommSdkImpl.kt

@@ -78,8 +78,8 @@ internal class CommSdkImpl(context: Context) {
         }
         TraceEventManager.instance.initialize(application) { id ->
             Logger.d("onTraceIdRead: $id")
-            CommSdkDrive.instance.setCommParam("aid", id)
-            MMKVManager.instance.eventKV.encode("adjust_id", id)
+            CommSdkDrive.getInstance().setCommParam("aid", id)
+            MMKVManager.getInstance().eventKV.encode("adjust_id", id)
         }
         SdkProxyManager.call(Function.INIT_APPLICATION, arrayOf(Application::class.java), arrayOf(application))
     }
@@ -111,13 +111,13 @@ internal class CommSdkImpl(context: Context) {
         }
 
         //获取当前屏幕尺寸
-        CommSdkDrive.instance.setCommParam("screen", DensityUtils.getResolutionByFullScreen(activity))
+        CommSdkDrive.getInstance().setCommParam("screen", DensityUtils.getResolutionByFullScreen(activity))
 
-        val adjustId = MMKVManager.instance.eventKV.decodeString("adjust_id")
+        val adjustId = MMKVManager.getInstance().eventKV.decodeString("adjust_id")
         if (TextUtils.isEmpty(adjustId)) {
-            CommSdkDrive.instance.setCommParam("aid", "")
+            CommSdkDrive.getInstance().setCommParam("aid", "")
         } else {
-            CommSdkDrive.instance.setCommParam("aid", adjustId!!)
+            CommSdkDrive.getInstance().setCommParam("aid", adjustId!!)
         }
 
         // 有些CP在资源再加时候回重复调用初始化,这里拦截一下
@@ -172,7 +172,7 @@ internal class CommSdkImpl(context: Context) {
     }
 
     private fun startInitCommSdk(activity: Activity, callback: ICallback) {
-        SdkRequest.instance.initSdk(activity, "") { resultInfo ->
+        SdkRequest.getInstance().initSdk(activity, "") { resultInfo ->
             initLoadingDialog?.apply {
                 dismiss()
                 initLoadingDialog = null
@@ -220,20 +220,20 @@ internal class CommSdkImpl(context: Context) {
         val channelCallback = object : ICallback {
             override fun onResult(code: Int, result: String) {
                 if (code == 0) {
-                    SdkRequest.instance.userVerify(activity, result) { resultInfo ->
+                    SdkRequest.getInstance().userVerify(activity, result) { resultInfo ->
                         if (resultInfo.code == 1) {
                             if (!TextUtils.isEmpty(resultInfo.data)) {
                                 val jsonObject = JSONObject(resultInfo.data)
-                                SdkLoginInfo.instance.userId = jsonObject.getString("uid")
-                                SdkLoginInfo.instance.token = jsonObject.getString("token")
-                                SdkLoginInfo.instance.isRegUser = jsonObject.getInt("is_reg_user") == 1
-                                if (SdkLoginInfo.instance.isRegUser) {
+                                SdkLoginInfo.getInstance().userId = jsonObject.getString("uid")
+                                SdkLoginInfo.getInstance().token = jsonObject.getString("token")
+                                SdkLoginInfo.getInstance().isRegUser = jsonObject.getInt("is_reg_user") == 1
+                                if (SdkLoginInfo.getInstance().isRegUser) {
                                     TraceEventManager.instance.register(activity)
                                 }
                                 TraceEventManager.instance.login(activity)
                             }
                             showFloatBall(activity)
-                            callback.onResult(0, SdkLoginInfo.instance.toJsonString())
+                            callback.onResult(0, SdkLoginInfo.getInstance().toJsonString())
                         } else {
                             callback.onResult(-1, resultInfo.msg)
                         }
@@ -263,7 +263,7 @@ internal class CommSdkImpl(context: Context) {
         val channelCallback = object : ICallback {
             override fun onResult(code: Int, result: String) {
                 if (code == 0) {
-                    SdkLoginInfo.instance.reset()
+                    SdkLoginInfo.getInstance().reset()
                 }
                 callback.onResult(code, result)
             }
@@ -305,7 +305,7 @@ internal class CommSdkImpl(context: Context) {
 
         showPayLoadingDialog(activity)
 
-        SdkRequest.instance.createOrder(activity, "", innerChargeInfo) { resultInfo ->
+        SdkRequest.getInstance().createOrder(activity, "", innerChargeInfo) { resultInfo ->
             dismissPayLoadingDsmiialog(activity)
             if (resultInfo.code == 1 && !TextUtils.isEmpty(resultInfo.data)) {
                 val jsonObject = JSONObject(resultInfo.data)
@@ -350,13 +350,13 @@ internal class CommSdkImpl(context: Context) {
             return
         }
 
-        SdkLoginInfo.instance.currentRoleId = roleInfo.roleId
-        SdkLoginInfo.instance.currentRoleName = roleInfo.roleName
-        SdkLoginInfo.instance.currentRoleLevel = roleInfo.roleLevel
-        SdkLoginInfo.instance.currentServerId = roleInfo.serverId
-        SdkLoginInfo.instance.currentServerName = roleInfo.serverName
+        SdkLoginInfo.getInstance().currentRoleId = roleInfo.roleId
+        SdkLoginInfo.getInstance().currentRoleName = roleInfo.roleName
+        SdkLoginInfo.getInstance().currentRoleLevel = roleInfo.roleLevel
+        SdkLoginInfo.getInstance().currentServerId = roleInfo.serverId
+        SdkLoginInfo.getInstance().currentServerName = roleInfo.serverName
 
-        SdkRequest.instance.submitRoleData(activity, roleInfo, "createRole") { resultInfo ->
+        SdkRequest.getInstance().submitRoleData(activity, roleInfo, "createRole") { resultInfo ->
             Logger.d(resultInfo.toString())
         }
 
@@ -377,13 +377,13 @@ internal class CommSdkImpl(context: Context) {
             return
         }
 
-        SdkLoginInfo.instance.currentRoleId = roleInfo.roleId
-        SdkLoginInfo.instance.currentRoleName = roleInfo.roleName
-        SdkLoginInfo.instance.currentRoleLevel = roleInfo.roleLevel
-        SdkLoginInfo.instance.currentServerId = roleInfo.serverId
-        SdkLoginInfo.instance.currentServerName = roleInfo.serverName
+        SdkLoginInfo.getInstance().currentRoleId = roleInfo.roleId
+        SdkLoginInfo.getInstance().currentRoleName = roleInfo.roleName
+        SdkLoginInfo.getInstance().currentRoleLevel = roleInfo.roleLevel
+        SdkLoginInfo.getInstance().currentServerId = roleInfo.serverId
+        SdkLoginInfo.getInstance().currentServerName = roleInfo.serverName
 
-        SdkRequest.instance.submitRoleData(activity, roleInfo, "enterGame") { resultInfo ->
+        SdkRequest.getInstance().submitRoleData(activity, roleInfo, "enterGame") { resultInfo ->
             Logger.d(resultInfo.toString())
         }
 
@@ -404,11 +404,11 @@ internal class CommSdkImpl(context: Context) {
             return
         }
 
-        SdkLoginInfo.instance.currentRoleId = roleInfo.roleId
-        SdkLoginInfo.instance.currentRoleName = roleInfo.roleName
-        SdkLoginInfo.instance.currentRoleLevel = roleInfo.roleLevel
-        SdkLoginInfo.instance.currentServerId = roleInfo.serverId
-        SdkLoginInfo.instance.currentServerName = roleInfo.serverName
+        SdkLoginInfo.getInstance().currentRoleId = roleInfo.roleId
+        SdkLoginInfo.getInstance().currentRoleName = roleInfo.roleName
+        SdkLoginInfo.getInstance().currentRoleLevel = roleInfo.roleLevel
+        SdkLoginInfo.getInstance().currentServerId = roleInfo.serverId
+        SdkLoginInfo.getInstance().currentServerName = roleInfo.serverName
 
         SdkProxyManager.call(Function.ROLE_LEVEL_UP, arrayOf(Activity::class.java, SdkRoleInfo::class.java), arrayOf(activity, roleInfo))
     }
@@ -519,54 +519,7 @@ internal class CommSdkImpl(context: Context) {
         SdkProxyManager.call(Function.ON_NEW_INTENT, arrayOf(Activity::class.java, Intent::class.java), arrayOf(activity, intent))
     }
 
-    fun getCurrentUserId(): String = SdkLoginInfo.instance.userId
-
-//    fun getChannelVersion(): String {
-//        if (checkSdkProxyNull(Function.GET_CHANNEL_VERSION, null)) {
-//            return ""
-//        }
-//        if (checkSdkNonInit(Function.GET_CHANNEL_VERSION, null)) {
-//            return ""
-//        }
-//
-//        return SdkProxyManager.callback(Function.GET_CHANNEL_VERSION, emptyArray(), emptyArray()).toString()
-//    }
-//
-//    fun getChannelName(): String {
-//        if (checkSdkProxyNull(Function.GET_CHANNEL_NAME, null)) {
-//            return ""
-//        }
-//        if (checkSdkNonInit(Function.GET_CHANNEL_NAME, null)) {
-//            return ""
-//        }
-//
-//        return SdkProxyManager.callback(Function.GET_CHANNEL_NAME, emptyArray(), emptyArray()).toString()
-//    }
-
-//    fun linkingEvent(context: Context, sdkEvent: SdkEvent) {
-//        if (checkSdkProxyNull(Function.LINKING_EVENT, null)) {
-//            return
-//        }
-//        if (checkSdkNonInit(Function.LINKING_EVENT, null)) {
-//            return
-//        }
-//
-//        SdkProxyManager.call(Function.LINKING_EVENT, arrayOf(Context::class.kotlin, SdkEvent::class.kotlin), arrayOf(context, sdkEvent))
-//    }
-//
-//    fun share(activity: Activity, line: String, tag: String, quote: String, callback: ICallback) {
-//        if (checkSdkProxyNull(Function.SHARE, null)) {
-//            return
-//        }
-//        if (checkSdkNonInit(Function.SHARE, null)) {
-//            return
-//        }
-//
-//        SdkProxyManager.call(
-//            Function.SHARE, arrayOf(Activity::class.kotlin, String::class.kotlin, String::class.kotlin, String::class.kotlin, ICallback::class.kotlin),
-//            arrayOf(activity, line, tag, quote, callback)
-//        )
-//    }
+    fun getCurrentUserId(): String = SdkLoginInfo.getInstance().userId
 
     /**
      * SDK浮窗账号切换

+ 14 - 2
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/network/SdkRequest.kt

@@ -22,8 +22,20 @@ import org.json.JSONObject
 class SdkRequest private constructor() {
 
     companion object {
-        val instance: SdkRequest by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
-            SdkRequest()
+        @JvmStatic
+        fun getInstance(): SdkRequest {
+            return SdkRequestHolder.INSTANCE
+        }
+
+        private object SdkRequestHolder {
+            val INSTANCE: SdkRequest = SdkRequest()
+        }
+
+        /**
+         * 防止单例对象在反序列化时重新生成对象
+         */
+        private fun readResolve(): Any {
+            return SdkRequestHolder.INSTANCE
         }
     }
 

+ 3 - 3
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/network/VolleyRequest.kt

@@ -47,7 +47,7 @@ object VolleyRequest {
         val randomKey = time + StrUtils.getRandomString(16)
         val rawKey = Md5Utils.encodeByMD5(randomKey)
         val aesKey = Md5Utils.encodeByMD5(rawKey + StrUtils.reverseString(rawKey))
-        val hexP = CommSdkDrive.instance.invokeJob(aesKey.substring(8, 24), jsonObject.toString())
+        val hexP = CommSdkDrive.getInstance().invokeJob(aesKey.substring(8, 24), jsonObject.toString())
 
         val tmp = HexUtils.hexString2Bytes(hexP)
         val p = Base64Utils.encode(tmp)
@@ -161,7 +161,7 @@ object VolleyRequest {
         val rawKey = Md5Utils.encodeByMD5(randomKey)
         val aesKey = Md5Utils.encodeByMD5(rawKey + StrUtils.reverseString(rawKey))
 
-        val hexP = CommSdkDrive.instance.invokeJob(aesKey.substring(8, 24), jsonObject.toString())
+        val hexP = CommSdkDrive.getInstance().invokeJob(aesKey.substring(8, 24), jsonObject.toString())
 
         val tmp = HexUtils.hexString2Bytes(hexP)
         val p = Base64Utils.encode(tmp)
@@ -211,7 +211,7 @@ object VolleyRequest {
             val base64P = getString("p")
             val tmp = Base64Utils.decode(base64P)
             val p = HexUtils.bytes2HexString(tmp)
-            return CommSdkDrive.instance.parseJob(aesKey.substring(8, 24), p)
+            return CommSdkDrive.getInstance().parseJob(aesKey.substring(8, 24), p)
         } catch (e: JSONException) {
             e.printStackTrace()
         }

+ 6 - 1
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/trace/TraceEventManager.kt

@@ -9,6 +9,7 @@ import cn.yyxx.eyuancomm.comm.internal.ITrace
 import cn.yyxx.eyuancomm.comm.trace.channel.AdjustEventImpl
 import cn.yyxx.eyuancomm.comm.trace.channel.FacebookEventImpl
 import cn.yyxx.eyuancomm.comm.trace.channel.FirebaseEventImpl
+import cn.yyxx.eyuancomm.comm.trace.channel.HiAnalyticsEventImpl
 import cn.yyxx.eyuancomm.comm.utils.ParamsUtils
 
 /**
@@ -37,13 +38,17 @@ class TraceEventManager private constructor() {
         if (ParamsUtils.getFacebookTrace(application)) {
             observers.add(FacebookEventImpl())
         }
+        if (ParamsUtils.getHiAnalyticsTrace(application)) {
+            observers.add(HiAnalyticsEventImpl())
+        }
+
         for (ob in observers) {
             ob.onInitialize(application)
         }
     }
 
     fun release() {
-        if (!observers.isNullOrEmpty()) {
+        if (observers.isNotEmpty()) {
             observers.clear()
         }
     }

+ 7 - 7
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/trace/channel/AdjustEventImpl.kt

@@ -71,7 +71,7 @@ class AdjustEventImpl(private val onIdRead: (String) -> Unit) : ITrace {
         Adjust.addSessionCallbackParameter("game_code", ParamsUtils.getGameCode(application))
         Adjust.addSessionCallbackParameter("gcp_code", ParamsUtils.getGcpCode(application))
 
-        if (MMKVManager.instance.eventKV.decodeBool("adjust_activities")) {
+        if (MMKVManager.getInstance().eventKV.decodeBool("adjust_activities")) {
             isInitSuccess = true
             return
         }
@@ -79,7 +79,7 @@ class AdjustEventImpl(private val onIdRead: (String) -> Unit) : ITrace {
             if (JsonUtils.hasJsonKey(this, "open_app")) {
                 Adjust.trackEvent(AdjustEvent(this.getString("open_app")))
                 Logger.d("adjust log open app success")
-                MMKVManager.instance.eventKV.encode("adjust_activities", true)
+                MMKVManager.getInstance().eventKV.encode("adjust_activities", true)
                 isInitSuccess = true
             }
         }
@@ -91,7 +91,7 @@ class AdjustEventImpl(private val onIdRead: (String) -> Unit) : ITrace {
             return
         }
 
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.userId)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
             Logger.e("adjust log failed , user is null")
             return
         }
@@ -110,7 +110,7 @@ class AdjustEventImpl(private val onIdRead: (String) -> Unit) : ITrace {
             return
         }
 
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.userId)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
             Logger.e("adjust log failed , user is null")
             return
         }
@@ -129,20 +129,20 @@ class AdjustEventImpl(private val onIdRead: (String) -> Unit) : ITrace {
             return
         }
 
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.userId)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
             Logger.e("adjust log failed , user is null")
             return
         }
 
         sdkConfig?.apply {
-            if (!MMKVManager.instance.eventKV.decodeBool("adjust_first_purchase")) {
+            if (!MMKVManager.getInstance().eventKV.decodeBool("adjust_first_purchase")) {
                 if (JsonUtils.hasJsonKey(this, "first_purchase")) {
                     val event = AdjustEvent(this.getString("first_purchase"))
                     event.setRevenue(chargeInfo.amount.toDouble() / 100, "USD")
 //                    event.setOrderId(chargeInfo.orderId)
                     Adjust.trackEvent(event)
                     Logger.d("adjust log first charge success")
-                    MMKVManager.instance.eventKV.encode("adjust_first_purchase", true)
+                    MMKVManager.getInstance().eventKV.encode("adjust_first_purchase", true)
                 }
             }
 

+ 7 - 7
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/trace/channel/FacebookEventImpl.kt

@@ -34,14 +34,14 @@ class FacebookEventImpl : ITrace {
 
         fbLogger = AppEventsLogger.newLogger(application)
 
-        if (MMKVManager.instance.eventKV.decodeBool("facebook_activities")) {
+        if (MMKVManager.getInstance().eventKV.decodeBool("facebook_activities")) {
             isInitSuccess = true
             return
         }
         //open_app
         Logger.d("facebook log open app success")
         fbLogger.logEvent("open_app")
-        MMKVManager.instance.eventKV.encode("facebook_activities", true)
+        MMKVManager.getInstance().eventKV.encode("facebook_activities", true)
         isInitSuccess = true
     }
 
@@ -51,7 +51,7 @@ class FacebookEventImpl : ITrace {
             return
         }
 
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.userId)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
             Logger.e("facebook log failed , user is null")
             return
         }
@@ -66,7 +66,7 @@ class FacebookEventImpl : ITrace {
             return
         }
 
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.userId)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
             Logger.e("facebook log failed , user is null")
             return
         }
@@ -81,7 +81,7 @@ class FacebookEventImpl : ITrace {
             return
         }
 
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.userId)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
             Logger.e("facebook log failed , user is null")
             return
         }
@@ -89,10 +89,10 @@ class FacebookEventImpl : ITrace {
         params.putDouble("price", chargeInfo.amount.toDouble() / 100)
         params.putString("order", chargeInfo.orderId)
 
-        if (!MMKVManager.instance.eventKV.decodeBool("facebook_first_purchase")) {
+        if (!MMKVManager.getInstance().eventKV.decodeBool("facebook_first_purchase")) {
             fbLogger.logEvent("first_purchase", params)
             Logger.d("facebook log first charge success")
-            MMKVManager.instance.eventKV.encode("facebook_first_purchase", true)
+            MMKVManager.getInstance().eventKV.encode("facebook_first_purchase", true)
         }
 
         fbLogger.logPurchase(BigDecimal.valueOf(chargeInfo.amount.toDouble() / 100), Currency.getInstance("USD"), params)

+ 7 - 8
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/trace/channel/FirebaseEventImpl.kt

@@ -24,13 +24,13 @@ class FirebaseEventImpl : ITrace {
     private var isInitSuccess = false
 
     override fun onInitialize(application: Application) {
-        if (MMKVManager.instance.eventKV.decodeBool("firebase_activities")) {
+        if (MMKVManager.getInstance().eventKV.decodeBool("firebase_activities")) {
             isInitSuccess = true
             return
         }
         Firebase.analytics.logEvent("open_app", null)
         Logger.d("firebase log open app success")
-        MMKVManager.instance.eventKV.encode("firebase_activities", true)
+        MMKVManager.getInstance().eventKV.encode("firebase_activities", true)
         isInitSuccess = true
     }
 
@@ -40,7 +40,7 @@ class FirebaseEventImpl : ITrace {
             return
         }
 
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.userId)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
             Logger.e("firebase log failed , user is null")
             return
         }
@@ -55,7 +55,7 @@ class FirebaseEventImpl : ITrace {
             return
         }
 
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.userId)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
             Logger.e("firebase log failed , user is null")
             return
         }
@@ -70,18 +70,18 @@ class FirebaseEventImpl : ITrace {
             return
         }
 
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.userId)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
             Logger.e("firebase log failed , user is null")
             return
         }
 
-        if (!MMKVManager.instance.eventKV.decodeBool("firebase_first_purchase")) {
+        if (!MMKVManager.getInstance().eventKV.decodeBool("firebase_first_purchase")) {
             Firebase.analytics.logEvent("first_purchase") {
                 param(FirebaseAnalytics.Param.PRICE, (chargeInfo.amount.toDouble() / 100).toString())
                 param("order_id", chargeInfo.orderId)
             }
             Logger.d("firebase log first charge success")
-            MMKVManager.instance.eventKV.encode("firebase_first_purchase", true)
+            MMKVManager.getInstance().eventKV.encode("firebase_first_purchase", true)
         }
 
         Firebase.analytics.logEvent("ecommerce_purchase") {
@@ -101,7 +101,6 @@ class FirebaseEventImpl : ITrace {
     override fun onPause(activity: Activity) {
     }
 
-
     override fun onSdkEvent(context: Context, sdkEvent: SdkEvent) {
         if (!isInitSuccess) {
             Logger.e("firebase log failed , component initialize failed")

+ 127 - 0
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/trace/channel/HiAnalyticsEventImpl.kt

@@ -0,0 +1,127 @@
+package cn.yyxx.eyuancomm.comm.trace.channel
+
+import android.app.Activity
+import android.app.Application
+import android.content.Context
+import android.os.Bundle
+import android.text.TextUtils
+import cn.yyxx.eyuancomm.comm.entity.SdkChargeInfo
+import cn.yyxx.eyuancomm.comm.entity.SdkEvent
+import cn.yyxx.eyuancomm.comm.entity.SdkLoginInfo
+import cn.yyxx.eyuancomm.comm.internal.ITrace
+import cn.yyxx.eyuancomm.comm.utils.Logger
+import cn.yyxx.eyuancomm.comm.utils.MMKVManager
+import com.huawei.hms.analytics.HiAnalytics
+import com.huawei.hms.analytics.HiAnalyticsInstance
+import com.huawei.hms.analytics.HiAnalyticsTools
+import com.huawei.hms.analytics.type.HAParamType
+
+/**
+ * @author #Suyghur.
+ * Created on 2022/6/8
+ */
+class HiAnalyticsEventImpl : ITrace {
+
+
+    private lateinit var analyticsInstance: HiAnalyticsInstance
+    private var isInitSuccess = false
+
+    override fun onInitialize(application: Application) {
+        HiAnalyticsTools.enableLog()
+        analyticsInstance = HiAnalytics.getInstance(application)
+        analyticsInstance.setCollectAdsIdEnabled(true)
+        analyticsInstance.setPushTokenCollectionEnabled(true)
+        if (MMKVManager.getInstance().eventKV.decodeBool("hianalytics_activities")) {
+            isInitSuccess = true
+            return
+        }
+        analyticsInstance.onEvent("open_app", null)
+        Logger.d("hianalytics log open app success")
+        MMKVManager.getInstance().eventKV.encode("hianalytics_activities", true)
+        isInitSuccess = true
+    }
+
+    override fun onLogin(context: Context) {
+        if (!isInitSuccess) {
+            Logger.e("hianalytics log failed , component initialize failed")
+            return
+        }
+
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
+            Logger.e("hianalytics log failed , user is null")
+            return
+        }
+
+        analyticsInstance.onEvent("login_success_account", null)
+        Logger.d("hianalytics log account login success")
+    }
+
+    override fun onRegister(context: Context) {
+        if (!isInitSuccess) {
+            Logger.e("hianalytics log failed , component initialize failed")
+            return
+        }
+
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
+            Logger.e("hianalytics log failed , user is null")
+            return
+        }
+
+        analyticsInstance.onEvent("sign_up", null)
+        Logger.d("hianalytics log sign up success")
+    }
+
+    override fun onCharge(context: Context, chargeInfo: SdkChargeInfo) {
+        if (!isInitSuccess) {
+            Logger.e("hianalytics log failed , component initialize failed")
+            return
+        }
+
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
+            Logger.e("hianalytics log failed , user is null")
+            return
+        }
+
+        if (!MMKVManager.getInstance().eventKV.decodeBool("hianalytics_first_purchase")) {
+            val bundle = Bundle()
+            bundle.putDouble(HAParamType.PRICE, chargeInfo.amount.toDouble() / 100)
+            bundle.putString("order_id", chargeInfo.orderId)
+            analyticsInstance.onEvent("first_purchase", bundle)
+            Logger.d("hianalytics log first charge success")
+            MMKVManager.getInstance().eventKV.encode("hianalytics_first_purchase", true)
+        }
+
+        val bundle = Bundle()
+        bundle.putDouble(HAParamType.PRICE, chargeInfo.amount.toDouble() / 100)
+        bundle.putString("order_id", chargeInfo.orderId)
+        analyticsInstance.onEvent("ecommerce_purchase", bundle)
+        Logger.d("hianalytics log charge success")
+    }
+
+    override fun onCreate(activity: Activity) {
+    }
+
+    override fun onResume(activity: Activity) {
+    }
+
+    override fun onPause(activity: Activity) {
+    }
+
+    override fun onSdkEvent(context: Context, sdkEvent: SdkEvent) {
+        if (!isInitSuccess) {
+            Logger.e("hianalytics log failed , component initialize failed")
+            return
+        }
+        analyticsInstance.onEvent(sdkEvent.eventName, null)
+        Logger.d("hianalytics log sdk event ${sdkEvent.eventName} success")
+    }
+
+    override fun onExtEvent(context: Context, sdkEvent: SdkEvent) {
+        if (!isInitSuccess) {
+            Logger.e("hianalytics log failed , component initialize failed")
+            return
+        }
+        analyticsInstance.onEvent(sdkEvent.eventName, null)
+        Logger.d("hianalytics log ext event ${sdkEvent.eventName} success")
+    }
+}

+ 1 - 1
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/utils/Logger.kt

@@ -75,7 +75,7 @@ object Logger {
 
     @JvmStatic
     fun e(any: Any?) {
-        d(TAG, any)
+        e(TAG, any)
     }
 
     @JvmStatic

+ 15 - 2
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/utils/MMKVManager.kt

@@ -1,6 +1,7 @@
 package cn.yyxx.eyuancomm.comm.utils
 
 import android.content.Context
+import cn.yyxx.eyuancomm.comm.network.SdkRequest
 import com.tencent.mmkv.MMKV
 import com.tencent.mmkv.MMKVHandler
 import com.tencent.mmkv.MMKVLogLevel
@@ -15,8 +16,20 @@ import java.io.File
 class MMKVManager private constructor() : MMKVHandler {
 
     companion object {
-        val instance: MMKVManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
-            MMKVManager()
+        @JvmStatic
+        fun getInstance(): MMKVManager {
+            return MMKVManagerHolder.INSTANCE
+        }
+
+        private object MMKVManagerHolder {
+            val INSTANCE: MMKVManager = MMKVManager()
+        }
+
+        /**
+         * 防止单例对象在反序列化时重新生成对象
+         */
+        private fun readResolve(): Any {
+            return MMKVManagerHolder.INSTANCE
         }
     }
 

+ 13 - 0
library_comm/src/main/kotlin/cn/yyxx/eyuancomm/comm/utils/ParamsUtils.kt

@@ -20,6 +20,7 @@ object ParamsUtils {
     private const val YYXX_ADJUST_TRACE = "YYXX_ADJUST_TRACE"
     private const val YYXX_FIREBASE_TRACE = "YYXX_FIREBASE_TRACE"
     private const val YYXX_FACEBOOK_TRACE = "YYXX_FACEBOOK_TRACE"
+    private const val YYXX_HIANALYTICS_TRACE = "YYXX_HIANALYTICS_TRACE"
     private const val YYXX_LANG_ENV = "YYXX_LANG_ENV"
 
 
@@ -125,6 +126,18 @@ object ParamsUtils {
         return false
     }
 
+    fun getHiAnalyticsTrace(context: Context): Boolean {
+        try {
+            val enable = PropertiesUtils.getValue4Properties(context, CONFIG_FILE, "yyxx_game", YYXX_HIANALYTICS_TRACE)
+            if (!TextUtils.isEmpty(enable)) {
+                return enable.toBoolean()
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        return false
+    }
+
     @JvmStatic
     fun getLangEnv(context: Context): Int {
         try {

+ 1 - 1
library_impl/publish.gradle

@@ -4,7 +4,7 @@ apply plugin: 'signing'
 ext {
     PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
     PUBLISH_ARTIFACT_ID = 'eyuancomm-sdk-ktx-impl'
-    PUBLISH_VERSION = '1.0.0-rc8'
+    PUBLISH_VERSION = '1.0.0-rc11'
 }
 
 Properties properties = new Properties()

+ 1 - 1
library_impl/src/main/java/cn/yyxx/eyuancomm/impl/channel/eyuangame/ChannelSdkEYuanGame.kt

@@ -42,7 +42,7 @@ internal class ChannelSdkEYuanGame : IFeature, ILifeCycle, IConfig, IRoleData, I
                         val jsonObject = JSONObject(result)
                         val orderNotifyData = JSONObject(jsonObject.getString("order_notify_data"))
                         val purchaseToken = orderNotifyData.getString("purchaseToken")
-                        SdkRequest.instance.notifyOrder(activity, jsonObject) { resultInfo ->
+                        SdkRequest.getInstance().notifyOrder(activity, jsonObject) { resultInfo ->
                             if (resultInfo.code == 1 || resultInfo.code == 2) {
                                 if (code == 1) {
                                     EYuanGameSdk.getInstance().consumeOrder(activity, chargeInfo, purchaseToken, false)

+ 9 - 4
library_impl/src/main/java/cn/yyxx/eyuancomm/impl/channel/huawei/ChannelSdkHuawei.kt

@@ -24,12 +24,16 @@ import cn.yyxx.eyuancomm.impl.channel.huawei.floatview.FloatCenterServiceManager
 import cn.yyxx.eyuancomm.impl.channel.huawei.floatview.FloatFeature
 import cn.yyxx.support.ResUtils
 import cn.yyxx.support.hawkeye.ToastUtils
+import com.facebook.*
+import com.facebook.login.LoginManager
+import com.facebook.login.LoginResult
 import com.huawei.agconnect.AGCRoutePolicy
 import com.huawei.agconnect.AGConnectInstance
 import com.huawei.agconnect.AGConnectOptionsBuilder
 import com.huawei.agconnect.api.AGConnectApi
-import com.huawei.agconnect.auth.AGConnectAuth
-import com.huawei.agconnect.auth.AGConnectAuthCredential
+import com.huawei.agconnect.auth.*
+import com.huawei.hmf.tasks.OnFailureListener
+import com.huawei.hmf.tasks.OnSuccessListener
 import com.huawei.hmf.tasks.Task
 import com.huawei.hms.analytics.HiAnalytics
 import com.huawei.hms.analytics.HiAnalyticsInstance
@@ -47,6 +51,7 @@ import com.huawei.hms.jos.games.buoy.BuoyClient
 import com.huawei.hms.support.account.request.AccountAuthParams
 import com.huawei.hms.utils.ResourceLoaderUtil
 import org.json.JSONObject
+import java.util.*
 
 
 /**
@@ -261,7 +266,7 @@ internal class ChannelSdkHuawei : IFeature, IApplication, ILifeCycle, IFloatBall
             override fun onResult(code: Int, result: String) {
                 if (code == 0 || code == 1) {
                     val jsonObject = JSONObject(result)
-                    SdkRequest.instance.notifyOrder(activity, jsonObject) { resultInfo ->
+                    SdkRequest.getInstance().notifyOrder(activity, jsonObject) { resultInfo ->
                         if (resultInfo.code == 1 || resultInfo.code == 2) {
                             if (code == 0) {
                                 dismissLoadingDialog()
@@ -388,12 +393,12 @@ internal class ChannelSdkHuawei : IFeature, IApplication, ILifeCycle, IFloatBall
             }
         }.addOnFailureListener {
             // onFail
+            AGConnectAuth.getInstance().currentUser.unlink(channel)
             ToastUtils.toastInfo(activity, "Account linking failed,${it.localizedMessage}")
             Logger.d("账号关联失败, ${it.localizedMessage}")
         }
     }
 
-
     private fun showLoadingDialog(context: Context) {
         loadingDialog?.apply {
             dismiss()

+ 15 - 0
library_impl/src/main/java/cn/yyxx/eyuancomm/impl/channel/huawei/HuaweiLinkDialog.kt

@@ -6,6 +6,8 @@ import android.graphics.Color
 import android.graphics.drawable.ColorDrawable
 import android.view.*
 import android.widget.ImageView
+import android.widget.TextView
+import cn.yyxx.eyuancomm.comm.utils.ParamsUtils
 import cn.yyxx.support.DensityUtils
 import cn.yyxx.support.ResUtils
 
@@ -15,10 +17,12 @@ import cn.yyxx.support.ResUtils
  */
 internal class HuaweiLinkDialog(context: Context, private val isLandscape: Boolean) : Dialog(context) {
 
+    private lateinit var tvTitle: TextView
     lateinit var ivClose: ImageView
     lateinit var ivHw: ImageView
     lateinit var ivGoogle: ImageView
     lateinit var ivFacebook: ImageView
+    private lateinit var tvTips: TextView
 
     init {
         setCanceledOnTouchOutside(false)
@@ -41,11 +45,22 @@ internal class HuaweiLinkDialog(context: Context, private val isLandscape: Boole
         }
         attr.gravity = Gravity.CENTER
 
+        val env = ParamsUtils.getLangEnv(context)
+
+        tvTitle = findViewById(ResUtils.getResId(context, "yyxx_link_tv_title", "id"))
+        if (env == 2) {
+            tvTitle.text = "Liên Kết"
+        }
+
         ivClose = findViewById(ResUtils.getResId(context, "yyxx_link_iv_close", "id"))
         ivHw = findViewById(ResUtils.getResId(context, "yyxx_link_iv_hw", "id"))
         ivGoogle = findViewById(ResUtils.getResId(context, "yyxx_link_iv_google", "id"))
         ivFacebook = findViewById(ResUtils.getResId(context, "yyxx_link_iv_facebook", "id"))
 
+        tvTips = findViewById(ResUtils.getResId(context, "yyxx_link_tv_tips", "id"))
+        if (env == 2) {
+            tvTips.text = "Nhắc: Nhấn biểu tượng để liên kết tài khoản khác, rồi thực hiện trao đổi dữ liệu."
+        }
     }
 }
 

+ 1 - 1
library_impl/src/main/java/cn/yyxx/eyuancomm/impl/channel/huawei/floatview/FloatCenterServiceManager.kt

@@ -58,7 +58,7 @@ class FloatCenterServiceManager private constructor() {
             return
         }
         service?.attach()
-        if (!TextUtils.isEmpty(SdkLoginInfo.instance.userId)) {
+        if (!TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
             service?.attach()
         } else {
             detach()

+ 1 - 1
module_eyuan/library_eyuan/publish.gradle

@@ -4,7 +4,7 @@ apply plugin: 'signing'
 ext {
     PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
     PUBLISH_ARTIFACT_ID = 'eyuancomm-sdk-ktx-core'
-    PUBLISH_VERSION = '1.0.0-rc8'
+    PUBLISH_VERSION = '1.0.0-rc10'
 }
 
 Properties properties = new Properties()

+ 4 - 4
module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/EYuanGameSdk.kt

@@ -112,7 +112,7 @@ class EYuanGameSdk {
             return
         }
 
-        SdkLoginInfo.instance.reset()
+        SdkLoginInfo.getInstance().reset()
         LoginActivity.login(activity, isAutoLogin) { code, result ->
             callback.onResult(code, result)
         }
@@ -124,7 +124,7 @@ class EYuanGameSdk {
             return
         }
 
-        SdkLoginInfo.instance.reset()
+        SdkLoginInfo.getInstance().reset()
         FloatCenterServiceManager.instance.detach()
         callback.onResult(0, "用户登出成功")
     }
@@ -135,7 +135,7 @@ class EYuanGameSdk {
         if (checkSdkNonInit("charge", callback)) {
             return
         }
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.userId)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().userId)) {
             Logger.e("支付失败,用户未登录或登录失败")
             callback.onResult(-1, "支付失败,用户未登录或登录失败")
             return
@@ -246,7 +246,7 @@ class EYuanGameSdk {
     fun onDestroy(activity: Activity) {
         Logger.i("EYuanGameSdk onDestroy ...")
         FloatCenterServiceManager.instance.release()
-        MMKVManager.instance.release()
+        MMKVManager.getInstance().release()
     }
 
     fun onActivityResult(activity: Activity, requestCode: Int, resultCode: Int, data: Intent?) {

+ 3 - 3
module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/BindAccountContainer.kt

@@ -131,13 +131,13 @@ class BindAccountContainer(context: Context, private val callback: (Int, String)
 
         try {
             with(JSONObject()) {
-                put("uid", SdkLoginInfo.instance.userId)
-                put("login_type", SdkLoginInfo.instance.loginType)
+                put("uid", SdkLoginInfo.getInstance().userId)
+                put("login_type", SdkLoginInfo.getInstance().loginType)
                 put("uname", userName)
                 put("pwd", pwd)
                 SdkRequest.instance.bindAccount(context, this) { resultInfo ->
                     if (resultInfo.code == 1) {
-                        SdkLoginInfo.instance.hasBindAccount = true
+                        SdkLoginInfo.getInstance().hasBindAccount = true
                         ToastUtils.toastInfo(context, resultInfo.msg)
                         callback(0, resultInfo.msg)
                         dismiss()

+ 8 - 8
module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/BindEmailContainer.kt

@@ -100,13 +100,13 @@ class BindEmailContainer(context: Context, private val callback: (Int, String) -
         tvBindTips1.text = ResUtils.getResString(context, "yyxx_iv_bind_email_tips")
 
         tvBindTips2 = findViewById(ResUtils.getResId(context, "yyxx_tv_tips2", "id"))
-        tvBindTips2.text = if (SdkLoginInfo.instance.email.length > 6) {
-            val head = SdkLoginInfo.instance.email.substring(0, 3)
-            val index = SdkLoginInfo.instance.email.indexOf("@")
-            val foot = SdkLoginInfo.instance.email.substring(index, SdkLoginInfo.instance.email.length)
+        tvBindTips2.text = if (SdkLoginInfo.getInstance().email.length > 6) {
+            val head = SdkLoginInfo.getInstance().email.substring(0, 3)
+            val index = SdkLoginInfo.getInstance().email.indexOf("@")
+            val foot = SdkLoginInfo.getInstance().email.substring(index, SdkLoginInfo.getInstance().email.length)
             "${head}xxxx${foot}"
         } else {
-            SdkLoginInfo.instance.email
+            SdkLoginInfo.getInstance().email
         }
         showOrHideTips()
     }
@@ -154,12 +154,12 @@ class BindEmailContainer(context: Context, private val callback: (Int, String) -
 
         try {
             with(JSONObject()) {
-                put("uid", SdkLoginInfo.instance.userId)
+                put("uid", SdkLoginInfo.getInstance().userId)
                 put("email", email)
                 put("sms_code", captcha)
                 SdkRequest.instance.bindEmail(context, this) { resultInfo ->
                     if (resultInfo.code == 1) {
-                        SdkLoginInfo.instance.email = email
+                        SdkLoginInfo.getInstance().email = email
                         ToastUtils.toastInfo(context, resultInfo.msg)
                         callback(0, resultInfo.msg)
                         dismiss()
@@ -193,7 +193,7 @@ class BindEmailContainer(context: Context, private val callback: (Int, String) -
     }
 
     private fun showOrHideTips() {
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.email)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().email)) {
             llGroup.visibility = View.VISIBLE
             eetEmail.visibility = View.VISIBLE
             btnConfirm.visibility = View.VISIBLE

+ 7 - 7
module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/BindPhoneContainer.kt

@@ -124,12 +124,12 @@ class BindPhoneContainer(context: Context, private val callback: (Int, String) -
         tvBindTips1.text = ResUtils.getResString(context, "yyxx_iv_bind_phone_tips1")
 
         tvBindTips2 = findViewById(ResUtils.getResId(context, "yyxx_tv_tips2", "id"))
-        val tipsPhone = if (SdkLoginInfo.instance.phoneNum.length > 6) {
-            val head = SdkLoginInfo.instance.phoneNum.substring(0, 3)
-            val foot = SdkLoginInfo.instance.phoneNum.substring(SdkLoginInfo.instance.phoneNum.length - 3, SdkLoginInfo.instance.phoneNum.length)
+        val tipsPhone = if (SdkLoginInfo.getInstance().phoneNum.length > 6) {
+            val head = SdkLoginInfo.getInstance().phoneNum.substring(0, 3)
+            val foot = SdkLoginInfo.getInstance().phoneNum.substring(SdkLoginInfo.getInstance().phoneNum.length - 3, SdkLoginInfo.getInstance().phoneNum.length)
             "${head}xxxx${foot}"
         } else {
-            SdkLoginInfo.instance.phoneNum
+            SdkLoginInfo.getInstance().phoneNum
         }
         tvBindTips2.text = "${ResUtils.getResString(context, "yyxx_iv_bind_phone_tips2")}$tipsPhone"
 
@@ -261,12 +261,12 @@ class BindPhoneContainer(context: Context, private val callback: (Int, String) -
 
         try {
             with(JSONObject()) {
-                put("uid", SdkLoginInfo.instance.userId)
+                put("uid", SdkLoginInfo.getInstance().userId)
                 put("phone_number", phoneNum)
                 put("sms_code", captcha)
                 SdkRequest.instance.bindPhone(context, this) { resultInfo ->
                     if (resultInfo.code == 1) {
-                        SdkLoginInfo.instance.phoneNum = phoneNum
+                        SdkLoginInfo.getInstance().phoneNum = phoneNum
                         ToastUtils.toastInfo(context, resultInfo.msg)
                         callback(0, resultInfo.msg)
                         dismiss()
@@ -300,7 +300,7 @@ class BindPhoneContainer(context: Context, private val callback: (Int, String) -
     }
 
     private fun showOrHideTips() {
-        if (TextUtils.isEmpty(SdkLoginInfo.instance.phoneNum)) {
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().phoneNum)) {
             llGroup1.visibility = View.VISIBLE
             llGroup2.visibility = View.VISIBLE
             llTips.visibility = View.GONE

+ 10 - 10
module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/HybridFeatureContainer.kt

@@ -49,8 +49,8 @@ class HybridFeatureContainer(private val activity: Activity, private val url: St
     private val jsCallback = object : SdkJsImpl.IJsCallback {
         override fun onResult(method: String, data: String): String {
             return when (method) {
-                "getCommon" -> return CommSdkDrive.instance.getCommMap()
-                "getToken" -> return SdkLoginInfo.instance.token
+                "getCommon" -> return CommSdkDrive.getInstance().getCommMap()
+                "getToken" -> return SdkLoginInfo.getInstance().token
                 "close" -> {
                     activity.runOnUiThread {
                         dismiss()
@@ -96,18 +96,18 @@ class HybridFeatureContainer(private val activity: Activity, private val url: St
                 "getRoleInfo" -> {
                     val jsonObject = JSONObject()
                     kotlin.runCatching {
-                        jsonObject.put("login_type", SdkLoginInfo.instance.loginType)
-                        jsonObject.put("uid", SdkLoginInfo.instance.userId)
-                        jsonObject.put("role_id", SdkLoginInfo.instance.currentRoleId)
-                        jsonObject.put("role_name", SdkLoginInfo.instance.currentRoleName)
-                        jsonObject.put("role_level", SdkLoginInfo.instance.currentRoleLevel)
-                        jsonObject.put("server_id", SdkLoginInfo.instance.currentServerId)
-                        jsonObject.put("server_name", SdkLoginInfo.instance.currentServerName)
+                        jsonObject.put("login_type", SdkLoginInfo.getInstance().loginType)
+                        jsonObject.put("uid", SdkLoginInfo.getInstance().userId)
+                        jsonObject.put("role_id", SdkLoginInfo.getInstance().currentRoleId)
+                        jsonObject.put("role_name", SdkLoginInfo.getInstance().currentRoleName)
+                        jsonObject.put("role_level", SdkLoginInfo.getInstance().currentRoleLevel)
+                        jsonObject.put("server_id", SdkLoginInfo.getInstance().currentServerId)
+                        jsonObject.put("server_name", SdkLoginInfo.getInstance().currentServerName)
                     }
                     return jsonObject.toString()
                 }
                 "jump2bindPhone" -> {
-                    if (TextUtils.isEmpty(SdkLoginInfo.instance.phoneNum)) {
+                    if (TextUtils.isEmpty(SdkLoginInfo.getInstance().phoneNum)) {
                         activity.runOnUiThread {
                             MemberCenterContainer(context).show()
                             dismiss()

+ 5 - 5
module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/MemberCenterContainer.kt

@@ -134,7 +134,7 @@ class MemberCenterContainer(context: Context) : Dialog(context) {
         tvAccountTips = findViewById(ResUtils.getResId(context, "yyxx_tv_bind_account_tips", "id"))
         var img = 0
         var tips = ""
-        when (SdkLoginInfo.instance.loginType) {
+        when (SdkLoginInfo.getInstance().loginType) {
             LoginType.TYPE_GUEST_LOGIN -> {
                 img = ResUtils.getResId(context, "yyxx_guest_img", "drawable")
                 tips = ResUtils.getResString(context, "yyxx_login_type_guest")
@@ -170,7 +170,7 @@ class MemberCenterContainer(context: Context) : Dialog(context) {
     }
 
     private fun showOrHideBindAccount() {
-        llBindAccount.visibility = if (SdkLoginInfo.instance.hasBindAccount) {
+        llBindAccount.visibility = if (SdkLoginInfo.getInstance().hasBindAccount) {
             View.GONE
         } else {
             View.VISIBLE
@@ -178,7 +178,7 @@ class MemberCenterContainer(context: Context) : Dialog(context) {
     }
 
     private fun showOrHideBindPhone() {
-        llBindPhone.visibility = if (SdkLoginInfo.instance.hasBindAccount) {
+        llBindPhone.visibility = if (SdkLoginInfo.getInstance().hasBindAccount) {
             View.VISIBLE
         } else {
             View.GONE
@@ -186,7 +186,7 @@ class MemberCenterContainer(context: Context) : Dialog(context) {
     }
 
     private fun showOrHideBindEmail() {
-        llBindEmail.visibility = if (SdkLoginInfo.instance.hasBindAccount) {
+        llBindEmail.visibility = if (SdkLoginInfo.getInstance().hasBindAccount) {
             View.VISIBLE
         } else {
             View.GONE
@@ -195,7 +195,7 @@ class MemberCenterContainer(context: Context) : Dialog(context) {
 
     private fun showOrHideModifyPwd() {
         llModifyPwd.visibility =
-            if (SdkLoginInfo.instance.hasBindAccount && (!TextUtils.isEmpty(SdkLoginInfo.instance.phoneNum) || !TextUtils.isEmpty(SdkLoginInfo.instance.email))) {
+            if (SdkLoginInfo.getInstance().hasBindAccount && (!TextUtils.isEmpty(SdkLoginInfo.getInstance().phoneNum) || !TextUtils.isEmpty(SdkLoginInfo.getInstance().email))) {
                 View.VISIBLE
             } else {
                 View.GONE

+ 1 - 1
module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/center/ModifyPwdContainer.kt

@@ -137,7 +137,7 @@ class ModifyPwdContainer(context: Context) : Dialog(context) {
 
         try {
             with(JSONObject()) {
-                put("uid", SdkLoginInfo.instance.userId)
+                put("uid", SdkLoginInfo.getInstance().userId)
                 put("pwd", oldPwd)
                 put("new_pwd", newPwd)
                 SdkRequest.instance.modifyUserPwd(context, this) { resultInfo ->

+ 1 - 1
module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/floatball/FloatCenterServiceManager.kt

@@ -48,7 +48,7 @@ class FloatCenterServiceManager private constructor() {
             Logger.e("浮标服务未初始化或发生异常")
             return
         }
-        if (!TextUtils.isEmpty(SdkLoginInfo.instance.userId) && EYuanGameSdk.initBean.floatCfg.switch == 1) {
+        if (!TextUtils.isEmpty(SdkLoginInfo.getInstance().userId) && EYuanGameSdk.initBean.floatCfg.switch == 1) {
             mService?.attach()
         } else {
             detach()

+ 18 - 18
module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/impl/login/UserSignInImpl.kt

@@ -166,17 +166,17 @@ class UserSignInImpl constructor(val activity: LoginActivity, private val callba
                 if (resultInfo.code == 1 && !TextUtils.isEmpty(resultInfo.data)) {
                     try {
                         val jsonObject = JSONObject(resultInfo.data)
-                        SdkLoginInfo.instance.userId = jsonObject.getString("uid")
-                        SdkLoginInfo.instance.token = jsonObject.getString("token")
-                        SdkLoginInfo.instance.isRegUser = jsonObject.getInt("is_reg_user") == 1
-                        SdkLoginInfo.instance.hasBindAccount = jsonObject.getInt("has_bind_account") == 1
-                        SdkLoginInfo.instance.phoneNum = jsonObject.getString("phone_num")
-                        SdkLoginInfo.instance.email = jsonObject.getString("email")
-                        SdkLoginInfo.instance.loginType = LoginType.TYPE_ACCOUNT_LOGIN
+                        SdkLoginInfo.getInstance().userId = jsonObject.getString("uid")
+                        SdkLoginInfo.getInstance().token = jsonObject.getString("token")
+                        SdkLoginInfo.getInstance().isRegUser = jsonObject.getInt("is_reg_user") == 1
+                        SdkLoginInfo.getInstance().hasBindAccount = jsonObject.getInt("has_bind_account") == 1
+                        SdkLoginInfo.getInstance().phoneNum = jsonObject.getString("phone_num")
+                        SdkLoginInfo.getInstance().email = jsonObject.getString("email")
+                        SdkLoginInfo.getInstance().loginType = LoginType.TYPE_ACCOUNT_LOGIN
 
                         with(Session()) {
-                            userId = SdkLoginInfo.instance.userId
-                            loginType = SdkLoginInfo.instance.loginType
+                            userId = SdkLoginInfo.getInstance().userId
+                            loginType = SdkLoginInfo.getInstance().loginType
                             this.userName = userName
                             this.pwd = pwd
                             CoroutineScope(Dispatchers.IO).launch {
@@ -218,21 +218,21 @@ class UserSignInImpl constructor(val activity: LoginActivity, private val callba
             if (resultInfo.code == 1 && !TextUtils.isEmpty(resultInfo.data)) {
                 try {
                     val jsonObject = JSONObject(resultInfo.data)
-                    SdkLoginInfo.instance.userId = jsonObject.getString("uid")
-                    SdkLoginInfo.instance.token = jsonObject.getString("token")
-                    SdkLoginInfo.instance.isRegUser = jsonObject.getInt("is_reg_user") == 1
-                    SdkLoginInfo.instance.hasBindAccount = jsonObject.getInt("has_bind_account") == 1
-                    SdkLoginInfo.instance.phoneNum = jsonObject.getString("phone_num")
-                    SdkLoginInfo.instance.email = jsonObject.getString("email")
-                    SdkLoginInfo.instance.loginType = loginParams.getInt("login_type")
+                    SdkLoginInfo.getInstance().userId = jsonObject.getString("uid")
+                    SdkLoginInfo.getInstance().token = jsonObject.getString("token")
+                    SdkLoginInfo.getInstance().isRegUser = jsonObject.getInt("is_reg_user") == 1
+                    SdkLoginInfo.getInstance().hasBindAccount = jsonObject.getInt("has_bind_account") == 1
+                    SdkLoginInfo.getInstance().phoneNum = jsonObject.getString("phone_num")
+                    SdkLoginInfo.getInstance().email = jsonObject.getString("email")
+                    SdkLoginInfo.getInstance().loginType = loginParams.getInt("login_type")
 
                     if (jsonObject.getInt("upload_log_auto") == 1) {
                         uploadLogFile(context)
                     }
 
                     with(Session()) {
-                        userId = SdkLoginInfo.instance.userId
-                        loginType = SdkLoginInfo.instance.loginType
+                        userId = SdkLoginInfo.getInstance().userId
+                        loginType = SdkLoginInfo.getInstance().loginType
                         if (loginType == LoginType.TYPE_ACCOUNT_LOGIN) {
                             userName = loginParams.getString("uname")
                             pwd = loginParams.getString("pwd")

+ 1 - 1
module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/network/SdkRequest.kt

@@ -225,7 +225,7 @@ class SdkRequest {
                 jsonObject.put("upload_type", "log")
             }
             jsonObject.put("upload_file_sign", md5)
-            jsonObject.put("uid", SdkLoginInfo.instance.userId)
+            jsonObject.put("uid", SdkLoginInfo.getInstance().userId)
             val url = "${Host.HOST}/${Host.BASIC_ROUTE_UPLOAD_SDK_LOG}"
             VolleyRequest.uploadFile(context, url, file, jsonObject, callback)
         }

+ 3 - 3
module_eyuan/library_eyuan/src/main/kotlin/cn/yyxx/eyuancomm/core/utils/SessionUtils.kt

@@ -61,7 +61,7 @@ class SessionUtils private constructor() {
                 HostModelUtils.ENV_TEST -> "test"
                 else -> "online"
             }
-            MMKVManager.instance.userKV.encode(keyName, jsonObject.toString())
+            MMKVManager.getInstance().userKV.encode(keyName, jsonObject.toString())
         }
     }
 
@@ -105,7 +105,7 @@ class SessionUtils private constructor() {
             HostModelUtils.ENV_TEST -> "test"
             else -> "online"
         }
-        val json = MMKVManager.instance.userKV.decodeString(keyName)
+        val json = MMKVManager.getInstance().userKV.decodeString(keyName)
         return if (TextUtils.isEmpty(json)) {
             mutableListOf()
         } else {
@@ -151,7 +151,7 @@ class SessionUtils private constructor() {
             HostModelUtils.ENV_TEST -> "test"
             else -> "online"
         }
-        MMKVManager.instance.userKV.encode(keyName, jsonObject.toString())
+        MMKVManager.getInstance().userKV.encode(keyName, jsonObject.toString())
     }
 
     private fun toList(json: String): MutableList<Session> {

+ 1 - 1
module_eyuan/library_hk_language/publish.gradle

@@ -4,7 +4,7 @@ apply plugin: 'signing'
 ext {
     PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
     PUBLISH_ARTIFACT_ID = 'eyuancomm-lang-hk'
-    PUBLISH_VERSION = '1.0.0-rc8'
+    PUBLISH_VERSION = '1.0.0-rc10'
 }
 
 Properties properties = new Properties()

+ 1 - 1
module_eyuan/library_vn_language/publish.gradle

@@ -4,7 +4,7 @@ apply plugin: 'signing'
 ext {
     PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
     PUBLISH_ARTIFACT_ID = 'eyuancomm-lang-vn'
-    PUBLISH_VERSION = '1.0.0-rc8'
+    PUBLISH_VERSION = '1.0.0-rc10'
 }
 
 Properties properties = new Properties()