- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
68 lines
3.2 KiB
Java
68 lines
3.2 KiB
Java
package com.glu.plugins.gluanalytics;
|
|
|
|
import android.content.Intent;
|
|
import android.content.IntentFilter;
|
|
import android.os.Bundle;
|
|
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
|
|
import com.glu.plugins.gluanalytics.util.CollectionUtil;
|
|
import com.glu.plugins.gluanalytics.util.EventBus;
|
|
import com.glu.plugins.gluanalytics.util.Subscriber;
|
|
import com.glu.plugins.gluanalytics.util.YLogger;
|
|
import com.ironsource.nb;
|
|
import csdk.gluads.Consts;
|
|
import java.util.Collections;
|
|
import java.util.UUID;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class AnalyticsSubscriber implements Subscriber {
|
|
private static final String ACTION_LOG_EVENT = "com.glu.intent.action.LOG_EVENT";
|
|
private static final String ACTION_TRACK_REVENUE = "com.glu.intent.action.TRACK_REVENUE";
|
|
private final IAnalytics mAnalytics;
|
|
private final YLogger mLog = YLogger.create(getClass());
|
|
|
|
private AnalyticsSubscriber(IAnalytics iAnalytics) {
|
|
this.mAnalytics = iAnalytics;
|
|
}
|
|
|
|
public static Subscriber subscribe(EventBus eventBus, UUID uuid, IAnalytics iAnalytics) {
|
|
IntentFilter intentFilter = new IntentFilter();
|
|
intentFilter.addAction(ACTION_LOG_EVENT);
|
|
intentFilter.addAction(ACTION_TRACK_REVENUE);
|
|
AnalyticsSubscriber analyticsSubscriber = new AnalyticsSubscriber(iAnalytics);
|
|
eventBus.subscribe(uuid, analyticsSubscriber, Collections.singleton(intentFilter));
|
|
return analyticsSubscriber;
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.util.Subscriber
|
|
public void onReceive(EventBus eventBus, Intent intent) {
|
|
String action = intent.getAction();
|
|
if (ACTION_LOG_EVENT.equals(action)) {
|
|
logEvent(intent);
|
|
} else if (ACTION_TRACK_REVENUE.equals(action)) {
|
|
trackRevenue(intent);
|
|
} else {
|
|
this.mLog.i("ANALYTICS.BROADCAST.ERROR", InneractiveMediationDefs.GENDER_MALE, "unsupported-action", Consts.KEY_TAPJOY_USER_ID_VERSION, action);
|
|
}
|
|
}
|
|
|
|
private static Number getNumber(Bundle bundle, String str, Number number) {
|
|
Object obj = bundle.get(str);
|
|
return obj != null ? (Number) obj : number;
|
|
}
|
|
|
|
private void logEvent(Intent intent) {
|
|
Bundle extras = intent.getExtras();
|
|
String stringExtra = intent.getStringExtra(nb.q);
|
|
String stringExtra2 = intent.getStringExtra("st1");
|
|
String stringExtra3 = intent.getStringExtra("st2");
|
|
String stringExtra4 = intent.getStringExtra("st3");
|
|
Number number = getNumber(extras, Consts.KEY_TAPJOY_USER_ID_VERSION, null);
|
|
Number number2 = getNumber(extras, "l", null);
|
|
this.mAnalytics.internal_logEvent(stringExtra, stringExtra2, stringExtra3, stringExtra4, number != null ? Long.valueOf(number.longValue()) : null, number2 != null ? Long.valueOf(number2.longValue()) : null, CollectionUtil.toMap(intent.getBundleExtra("data")));
|
|
}
|
|
|
|
private void trackRevenue(Intent intent) {
|
|
this.mAnalytics.internal_trackRevenueInUsd(getNumber(intent.getExtras(), "price-usd", Double.valueOf(0.0d)).doubleValue(), intent.getStringExtra("st1"), intent.getStringExtra("st2"), intent.getStringExtra("st3"), CollectionUtil.toMap(intent.getBundleExtra("data")));
|
|
}
|
|
}
|