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,31 @@
package com.helpshift.poller;
import com.helpshift.log.HSLogger;
import com.helpshift.user.UserManager;
/* loaded from: classes3.dex */
public class ConversationPoller {
public PollerController pollerController;
public UserManager userManager;
public ConversationPoller(PollerController pollerController, UserManager userManager) {
this.pollerController = pollerController;
this.userManager = userManager;
}
public synchronized void startPoller() {
boolean shouldPoll = this.userManager.shouldPoll();
boolean isPushTokenSynced = this.userManager.isPushTokenSynced();
if (shouldPoll && !isPushTokenSynced) {
HSLogger.d("ConvPolr", "Starting poller.");
this.pollerController.start();
return;
}
HSLogger.d("ConvPolr", "Not starting poller, shouldPoll: " + shouldPoll + ", push synced: " + isPushTokenSynced);
}
public synchronized void stopPoller() {
HSLogger.d("ConvPolr", "Stopping poller.");
this.pollerController.stop();
}
}

View File

@@ -0,0 +1,45 @@
package com.helpshift.poller;
/* loaded from: classes3.dex */
public class ExponentialBackoff {
public int baseInterval;
public int currentInterval;
public int maxInterval;
public int nextInterval(int i) {
if (i == 0) {
return this.currentInterval;
}
if ((i < 200 || i >= 400) && i < 500) {
this.currentInterval = -1;
} else {
int i2 = this.currentInterval;
int i3 = i2 * 2;
int i4 = this.maxInterval;
if (i3 <= i4) {
i4 = i2 * 2;
}
this.currentInterval = i4;
}
return this.currentInterval;
}
public void reconcileIntervals(int i, int i2) {
if (this.baseInterval == i && this.maxInterval == i2) {
return;
}
this.baseInterval = i;
this.maxInterval = i2;
this.currentInterval = i;
}
public void reset() {
this.currentInterval = this.baseInterval;
}
public ExponentialBackoff(int i, int i2) {
this.baseInterval = i;
this.maxInterval = i2;
this.currentInterval = i;
}
}

View File

@@ -0,0 +1,95 @@
package com.helpshift.poller;
import com.helpshift.chat.HSEventProxy;
import com.helpshift.log.HSLogger;
import com.helpshift.network.AuthenticationFailureNetwork;
import com.helpshift.network.GETNetwork;
import com.helpshift.network.HSRequestData;
import com.helpshift.network.HSResponse;
import com.helpshift.network.HTTPTransport;
import com.helpshift.network.exception.HSRootApiException;
import com.helpshift.network.exception.NetworkException;
import com.helpshift.notification.CoreNotificationManager;
import com.helpshift.platform.Device;
import com.helpshift.storage.HSGenericDataManager;
import com.helpshift.storage.HSPersistentStorage;
import com.helpshift.user.UserManager;
import com.helpshift.util.Utils;
import com.mbridge.msdk.newreward.function.common.MBridgeCommon;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes3.dex */
public class FetchNotificationUpdate {
public Device device;
public HSGenericDataManager genericDataManager;
public HSEventProxy hsEventProxy;
public HTTPTransport httpTransport;
public CoreNotificationManager notificationManager;
public HSPersistentStorage persistentStorage;
public UserManager userManager;
public FetchNotificationUpdate(Device device, HSPersistentStorage hSPersistentStorage, HSGenericDataManager hSGenericDataManager, UserManager userManager, CoreNotificationManager coreNotificationManager, HTTPTransport hTTPTransport, HSEventProxy hSEventProxy) {
this.device = device;
this.persistentStorage = hSPersistentStorage;
this.genericDataManager = hSGenericDataManager;
this.userManager = userManager;
this.notificationManager = coreNotificationManager;
this.httpTransport = hTTPTransport;
this.hsEventProxy = hSEventProxy;
}
public int execute() {
HSLogger.d("ftchNotif", "Fetching notification count from network.");
Map networkHeaders = this.genericDataManager.getNetworkHeaders();
String pollingRoute = this.genericDataManager.getPollingRoute();
Map activeUserDataForNetworkCall = this.userManager.getActiveUserDataForNetworkCall();
if (Utils.isEmpty(activeUserDataForNetworkCall) || Utils.isEmpty(networkHeaders) || Utils.isEmpty(pollingRoute)) {
HSLogger.d("ftchNotif", "Skipping notification count fetch. Invalid params for network call.");
return -1;
}
long pollerCursor = this.userManager.getPollerCursor();
if (pollerCursor != 0) {
activeUserDataForNetworkCall.put("cursor", String.valueOf(pollerCursor));
}
activeUserDataForNetworkCall.put("did", this.device.getDeviceId());
activeUserDataForNetworkCall.put("platform-id", this.persistentStorage.getPlatformId());
try {
HSResponse makeRequest = new AuthenticationFailureNetwork(new GETNetwork(this.httpTransport, pollingRoute)).makeRequest(new HSRequestData(networkHeaders, activeUserDataForNetworkCall));
JSONObject jSONObject = new JSONObject(makeRequest.getResponseString());
int optInt = jSONObject.optInt("uc", 0);
int optInt2 = jSONObject.optInt("bpi", 5000);
int optInt3 = jSONObject.optInt("mpi", MBridgeCommon.DEFAULT_LOAD_TIMEOUT);
boolean optBoolean = jSONObject.optBoolean("cp", false);
long optLong = jSONObject.optLong("c", 0L);
this.userManager.setPollingBaseInterval(optInt2);
this.userManager.setPollingMaxInterval(optInt3);
this.userManager.setShouldPollFlag(optBoolean);
if (optInt > 0) {
int unreadNotificationCount = this.userManager.getUnreadNotificationCount() + optInt;
this.userManager.updateUnreadCountBy(optInt);
if (!this.userManager.isPushTokenSynced()) {
this.notificationManager.showNotification(this.genericDataManager.getNotificationStringForCount(unreadNotificationCount), false);
}
}
this.userManager.setPollerCursor(optLong);
return makeRequest.getStatus();
} catch (HSRootApiException e) {
HSRootApiException.ExceptionType exceptionType = e.exceptionType;
if (exceptionType == NetworkException.INVALID_AUTH_TOKEN) {
this.hsEventProxy.sendAuthFailureEvent("invalid user auth token");
} else if (exceptionType == NetworkException.AUTH_TOKEN_NOT_PROVIDED) {
this.hsEventProxy.sendAuthFailureEvent("missing user auth token");
}
HSLogger.e("ftchNotif", "HSRootApiException in poller request", e);
return -1;
} catch (JSONException e2) {
HSLogger.e("ftchNotif", "Error parsing poller response", e2);
return -1;
} catch (Exception e3) {
HSLogger.e("ftchNotif", "Error in poller request", e3);
return -1;
}
}
}

