Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
package csdk.glucustomersupport.impl;
import csdk.glucustomersupport.IGluCustomerSupport;
import csdk.glucustomersupport.IGluCustomerSupportListener;
import csdk.glucustomersupport.eventbus.GluEventHandler;
import java.util.List;
import java.util.Map;
/* loaded from: classes4.dex */
public class GluDummyImpl implements IGluCustomerSupport {
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void close() {
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void destroy() {
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void init(GluEventHandler gluEventHandler) {
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void login(Map<String, Object> map) {
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void logout() {
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void queryNotificationCount() {
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setConsentFlags(Map<String, ?> map) {
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setLanguageCode(String str) {
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setListener(IGluCustomerSupportListener iGluCustomerSupportListener) {
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setMetadata(Map<String, Object> map, List<Object> list, Map<String, Object> map2) {
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setPushToken(String str) {
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void show(String str, Map<String, Object> map) {
}
}

View File

@@ -0,0 +1,90 @@
package csdk.glucustomersupport.impl;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import csdk.glucustomersupport.util.GluUtil;
import java.util.HashSet;
import java.util.Set;
/* loaded from: classes4.dex */
public class GluHelpShiftActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
public static final String APPLICATION_PAUSE = "onApplicationPaused";
public static final String APPLICATION_RESUME = "onApplicationResumed";
private Set<Activity> mActivities;
private Application mApplication;
private IAction2<String, Activity> mOnActivityCallback;
public boolean isRunning() {
return this.mApplication != null;
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityCreated(Activity activity, Bundle bundle) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityDestroyed(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityResumed(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
}
public GluHelpShiftActivityLifecycleCallbacks(Context context, IAction2<String, Activity> iAction2) {
Context applicationContext = context.getApplicationContext();
if (applicationContext instanceof Application) {
this.mOnActivityCallback = iAction2;
this.mActivities = new HashSet();
Application application = (Application) applicationContext;
this.mApplication = application;
application.registerActivityLifecycleCallbacks(this);
}
}
public void destroy() {
GluUtil.runOnUIThread(new Runnable() { // from class: csdk.glucustomersupport.impl.GluHelpShiftActivityLifecycleCallbacks.1
@Override // java.lang.Runnable
public void run() {
if (GluHelpShiftActivityLifecycleCallbacks.this.mApplication != null) {
GluHelpShiftActivityLifecycleCallbacks.this.mApplication.unregisterActivityLifecycleCallbacks(this);
}
GluHelpShiftActivityLifecycleCallbacks.this.mApplication = null;
GluHelpShiftActivityLifecycleCallbacks.this.mOnActivityCallback = null;
GluHelpShiftActivityLifecycleCallbacks.this.mActivities = null;
}
});
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStarted(Activity activity) {
if (this.mOnActivityCallback != null && addActivity(activity) && this.mActivities.size() == 1) {
this.mOnActivityCallback.apply("onApplicationResumed", activity);
}
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityPaused(Activity activity) {
addActivity(activity);
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStopped(Activity activity) {
if (this.mOnActivityCallback != null && this.mActivities.remove(activity) && this.mActivities.size() == 0) {
this.mOnActivityCallback.apply("onApplicationPaused", activity);
}
}
private boolean addActivity(Activity activity) {
Set<Activity> set = this.mActivities;
if (set != null) {
return set.add(activity);
}
return false;
}
}

View File

@@ -0,0 +1,474 @@
package csdk.glucustomersupport.impl;
import android.app.Activity;
import android.app.Application;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Pair;
import androidx.annotation.NonNull;
import androidx.core.app.NotificationCompat;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.helpshift.Helpshift;
import com.helpshift.HelpshiftAuthenticationFailureReason;
import com.helpshift.HelpshiftEventsListener;
import com.helpshift.core.HSContext;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.tapjoy.TJAdUnitConstants;
import csdk.gluads.PrivacyStatus;
import csdk.glucustomersupport.Consts;
import csdk.glucustomersupport.GluCustomerSupportSessionEndedEvent;
import csdk.glucustomersupport.GluCustomerSupportSessionStartedEvent;
import csdk.glucustomersupport.NotificationCountEvent;
import csdk.glucustomersupport.util.ConfigUtil;
import csdk.glucustomersupport.util.GluUtil;
import csdk.glucustomersupport.util.JsonUtil;
import csdk.glucustomersupport.util.StringStore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
/* loaded from: classes4.dex */
public class GluHelpshift extends GluImplBase {
List<Object> countriesThatRequireFullPrivacy;
private GluHelpShiftActivityLifecycleCallbacks mActivityLifeCycleCallbacks;
private boolean mCcpaApplies;
HashMap<String, Object> mConfig;
private String mDefaultShowType;
private boolean mFetchNotificationCountFromServer;
private boolean mGdprApplies;
private String mPublishID;
private boolean mUnderAge;
private String pushTokenCopy;
private boolean sendAnalyticsEvents;
public void sendAnalyticsEvent(String str, Map<String, Object> map) {
if (this.sendAnalyticsEvents) {
if (map == null) {
map = new HashMap<>();
}
String str2 = "C_" + str;
String str3 = this.mPublishID;
if (str3 != null && str3.length() > 0 && !this.mPublishID.equals("NOT_AVAILABLE")) {
map.put("publishID", this.mPublishID);
}
map.put("tier", Integer.valueOf(this.tier));
this.mEventHandler.sendAnalyticsEvent(str2, map);
}
}
public GluHelpshift(Callable<Activity> callable, Map<String, Object> map, Map<String, Object> map2) {
super(callable, map, "HELPSHIFT");
this.mConfig = new HashMap<>();
this.mDefaultShowType = ConfigUtil.getString(map, "csdk.gluCustomerSupport.helpshift.defaultShowType", "chat");
ConfigUtil.getString(map, "csdk.gluCustomerSupport.helpshift.apiKey", null);
String string = ConfigUtil.getString(map, "csdk.gluCustomerSupport.helpshift.domainName", null);
String string2 = ConfigUtil.getString(map, "csdk.gluCustomerSupport.helpshift.appID", null);
Boolean valueOf = Boolean.valueOf(ConfigUtil.getBoolean(map, "csdk.gluCustomerSupport.helpshift.enableManualLifecycleTracking", false));
this.mFetchNotificationCountFromServer = ConfigUtil.getBoolean(map, "csdk.gluCustomerSupport.helpshift.fetchNotificationCountFromServer", true);
this.mGdprApplies = false;
this.mCcpaApplies = false;
this.mUnderAge = false;
this.sendAnalyticsEvents = !ConfigUtil.getBoolean(map, "csdk.gluCustomerSupport.disabled.sendAnalyticsEvents", false);
ArrayList arrayList = new ArrayList();
arrayList.add("RU");
this.countriesThatRequireFullPrivacy = ConfigUtil.getList(map, "csdk.gluCustomerSupport.helpshift.countriesThatRequireFullPrivacy", arrayList);
try {
Map<String, Object> installConfig = getInstallConfig(map2, valueOf.booleanValue());
Helpshift.install(this.mActivity.getApplication(), string2, string, installConfig);
String string3 = ConfigUtil.getString(map2, "language", null);
if (string3 != null && string3.length() == 2) {
Helpshift.setLanguage(string3);
}
internal_cacheConfig(string2, string, installConfig);
} catch (Exception e) {
log("Exception", e.toString());
}
Helpshift.setHelpshiftEventsListener(new HelpshiftEventsListener() { // from class: csdk.glucustomersupport.impl.GluHelpshift.1
@Override // com.helpshift.HelpshiftEventsListener
public void onUserAuthenticationFailure(HelpshiftAuthenticationFailureReason helpshiftAuthenticationFailureReason) {
}
@Override // com.helpshift.HelpshiftEventsListener
public void onEventOccurred(@NonNull String str, Map<String, Object> map3) {
str.hashCode();
switch (str) {
case "helpshiftSessionStarted":
GluHelpshift.this.log(InneractiveMediationDefs.GENDER_MALE, "HelpshiftX session started.");
GluHelpshift.this.sendAnalyticsEvent("SESSION_STARTED", null);
GluHelpshift.this.mListener.onHelpshiftSessionStarted(new GluCustomerSupportSessionStartedEvent(null));
break;
case "messageAdd":
GluHelpshift.this.log(map3.get("body"));
if (map3.get("type").equals("attachment")) {
GluHelpshift.this.log(InneractiveMediationDefs.GENDER_MALE, "user sent an attachment");
}
GluHelpshift.this.sendAnalyticsEvent("MESSAGE_ADD", null);
break;
case "receivedUnreadMessageCount":
GluHelpshift.this.log(InneractiveMediationDefs.GENDER_MALE, "HelpshiftX message count event.");
GluHelpshift.this.mListener.onQueryNotificationCount(new NotificationCountEvent(((Integer) map3.get("count")).intValue(), null));
break;
case "conversationEnd":
GluHelpshift.this.sendAnalyticsEvent("CONVERSATION_ENDED", null);
break;
case "helpshiftSessionEnded":
GluHelpshift.this.log(InneractiveMediationDefs.GENDER_MALE, "HelpshiftX session ended.");
GluHelpshift.this.sendAnalyticsEvent("SESSION_ENDED", null);
GluHelpshift.this.mListener.onHelpshiftSessionEnded(new GluCustomerSupportSessionEndedEvent(null));
break;
case "csatSubmit":
GluHelpshift.this.log(map3.get(CampaignEx.JSON_KEY_STAR));
GluHelpshift.this.log(map3.get("additionalFeedback"));
Map<String, Object> createMap = GluUtil.createMap();
createMap.put(CampaignEx.JSON_KEY_STAR, map3.get(CampaignEx.JSON_KEY_STAR));
GluHelpshift.this.sendAnalyticsEvent("CSAT_SUBMIT", createMap);
break;
case "conversationStart":
GluHelpshift.this.log(map3.get("message"));
GluHelpshift.this.sendAnalyticsEvent("CONVERSATION_START", null);
break;
case "widgetToggle":
GluHelpshift.this.log(map3.get(TJAdUnitConstants.String.VISIBLE));
break;
case "conversationRejected":
GluHelpshift.this.log(InneractiveMediationDefs.GENDER_MALE, "Conversation rejected.");
GluHelpshift.this.sendAnalyticsEvent("CONVERSATION_REJECTED", null);
break;
case "conversationReopened":
GluHelpshift.this.log(InneractiveMediationDefs.GENDER_MALE, "Conversation reopened.");
GluHelpshift.this.sendAnalyticsEvent("CONVERSATION_REOPENED", null);
break;
case "conversationResolved":
GluHelpshift.this.log(InneractiveMediationDefs.GENDER_MALE, "Conversation resolved.");
GluHelpshift.this.sendAnalyticsEvent("CONVERSATION_RESOLVED", null);
break;
case "conversationStatus":
GluHelpshift.this.log(map3.get("latestIssuePublishId"));
GluHelpshift.this.mPublishID = (String) map3.get("latestIssuePublishId");
break;
}
}
});
if (valueOf.booleanValue()) {
Helpshift.onAppForeground();
this.mActivityLifeCycleCallbacks = new GluHelpShiftActivityLifecycleCallbacks(this.mActivity, new IAction2<String, Activity>() { // from class: csdk.glucustomersupport.impl.GluHelpshift.2
@Override // csdk.glucustomersupport.impl.IAction2
public void apply(String str, Activity activity) {
GluHelpshift.this.log("ACTIVITY", NotificationCompat.CATEGORY_EVENT, str, "activity", activity);
if ("onApplicationResumed".equals(str)) {
Helpshift.onAppForeground();
} else if ("onApplicationPaused".equals(str)) {
Helpshift.onAppBackground();
}
}
});
}
}
private void internal_cacheConfig(String str, String str2, Map<String, Object> map) {
SharedPreferences.Editor edit = this.mActivity.getApplication().getSharedPreferences("hs_shared", 0).edit();
edit.putString("hs_appID", str);
edit.putString("hs_domainName", str2);
edit.putString("hs_config", JsonUtil.toJson(map));
edit.apply();
}
public static void internal_Install(Application application) {
if (application == null || HSContext.verifyInstall()) {
return;
}
SharedPreferences sharedPreferences = application.getSharedPreferences("hs_shared", 0);
String string = sharedPreferences.getString("hs_appID", "");
String string2 = sharedPreferences.getString("hs_domainName", "");
String string3 = sharedPreferences.getString("hs_config", "");
if (string.length() <= 0 || string2.length() <= 0 || string3.length() <= 0) {
return;
}
try {
Helpshift.install(application, string, string2, JsonUtil.toMap(string3));
} catch (Exception unused) {
}
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void login(Map<String, Object> map) {
String gluImplBase = toString(map.get(Consts.LOGIN_INFO_USERID));
String gluImplBase2 = toString(map.get(Consts.LOGIN_INFO_NAME));
String gluImplBase3 = toString(map.get(Consts.LOGIN_INFO_EMAIL));
GluUtil.require(!TextUtils.isEmpty(gluImplBase), "userID can't be null or empty.");
String trim = gluImplBase.trim();
if (trim.length() > 750) {
trim = trim.substring(0, 750);
log(InneractiveMediationDefs.GENDER_MALE, "userID is too long, truncated to 750 chars");
}
this.mUserID = trim;
if (gluImplBase2 != null) {
gluImplBase2 = gluImplBase2.trim();
if (gluImplBase2.length() > 255) {
gluImplBase2 = gluImplBase2.substring(0, 255);
log(InneractiveMediationDefs.GENDER_MALE, "userName is too long, truncated to 255 chars");
}
}
if (gluImplBase3 != null) {
gluImplBase3 = gluImplBase3.trim();
}
this.mUserName = gluImplBase2;
this.mUserEmail = gluImplBase3;
HashMap hashMap = new HashMap();
String str = this.mUserID;
if (str != null && !TextUtils.isEmpty(str)) {
hashMap.put("userId", this.mUserID);
}
String str2 = this.mUserEmail;
if (str2 != null && !TextUtils.isEmpty(str2)) {
hashMap.put("userEmail", this.mUserEmail);
}
String str3 = this.mUserName;
if (str3 != null && !TextUtils.isEmpty(str3)) {
hashMap.put("userName", this.mUserName);
}
if (hashMap.size() > 0) {
Helpshift.login(hashMap);
} else {
log(InneractiveMediationDefs.GENDER_MALE, "HelpShift login called with no data, ignoring.");
}
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void logout() {
Helpshift.logout();
}
@Override // csdk.glucustomersupport.impl.GluImplBase, csdk.glucustomersupport.IGluCustomerSupport
public void destroy() {
GluHelpShiftActivityLifecycleCallbacks gluHelpShiftActivityLifecycleCallbacks = this.mActivityLifeCycleCallbacks;
if (gluHelpShiftActivityLifecycleCallbacks != null) {
gluHelpShiftActivityLifecycleCallbacks.destroy();
}
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void queryNotificationCount() {
log(InneractiveMediationDefs.GENDER_MALE, "queryNotificationCount");
Helpshift.requestUnreadMessageCount(this.mFetchNotificationCountFromServer);
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void show(String str, Map<String, Object> map) {
str.hashCode();
switch (str) {
case "GCC_SHOW_TYPE_CHAT":
showConversation(map);
break;
case "GCC_SHOW_TYPE_DEFAULT":
if (this.mDefaultShowType.equals("chat")) {
show(Consts.SHOW_TYPE_CHAT, map);
break;
} else if (this.mDefaultShowType.equals("faq")) {
show(Consts.SHOW_TYPE_FAQ, map);
break;
} else {
log("Unsupported default type", this.mDefaultShowType);
break;
}
case "GCC_SHOW_TYPE_FAQ":
if (map != null && map.containsKey(Consts.SHOW_OPTION_FAQ_ID)) {
showSingleFAQ(toString(map.get(Consts.SHOW_OPTION_FAQ_ID)), map);
break;
} else if (map != null && map.containsKey(Consts.SHOW_OPTION_FAQ_SECTION)) {
showFAQSection(toString(map.get(Consts.SHOW_OPTION_FAQ_SECTION)), map);
break;
} else {
showFAQs(map);
break;
}
break;
default:
log("Unsupported type", str);
break;
}
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setMetadata(Map<String, Object> map, List<Object> list, Map<String, Object> map2) {
log("setMetadata", map, "tags", list);
Pair<Map<String, Object>, Set<String>> metadata = getMetadata(map, list);
HashMap hashMap = new HashMap();
if (map2 != null) {
hashMap.putAll(map2);
}
String str = this.mUserID;
if (str != null && str.length() > 0 && !hashMap.containsKey("customer_id")) {
HashMap hashMap2 = new HashMap();
hashMap2.put("type", "singleline");
hashMap2.put("value", this.mUserID);
hashMap.put("customer_id", hashMap2);
}
Map map3 = (Map) metadata.first;
map3.put("gdpr_applies", this.mGdprApplies ? "true" : "false");
map3.put("ccpa_applies", this.mCcpaApplies ? "true" : "false");
HashMap<String, Object> hashMap3 = new HashMap<>();
this.mConfig = hashMap3;
hashMap3.put("customMetadata", map3);
this.mConfig.put("tags", ((Set) metadata.second).toArray());
if (hashMap.size() > 0) {
this.mConfig.put("customIssueFields", hashMap);
}
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setLanguageCode(String str) {
log(InneractiveMediationDefs.GENDER_MALE, "setLanguageCode", "code", str);
Helpshift.setLanguage(str);
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setPushToken(String str) {
this.pushTokenCopy = str;
log(InneractiveMediationDefs.GENDER_MALE, "setPushToken");
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setConsentFlags(Map<String, ?> map) {
this.mGdprApplies = ConfigUtil.getBoolean(map, PrivacyStatus.GDPR_APPLIES, false);
this.mCcpaApplies = ConfigUtil.getBoolean(map, PrivacyStatus.CCPA_APPLIES, false);
boolean z = ConfigUtil.getBoolean(map, PrivacyStatus.UNDER_AGE_USER, false);
this.mUnderAge = z;
if (z || this.pushTokenCopy == null) {
return;
}
log(InneractiveMediationDefs.GENDER_MALE, "setConsentFlags");
Helpshift.registerPushToken(this.pushTokenCopy);
}
private void showFAQs(Map<String, Object> map) {
log(InneractiveMediationDefs.GENDER_MALE, "showFAQs");
Helpshift.showFAQs(this.mActivity, convertOptions(map));
}
private void showSingleFAQ(String str, Map<String, Object> map) {
log(InneractiveMediationDefs.GENDER_MALE, "showSingleFAQ", "faq", str);
Helpshift.showSingleFAQ(this.mActivity, str, convertOptions(map));
}
private void showFAQSection(String str, Map<String, Object> map) {
log(InneractiveMediationDefs.GENDER_MALE, "showFAQSection", "section", str);
Helpshift.showFAQSection(this.mActivity, str, convertOptions(map));
}
private void showConversation(Map<String, Object> map) {
log(InneractiveMediationDefs.GENDER_MALE, "showConversation");
Helpshift.showConversation(this.mActivity, convertOptions(map));
}
private void logUserAction(String str) {
log("logUserAction", str);
Helpshift.leaveBreadCrumb(str);
}
private void clearUserActions() {
log(InneractiveMediationDefs.GENDER_MALE, "clearUserActions");
Helpshift.clearBreadCrumbs();
}
private Map<String, Object> getInstallConfig(Map<String, Object> map, boolean z) {
Object value;
Boolean bool;
Integer integer;
boolean z2;
HashMap hashMap = new HashMap();
if (map != null) {
for (Map.Entry<String, Object> entry : map.entrySet()) {
value = entry.getValue();
bool = toBoolean(value);
integer = toInteger(value);
String key = entry.getKey();
key.hashCode();
z2 = true;
switch (key) {
case "notificationSound":
hashMap.put("notificationSoundId", Integer.valueOf(this.mActivity.getResources().getIdentifier(toString(value), "raw", this.mActivity.getPackageName())));
break;
case "largeNotificationIcon":
hashMap.put("notificationLargeIcon", Integer.valueOf(this.mActivity.getResources().getIdentifier(toString(value), "drawable", this.mActivity.getPackageName())));
break;
case "isForChina":
if (bool != null && !bool.booleanValue()) {
z2 = false;
}
hashMap.put("isForChina", Boolean.valueOf(z2));
break;
case "enableInAppNotification":
if (bool != null && !bool.booleanValue()) {
z2 = false;
}
hashMap.put("enableInAppNotification", Boolean.valueOf(z2));
break;
case "supportNotificationChannelId":
hashMap.put("notificationChannelId", value);
break;
case "screenOrientation":
hashMap.put("screenOrientation", Integer.valueOf(integer != null ? integer.intValue() : 0));
break;
case "enableLogging":
if (bool != null && !bool.booleanValue()) {
z2 = false;
}
hashMap.put("enableLogging", Boolean.valueOf(z2));
break;
case "notificationIcon":
hashMap.put("notificationIcon", Integer.valueOf(this.mActivity.getResources().getIdentifier(toString(value), "drawable", this.mActivity.getPackageName())));
break;
}
}
}
if (map != null && !map.containsKey("enableLogging")) {
hashMap.put("enableLogging", Boolean.valueOf(this.mIsDebug));
}
if (z) {
hashMap.put("manualLifecycleTracking", Boolean.TRUE);
}
return hashMap;
}
private Map<String, Object> convertOptions(Map<String, Object> map) {
HashMap hashMap = (HashMap) this.mConfig.clone();
boolean z = false;
if (map != null) {
for (Map.Entry<String, Object> entry : map.entrySet()) {
Boolean bool = toBoolean(entry.getValue());
String key = entry.getKey();
key.hashCode();
if (key.equals("fullPrivacy") || key.equals("enableFullPrivacy")) {
hashMap.put("fullPrivacy", Boolean.valueOf(bool != null && bool.booleanValue()));
} else {
log("Option is not supported:", entry.getKey());
}
}
}
try {
String lowerCase = StringStore.get(StringStore.Key.LOCATION_ISO_CODE).toLowerCase();
if (lowerCase != null) {
int i = 0;
while (true) {
if (i >= this.countriesThatRequireFullPrivacy.size()) {
break;
}
if (((String) this.countriesThatRequireFullPrivacy.get(i)).compareToIgnoreCase(lowerCase) == 0) {
z = true;
break;
}
i++;
}
}
} catch (Exception unused) {
}
if (this.mUnderAge || z) {
hashMap.put("fullPrivacy", Boolean.TRUE);
}
return hashMap;
}
}

View File

@@ -0,0 +1,192 @@
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;
}
}
}

View File

@@ -0,0 +1,139 @@
package csdk.glucustomersupport.impl;
import csdk.glucustomersupport.IGluCustomerSupport;
import csdk.glucustomersupport.IGluCustomerSupportListener;
import csdk.glucustomersupport.eventbus.GluEventHandler;
import csdk.glucustomersupport.util.GluTaskQueue;
import java.util.List;
import java.util.Map;
/* loaded from: classes4.dex */
public class GluImplWrapper implements IGluCustomerSupport {
private IGluCustomerSupport mImpl;
private GluTaskQueue mQueue;
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void init(GluEventHandler gluEventHandler) {
}
public GluImplWrapper() {
GluTaskQueue gluTaskQueue = new GluTaskQueue();
this.mQueue = gluTaskQueue;
gluTaskQueue.suspend();
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void login(final Map<String, Object> map) {
this.mQueue.run(new Runnable() { // from class: csdk.glucustomersupport.impl.GluImplWrapper.1
@Override // java.lang.Runnable
public void run() {
GluImplWrapper.this.mImpl.login(map);
}
});
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void logout() {
this.mQueue.run(new Runnable() { // from class: csdk.glucustomersupport.impl.GluImplWrapper.2
@Override // java.lang.Runnable
public void run() {
GluImplWrapper.this.mImpl.logout();
}
});
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void queryNotificationCount() {
this.mQueue.runOnUiThread(new Runnable() { // from class: csdk.glucustomersupport.impl.GluImplWrapper.3
@Override // java.lang.Runnable
public void run() {
GluImplWrapper.this.mImpl.queryNotificationCount();
}
});
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void show(final String str, final Map<String, Object> map) {
this.mQueue.run(new Runnable() { // from class: csdk.glucustomersupport.impl.GluImplWrapper.4
@Override // java.lang.Runnable
public void run() {
GluImplWrapper.this.mImpl.show(str, map);
}
});
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void close() {
this.mQueue.run(new Runnable() { // from class: csdk.glucustomersupport.impl.GluImplWrapper.5
@Override // java.lang.Runnable
public void run() {
GluImplWrapper.this.mImpl.close();
}
});
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setMetadata(final Map<String, Object> map, final List<Object> list, final Map<String, Object> map2) {
this.mQueue.run(new Runnable() { // from class: csdk.glucustomersupport.impl.GluImplWrapper.6
@Override // java.lang.Runnable
public void run() {
GluImplWrapper.this.mImpl.setMetadata(map, list, map2);
}
});
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setLanguageCode(final String str) {
this.mQueue.run(new Runnable() { // from class: csdk.glucustomersupport.impl.GluImplWrapper.7
@Override // java.lang.Runnable
public void run() {
GluImplWrapper.this.mImpl.setLanguageCode(str);
}
});
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void destroy() {
this.mQueue.run(new Runnable() { // from class: csdk.glucustomersupport.impl.GluImplWrapper.8
@Override // java.lang.Runnable
public void run() {
GluImplWrapper.this.mImpl.destroy();
}
});
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setListener(final IGluCustomerSupportListener iGluCustomerSupportListener) {
this.mQueue.run(new Runnable() { // from class: csdk.glucustomersupport.impl.GluImplWrapper.9
@Override // java.lang.Runnable
public void run() {
GluImplWrapper.this.mImpl.setListener(iGluCustomerSupportListener);
}
});
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setPushToken(final String str) {
this.mQueue.run(new Runnable() { // from class: csdk.glucustomersupport.impl.GluImplWrapper.10
@Override // java.lang.Runnable
public void run() {
GluImplWrapper.this.mImpl.setPushToken(str);
}
});
}
@Override // csdk.glucustomersupport.IGluCustomerSupport
public void setConsentFlags(final Map<String, ?> map) {
this.mQueue.run(new Runnable() { // from class: csdk.glucustomersupport.impl.GluImplWrapper.11
@Override // java.lang.Runnable
public void run() {
GluImplWrapper.this.mImpl.setConsentFlags(map);
}
});
}
public void setImpl(IGluCustomerSupport iGluCustomerSupport) {
this.mImpl = iGluCustomerSupport;
this.mQueue.resume();
}
}

View File

@@ -0,0 +1,6 @@
package csdk.glucustomersupport.impl;
/* loaded from: classes4.dex */
public interface IAction2<T1, T2> {
void apply(T1 t1, T2 t2);
}