Commit 6240225b authored by wanglei's avatar wanglei

...

parent d9fbd4be
......@@ -21,6 +21,11 @@ import com.base.datarecovery.utils.InstallHelps
import com.base.datarecovery.utils.LogEx
import com.base.datarecovery.utils.NewComUtils
import com.google.android.gms.ads.MobileAds
import com.google.android.gms.ads.identifier.AdvertisingIdClient
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.async
import kotlinx.coroutines.launch
import java.util.UUID
class MyApplication : BaseApplication() {
......@@ -63,21 +68,17 @@ class MyApplication : BaseApplication() {
initAdMax()
}
InstallHelps.init()
NewComUtils.requestCfg {
ScreenStatusReceiver.setupScreenStatusListener(this)
val timerStatus: Int = AppPreferences.getInstance().getString("timerS", "1").toIntOrNull() ?: 1
if (timerStatus == 0) {
RecoveryTimerManager.getInstance().stopTaskTimer()
} else {
val timerDelay: Int = AppPreferences.getInstance().getString("timerDelay", "1").toIntOrNull() ?: 1
val timerInterval: Int = AppPreferences.getInstance().getString("timerInterval", "7").toIntOrNull() ?: 7
if (!RecoveryTimerManager.getInstance().isTaskTimerActive) {
RecoveryTimerManager.getInstance().scheduleTask(
(timerDelay * 60 * 1000).toLong(),
(timerInterval * 60 * 1000).toLong()
)
MainScope().launch(Dispatchers.Main) {
val deferred = async(Dispatchers.IO) {
try {
AdvertisingIdClient.getAdvertisingIdInfo(context).id
} catch (_: Exception) {
"unknown"
}
}
val gid = deferred.await() ?: ""
AppPreferences.getInstance().put("gid", gid)
}
}
initLifeListener()
......
......@@ -14,11 +14,11 @@ object AdMaxEvent {
obj.put("source", nativeAd.dspName)
obj.put("ad_unit", adUnit)
// val credentials = mapOf(
// "placementid" to response?.credentials?.get("placementid"),
// "appid" to response?.credentials?.get("appid"),
// "pubid" to response?.credentials?.get("pubid")
// )
val credentials = mapOf(
"placementid" to nativeAd.placement,
"appid" to nativeAd.adUnitId,
// "pubid" to
)
// obj.put("credentials", credentials.toString())
// obj.put("session_id", responseInfo?.responseId)
// obj.put("networkname", responseInfo?.mediationAdapterClassName)
......
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