- 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
193 lines
7.0 KiB
Java
193 lines
7.0 KiB
Java
package csdk.glucustomersupport.impl;
|
|
|
|
import android.app.Activity;
|
|
import android.content.pm.ApplicationInfo;
|
|
import android.content.pm.InstallSourceInfo;
|
|
import android.content.pm.PackageManager;
|
|
import android.os.Build;
|
|
import android.util.Pair;
|
|
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
|
|
import com.unity3d.ads.core.data.datasource.AndroidStaticDeviceInfoDataSource;
|
|
import csdk.glucustomersupport.BuildConfig;
|
|
import csdk.glucustomersupport.IGluCustomerSupport;
|
|
import csdk.glucustomersupport.IGluCustomerSupportListener;
|
|
import csdk.glucustomersupport.eventbus.GluEventHandler;
|
|
import csdk.glucustomersupport.util.ConfigUtil;
|
|
import csdk.glucustomersupport.util.GluUtil;
|
|
import csdk.glucustomersupport.util.StringStore;
|
|
import java.util.Arrays;
|
|
import java.util.HashMap;
|
|
import java.util.HashSet;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import java.util.concurrent.Callable;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public abstract class GluImplBase implements IGluCustomerSupport {
|
|
private List<Object> ltvTiers;
|
|
protected Activity mActivity;
|
|
protected GluEventHandler mEventHandler;
|
|
protected boolean mIsDebug;
|
|
protected IGluCustomerSupportListener mListener;
|
|
private String mLogName;
|
|
protected String mUserEmail;
|
|
protected String mUserID;
|
|
protected String mUserName;
|
|
protected int tier = 0;
|
|
|
|
@Override // csdk.glucustomersupport.IGluCustomerSupport
|
|
public void setListener(IGluCustomerSupportListener iGluCustomerSupportListener) {
|
|
this.mListener = iGluCustomerSupportListener;
|
|
}
|
|
|
|
public GluImplBase(Callable<Activity> callable, Map<String, Object> map, String str) {
|
|
this.mActivity = (Activity) GluUtil.call(callable);
|
|
this.mIsDebug = ConfigUtil.getBoolean(map, "csdk.gluCustomerSupport.debug.all", false);
|
|
this.mLogName = str;
|
|
this.ltvTiers = ConfigUtil.getList(map, "csdk.gluCustomerSupport.ltvTiers", Arrays.asList(Double.valueOf(0.01d), Double.valueOf(50.0d), Double.valueOf(100.0d), Double.valueOf(500.0d), Double.valueOf(2000.0d), Double.valueOf(10000.0d), Double.valueOf(25000.0d), Double.valueOf(50000.0d)));
|
|
}
|
|
|
|
@Override // csdk.glucustomersupport.IGluCustomerSupport
|
|
public void init(GluEventHandler gluEventHandler) {
|
|
this.mEventHandler = gluEventHandler;
|
|
if (gluEventHandler != null) {
|
|
gluEventHandler.onInit(BuildConfig.VERSION_NAME);
|
|
}
|
|
}
|
|
|
|
@Override // csdk.glucustomersupport.IGluCustomerSupport
|
|
public void destroy() {
|
|
log(InneractiveMediationDefs.GENDER_MALE, "destroy");
|
|
GluEventHandler gluEventHandler = this.mEventHandler;
|
|
if (gluEventHandler != null) {
|
|
gluEventHandler.onDestroy();
|
|
}
|
|
StringStore.destroy();
|
|
}
|
|
|
|
@Override // csdk.glucustomersupport.IGluCustomerSupport
|
|
public void close() {
|
|
log(InneractiveMediationDefs.GENDER_MALE, "close");
|
|
}
|
|
|
|
public void log(Object... objArr) {
|
|
GluUtil.log(this.mIsDebug, this.mLogName, objArr);
|
|
}
|
|
|
|
public Pair<Map<String, Object>, Set<String>> getMetadata(Map<String, Object> map, List<Object> list) {
|
|
if (list == null) {
|
|
list = map == null ? null : toList(map.get("hs-tags"));
|
|
}
|
|
return Pair.create(updateMetadata(map), updateTags(list, map != null ? toDouble(map.get("ltv")) : null));
|
|
}
|
|
|
|
private Map<String, Object> updateMetadata(Map<String, Object> map) {
|
|
if (map == null) {
|
|
map = new HashMap<>();
|
|
}
|
|
map.put("analytics_id", StringStore.get(StringStore.Key.ANALYTICS_ID));
|
|
map.put("player_id", this.mUserID);
|
|
map.put("user_name", this.mUserName);
|
|
map.put("country_code", StringStore.get(StringStore.Key.LOCATION_ISO_CODE));
|
|
map.put("identity_pin", StringStore.get(StringStore.Key.IDENTITY_PIN));
|
|
map.put("under_age_user", StringStore.get(StringStore.Key.UNDER_AGE_USER));
|
|
map.put("preexisting_under_age_user", StringStore.get(StringStore.Key.PREEXISTING_UNDER_AGE_USER));
|
|
map.remove("hs-tags");
|
|
if (!map.containsKey("ltv")) {
|
|
log(InneractiveMediationDefs.GENDER_MALE, "ltv is missing");
|
|
}
|
|
return map;
|
|
}
|
|
|
|
private Set<String> updateTags(List<Object> list, Double d) {
|
|
HashSet hashSet = new HashSet();
|
|
if (list != null) {
|
|
Iterator<Object> it = list.iterator();
|
|
while (it.hasNext()) {
|
|
String gluImplBase = toString(it.next());
|
|
if (gluImplBase != null) {
|
|
hashSet.add(gluImplBase.toLowerCase());
|
|
}
|
|
}
|
|
}
|
|
if (!hashSet.contains(AndroidStaticDeviceInfoDataSource.STORE_GOOGLE) && !hashSet.contains("amazon")) {
|
|
hashSet.add(getStore());
|
|
}
|
|
if (d != null) {
|
|
int i = 0;
|
|
Double[] dArr = (Double[]) this.ltvTiers.toArray(new Double[0]);
|
|
while (i < dArr.length && d.doubleValue() >= dArr[i].doubleValue()) {
|
|
i++;
|
|
}
|
|
hashSet.add("tier" + i);
|
|
this.tier = i;
|
|
}
|
|
return hashSet;
|
|
}
|
|
|
|
public Boolean toBoolean(Object obj) {
|
|
if (obj instanceof Boolean) {
|
|
return (Boolean) obj;
|
|
}
|
|
if ("true".equals(obj)) {
|
|
return Boolean.TRUE;
|
|
}
|
|
if ("false".equals(obj)) {
|
|
return Boolean.FALSE;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public String toString(Object obj) {
|
|
if (obj instanceof String) {
|
|
return (String) obj;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public Integer toInteger(Object obj) {
|
|
if (obj instanceof Integer) {
|
|
return (Integer) obj;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public Double toDouble(Object obj) {
|
|
if (obj instanceof Double) {
|
|
return (Double) obj;
|
|
}
|
|
if (obj instanceof Long) {
|
|
return new Double(((Long) obj).longValue());
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public List<Object> toList(Object obj) {
|
|
if (obj instanceof List) {
|
|
return (List) obj;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public String getStore() {
|
|
String installerPackageName;
|
|
InstallSourceInfo installSourceInfo;
|
|
PackageManager packageManager = this.mActivity.getPackageManager();
|
|
try {
|
|
ApplicationInfo applicationInfo = packageManager.getApplicationInfo(this.mActivity.getPackageName(), 0);
|
|
if (Build.VERSION.SDK_INT >= 30) {
|
|
installSourceInfo = packageManager.getInstallSourceInfo(applicationInfo.packageName);
|
|
installerPackageName = installSourceInfo.getInstallingPackageName();
|
|
} else {
|
|
installerPackageName = packageManager.getInstallerPackageName(applicationInfo.packageName);
|
|
}
|
|
return "com.amazon.venezia".equals(installerPackageName) ? "amazon" : AndroidStaticDeviceInfoDataSource.STORE_GOOGLE;
|
|
} catch (Exception e) {
|
|
log("Exception", e);
|
|
return AndroidStaticDeviceInfoDataSource.STORE_GOOGLE;
|
|
}
|
|
}
|
|
}
|