View File

@@ -0,0 +1,68 @@
package com.helpshift.poller;
import com.helpshift.log.HSLogger;
import com.helpshift.user.UserManager;
import com.helpshift.util.SafeWrappedRunnable;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/* loaded from: classes3.dex */
public class PollerController {
public ExponentialBackoff exponentialBackoff;
public boolean isRunning;
public FetchNotificationUpdate pollFunction;
public ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
public boolean shouldStop;
public UserManager userManager;
public PollerController(FetchNotificationUpdate fetchNotificationUpdate, UserManager userManager, ExponentialBackoff exponentialBackoff, ScheduledThreadPoolExecutor scheduledThreadPoolExecutor) {
this.pollFunction = fetchNotificationUpdate;
this.userManager = userManager;
this.exponentialBackoff = exponentialBackoff;
this.scheduledThreadPoolExecutor = scheduledThreadPoolExecutor;
}
public void start() {
this.shouldStop = false;
if (this.isRunning) {
return;
}
scheduleNextPoll(0);
this.isRunning = true;
}
public void stop() {
this.shouldStop = true;
this.isRunning = false;
this.exponentialBackoff.reset();
try {
this.scheduledThreadPoolExecutor.getQueue().clear();
} catch (Exception e) {
HSLogger.e("PolerCntlr", "Error in clearing the polling queue.", e);
}
}
public final void scheduleNextPoll(int i) {
if (this.shouldStop || !this.userManager.shouldPoll() || i == -1) {
HSLogger.d("PolerCntlr", "Stopping poller, shouldPoll is false or STOP_POLLING received.");
return;
}
this.exponentialBackoff.reconcileIntervals(this.userManager.getPollingBaseInterval(), this.userManager.getPollingMaxInterval());
int nextInterval = this.exponentialBackoff.nextInterval(i);
if (nextInterval == -1) {
HSLogger.d("PolerCntlr", "Stopping poller, request failed");
return;
}
HSLogger.d("PolerCntlr", "Scheduling next poll with interval: " + nextInterval);
try {
this.scheduledThreadPoolExecutor.schedule(new SafeWrappedRunnable(new Runnable() { // from class: com.helpshift.poller.PollerController.1
@Override // java.lang.Runnable
public void run() {
PollerController.this.scheduleNextPoll(PollerController.this.pollFunction.execute());
}
}), nextInterval, TimeUnit.MILLISECONDS);
} catch (Exception e) {
HSLogger.e("PolerCntlr", "Error in scheduling next poll", e);
}
}
}