- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
1427 lines
67 KiB
Java
1427 lines
67 KiB
Java
package com.glu.plugins.gluanalytics;
|
|
|
|
import android.content.ContentResolver;
|
|
import android.content.Context;
|
|
import android.content.SharedPreferences;
|
|
import android.content.pm.PackageManager;
|
|
import android.net.Uri;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import android.os.Message;
|
|
import android.provider.Settings;
|
|
import android.text.TextUtils;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.core.app.NotificationCompat;
|
|
import com.amazonaws.util.IOUtils;
|
|
import com.ea.nimble.pushtng.PushNotification;
|
|
import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
|
|
import com.facebook.share.internal.ShareConstants;
|
|
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
|
|
import com.glu.plugins.gluanalytics.AnalyticsData;
|
|
import com.glu.plugins.gluanalytics.eventbus.GluEventBus;
|
|
import com.glu.plugins.gluanalytics.kvstore.StringStore;
|
|
import com.glu.plugins.gluanalytics.network.GluTLS12SocketFactory;
|
|
import com.glu.plugins.gluanalytics.network.NetworkReachability;
|
|
import com.glu.plugins.gluanalytics.util.CollectionUtil;
|
|
import com.glu.plugins.gluanalytics.util.Common;
|
|
import com.glu.plugins.gluanalytics.util.ConfigUtil;
|
|
import com.glu.plugins.gluanalytics.util.Conversion;
|
|
import com.glu.plugins.gluanalytics.util.Crypto;
|
|
import com.glu.plugins.gluanalytics.util.GoogleAdvertisingIDUtil;
|
|
import com.glu.plugins.gluanalytics.util.YLogger;
|
|
import com.google.android.gms.appset.AppSet;
|
|
import com.google.android.gms.appset.AppSetIdInfo;
|
|
import com.google.android.gms.tasks.OnCompleteListener;
|
|
import com.google.android.gms.tasks.Task;
|
|
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
|
|
import com.ironsource.ad;
|
|
import com.ironsource.nb;
|
|
import com.mbridge.msdk.foundation.same.report.i;
|
|
import com.mbridge.msdk.foundation.tools.SameMD5;
|
|
import com.mbridge.msdk.newreward.function.common.MBridgeCommon;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
|
|
import com.unity3d.ads.core.domain.GetAndroidAdPlayerContext;
|
|
import csdk.gluads.Consts;
|
|
import java.io.BufferedInputStream;
|
|
import java.io.IOException;
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.math.BigDecimal;
|
|
import java.net.MalformedURLException;
|
|
import java.net.URL;
|
|
import java.net.URLConnection;
|
|
import java.net.URLEncoder;
|
|
import java.net.UnknownHostException;
|
|
import java.nio.charset.Charset;
|
|
import java.security.InvalidKeyException;
|
|
import java.security.MessageDigest;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.util.Arrays;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Locale;
|
|
import java.util.Map;
|
|
import java.util.UUID;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
import javax.crypto.ShortBufferException;
|
|
import javax.net.ssl.HttpsURLConnection;
|
|
import org.json.JSONException;
|
|
import org.json.JSONStringer;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class GluAnalytics extends Handler implements IAnalytics, IAnalyticsParametersGetter {
|
|
private static final int ARG1_APP_RESUME = 20;
|
|
private static final int ARG1_APP_START = 10;
|
|
private static final long HEARTBEAT_PERIOD_MS = 30000;
|
|
public static final String KEY_INTERNAL_TARGETED_ADS = "internalTargetedAds";
|
|
public static final String KEY_USAGE_SHARING = "usageSharing";
|
|
private static final String LOG_EVENT_SOURCE_CLIENT = "SDK_CUSTOM";
|
|
private static final String LOG_EVENT_SOURCE_SDK = "SDK_STANDARD";
|
|
private static final int MESSAGE_DESTROY = 110;
|
|
private static final int MESSAGE_HEARTBEAT = 60;
|
|
private static final int MESSAGE_LOG_CPU_EVENT = 140;
|
|
private static final int MESSAGE_LOG_EVT_EVENT = 30;
|
|
private static final int MESSAGE_LOG_EVT_EVENT_WITH_GCS_USER = 190;
|
|
private static final int MESSAGE_LOG_EVT_PINPOINT = 210;
|
|
private static final int MESSAGE_LOG_MTU_EVENT = 40;
|
|
private static final int MESSAGE_LOG_MTU_EVENT_TO_PENGUIN = 50;
|
|
private static final int MESSAGE_PERFORMANCE_EVENT = 180;
|
|
private static final int MESSAGE_PPS_UPDATE_VALUE = 80;
|
|
private static final int MESSAGE_SESSION_ID = 160;
|
|
private static final int MESSAGE_SET_REVID = 100;
|
|
private static final int MESSAGE_SET_SESSION_ID = 170;
|
|
private static final int MESSAGE_SET_USER_ID = 130;
|
|
private static final int MESSAGE_START_SESSION = 10;
|
|
private static final int MESSAGE_START_SESSION_REAL = 200;
|
|
private static final int MESSAGE_STOP_SESSION = 20;
|
|
private static final String PWD_CRYPTO_CHECKSUM = "appinstalled";
|
|
private static final long SESSION_ID_PERIOD_MS = 60000;
|
|
private static final String SPKEY_APP_INSTALLED = "appinstalled";
|
|
private static final String SPKEY_DEVICE_ID = "analyticsDeviceIdentifier";
|
|
private static final String SPKEY_DEVICE_ID_CHECKSUM = "analyticsDeviceIdentifierCheck";
|
|
private static final String SPKEY_LAST_LAUNCH_TIMESTAMP = "lastLaunchTimestamp";
|
|
private static final String SPKEY_REVID = "revid";
|
|
private static final String SPKEY_REVID_CHECKSUM = "revidChecksum";
|
|
private static final String SPKEY_REVID_SYNCED = "revidSynced";
|
|
private static final String SPKEY_SESSION_COUNT = "sessionCount";
|
|
private static final String SPKEY_SESSION_ID = "sessionID";
|
|
private Boolean mAdTrackingLimited;
|
|
private String mAmazonAdvertisingId;
|
|
private boolean mAmazonLimitAdTracking;
|
|
private final IRecordStream mAnalyticsRecordStream;
|
|
private final String mAnalyticsStreamName;
|
|
private String mAndroidId;
|
|
private final String mAppName;
|
|
private String mAppSetId;
|
|
private final Context mApplicationContext;
|
|
private CacheService mCacheService;
|
|
private IAnalyticsCallback mCallback;
|
|
private List<Object> mCriticalEventList;
|
|
private final AtomicReference<String> mDeviceId;
|
|
private final String mEnvironment;
|
|
private ExecutorService mExecutor;
|
|
private final Map<String, String[]> mExtraFields;
|
|
private final AtomicReference<GeoLocation> mGeoLocation;
|
|
private final URL mGeoLookUpUrl;
|
|
private String mGoogleAdvertisingId;
|
|
private boolean mInternalTargetedAds;
|
|
private boolean mIsAmazonDevice;
|
|
private final YLogger mLog;
|
|
private NetworkReachability mNetworkReachability;
|
|
private final boolean mOneWayHashUID;
|
|
private final String mPPSAppName;
|
|
private final IRecordStream mPPSRecordStream;
|
|
private final String mPPSStreamName;
|
|
private final Map<String, Object> mPartialCpuData;
|
|
private IPerformance mPerformance;
|
|
private GluAnalyticsPinpoint mPinpointImpl;
|
|
private final AtomicReference<RevIDInfo> mRevID;
|
|
private final boolean mRevIDEnabled;
|
|
private final Map<String, Object> mRuntimeConfig;
|
|
private final boolean mSendGeoEvent;
|
|
private final boolean mSendPenguinMTU;
|
|
private final AtomicReference<String> mSessionID;
|
|
private final String mSessionIDBaseAddress;
|
|
private long mSessionLimitOrphanEvent;
|
|
private final AtomicBoolean mSessionStopCalled;
|
|
private final SharedPreferences mSharedPrefs;
|
|
private boolean mShortcircuitEATargetedMarketing;
|
|
private final boolean mTomographyEnabled;
|
|
private final String mUnityVersion;
|
|
private boolean mUsageSharing;
|
|
private boolean mut_appForeground;
|
|
private String mut_userId;
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalyticsParametersGetter
|
|
public String getAnalyticsApplicationName() {
|
|
return this.mAppName;
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalyticsParametersGetter
|
|
public String getAnalyticsEnvironment() {
|
|
return this.mEnvironment;
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void shortcircuitEATargetedMarketingOff() {
|
|
this.mShortcircuitEATargetedMarketing = true;
|
|
}
|
|
|
|
public GluAnalytics(Context context, Looper looper, String str, String str2, String str3, Map<String, Object> map, URL url, String str4, SharedPreferences sharedPreferences, IRecordStream iRecordStream, String str5, IRecordStream iRecordStream2, String str6, String str7, String str8, String str9, IPerformance iPerformance, long j, boolean z, boolean z2, boolean z3, boolean z4, List<Object> list, CacheService cacheService, boolean z5, boolean z6) {
|
|
super(looper);
|
|
this.mLog = YLogger.create(getClass());
|
|
Context applicationContext = context.getApplicationContext();
|
|
this.mApplicationContext = applicationContext;
|
|
this.mGeoLookUpUrl = url;
|
|
AtomicReference<String> atomicReference = new AtomicReference<>();
|
|
this.mDeviceId = atomicReference;
|
|
this.mRevID = new AtomicReference<>(new RevIDInfo(null, false));
|
|
this.mSessionID = new AtomicReference<>();
|
|
this.mExtraFields = buildExtraFields(str, str2, str3, str8, str9, map);
|
|
this.mPartialCpuData = buildPartialCpuData(map);
|
|
this.mSharedPrefs = sharedPreferences;
|
|
this.mAnalyticsRecordStream = iRecordStream;
|
|
this.mAnalyticsStreamName = str5;
|
|
this.mAppName = str;
|
|
this.mEnvironment = str2;
|
|
this.mRevIDEnabled = z;
|
|
this.mut_userId = z2 ? ConfigUtil.getString(map, AnalyticsData.S_USER_ID) : null;
|
|
this.mSessionStopCalled = new AtomicBoolean(false);
|
|
this.mExecutor = Executors.newFixedThreadPool(2);
|
|
this.mPPSRecordStream = iRecordStream2;
|
|
this.mPPSStreamName = str6;
|
|
this.mPPSAppName = str7;
|
|
this.mSessionIDBaseAddress = str4;
|
|
this.mSessionLimitOrphanEvent = j;
|
|
this.mRuntimeConfig = CollectionUtil.shallowClone(map);
|
|
this.mUnityVersion = ConfigUtil.getString(map, AnalyticsData.S_UNITY_VERSION, null);
|
|
this.mNetworkReachability = new NetworkReachability(applicationContext);
|
|
this.mGeoLocation = new AtomicReference<>(null);
|
|
this.mPerformance = iPerformance;
|
|
if (iPerformance != null) {
|
|
iPerformance.internal_SetAnalytics(this);
|
|
}
|
|
this.mCacheService = cacheService;
|
|
this.mTomographyEnabled = z3;
|
|
this.mSendPenguinMTU = z4;
|
|
this.mOneWayHashUID = z5;
|
|
this.mSendGeoEvent = z6;
|
|
this.mCriticalEventList = list;
|
|
this.mUsageSharing = sharedPreferences.getBoolean(KEY_USAGE_SHARING, true);
|
|
this.mInternalTargetedAds = sharedPreferences.getBoolean(KEY_INTERNAL_TARGETED_ADS, true);
|
|
this.mShortcircuitEATargetedMarketing = false;
|
|
String string = sharedPreferences.getString(SPKEY_DEVICE_ID, null);
|
|
if (isEmptyDeviceId(string)) {
|
|
return;
|
|
}
|
|
atomicReference.set(string);
|
|
}
|
|
|
|
public void enablePinpoint(GluEventBus gluEventBus) {
|
|
this.mPinpointImpl = new GluAnalyticsPinpoint(gluEventBus, this);
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void init(IAnalyticsCallback iAnalyticsCallback) {
|
|
this.mLog.i("GLUANALYTICS.INIT", new Object[0]);
|
|
this.mCallback = iAnalyticsCallback;
|
|
sendMessageAtFrontOfQueue(obtainMessage(10, 10, 0));
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void destroy() {
|
|
this.mLog.i("GLUANALYTICS.DESTROY", new Object[0]);
|
|
sendMessage(obtainMessage(110));
|
|
IPerformance iPerformance = this.mPerformance;
|
|
if (iPerformance != null) {
|
|
iPerformance.destroy();
|
|
}
|
|
CacheService cacheService = this.mCacheService;
|
|
if (cacheService != null) {
|
|
cacheService.destroy();
|
|
this.mCacheService = null;
|
|
}
|
|
GluAnalyticsPinpoint gluAnalyticsPinpoint = this.mPinpointImpl;
|
|
if (gluAnalyticsPinpoint != null) {
|
|
gluAnalyticsPinpoint.destroy();
|
|
this.mPinpointImpl = null;
|
|
}
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void onResume() {
|
|
this.mLog.i("LIFECYCLE.RESUME", new Object[0]);
|
|
sendMessage(obtainMessage(10, 20, 0));
|
|
IPerformance iPerformance = this.mPerformance;
|
|
if (iPerformance != null) {
|
|
iPerformance.onResume();
|
|
}
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void onPause() {
|
|
this.mLog.i("LIFECYCLE.PAUSE", new Object[0]);
|
|
sendEmptyMessage(20);
|
|
IPerformance iPerformance = this.mPerformance;
|
|
if (iPerformance != null) {
|
|
iPerformance.onPause();
|
|
}
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void perfSampleStart(String str, int i, Map<String, ?> map) {
|
|
IPerformance iPerformance = this.mPerformance;
|
|
if (iPerformance != null) {
|
|
iPerformance.perfSampleStart(str, i, map);
|
|
}
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void perfSampleEnd(String str, Map<String, ?> map) {
|
|
IPerformance iPerformance = this.mPerformance;
|
|
if (iPerformance != null) {
|
|
iPerformance.perfSampleEnd(str, map);
|
|
}
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public PerfMeasure perfGetValues() {
|
|
IPerformance iPerformance = this.mPerformance;
|
|
if (iPerformance == null) {
|
|
return new PerfMeasure();
|
|
}
|
|
return iPerformance.perfGetValues();
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public boolean perfSampleAction(String str, int i) {
|
|
IPerformance iPerformance = this.mPerformance;
|
|
if (iPerformance == null) {
|
|
return false;
|
|
}
|
|
return iPerformance.perfSampleAction(str, i);
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void logEvent(String str, String str2, String str3, String str4, Long l, Long l2, Map<String, ?> map) {
|
|
List<Object> list;
|
|
if (!this.mUsageSharing && ((list = this.mCriticalEventList) == null || !list.contains(str))) {
|
|
return;
|
|
}
|
|
sendMessage(obtainMessage(30, beginJsonEvent("evt", str, str2, str3, str4, l, l2, map, LOG_EVENT_SOURCE_CLIENT)));
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void internal_logCpuEvent(Map<String, ?> map) {
|
|
sendMessage(obtainMessage(140, map));
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void internal_logEvent_adImpression(String str, String str2, String str3, String str4, BigDecimal bigDecimal, Long l, Map<String, ?> map) {
|
|
sendMessage(obtainMessage(30, beginJsonEvent("evt", str, str2, str3, str4, bigDecimal, l, map, LOG_EVENT_SOURCE_SDK)));
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void internal_logEvent(String str, String str2, String str3, String str4, Long l, Long l2, Map<String, ?> map) {
|
|
String string;
|
|
JSONStringer beginJsonEvent = beginJsonEvent("evt", str, str2, str3, str4, l, l2, map, LOG_EVENT_SOURCE_SDK);
|
|
String str5 = this.mut_userId;
|
|
if ((str5 == null || TextUtils.isEmpty(str5)) && (string = ConfigUtil.getString(map, "gluCentralServicesUserID")) != null && !TextUtils.isEmpty(string)) {
|
|
sendMessage(obtainMessage(190, new LogEventWithGCSUser(beginJsonEvent, string)));
|
|
} else {
|
|
sendMessage(obtainMessage(30, beginJsonEvent));
|
|
}
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public GeoLocation getGeoLocation() {
|
|
return this.mGeoLocation.get();
|
|
}
|
|
|
|
private String buildMarketingHash(String str, String str2, String str3, String str4, String str5, String str6) {
|
|
String format = String.format("%s%s%s%s%s%s", str, str2, str3, str4, str5, str6);
|
|
try {
|
|
MessageDigest messageDigest = MessageDigest.getInstance(SameMD5.TAG);
|
|
messageDigest.update(format.getBytes());
|
|
byte[] digest = messageDigest.digest();
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
for (byte b : digest) {
|
|
stringBuffer.append(String.format("%02X", Byte.valueOf(b)));
|
|
}
|
|
return stringBuffer.toString();
|
|
} catch (NoSuchAlgorithmException e) {
|
|
throw Common.propagate(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void internal_updatePSValue(String str, boolean z, String str2, String str3, String str4, String str5, String str6, String str7) {
|
|
String createReqId;
|
|
String str8 = z ? "DPS" : "PPS";
|
|
try {
|
|
JSONStringer beginJsonEvent = beginJsonEvent("p_eng", str2, str8, "UPDATE", this.mPPSAppName, str5, str4, null, LOG_EVENT_SOURCE_SDK);
|
|
if (TextUtils.isEmpty(str7)) {
|
|
createReqId = createReqIdAndForwardToGCS(str8, str, str2, str3, str4, str5, str6);
|
|
} else {
|
|
createReqId = createReqId(str8, str, str2, str4, str5);
|
|
}
|
|
CollectionUtil.putIfNotEmpty(beginJsonEvent, "su", str6);
|
|
CollectionUtil.putIfNotEmpty(beginJsonEvent, "c", str3);
|
|
CollectionUtil.putIfNotEmpty(beginJsonEvent, "req_id", createReqId);
|
|
sendMessage(obtainMessage(80, new PSValueUpdate(beginJsonEvent, str, z)));
|
|
} catch (JSONException e) {
|
|
throw Common.propagate(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void internal_pinpointAttribute(String str, String str2, String str3, Map<String, Object> map) {
|
|
try {
|
|
if (TextUtils.isEmpty(str3)) {
|
|
str3 = this.mut_userId;
|
|
}
|
|
JSONStringer beginJsonEvent = beginJsonEvent(str.equals(NotificationCompat.CATEGORY_EVENT) ? "mkt_event" : "mkt", str, "MKT", "UPDATE", this.mPPSAppName, str2, "string", map, LOG_EVENT_SOURCE_SDK);
|
|
String buildMarketingHash = buildMarketingHash(getAnalyticsApplicationName(), str3, str, "string", str2, getAnalyticsDeviceIdentifier());
|
|
CollectionUtil.putIfNotEmpty(beginJsonEvent, "su", "upsert");
|
|
CollectionUtil.putIfNotEmpty(beginJsonEvent, "req_id", buildMarketingHash);
|
|
sendMessage(obtainMessage(210, new PSValueUpdate(beginJsonEvent, str3, false)));
|
|
} catch (JSONException e) {
|
|
throw Common.propagate(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void userAgedUp() {
|
|
HashMap hashMap = new HashMap();
|
|
hashMap.put(KEY_INTERNAL_TARGETED_ADS, Boolean.TRUE);
|
|
setCustomProperties(hashMap);
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void setEATargetedMarketing(boolean z) {
|
|
HashMap hashMap = new HashMap();
|
|
hashMap.put(KEY_INTERNAL_TARGETED_ADS, Boolean.valueOf(z));
|
|
setCustomProperties(hashMap);
|
|
}
|
|
|
|
private String createReqId(String str, String str2, String str3, String str4, String str5) {
|
|
return buildMarketingHash(getAnalyticsApplicationName(), str.equals("PPS") ? str2 : "", str3, str4, str5, str.equals("PPS") ? "" : getAnalyticsDeviceIdentifier());
|
|
}
|
|
|
|
private String createReqIdAndForwardToGCS(String str, String str2, String str3, String str4, String str5, String str6, String str7) {
|
|
String createReqId = createReqId(str, str2, str3, str5, str6);
|
|
this.mCallback.recordAnalyticsRequest(str, str3, str4, str5, str6, str7, createReqId);
|
|
return createReqId;
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void internal_setRevID(String str, String str2, boolean z) {
|
|
HashMap hashMap = new HashMap();
|
|
hashMap.put(SPKEY_REVID, str);
|
|
hashMap.put("initialPlatform", str2);
|
|
sendMessage(obtainMessage(100, z ? 1 : 0, 0, hashMap));
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void internal_trackRevenueInUsd(double d, String str, String str2, String str3, Map<String, ?> map) {
|
|
Long valueOf = Long.valueOf(Conversion.usdToCents(d));
|
|
if (map != null && map.containsKey("ft") && map.get("ft").equals(1)) {
|
|
valueOf = null;
|
|
}
|
|
Long l = valueOf;
|
|
sendMessage(obtainMessage(40, beginJsonEvent("mtu", null, str, str2, str3, l, null, map, LOG_EVENT_SOURCE_SDK)));
|
|
if (this.mSendPenguinMTU) {
|
|
Map<String, ?> createMap = CollectionUtil.createMap();
|
|
CollectionUtil.putAll(createMap, map);
|
|
createMap.put("game_id", this.mPPSAppName);
|
|
sendMessage(obtainMessage(50, beginJsonEvent("mtu", null, str, str2, str3, l, null, createMap, LOG_EVENT_SOURCE_SDK)));
|
|
}
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void internal_perfEvent(String str, String str2, String str3, String str4, String str5, Map<String, Object> map) {
|
|
if (!TextUtils.isEmpty(this.mUnityVersion)) {
|
|
map.put("unity_ver", this.mUnityVersion);
|
|
}
|
|
sendMessage(obtainMessage(MESSAGE_PERFORMANCE_EVENT, beginJsonEvent("perf", str, str2, str3, str4, null, null, map, LOG_EVENT_SOURCE_SDK)));
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void setUserIdentifier(String str) {
|
|
this.mLog.i("ID.USER.SET", SDKConstants.PARAM_USER_ID, str);
|
|
sendMessage(obtainMessage(130, str));
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics
|
|
public void setCustomProperties(Map<String, Object> map) {
|
|
boolean z;
|
|
if (map != null) {
|
|
if (map.containsKey(KEY_USAGE_SHARING)) {
|
|
this.mUsageSharing = ConfigUtil.getBoolean(map, KEY_USAGE_SHARING, true);
|
|
SharedPreferences.Editor edit = this.mSharedPrefs.edit();
|
|
edit.putBoolean(KEY_USAGE_SHARING, this.mUsageSharing);
|
|
edit.apply();
|
|
internal_logEvent(null, "PRIVACY", this.mUsageSharing ? "USAGE_SHARING_ENABLED" : "USAGE_SHARING_DISABLED", null, null, null, null);
|
|
}
|
|
if (!map.containsKey(KEY_INTERNAL_TARGETED_ADS) || this.mShortcircuitEATargetedMarketing) {
|
|
return;
|
|
}
|
|
boolean contains = this.mSharedPrefs.contains(KEY_INTERNAL_TARGETED_ADS);
|
|
boolean z2 = this.mSharedPrefs.getBoolean(KEY_INTERNAL_TARGETED_ADS, true);
|
|
this.mInternalTargetedAds = ConfigUtil.getBoolean(map, KEY_INTERNAL_TARGETED_ADS, true);
|
|
SharedPreferences.Editor edit2 = this.mSharedPrefs.edit();
|
|
edit2.putBoolean(KEY_INTERNAL_TARGETED_ADS, this.mInternalTargetedAds);
|
|
edit2.apply();
|
|
unsync_doUpdatePSValue(null, true, KEY_INTERNAL_TARGETED_ADS, null, "bool", this.mInternalTargetedAds ? "true" : "false", "upsert");
|
|
internal_logEvent(null, "PRIVACY", this.mInternalTargetedAds ? "INTERNAL_TARGETED_ADS_ENABLED" : "INTERNAL_TARGETED_ADS_DISABLED", null, null, null, null);
|
|
if (!contains || z2 == (z = this.mInternalTargetedAds)) {
|
|
return;
|
|
}
|
|
this.mCallback.internalTargetedAdsChanged(z);
|
|
}
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalytics, com.glu.plugins.gluanalytics.IAnalyticsParametersGetter
|
|
public Map<String, Object> getCustomProperties() {
|
|
boolean z = this.mSharedPrefs.getBoolean(KEY_USAGE_SHARING, true);
|
|
boolean z2 = this.mSharedPrefs.getBoolean(KEY_INTERNAL_TARGETED_ADS, true);
|
|
if (this.mShortcircuitEATargetedMarketing) {
|
|
z2 = false;
|
|
}
|
|
HashMap hashMap = new HashMap();
|
|
hashMap.put(KEY_USAGE_SHARING, Boolean.valueOf(z));
|
|
hashMap.put(KEY_INTERNAL_TARGETED_ADS, Boolean.valueOf(z2));
|
|
return hashMap;
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalyticsParametersGetter
|
|
public String getAnalyticsDeviceIdentifier() {
|
|
return this.mDeviceId.get();
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalyticsParametersGetter
|
|
public String getRevenueIdentifier() {
|
|
RevIDInfo revIDInfo = this.mRevID.get();
|
|
if (revIDInfo != null) {
|
|
return revIDInfo.id;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.IAnalyticsParametersGetter
|
|
public String getSessionIdentifier() {
|
|
return this.mSessionID.get();
|
|
}
|
|
|
|
@Override // android.os.Handler
|
|
public void handleMessage(Message message) {
|
|
boolean z;
|
|
String str;
|
|
int i = message.what;
|
|
if (i == 10) {
|
|
this.mLog.i("GLUANALYTICS.MESSAGE_START_SESSION", new Object[0]);
|
|
Task<AppSetIdInfo> appSetIdInfo = AppSet.getClient(this.mApplicationContext).getAppSetIdInfo();
|
|
final int i2 = message.arg1;
|
|
appSetIdInfo.addOnCompleteListener(new OnCompleteListener<AppSetIdInfo>() { // from class: com.glu.plugins.gluanalytics.GluAnalytics.1
|
|
@Override // com.google.android.gms.tasks.OnCompleteListener
|
|
public void onComplete(@NonNull Task<AppSetIdInfo> task) {
|
|
if (task.isSuccessful()) {
|
|
GluAnalytics.this.mAppSetId = task.getResult().getId();
|
|
} else {
|
|
GluAnalytics.this.mLog.i("GLUANALYTICS.MESSAGE_START_SESSION.ERROR", "e", task.getException().getMessage());
|
|
GluAnalytics.this.mAppSetId = null;
|
|
}
|
|
GluAnalytics gluAnalytics = GluAnalytics.this;
|
|
gluAnalytics.sendMessageAtFrontOfQueue(gluAnalytics.obtainMessage(200, i2, 0));
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
if (i == 200) {
|
|
this.mLog.i("GLUANALYTICS.MESSAGE_START_SESSION_REAL", new Object[0]);
|
|
this.mut_appForeground = true;
|
|
this.mSessionID.set(null);
|
|
this.mSessionStopCalled.set(false);
|
|
if (message.arg1 == 10) {
|
|
this.mLog.i("GLUANALYTICS.appStart", new Object[0]);
|
|
AnalyticsData.AdvertisingIdInfo advertisingIdInfo = GoogleAdvertisingIDUtil.getAdvertisingIdInfo(this.mApplicationContext);
|
|
if (advertisingIdInfo != null) {
|
|
this.mGoogleAdvertisingId = upperCase(advertisingIdInfo.advertisingId);
|
|
this.mAdTrackingLimited = Boolean.valueOf(advertisingIdInfo.adTrackingLimited);
|
|
}
|
|
this.mAndroidId = upperCase(AnalyticsData.getAndroidId(this.mApplicationContext));
|
|
this.mIsAmazonDevice = false;
|
|
try {
|
|
ContentResolver contentResolver = this.mApplicationContext.getContentResolver();
|
|
this.mAmazonLimitAdTracking = Settings.Secure.getInt(contentResolver, "limit_ad_tracking") != 0;
|
|
this.mAmazonAdvertisingId = Settings.Secure.getString(contentResolver, "advertising_id");
|
|
this.mIsAmazonDevice = true;
|
|
} catch (Settings.SettingNotFoundException unused) {
|
|
this.mIsAmazonDevice = false;
|
|
this.mAmazonAdvertisingId = null;
|
|
this.mAmazonLimitAdTracking = false;
|
|
}
|
|
DeviceIdInfo deviceId = getDeviceId(this.mSharedPrefs, this.mGoogleAdvertisingId, this.mAndroidId, this.mAppSetId, this.mAmazonAdvertisingId, UUID.randomUUID().toString());
|
|
this.mDeviceId.set(deviceId.deviceId);
|
|
IPerformance iPerformance = this.mPerformance;
|
|
if (iPerformance != null) {
|
|
iPerformance.internal_LogLaunchOverhead();
|
|
}
|
|
if (this.mRevIDEnabled) {
|
|
RevIDInfo revID = getRevID(this.mSharedPrefs, deviceId.deviceId, this.mAndroidId);
|
|
this.mRevID.set(revID);
|
|
str = revID.id;
|
|
z = revID.synced;
|
|
} else {
|
|
z = false;
|
|
str = null;
|
|
}
|
|
this.mLog.i("LIFECYCLE.INIT.ID", "s", deviceId.deviceId, ShareConstants.FEED_SOURCE_PARAM, deviceId.source, "revID", str, "synced", Boolean.valueOf(z), "gaid", this.mGoogleAdvertisingId, "androidID", this.mAndroidId, "appSetId", this.mAppSetId);
|
|
this.mCallback.onInit(deviceId.deviceId, deviceId.source, str, this.mGoogleAdvertisingId, this.mAndroidId, this.mAppSetId);
|
|
unsync_doAppStart();
|
|
unsync_logDefaultSegmentationValues(this.mut_userId, this.mRuntimeConfig, true);
|
|
this.mCallback.onUserIdChanged(this.mut_userId, str);
|
|
sendDataToCacheService();
|
|
}
|
|
Long[] lArr = new Long[2];
|
|
unsync_doLogEvent("evt", "SESSION_START", "APP", "SESSION_START", null, null, null, buildSessionStartData(this.mAndroidId, this.mGoogleAdvertisingId, this.mAppSetId, Boolean.valueOf(this.mIsAmazonDevice), Boolean.valueOf(this.mAmazonLimitAdTracking), this.mAdTrackingLimited, this.mNetworkReachability.getNetworkType(), this.mTomographyEnabled ? Long.valueOf(AnalyticsData.getDeviceBootTimeSec(lArr)) : null, lArr[0], lArr[1]));
|
|
unsync_heartbeat();
|
|
unsync_sessionIDStart(getAnalyticsDeviceIdentifier());
|
|
return;
|
|
}
|
|
if (i == 20) {
|
|
unsync_doStopSession();
|
|
unsync_flushNow();
|
|
this.mSessionStopCalled.set(true);
|
|
this.mSessionID.set(null);
|
|
unsync_sessionID(getAnalyticsDeviceIdentifier(), true);
|
|
this.mut_appForeground = false;
|
|
return;
|
|
}
|
|
if (i == 30) {
|
|
unsync_endJsonEventAndLog(this.mAnalyticsRecordStream, this.mAnalyticsStreamName, (JSONStringer) message.obj);
|
|
if (this.mSessionStopCalled.get()) {
|
|
unsync_flushNow();
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (i == 190) {
|
|
LogEventWithGCSUser logEventWithGCSUser = (LogEventWithGCSUser) message.obj;
|
|
if (logEventWithGCSUser != null) {
|
|
unsync_endJsonEventAndLog(this.mAnalyticsRecordStream, this.mAnalyticsStreamName, logEventWithGCSUser.json, logEventWithGCSUser.userID);
|
|
if (this.mSessionStopCalled.get()) {
|
|
unsync_flushNow();
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (i == 80) {
|
|
PSValueUpdate pSValueUpdate = (PSValueUpdate) message.obj;
|
|
String str2 = !TextUtils.isEmpty(pSValueUpdate.userID) ? pSValueUpdate.userID : this.mut_userId;
|
|
unsync_assertCanUpdatePSValue(str2, pSValueUpdate.isDeviceValue, pSValueUpdate.json);
|
|
unsync_endJsonEventAndLog(this.mPPSRecordStream, this.mPPSStreamName, pSValueUpdate.json, str2);
|
|
this.mPPSRecordStream.flush();
|
|
return;
|
|
}
|
|
if (i == 40) {
|
|
unsync_endJsonEventAndLog(this.mAnalyticsRecordStream, this.mAnalyticsStreamName, (JSONStringer) message.obj);
|
|
unsync_flushNow();
|
|
return;
|
|
}
|
|
if (i == 50) {
|
|
JSONStringer jSONStringer = (JSONStringer) message.obj;
|
|
try {
|
|
unsync_endJsonEvent(jSONStringer, this.mut_userId);
|
|
this.mPPSRecordStream.saveRecord(this.mPPSStreamName, jSONStringer.toString());
|
|
this.mPPSRecordStream.flush();
|
|
return;
|
|
} catch (JSONException e) {
|
|
throw Common.propagate(e);
|
|
}
|
|
}
|
|
if (i == MESSAGE_PERFORMANCE_EVENT) {
|
|
unsync_endJsonEventAndLog(this.mAnalyticsRecordStream, this.mAnalyticsStreamName, (JSONStringer) message.obj);
|
|
unsync_flushNow();
|
|
return;
|
|
}
|
|
if (i == 60) {
|
|
unsync_heartbeat();
|
|
return;
|
|
}
|
|
if (i == MESSAGE_SESSION_ID) {
|
|
unsync_sessionIDStart(getAnalyticsDeviceIdentifier());
|
|
return;
|
|
}
|
|
if (i == MESSAGE_SET_SESSION_ID) {
|
|
if (this.mut_appForeground) {
|
|
String str3 = (String) message.obj;
|
|
if (!TextUtils.equals(str3, this.mSessionID.getAndSet(str3))) {
|
|
this.mLog.i("ID.SESSION.SET", "sessionID", str3);
|
|
this.mCallback.onUpdateSessionId();
|
|
sendDataToCacheService();
|
|
}
|
|
if (TextUtils.equals(str3, readLastSessionID(this.mSharedPrefs))) {
|
|
return;
|
|
}
|
|
writeLastSessionID(this.mSharedPrefs, str3);
|
|
SharedPreferences sharedPreferences = this.mSharedPrefs;
|
|
writeSessionCount(sharedPreferences, readSessionCount(sharedPreferences) + 1);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (i == 100) {
|
|
Map map = (Map) message.obj;
|
|
String str4 = (String) map.get(SPKEY_REVID);
|
|
String str5 = (String) map.get("initialPlatform");
|
|
boolean z2 = message.arg1 != 0;
|
|
if (TextUtils.isEmpty(str4)) {
|
|
this.mLog.e("ID.REVID.ERROR", "e", "revID can't be empty");
|
|
return;
|
|
}
|
|
RevIDInfo andSet = this.mRevID.getAndSet(new RevIDInfo(str4, z2));
|
|
if (TextUtils.equals(str4, andSet.id)) {
|
|
return;
|
|
}
|
|
sendDataToCacheService();
|
|
writeRevID(this.mSharedPrefs, str4, z2, this.mAndroidId);
|
|
this.mLog.i("ID.REVID.SET", "revID", str4, "synced", Boolean.valueOf(z2));
|
|
boolean z3 = readSessionCount(this.mSharedPrefs) <= this.mSessionLimitOrphanEvent;
|
|
if (TextUtils.isEmpty(andSet.id) || andSet.synced || !z2 || !z3) {
|
|
return;
|
|
}
|
|
this.mLog.i("ID.REVID.ORPHAN", "revID", str4, "oldRevID", andSet.id);
|
|
HashMap hashMap = new HashMap();
|
|
hashMap.put(SPKEY_REVID, andSet.id);
|
|
hashMap.put("initialPlatform", str5);
|
|
unsync_doLogEvent("evt", null, "SDK", "ORPHAN_REVID", null, null, null, hashMap);
|
|
return;
|
|
}
|
|
if (i == 110) {
|
|
this.mCallback.onDestroy();
|
|
return;
|
|
}
|
|
if (i == 130) {
|
|
String str6 = (String) message.obj;
|
|
String str7 = this.mut_userId;
|
|
this.mut_userId = str6;
|
|
if (TextUtils.equals(str6, str7)) {
|
|
return;
|
|
}
|
|
this.mCallback.onUserIdChanged(this.mut_userId, getRevenueIdentifier());
|
|
unsync_logDefaultSegmentationValues(str6, this.mRuntimeConfig, false);
|
|
sendDataToCacheService();
|
|
return;
|
|
}
|
|
if (i == 140) {
|
|
unsync_doLogEvent("cpu", null, "SDK", null, null, null, null, (Map) message.obj);
|
|
unsync_flushNow();
|
|
} else {
|
|
if (i == 210) {
|
|
PSValueUpdate pSValueUpdate2 = (PSValueUpdate) message.obj;
|
|
unsync_assertCanUpdatePSValue(pSValueUpdate2.userID, pSValueUpdate2.isDeviceValue, pSValueUpdate2.json);
|
|
unsync_endJsonEventAndLog(this.mPPSRecordStream, this.mPPSStreamName, pSValueUpdate2.json, pSValueUpdate2.userID);
|
|
this.mPPSRecordStream.flush();
|
|
return;
|
|
}
|
|
this.mLog.e("ASYNC.MESSAGE.ERROR", InneractiveMediationDefs.GENDER_MALE, "Unknown message", Consts.KEY_TAPJOY_USER_ID_VERSION, Integer.valueOf(i));
|
|
}
|
|
}
|
|
|
|
private static String[] flatten(Map<String, String> map) {
|
|
String[] strArr = new String[map.size() * 2];
|
|
int i = 0;
|
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
int i2 = i + 1;
|
|
strArr[i] = entry.getKey();
|
|
i += 2;
|
|
strArr[i2] = entry.getValue();
|
|
}
|
|
return strArr;
|
|
}
|
|
|
|
private static String upperCase(String str) {
|
|
if (str != null) {
|
|
return str.toUpperCase(Locale.ENGLISH);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private static DeviceIdInfo getDeviceId(SharedPreferences sharedPreferences, String str, String str2, String str3, String str4, String str5) {
|
|
String str6;
|
|
String readAnalyticsDeviceIdentifier = readAnalyticsDeviceIdentifier(sharedPreferences, str2);
|
|
if (!isEmptyDeviceId(readAnalyticsDeviceIdentifier)) {
|
|
return new DeviceIdInfo(upperCase(readAnalyticsDeviceIdentifier), "sharedPreferences");
|
|
}
|
|
if (!isEmptyDeviceId(str)) {
|
|
str6 = "googleAdvertisingID";
|
|
} else if (!isEmptyDeviceId(str4)) {
|
|
str = "AMID-" + str4;
|
|
str6 = "amazonId";
|
|
} else if (!isEmptyDeviceId(str3)) {
|
|
str = "ASID-" + str3;
|
|
str6 = "appSetId";
|
|
} else if (!isEmptyDeviceId(str2)) {
|
|
str6 = "androidID";
|
|
str = str2;
|
|
} else if (isEmptyDeviceId(str5)) {
|
|
str = null;
|
|
str6 = "none";
|
|
} else {
|
|
str = "UUID-" + str5;
|
|
str6 = "uuid";
|
|
}
|
|
String upperCase = upperCase(str);
|
|
writeAnalyticsDeviceIdentifier(sharedPreferences, upperCase, str2);
|
|
return new DeviceIdInfo(upperCase, str6);
|
|
}
|
|
|
|
@NonNull
|
|
private static RevIDInfo getRevID(SharedPreferences sharedPreferences, String str, String str2) {
|
|
RevIDInfo readRevID = readRevID(sharedPreferences, str2);
|
|
if (readRevID != null && !TextUtils.isEmpty(readRevID.id)) {
|
|
return readRevID;
|
|
}
|
|
RevIDInfo revIDInfo = new RevIDInfo(String.format(Locale.ENGLISH, "%s_%d", str, Long.valueOf(timestampSec())), false);
|
|
writeRevID(sharedPreferences, revIDInfo.id, revIDInfo.synced, str2);
|
|
return revIDInfo;
|
|
}
|
|
|
|
private static boolean isEmptyDeviceId(String str) {
|
|
return str == null || str.replaceAll("[-0]", "").length() == 0;
|
|
}
|
|
|
|
private static String analyticsDeviceIdentifierVerifyString(String str, String str2) {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(str);
|
|
if (str2 == null) {
|
|
str2 = "";
|
|
}
|
|
sb.append(str2);
|
|
return sb.toString();
|
|
}
|
|
|
|
private static String readAnalyticsDeviceIdentifier(SharedPreferences sharedPreferences, String str) {
|
|
String string = sharedPreferences.getString(SPKEY_DEVICE_ID, null);
|
|
String string2 = sharedPreferences.getString(SPKEY_DEVICE_ID_CHECKSUM, null);
|
|
if (string == null || string2 == null || !hmacSHA256(analyticsDeviceIdentifierVerifyString(string, str), "appinstalled").equalsIgnoreCase(string2)) {
|
|
return null;
|
|
}
|
|
return string;
|
|
}
|
|
|
|
private static void writeAnalyticsDeviceIdentifier(SharedPreferences sharedPreferences, String str, String str2) {
|
|
SharedPreferences.Editor edit = sharedPreferences.edit();
|
|
if (str == null) {
|
|
edit.remove(SPKEY_DEVICE_ID).remove(SPKEY_DEVICE_ID_CHECKSUM);
|
|
} else {
|
|
edit.putString(SPKEY_DEVICE_ID, str).putString(SPKEY_DEVICE_ID_CHECKSUM, hmacSHA256(analyticsDeviceIdentifierVerifyString(str, str2), "appinstalled"));
|
|
}
|
|
edit.apply();
|
|
}
|
|
|
|
private static String revIDVerifyString(String str, boolean z, String str2) {
|
|
Object[] objArr = new Object[3];
|
|
objArr[0] = str;
|
|
objArr[1] = Boolean.valueOf(z);
|
|
if (str2 == null) {
|
|
str2 = "";
|
|
}
|
|
objArr[2] = str2;
|
|
return String.format("%s-%s-%s", objArr);
|
|
}
|
|
|
|
private static RevIDInfo readRevID(SharedPreferences sharedPreferences, String str) {
|
|
String string = sharedPreferences.getString(SPKEY_REVID, null);
|
|
boolean z = sharedPreferences.getBoolean(SPKEY_REVID_SYNCED, false);
|
|
String string2 = sharedPreferences.getString(SPKEY_REVID_CHECKSUM, null);
|
|
if (string == null || string2 == null || !hmacSHA256(revIDVerifyString(string, z, str), "appinstalled").equalsIgnoreCase(string2)) {
|
|
return null;
|
|
}
|
|
return new RevIDInfo(string, z);
|
|
}
|
|
|
|
private static void writeRevID(SharedPreferences sharedPreferences, String str, boolean z, String str2) {
|
|
SharedPreferences.Editor edit = sharedPreferences.edit();
|
|
if (str == null) {
|
|
edit.remove(SPKEY_REVID).remove(SPKEY_REVID_CHECKSUM).remove(SPKEY_REVID_SYNCED);
|
|
} else {
|
|
edit.putString(SPKEY_REVID, str).putBoolean(SPKEY_REVID_SYNCED, z).putString(SPKEY_REVID_CHECKSUM, hmacSHA256(revIDVerifyString(str, z, str2), "appinstalled"));
|
|
}
|
|
edit.apply();
|
|
}
|
|
|
|
private static void writeSessionCount(SharedPreferences sharedPreferences, long j) {
|
|
SharedPreferences.Editor edit = sharedPreferences.edit();
|
|
edit.putLong(SPKEY_SESSION_COUNT, j);
|
|
edit.apply();
|
|
}
|
|
|
|
public static long readSessionCount(SharedPreferences sharedPreferences) {
|
|
return sharedPreferences.getLong(SPKEY_SESSION_COUNT, 0L);
|
|
}
|
|
|
|
public static void writeLastSessionID(SharedPreferences sharedPreferences, String str) {
|
|
SharedPreferences.Editor edit = sharedPreferences.edit();
|
|
edit.putString("sessionID", str);
|
|
edit.apply();
|
|
}
|
|
|
|
public static String readLastSessionID(SharedPreferences sharedPreferences) {
|
|
return sharedPreferences.getString("sessionID", "");
|
|
}
|
|
|
|
private static String hmacSHA256(String str, String str2) {
|
|
byte[] bytes = str2.getBytes(Charset.forName("UTF-8"));
|
|
byte[] bytes2 = str.getBytes(Charset.forName("UTF-8"));
|
|
byte[] bArr = new byte[32];
|
|
try {
|
|
try {
|
|
Crypto.hmacSHA256(bytes2, 0, bytes2.length, bytes, bArr, 0);
|
|
Arrays.fill(bytes, (byte) 0);
|
|
Arrays.fill(bytes2, (byte) 0);
|
|
return upperCase(Common.printBytes(bArr, 0, 32));
|
|
} catch (Throwable th) {
|
|
Arrays.fill(bytes, (byte) 0);
|
|
Arrays.fill(bytes2, (byte) 0);
|
|
throw th;
|
|
}
|
|
} catch (InvalidKeyException | NoSuchAlgorithmException | ShortBufferException e) {
|
|
throw Common.propagate(e);
|
|
}
|
|
}
|
|
|
|
private static Map<String, String[]> buildExtraFields(String str, String str2, String str3, String str4, String str5, Map<String, Object> map) {
|
|
Map createMap = CollectionUtil.createMap();
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "kt_v", ConfigUtil.getString(map, AnalyticsData.S_LONG_SDK_VERSION));
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "v_maj", ConfigUtil.getString(map, AnalyticsData.S_APPLICATION_VERSION));
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "v_min", str3);
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "v_rev", ConfigUtil.getString(map, AnalyticsData.S_APPLICATION_VERSION_CODE));
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "game_name", str);
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, nb.o, str2);
|
|
Map<String, String[]> createMap2 = CollectionUtil.createMap();
|
|
String[] strArr = {"apa", "evt", "mtu", "pgr", "perf"};
|
|
String[] flatten = flatten(createMap);
|
|
for (int i = 0; i < 5; i++) {
|
|
createMap2.put(strArr[i], flatten);
|
|
}
|
|
Map shallowClone = CollectionUtil.shallowClone(createMap);
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) shallowClone, ad.y, ConfigUtil.getString(map, AnalyticsData.S_OS_VERSION));
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) shallowClone, "d", ConfigUtil.getString(map, "deviceModel"));
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) shallowClone, InneractiveMediationDefs.GENDER_MALE, ConfigUtil.getString(map, "deviceManufacturer"));
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) shallowClone, "c", ConfigUtil.getString(map, AnalyticsData.S_CARRIER_NAME));
|
|
createMap2.put("cpu", flatten(shallowClone));
|
|
Map createMap3 = CollectionUtil.createMap();
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap3, ad.y, str4);
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap3, "game_name", str);
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap3, nb.o, str2);
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap3, "tu", str5);
|
|
String[] flatten2 = flatten(createMap3);
|
|
createMap2.put("p_eng", flatten2);
|
|
createMap2.put("glu_id", flatten2);
|
|
createMap2.put("mkt", flatten2);
|
|
return createMap2;
|
|
}
|
|
|
|
private static Map<String, Object> buildPartialCpuData(Map<String, Object> map) {
|
|
Map<String, Object> createMap = CollectionUtil.createMap();
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, TtmlNode.TAG_P, ConfigUtil.getString(map, AnalyticsData.S_DEVICE_NAME));
|
|
Long nullableLong = ConfigUtil.getNullableLong(map, AnalyticsData.S_DEVICE_TIER, null);
|
|
boolean z = true;
|
|
if (nullableLong != null) {
|
|
createMap.put("tier", nullableLong);
|
|
if (ConfigUtil.getBoolean(map, AnalyticsData.S_DEVICE_TIER_FALLBACK)) {
|
|
createMap.put("tierfb", 1);
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "gpuv", ConfigUtil.getString(map, AnalyticsData.S_GPU_VENDOR));
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "gpur", ConfigUtil.getString(map, AnalyticsData.S_GPU_RENDERER));
|
|
CollectionUtil.putIfNotNull(createMap, "cores", ConfigUtil.getNullableLong(map, "cpuCoreCount", null));
|
|
}
|
|
}
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "ln", ConfigUtil.getString(map, AnalyticsData.S_LOCALE_LANGUAGE_CODE));
|
|
List<Object> list = ConfigUtil.getList(map, AnalyticsData.S_SUPPORTED_ABIS);
|
|
if (list != null) {
|
|
StringBuilder sb = new StringBuilder();
|
|
for (Object obj : list) {
|
|
if (!z) {
|
|
sb.append(",");
|
|
}
|
|
sb.append(obj.toString());
|
|
z = false;
|
|
}
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "abi", sb.toString());
|
|
}
|
|
return createMap;
|
|
}
|
|
|
|
private static Map<String, Object> buildSessionStartData(String str, String str2, String str3, Boolean bool, Boolean bool2, Boolean bool3, String str4, Long l, Long l2, Long l3) {
|
|
Map<String, Object> createMap = CollectionUtil.createMap();
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "idfa", str2);
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "android_id", str);
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "app_set_id", str3);
|
|
if (bool.booleanValue()) {
|
|
createMap.put(PushNotification.DISABLED_REASON_OPT_OUT, Integer.valueOf(bool2.booleanValue() ? 1 : 0));
|
|
} else if (bool3 != null && bool3.booleanValue()) {
|
|
createMap.put(PushNotification.DISABLED_REASON_OPT_OUT, 1);
|
|
}
|
|
CollectionUtil.putIfNotEmpty((Map<String, ? super String>) createMap, "conn_type", str4);
|
|
if (l != null) {
|
|
createMap.put("deviceBootTimeSec", Long.valueOf(l.longValue()));
|
|
}
|
|
if (l2 != null) {
|
|
createMap.put("realtime", Long.valueOf(l2.longValue()));
|
|
}
|
|
if (l3 != null) {
|
|
createMap.put("monotonicRaw", Long.valueOf(l3.longValue()));
|
|
}
|
|
return createMap;
|
|
}
|
|
|
|
private static long timestampSec() {
|
|
return System.currentTimeMillis() / 1000;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static String readBodyAsString(URLConnection uRLConnection) throws IOException {
|
|
return IOUtils.toString(new BufferedInputStream(uRLConnection.getInputStream()));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static void configureConnection(HttpsURLConnection httpsURLConnection) {
|
|
GluTLS12SocketFactory.fixTLSPre21(httpsURLConnection);
|
|
httpsURLConnection.setUseCaches(false);
|
|
httpsURLConnection.setAllowUserInteraction(false);
|
|
httpsURLConnection.setConnectTimeout(MBridgeCommon.DEFAULT_LOAD_TIMEOUT);
|
|
httpsURLConnection.setReadTimeout(MBridgeCommon.DEFAULT_LOAD_TIMEOUT);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public URL buildSessionIDURL(String str) {
|
|
try {
|
|
return new URL(String.format("%s/v1/sessions/games/%s/devices/%s", this.mSessionIDBaseAddress, URLEncoder.encode(this.mPPSAppName, "UTF-8"), URLEncoder.encode(str, "UTF-8")));
|
|
} catch (UnsupportedEncodingException | MalformedURLException e) {
|
|
throw Common.propagate(e);
|
|
}
|
|
}
|
|
|
|
private JSONStringer beginUpdatePSValue(boolean z, String str, String str2, String str3, String str4, String str5) {
|
|
String str6 = z ? "DPS" : "PPS";
|
|
try {
|
|
JSONStringer beginJsonEvent = beginJsonEvent("p_eng", str, str6, "UPDATE", this.mPPSAppName, str4, str3, null, LOG_EVENT_SOURCE_SDK);
|
|
CollectionUtil.putIfNotEmpty(beginJsonEvent, "su", str5);
|
|
CollectionUtil.putIfNotEmpty(beginJsonEvent, "c", str2);
|
|
CollectionUtil.putIfNotEmpty(beginJsonEvent, "req_id", createReqIdAndForwardToGCS(str6, this.mut_userId, str, str2, str3, str4, str5));
|
|
return beginJsonEvent;
|
|
} catch (JSONException e) {
|
|
throw Common.propagate(e);
|
|
}
|
|
}
|
|
|
|
private void unsync_assertCanUpdatePSValue(String str, boolean z, JSONStringer jSONStringer) {
|
|
if (!z) {
|
|
if (TextUtils.isEmpty(str)) {
|
|
this.mLog.e("PPS.UPDATE.ERROR", InneractiveMediationDefs.GENDER_MALE, "user ID is empty", Consts.KEY_TAPJOY_USER_ID_VERSION, jSONStringer.toString());
|
|
}
|
|
} else if (TextUtils.isEmpty(getAnalyticsDeviceIdentifier())) {
|
|
this.mLog.e("DPS.UPDATE.ERROR", InneractiveMediationDefs.GENDER_MALE, "s is empty", Consts.KEY_TAPJOY_USER_ID_VERSION, jSONStringer.toString());
|
|
}
|
|
}
|
|
|
|
private void unsync_doUpdatePSValue(String str, boolean z, String str2, String str3, String str4, String str5, String str6) {
|
|
JSONStringer beginUpdatePSValue = beginUpdatePSValue(z, str2, str3, str4, str5, str6);
|
|
unsync_assertCanUpdatePSValue(str, z, beginUpdatePSValue);
|
|
unsync_endJsonEventAndLog(this.mPPSRecordStream, this.mPPSStreamName, beginUpdatePSValue, str);
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:4:0x0009, code lost:
|
|
|
|
if (r11.mSharedPrefs.getBoolean("appinstalled", false) == false) goto L8;
|
|
*/
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private void unsync_doAppStart() {
|
|
/*
|
|
r11 = this;
|
|
java.lang.String r10 = "appinstalled"
|
|
android.content.SharedPreferences r0 = r11.mSharedPrefs // Catch: java.lang.RuntimeException -> Lc
|
|
r1 = 0
|
|
boolean r0 = r0.getBoolean(r10, r1) // Catch: java.lang.RuntimeException -> Lc
|
|
if (r0 != 0) goto L3e
|
|
goto L23
|
|
Lc:
|
|
r0 = move-exception
|
|
r6 = r0
|
|
com.glu.plugins.gluanalytics.util.YLogger r0 = r11.mLog
|
|
java.lang.String r1 = "m"
|
|
java.lang.String r2 = "bad-boolean-property"
|
|
java.lang.String r3 = "k"
|
|
java.lang.String r4 = "appinstalled"
|
|
java.lang.String r5 = "e"
|
|
java.lang.Object[] r1 = new java.lang.Object[]{r1, r2, r3, r4, r5, r6}
|
|
java.lang.String r2 = "LIFECYCLE.INIT.ERROR"
|
|
r0.e(r2, r1)
|
|
L23:
|
|
r9 = 0
|
|
java.lang.String r2 = "apa"
|
|
r3 = 0
|
|
r4 = 0
|
|
r5 = 0
|
|
r6 = 0
|
|
r7 = 0
|
|
r8 = 0
|
|
r1 = r11
|
|
r1.unsync_doLogEvent(r2, r3, r4, r5, r6, r7, r8, r9)
|
|
android.content.SharedPreferences r0 = r11.mSharedPrefs
|
|
android.content.SharedPreferences$Editor r0 = r0.edit()
|
|
r1 = 1
|
|
android.content.SharedPreferences$Editor r0 = r0.putBoolean(r10, r1)
|
|
r0.apply()
|
|
L3e:
|
|
java.util.Map<java.lang.String, java.lang.Object> r0 = r11.mPartialCpuData
|
|
java.util.Map r9 = com.glu.plugins.gluanalytics.util.CollectionUtil.shallowClone(r0)
|
|
java.lang.String r0 = "idfa"
|
|
java.lang.String r1 = r11.mGoogleAdvertisingId
|
|
com.glu.plugins.gluanalytics.util.CollectionUtil.putIfNotEmpty(r9, r0, r1)
|
|
java.lang.String r0 = "android_id"
|
|
java.lang.String r1 = r11.mAndroidId
|
|
com.glu.plugins.gluanalytics.util.CollectionUtil.putIfNotEmpty(r9, r0, r1)
|
|
java.lang.String r0 = "asid"
|
|
java.lang.String r1 = r11.mAppSetId
|
|
com.glu.plugins.gluanalytics.util.CollectionUtil.putIfNotEmpty(r9, r0, r1)
|
|
java.util.Map r0 = com.glu.plugins.gluanalytics.util.CollectionUtil.createMap()
|
|
com.glu.plugins.gluanalytics.network.NetworkReachability r1 = r11.mNetworkReachability
|
|
java.lang.String r1 = r1.getNetworkType()
|
|
java.lang.String r2 = "conn_type"
|
|
com.glu.plugins.gluanalytics.util.CollectionUtil.putIfNotEmpty(r0, r2, r1)
|
|
java.lang.String r2 = "cpu"
|
|
r3 = 0
|
|
r4 = 0
|
|
r5 = 0
|
|
r6 = 0
|
|
r7 = 0
|
|
r8 = 0
|
|
r1 = r11
|
|
r1.unsync_doLogEvent(r2, r3, r4, r5, r6, r7, r8, r9)
|
|
java.lang.String r2 = "evt"
|
|
java.lang.String r3 = "APP_START"
|
|
java.lang.String r4 = "APP"
|
|
java.lang.String r5 = "APP_START"
|
|
r9 = r0
|
|
r1.unsync_doLogEvent(r2, r3, r4, r5, r6, r7, r8, r9)
|
|
boolean r0 = r11.mSendGeoEvent
|
|
if (r0 == 0) goto L89
|
|
java.net.URL r0 = r11.mGeoLookUpUrl
|
|
r11.unsync_logGeoInfoAsync(r0)
|
|
L89:
|
|
r11.unsync_cacheLaunchTime()
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.glu.plugins.gluanalytics.GluAnalytics.unsync_doAppStart():void");
|
|
}
|
|
|
|
private void unsync_doStopSession() {
|
|
unsync_doLogEvent("evt", "SESSION_STOP", "APP", "SESSION_STOP", null, null, null, null);
|
|
removeMessages(60);
|
|
removeMessages(MESSAGE_SESSION_ID);
|
|
}
|
|
|
|
private JSONStringer beginJsonEvent(String str, String str2, String str3, String str4, String str5, Object obj, Object obj2, Map<String, ?> map, String str6) {
|
|
return beginJsonEvent(str, str2, str3, str4, str5, obj, obj2, map, str6, Boolean.TRUE);
|
|
}
|
|
|
|
private JSONStringer beginJsonEvent(String str, String str2, String str3, String str4, String str5, Object obj, Object obj2, Map<String, ?> map, String str6, Boolean bool) {
|
|
try {
|
|
long timestampSec = timestampSec();
|
|
JSONStringer object = new JSONStringer().object();
|
|
object.key("ts").value(timestampSec);
|
|
CollectionUtil.putIfNotEmpty(object, "event_type", str);
|
|
CollectionUtil.putIfNotEmpty(object, nb.q, str2);
|
|
CollectionUtil.putIfNotEmpty(object, "st1", str3);
|
|
CollectionUtil.putIfNotEmpty(object, "st2", str4);
|
|
CollectionUtil.putIfNotEmpty(object, "st3", str5);
|
|
if (bool.booleanValue()) {
|
|
CollectionUtil.putIfNotEmpty(object, i.a, str6);
|
|
}
|
|
if (obj instanceof String) {
|
|
CollectionUtil.putIfNotEmpty(object, Consts.KEY_TAPJOY_USER_ID_VERSION, (String) obj);
|
|
} else {
|
|
CollectionUtil.putIfNotNull(object, Consts.KEY_TAPJOY_USER_ID_VERSION, obj);
|
|
}
|
|
if (obj2 instanceof String) {
|
|
CollectionUtil.putIfNotEmpty(object, "l", (String) obj2);
|
|
} else {
|
|
CollectionUtil.putIfNotNull(object, "l", obj2);
|
|
}
|
|
if (map != null && !CollectionUtil.isEmpty(map)) {
|
|
object.key("json_data");
|
|
CollectionUtil.writeSanitizedMap(object, map);
|
|
}
|
|
String[] strArr = this.mExtraFields.get(str);
|
|
if (strArr != null) {
|
|
int length = strArr.length;
|
|
for (int i = 0; i < length; i += 2) {
|
|
object.key(strArr[i]).value(strArr[i + 1]);
|
|
}
|
|
}
|
|
return object;
|
|
} catch (JSONException e) {
|
|
throw Common.propagate(e);
|
|
}
|
|
}
|
|
|
|
private void unsync_endJsonEvent(JSONStringer jSONStringer, String str) throws JSONException {
|
|
CollectionUtil.putIfNotEmpty(jSONStringer, "s", getAnalyticsDeviceIdentifier());
|
|
CollectionUtil.putIfNotEmpty(jSONStringer, SPKEY_REVID, getRevenueIdentifier());
|
|
CollectionUtil.putIfNotEmpty(jSONStringer, "uid", str);
|
|
CollectionUtil.putIfNotEmpty(jSONStringer, "sess_id", getSessionIdentifier());
|
|
jSONStringer.endObject();
|
|
}
|
|
|
|
private void unsync_endJsonEventAndLog(IRecordStream iRecordStream, String str, JSONStringer jSONStringer) {
|
|
unsync_endJsonEventAndLog(iRecordStream, str, jSONStringer, this.mut_userId);
|
|
}
|
|
|
|
private void unsync_endJsonEventAndLog(IRecordStream iRecordStream, String str, JSONStringer jSONStringer, String str2) {
|
|
try {
|
|
unsync_endJsonEvent(jSONStringer, str2);
|
|
iRecordStream.saveRecord(str, jSONStringer.toString());
|
|
} catch (JSONException e) {
|
|
throw Common.propagate(e);
|
|
}
|
|
}
|
|
|
|
private void unsync_doLogEvent(String str, String str2, String str3, String str4, String str5, Long l, Long l2, Map<String, ?> map) {
|
|
unsync_endJsonEventAndLog(this.mAnalyticsRecordStream, this.mAnalyticsStreamName, beginJsonEvent(str, str2, str3, str4, str5, l, l2, map, LOG_EVENT_SOURCE_SDK));
|
|
}
|
|
|
|
private void unsync_logGeoInfoAsync(URL url) {
|
|
String analyticsDeviceIdentifier = getAnalyticsDeviceIdentifier();
|
|
String revenueIdentifier = getRevenueIdentifier();
|
|
Uri.Builder buildUpon = Uri.parse(url.toString()).buildUpon();
|
|
if (!TextUtils.isEmpty(analyticsDeviceIdentifier)) {
|
|
buildUpon.appendQueryParameter("s", analyticsDeviceIdentifier);
|
|
}
|
|
if (!TextUtils.isEmpty(this.mut_userId)) {
|
|
buildUpon.appendQueryParameter("playerId", this.mut_userId);
|
|
}
|
|
if (!TextUtils.isEmpty(this.mAppName)) {
|
|
buildUpon.appendQueryParameter("gameName", this.mAppName);
|
|
}
|
|
if (!TextUtils.isEmpty(revenueIdentifier)) {
|
|
buildUpon.appendQueryParameter("revId", revenueIdentifier);
|
|
}
|
|
if (!TextUtils.isEmpty(this.mPPSAppName)) {
|
|
buildUpon.appendQueryParameter(GetAndroidAdPlayerContext.KEY_GAME_ID, this.mPPSAppName);
|
|
}
|
|
try {
|
|
final URL url2 = new URL(buildUpon.build().toString());
|
|
this.mExecutor.execute(new Runnable() { // from class: com.glu.plugins.gluanalytics.GluAnalytics.2
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
HttpsURLConnection httpsURLConnection;
|
|
HttpsURLConnection httpsURLConnection2 = null;
|
|
try {
|
|
try {
|
|
httpsURLConnection = (HttpsURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(url2.openConnection()));
|
|
} catch (Throwable th) {
|
|
th = th;
|
|
}
|
|
} catch (IOException e) {
|
|
e = e;
|
|
} catch (Exception e2) {
|
|
e = e2;
|
|
}
|
|
try {
|
|
GluAnalytics.configureConnection(httpsURLConnection);
|
|
httpsURLConnection.connect();
|
|
Map<String, Object> parseJsonObject = CollectionUtil.parseJsonObject(GluAnalytics.readBodyAsString(httpsURLConnection));
|
|
String obj = parseJsonObject.get("ipaddress").toString();
|
|
String obj2 = parseJsonObject.get("isocode").toString();
|
|
StringStore.set(StringStore.Key.LOCATION_IP_ADDRESS, obj);
|
|
StringStore.set(StringStore.Key.LOCATION_ISO_CODE, obj2);
|
|
GluAnalytics.this.mGeoLocation.set(new GeoLocation(obj, obj2));
|
|
GluAnalytics.this.mLog.i("GeoLocation", "IP", obj, "Country", obj2);
|
|
GluAnalytics.this.mLog.i("HTTP.GEO_PUBLISH.OK", "url", url2);
|
|
httpsURLConnection.disconnect();
|
|
} catch (IOException e3) {
|
|
e = e3;
|
|
httpsURLConnection2 = httpsURLConnection;
|
|
UnknownHostException unknownHostCause = Common.unknownHostCause(e);
|
|
if (unknownHostCause != null) {
|
|
GluAnalytics.this.mLog.i("HTTP.GEO_PUBLISH.ERROR", "url", url2, "e", unknownHostCause.getMessage());
|
|
} else {
|
|
GluAnalytics.this.mLog.e("HTTP.GEO_PUBLISH.ERROR", "url", url2, "e", e);
|
|
}
|
|
if (httpsURLConnection2 == null) {
|
|
return;
|
|
}
|
|
httpsURLConnection2.disconnect();
|
|
} catch (Exception e4) {
|
|
e = e4;
|
|
httpsURLConnection2 = httpsURLConnection;
|
|
GluAnalytics.this.mLog.e("HTTP.GEO_PUBLISH.ERROR", "url", url2, "e", e);
|
|
if (httpsURLConnection2 == null) {
|
|
return;
|
|
}
|
|
httpsURLConnection2.disconnect();
|
|
} catch (Throwable th2) {
|
|
th = th2;
|
|
httpsURLConnection2 = httpsURLConnection;
|
|
if (httpsURLConnection2 != null) {
|
|
httpsURLConnection2.disconnect();
|
|
}
|
|
throw th;
|
|
}
|
|
}
|
|
});
|
|
} catch (MalformedURLException e) {
|
|
throw Common.propagate(e);
|
|
}
|
|
}
|
|
|
|
private void unsync_sessionID(final String str, final boolean z) {
|
|
this.mExecutor.execute(new Runnable() { // from class: com.glu.plugins.gluanalytics.GluAnalytics.3
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
/* JADX WARN: Not initialized variable reg: 12, insn: 0x005b: MOVE (r10 I:??[OBJECT, ARRAY]) = (r12 I:??[OBJECT, ARRAY]), block:B:44:0x005b */
|
|
/* JADX WARN: Removed duplicated region for block: B:46:0x0128 */
|
|
@Override // java.lang.Runnable
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public void run() {
|
|
/*
|
|
Method dump skipped, instructions count: 300
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.glu.plugins.gluanalytics.GluAnalytics.AnonymousClass3.run():void");
|
|
}
|
|
});
|
|
}
|
|
|
|
private void unsync_scheduleHeartbeat() {
|
|
removeMessages(60);
|
|
sendEmptyMessageDelayed(60, 30000L);
|
|
}
|
|
|
|
private void unsync_heartbeat() {
|
|
unsync_doLogEvent("pgr", null, null, null, null, null, null, null);
|
|
unsync_scheduleHeartbeat();
|
|
unsync_flushNow();
|
|
}
|
|
|
|
private void unsync_flushNow() {
|
|
this.mPPSRecordStream.flush();
|
|
this.mAnalyticsRecordStream.flush();
|
|
}
|
|
|
|
private void unsync_sessionIDStart(String str) {
|
|
unsync_sessionID(str, false);
|
|
removeMessages(MESSAGE_SESSION_ID);
|
|
sendEmptyMessageDelayed(MESSAGE_SESSION_ID, 60000L);
|
|
}
|
|
|
|
private void unsync_logDefaultSegmentationValues(String str, Map<String, Object> map, boolean z) {
|
|
boolean z2 = !TextUtils.isEmpty(str);
|
|
Long firstInstallTime = getFirstInstallTime();
|
|
if (z2) {
|
|
unsync_doUpdatePSValue(str, false, "AndroidPlayer", null, "bool", "true", "insert");
|
|
unsync_doUpdatePSValue(str, false, "AppVersion", null, "version", ConfigUtil.getString(map, AnalyticsData.S_APPLICATION_VERSION), "upsert");
|
|
if (firstInstallTime != null) {
|
|
unsync_doUpdatePSValue(str, false, "installTimestamp", null, "timestamp", String.valueOf(firstInstallTime), "insert");
|
|
}
|
|
}
|
|
if (z) {
|
|
unsync_doUpdatePSValue(str, true, "deviceMake", null, "string", ConfigUtil.getString(map, "deviceManufacturer"), "upsert");
|
|
unsync_doUpdatePSValue(str, true, "deviceModel", null, "string", ConfigUtil.getString(map, "deviceModel"), "upsert");
|
|
unsync_doUpdatePSValue(str, true, "deviceOS", null, "string", ConfigUtil.getString(map, AnalyticsData.S_OS_VERSION), "upsert");
|
|
unsync_doUpdatePSValue(str, true, "deviceCarrier", null, "string", ConfigUtil.getString(map, AnalyticsData.S_CARRIER_NAME), "upsert");
|
|
unsync_doUpdatePSValue(str, true, "deviceAppVersion", null, "version", ConfigUtil.getString(map, AnalyticsData.S_APPLICATION_VERSION), "upsert");
|
|
unsync_doUpdatePSValue(str, true, "devicePlatform", null, "string", "ANDROID", "upsert");
|
|
if (firstInstallTime != null) {
|
|
unsync_doUpdatePSValue(str, true, "deviceInstallTimestamp", null, "timestamp", String.valueOf(firstInstallTime), "insert");
|
|
}
|
|
Long unsync_getLastLaunchTime = unsync_getLastLaunchTime();
|
|
if (unsync_getLastLaunchTime != null) {
|
|
unsync_doUpdatePSValue(str, true, "deviceLastLaunchTimestamp", null, "timestamp", String.valueOf(unsync_getLastLaunchTime), "upsert");
|
|
}
|
|
}
|
|
this.mPPSRecordStream.flush();
|
|
}
|
|
|
|
private Long getFirstInstallTime() {
|
|
try {
|
|
return Long.valueOf(this.mApplicationContext.getPackageManager().getPackageInfo(this.mApplicationContext.getPackageName(), 0).firstInstallTime / 1000);
|
|
} catch (PackageManager.NameNotFoundException unused) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
private Long unsync_getLastLaunchTime() {
|
|
if (this.mSharedPrefs.contains(SPKEY_LAST_LAUNCH_TIMESTAMP)) {
|
|
return Long.valueOf(this.mSharedPrefs.getLong(SPKEY_LAST_LAUNCH_TIMESTAMP, 0L));
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private void unsync_cacheLaunchTime() {
|
|
this.mSharedPrefs.edit().putLong(SPKEY_LAST_LAUNCH_TIMESTAMP, timestampSec()).apply();
|
|
}
|
|
|
|
private void sendDataToCacheService() {
|
|
CacheService cacheService = this.mCacheService;
|
|
if (cacheService == null) {
|
|
return;
|
|
}
|
|
cacheService.putData(getAnalyticsDeviceIdentifier(), getAnalyticsApplicationName(), this.mut_userId, getRevenueIdentifier(), getSessionIdentifier(), StringStore.get(StringStore.Key.LOCATION_IP_ADDRESS));
|
|
}
|
|
|
|
public static class DeviceIdInfo {
|
|
public final String deviceId;
|
|
public final String source;
|
|
|
|
public DeviceIdInfo(String str, String str2) {
|
|
this.deviceId = str;
|
|
this.source = str2;
|
|
}
|
|
}
|
|
|
|
public static class RevIDInfo {
|
|
public final String id;
|
|
public final boolean synced;
|
|
|
|
public RevIDInfo(String str, boolean z) {
|
|
this.id = str;
|
|
this.synced = z;
|
|
}
|
|
}
|
|
|
|
public static class PSValueUpdate {
|
|
public final boolean isDeviceValue;
|
|
public final JSONStringer json;
|
|
public final String userID;
|
|
|
|
public PSValueUpdate(JSONStringer jSONStringer, String str, boolean z) {
|
|
this.json = jSONStringer;
|
|
this.userID = str;
|
|
this.isDeviceValue = z;
|
|
}
|
|
}
|
|
|
|
public static class LogEventWithGCSUser {
|
|
public final JSONStringer json;
|
|
public final String userID;
|
|
|
|
public LogEventWithGCSUser(JSONStringer jSONStringer, String str) {
|
|
this.json = jSONStringer;
|
|
this.userID = str;
|
|
}
|
|
}
|
|
}
|