|
@@ -34,6 +34,7 @@ import cn.yyxx.support.device.DeviceInfoUtils
|
|
import cn.yyxx.support.gaid.GAIDUtils
|
|
import cn.yyxx.support.gaid.GAIDUtils
|
|
import cn.yyxx.support.hawkeye.LogUtils
|
|
import cn.yyxx.support.hawkeye.LogUtils
|
|
import cn.yyxx.support.hawkeye.OwnDebugUtils
|
|
import cn.yyxx.support.hawkeye.OwnDebugUtils
|
|
|
|
+import com.google.firebase.crashlytics.FirebaseCrashlytics
|
|
import java.util.concurrent.atomic.AtomicInteger
|
|
import java.util.concurrent.atomic.AtomicInteger
|
|
|
|
|
|
|
|
|
|
@@ -79,9 +80,11 @@ class SdkBridgeImpl(context: Context) {
|
|
if (code == 0) {
|
|
if (code == 0) {
|
|
Logger.i("谷歌框架可以访问,请求gaid")
|
|
Logger.i("谷歌框架可以访问,请求gaid")
|
|
SdkDrive.instance.setParam("device_id", GAIDUtils.getGoogleAdid())
|
|
SdkDrive.instance.setParam("device_id", GAIDUtils.getGoogleAdid())
|
|
|
|
+ FirebaseCrashlytics.getInstance().setCustomKey("device_id", GAIDUtils.getGoogleAdid())
|
|
} else {
|
|
} else {
|
|
Logger.e("谷歌框架不可访问,使用android id替代")
|
|
Logger.e("谷歌框架不可访问,使用android id替代")
|
|
SdkDrive.instance.setParam("device_id", DeviceInfoUtils.getAndroidDeviceId(application))
|
|
SdkDrive.instance.setParam("device_id", DeviceInfoUtils.getAndroidDeviceId(application))
|
|
|
|
+ FirebaseCrashlytics.getInstance().setCustomKey("device_id", DeviceInfoUtils.getAndroidDeviceId(application))
|
|
}
|
|
}
|
|
hasReadGaid = true
|
|
hasReadGaid = true
|
|
}
|
|
}
|
|
@@ -156,6 +159,8 @@ class SdkBridgeImpl(context: Context) {
|
|
if (resultInfo.code == 1 && !TextUtils.isEmpty(resultInfo.data)) {
|
|
if (resultInfo.code == 1 && !TextUtils.isEmpty(resultInfo.data)) {
|
|
initBean = InitBean.toBean(resultInfo.data)
|
|
initBean = InitBean.toBean(resultInfo.data)
|
|
//TODO 下载图片资源
|
|
//TODO 下载图片资源
|
|
|
|
+ cacheImageResource(activity)
|
|
|
|
+
|
|
Linking.instance.create(activity)
|
|
Linking.instance.create(activity)
|
|
showInitDialog(activity, callback, initCallback)
|
|
showInitDialog(activity, callback, initCallback)
|
|
FloatCenterServiceManager.instance.init(activity)
|
|
FloatCenterServiceManager.instance.init(activity)
|
|
@@ -168,6 +173,33 @@ class SdkBridgeImpl(context: Context) {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ private fun cacheImageResource(activity: Activity) {
|
|
|
|
+ //浮标icon
|
|
|
|
+ initBean.floatCfg.floatIconUrl =
|
|
|
|
+ "http://gogs.yyxxgame.com/Client/EYuanGameSdk-KTX/raw/eb71e59d47ea88a5200cfe691e550334b38fff48/library_core/src/main/res/drawable-xhdpi/yyxx_float_logo_img.png"
|
|
|
|
+ initBean.floatCfg.floatIconLeftUrl =
|
|
|
|
+ "http://gogs.yyxxgame.com/Client/EYuanGameSdk-KTX/raw/eb71e59d47ea88a5200cfe691e550334b38fff48/library_core/src/main/res/drawable-xhdpi/yyxx_float_logo_left_img.png"
|
|
|
|
+ initBean.floatCfg.floatIconRightUrl =
|
|
|
|
+ "http://gogs.yyxxgame.com/Client/EYuanGameSdk-KTX/raw/eb71e59d47ea88a5200cfe691e550334b38fff48/library_core/src/main/res/drawable-xhdpi/yyxx_float_logo_right_img.png"
|
|
|
|
+
|
|
|
|
+ SdkRequest.instance.downloadImageFile(activity, initBean.floatCfg.floatIconUrl)
|
|
|
|
+ //左边
|
|
|
|
+ SdkRequest.instance.downloadImageFile(activity, initBean.floatCfg.floatIconLeftUrl)
|
|
|
|
+ //右边
|
|
|
|
+ SdkRequest.instance.downloadImageFile(activity, initBean.floatCfg.floatIconRightUrl)
|
|
|
|
+// //会员中心
|
|
|
|
+// SdkRequest.instance.downloadImageFile(activity, initBean.floatCfg.floatIconUrl)
|
|
|
|
+// //礼包
|
|
|
|
+// SdkRequest.instance.downloadImageFile(activity, initBean.floatCfg.floatIconUrl)
|
|
|
|
+// //客服
|
|
|
|
+// SdkRequest.instance.downloadImageFile(activity, initBean.floatCfg.floatIconUrl)
|
|
|
|
+// //储值
|
|
|
|
+// SdkRequest.instance.downloadImageFile(activity, initBean.floatCfg.floatIconUrl)
|
|
|
|
+// //邀请
|
|
|
|
+// SdkRequest.instance.downloadImageFile(activity, initBean.floatCfg.floatIconUrl)
|
|
|
|
+ }
|
|
|
|
+
|
|
private fun showInitDialog(activity: Activity, callback: ICallback, initCallback: IInitialize) {
|
|
private fun showInitDialog(activity: Activity, callback: ICallback, initCallback: IInitialize) {
|
|
isShowInitDialog = false
|
|
isShowInitDialog = false
|
|
initState = true
|
|
initState = true
|
|
@@ -225,6 +257,7 @@ class SdkBridgeImpl(context: Context) {
|
|
if (SdkBackLoginInfo.instance.isRegUser) {
|
|
if (SdkBackLoginInfo.instance.isRegUser) {
|
|
Linking.instance.register(activity)
|
|
Linking.instance.register(activity)
|
|
}
|
|
}
|
|
|
|
+ FirebaseCrashlytics.getInstance().setUserId(SdkBackLoginInfo.instance.userId)
|
|
Linking.instance.login(activity)
|
|
Linking.instance.login(activity)
|
|
}
|
|
}
|
|
callback.onResult(code, result)
|
|
callback.onResult(code, result)
|
|
@@ -237,6 +270,7 @@ class SdkBridgeImpl(context: Context) {
|
|
|
|
|
|
this.roleInfo = null
|
|
this.roleInfo = null
|
|
SdkBackLoginInfo.instance.reset()
|
|
SdkBackLoginInfo.instance.reset()
|
|
|
|
+ FirebaseCrashlytics.getInstance().setUserId("")
|
|
FloatCenterServiceManager.instance.detach()
|
|
FloatCenterServiceManager.instance.detach()
|
|
callback.onResult(0, "用户登出成功")
|
|
callback.onResult(0, "用户登出成功")
|
|
}
|
|
}
|