Files
rr3-apk/decompiled/sources/csdk/glucustomersupport/unity/UnityCustomerSupportFactory.java
Daniel Elliott f9d20bb3fc 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>
2026-02-18 14:52:23 -08:00

71 lines
3.2 KiB
Java

package csdk.glucustomersupport.unity;
import android.app.Activity;
import android.text.TextUtils;
import com.unity3d.player.UnityPlayer;
import csdk.glucustomersupport.GluCustomerSupportSessionEndedEvent;
import csdk.glucustomersupport.GluCustomerSupportSessionStartedEvent;
import csdk.glucustomersupport.GluFactory;
import csdk.glucustomersupport.IGluCustomerSupport;
import csdk.glucustomersupport.IGluCustomerSupportListener;
import csdk.glucustomersupport.NotificationCountEvent;
import csdk.glucustomersupport.util.GluUtil;
import csdk.glucustomersupport.util.JsonUtil;
import java.util.Map;
import java.util.concurrent.Callable;
import org.json.JSONException;
/* loaded from: classes4.dex */
public class UnityCustomerSupportFactory {
public static class UnityCustomerSupportListener implements IGluCustomerSupportListener {
private final String gameObject;
public UnityCustomerSupportListener(String str) {
this.gameObject = str;
}
@Override // csdk.glucustomersupport.IGluCustomerSupportListener
public void onQueryNotificationCount(NotificationCountEvent notificationCountEvent) {
UnityPlayer.UnitySendMessage(this.gameObject, "AndroidCustomerSupportOnQueryNotificationCount", JsonUtil.toJson(notificationCountEvent));
}
@Override // csdk.glucustomersupport.IGluCustomerSupportListener
public void onHelpshiftSessionStarted(GluCustomerSupportSessionStartedEvent gluCustomerSupportSessionStartedEvent) {
UnityPlayer.UnitySendMessage(this.gameObject, "AndroidCustomerSupportOnHelpshiftSessionStarted", JsonUtil.toJson(gluCustomerSupportSessionStartedEvent));
}
@Override // csdk.glucustomersupport.IGluCustomerSupportListener
public void onHelpshiftSessionEnded(GluCustomerSupportSessionEndedEvent gluCustomerSupportSessionEndedEvent) {
UnityPlayer.UnitySendMessage(this.gameObject, "AndroidCustomerSupportOnHelpshiftSessionEnded", JsonUtil.toJson(gluCustomerSupportSessionEndedEvent));
}
}
public IGluCustomerSupport createCustomerSupport(String str, String str2, String str3) {
Map<String, Object> parseJsonObject;
Callable<Activity> callable = new Callable<Activity>() { // from class: csdk.glucustomersupport.unity.UnityCustomerSupportFactory.1
/* JADX WARN: Can't rename method to resolve collision */
@Override // java.util.concurrent.Callable
public Activity call() throws Exception {
Activity activity = UnityPlayer.currentActivity;
if (activity != null) {
return activity;
}
throw new Error("Current activity is null.");
}
};
if (TextUtils.isEmpty(str3)) {
parseJsonObject = null;
} else {
try {
parseJsonObject = JsonUtil.parseJsonObject(str3);
} catch (JSONException e) {
throw GluUtil.propagate(e);
}
}
IGluCustomerSupport createCustomerSupport = new GluFactory().createCustomerSupport(callable, GluUtil.emptyToNull(str2), parseJsonObject);
createCustomerSupport.setListener(new UnityCustomerSupportListener(str));
return createCustomerSupport;
}
}