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,10 @@
package com.helpshift.core;
import android.app.LocaleManager;
/* loaded from: classes3.dex */
public abstract /* synthetic */ class AndroidDevice$$ExternalSyntheticApiModelOutline0 {
public static /* bridge */ /* synthetic */ Class m() {
return LocaleManager.class;
}
}

View File

@@ -0,0 +1,10 @@
package com.helpshift.core;
import android.app.LocaleManager;
/* loaded from: classes3.dex */
public abstract /* synthetic */ class AndroidDevice$$ExternalSyntheticApiModelOutline1 {
public static /* bridge */ /* synthetic */ LocaleManager m(Object obj) {
return (LocaleManager) obj;
}
}

View File

@@ -0,0 +1,5 @@
package com.helpshift.core;
/* loaded from: classes3.dex */
public abstract /* synthetic */ class AndroidDevice$$ExternalSyntheticApiModelOutline2 {
}

View File

@@ -0,0 +1,188 @@
package com.helpshift.core;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.os.Environment;
import android.os.LocaleList;
import android.os.StatFs;
import android.telephony.TelephonyManager;
import android.util.Base64;
import com.applovin.sdk.AppLovinEventTypes;
import com.facebook.internal.AnalyticsEvents;
import com.facebook.internal.security.CertificateUtil;
import com.helpshift.log.HSLogger;
import com.helpshift.platform.Device;
import com.helpshift.storage.HSPersistentStorage;
import com.helpshift.util.Utils;
import com.helpshift.util.ValuePair;
import java.util.Locale;
import java.util.UUID;
/* loaded from: classes3.dex */
public class AndroidDevice implements Device {
public final Context context;
public HSPersistentStorage persistentStorage;
@Override // com.helpshift.platform.Device
public String getOsType() {
return "android";
}
@Override // com.helpshift.platform.Device
public String getSDKVersion() {
return "10.2.2";
}
public AndroidDevice(Context context, HSPersistentStorage hSPersistentStorage) {
this.context = context;
this.persistentStorage = hSPersistentStorage;
}
@Override // com.helpshift.platform.Device
public String getAppVersion() {
try {
return this.context.getPackageManager().getPackageInfo(getAppIdentifier(), 0).versionName;
} catch (Exception e) {
HSLogger.d("Device", "Error getting app version", e);
return null;
}
}
@Override // com.helpshift.platform.Device
public String getAppName() {
String str;
try {
str = this.context.getPackageManager().getApplicationLabel(this.context.getApplicationInfo()).toString();
} catch (Exception e) {
HSLogger.d("Device", "Error getting application name", e);
str = null;
}
return str == null ? "Support" : str;
}
@Override // com.helpshift.platform.Device
public String getAppIdentifier() {
return this.context.getPackageName();
}
@Override // com.helpshift.platform.Device
public String getDeviceModel() {
return Build.MODEL;
}
@Override // com.helpshift.platform.Device
public String getBatteryLevel() {
if (this.context.registerReceiver(null, new IntentFilter("android.intent.action.BATTERY_CHANGED")) == null) {
return "";
}
return ((int) ((r0.getIntExtra(AppLovinEventTypes.USER_COMPLETED_LEVEL, -1) / r0.getIntExtra("scale", -1)) * 100.0f)) + "%";
}
@Override // com.helpshift.platform.Device
public String getBatteryStatus() {
Intent registerReceiver = this.context.registerReceiver(null, new IntentFilter("android.intent.action.BATTERY_CHANGED"));
if (registerReceiver == null) {
return "Not charging";
}
int intExtra = registerReceiver.getIntExtra("status", -1);
return (intExtra == 2 || intExtra == 5) ? "Charging" : "Not charging";
}
@Override // com.helpshift.platform.Device
public ValuePair getDiskSpace() {
StatFs statFs = new StatFs(Environment.getDataDirectory().getPath());
return new ValuePair((Math.round(((statFs.getBlockCountLong() * statFs.getBlockSizeLong()) / 1.073741824E9d) * 100.0d) / 100.0d) + " GB", (Math.round(((statFs.getAvailableBlocksLong() * statFs.getBlockSizeLong()) / 1.073741824E9d) * 100.0d) / 100.0d) + " GB");
}
@Override // com.helpshift.platform.Device
public String getOSVersion() {
return Build.VERSION.RELEASE;
}
@Override // com.helpshift.platform.Device
public String getCarrierName() {
TelephonyManager telephonyManager = (TelephonyManager) this.context.getSystemService("phone");
return telephonyManager == null ? "" : telephonyManager.getNetworkOperatorName();
}
@Override // com.helpshift.platform.Device
public String getNetworkType() {
NetworkInfo activeNetworkInfo;
String str = null;
try {
ConnectivityManager connectivityManager = (ConnectivityManager) this.context.getSystemService("connectivity");
if (connectivityManager != null && (activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) != null) {
str = activeNetworkInfo.getTypeName();
}
} catch (SecurityException unused) {
}
return str == null ? AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_UNKNOWN : str;
}
@Override // com.helpshift.platform.Device
public String getCountryCode() {
TelephonyManager telephonyManager = (TelephonyManager) this.context.getSystemService("phone");
return telephonyManager == null ? "" : telephonyManager.getSimCountryIso();
}
@Override // com.helpshift.platform.Device
public String getRom() {
return System.getProperty("os.version") + CertificateUtil.DELIMITER + Build.FINGERPRINT;
}
@Override // com.helpshift.platform.Device
public String getLanguage() {
String languageTag;
LocaleList applicationLocales;
try {
if (Build.VERSION.SDK_INT >= 33) {
applicationLocales = AndroidDevice$$ExternalSyntheticApiModelOutline1.m(this.context.getSystemService(AndroidDevice$$ExternalSyntheticApiModelOutline0.m())).getApplicationLocales();
if (applicationLocales != null && !applicationLocales.isEmpty()) {
languageTag = applicationLocales.get(0).toLanguageTag();
} else {
languageTag = Locale.getDefault().toLanguageTag();
}
} else {
languageTag = Locale.getDefault().toLanguageTag();
}
return languageTag;
} catch (Exception e) {
HSLogger.e("Device", "Error getting app language", e);
return "unknown";
}
}
@Override // com.helpshift.platform.Device
public boolean isOnline() {
try {
NetworkInfo activeNetworkInfo = ((ConnectivityManager) this.context.getSystemService("connectivity")).getActiveNetworkInfo();
if (activeNetworkInfo != null) {
return activeNetworkInfo.isConnected();
}
return false;
} catch (Exception e) {
HSLogger.e("Device", "Exception while getting system connectivity service", e);
return false;
}
}
@Override // com.helpshift.platform.Device
public String encodeBase64(String str) {
return Base64.encodeToString(str.getBytes(), 2);
}
@Override // com.helpshift.platform.Device
public String getDeviceId() {
String hsDeviceId = this.persistentStorage.getHsDeviceId();
if (!Utils.isEmpty(hsDeviceId)) {
return hsDeviceId;
}
String uuid = UUID.randomUUID().toString();
this.persistentStorage.setHsDeviceId(uuid);
return uuid;
}
}

View File

@@ -0,0 +1,240 @@
package com.helpshift.core;
import android.content.Context;
import com.helpshift.analytics.HSAnalyticsEventDM;
import com.helpshift.analytics.HSWebchatAnalyticsManager;
import com.helpshift.cache.ChatResourceEvictStrategy;
import com.helpshift.cache.HCResourceCacheEvictStrategy;
import com.helpshift.cache.HelpcenterCacheEvictionManager;
import com.helpshift.cache.HelpshiftResourceCacheManager;
import com.helpshift.cache.ResourceCacheEvictStrategy;
import com.helpshift.chat.HSEventProxy;
import com.helpshift.concurrency.HSThreadingService;
import com.helpshift.concurrency.HSUIThreader;
import com.helpshift.concurrency.HSWorkerThreader;
import com.helpshift.config.HSConfigManager;
import com.helpshift.migrator.MigrationFailureLogProvider;
import com.helpshift.migrator.NativeToSdkxMigrator;
import com.helpshift.network.HSDownloaderNetwork;
import com.helpshift.network.HSHttpTransport;
import com.helpshift.network.HTTPTransport;
import com.helpshift.network.URLConnectionProvider;
import com.helpshift.notification.CoreNotificationManager;
import com.helpshift.notification.HSNotificationManager;
import com.helpshift.notification.HSPushTokenManager;
import com.helpshift.notification.RequestUnreadMessageCountHandler;
import com.helpshift.platform.Device;
import com.helpshift.poller.ConversationPoller;
import com.helpshift.poller.ExponentialBackoff;
import com.helpshift.poller.FetchNotificationUpdate;
import com.helpshift.poller.PollerController;
import com.helpshift.storage.HSGenericDataManager;
import com.helpshift.storage.HSPersistentStorage;
import com.helpshift.storage.SharedPreferencesStore;
import com.helpshift.user.UserManager;
import com.helpshift.util.SdkURLs;
import com.mbridge.msdk.newreward.function.common.MBridgeCommon;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicBoolean;
/* loaded from: classes3.dex */
public class HSContext {
public static AtomicBoolean installCallSuccessful = new AtomicBoolean(false);
public static HSContext instance;
public HSAnalyticsEventDM analyticsEventDM;
public HSWebchatAnalyticsManager analyticsManager;
public HelpshiftResourceCacheManager chatResourceCacheManager;
public HSConfigManager configManager;
public final Context context;
public ConversationPoller conversationPoller;
public Device device;
public HSGenericDataManager genericDataManager;
public HelpcenterCacheEvictionManager helpcenterCacheEvictionManager;
public HelpshiftResourceCacheManager helpcenterResourceCacheManager;
public HSEventProxy hsEventProxy;
public HSThreadingService hsThreadingService = new HSThreadingService(new HSWorkerThreader(Executors.newFixedThreadPool(2)), new HSWorkerThreader(Executors.newSingleThreadExecutor()), new HSUIThreader());
public HTTPTransport httpTransport;
public boolean isSDKLoggingEnabled;
public boolean isSdkOpen;
public boolean isWebchatOpen;
public boolean isWebchatOpenedFromHelpcenter;
public HSJSGenerator jsGenerator;
public final NativeToSdkxMigrator nativeToSdkxMigrator;
public CoreNotificationManager notificationManager;
public HSPersistentStorage persistentStorage;
public HSPushTokenManager pushTokenManager;
public RequestUnreadMessageCountHandler requestUnreadMessageCountHandler;
public ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
public UserManager userManager;
public static HSContext getInstance() {
return instance;
}
public HSAnalyticsEventDM getAnalyticsEventDM() {
return this.analyticsEventDM;
}
public HSConfigManager getConfigManager() {
return this.configManager;
}
public ConversationPoller getConversationPoller() {
return this.conversationPoller;
}
public Device getDevice() {
return this.device;
}
public HSGenericDataManager getGenericDataManager() {
return this.genericDataManager;
}
public HSEventProxy getHsEventProxy() {
return this.hsEventProxy;
}
public HSThreadingService getHsThreadingService() {
return this.hsThreadingService;
}
public HSJSGenerator getJsGenerator() {
return this.jsGenerator;
}
public NativeToSdkxMigrator getNativeToSdkxMigrator() {
return this.nativeToSdkxMigrator;
}
public CoreNotificationManager getNotificationManager() {
return this.notificationManager;
}
public HSPersistentStorage getPersistentStorage() {
return this.persistentStorage;
}
public RequestUnreadMessageCountHandler getRequestUnreadMessageCountHandler() {
return this.requestUnreadMessageCountHandler;
}
public UserManager getUserManager() {
return this.userManager;
}
public HSWebchatAnalyticsManager getWebchatAnalyticsManager() {
return this.analyticsManager;
}
public boolean isIsWebchatOpenedFromHelpcenter() {
return this.isWebchatOpenedFromHelpcenter;
}
public boolean isSDKLoggingEnabled() {
return this.isSDKLoggingEnabled;
}
public boolean isSdkOpen() {
return this.isSdkOpen;
}
public boolean isWebchatUIOpen() {
return this.isWebchatOpen;
}
public void setIsWebchatOpenedFromHelpcenter(boolean z) {
this.isWebchatOpenedFromHelpcenter = z;
}
public void setSDKLoggingEnabled(boolean z) {
this.isSDKLoggingEnabled = z;
}
public void setSdkIsOpen(boolean z) {
this.isSdkOpen = z;
}
public void setWebchatUIIsOpen(boolean z) {
this.isWebchatOpen = z;
}
public static synchronized void initInstance(Context context) {
synchronized (HSContext.class) {
if (instance == null) {
instance = new HSContext(context);
}
}
}
public HSContext(Context context) {
this.context = context;
this.persistentStorage = new HSPersistentStorage(new SharedPreferencesStore(context, "__hs_lite_sdk_store", 0));
this.nativeToSdkxMigrator = new NativeToSdkxMigrator(context, this.persistentStorage);
}
public void initialiseComponents(Context context) {
this.scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(1, new ThreadFactory() { // from class: com.helpshift.core.HSContext.1
@Override // java.util.concurrent.ThreadFactory
public Thread newThread(Runnable runnable) {
return new Thread(runnable, "hs_notif_poller");
}
});
AndroidDevice androidDevice = new AndroidDevice(context, this.persistentStorage);
this.device = androidDevice;
this.notificationManager = new HSNotificationManager(context, androidDevice, this.persistentStorage, this.hsThreadingService);
this.genericDataManager = new HSGenericDataManager(this.persistentStorage);
this.httpTransport = new HSHttpTransport();
this.analyticsManager = new HSWebchatAnalyticsManager(this.persistentStorage, this.device);
HSEventProxy hSEventProxy = new HSEventProxy(this.hsThreadingService);
this.hsEventProxy = hSEventProxy;
HSPushTokenManager hSPushTokenManager = new HSPushTokenManager(this.device, this.persistentStorage, this.hsThreadingService, hSEventProxy, this.httpTransport, this.genericDataManager);
this.pushTokenManager = hSPushTokenManager;
UserManager userManager = new UserManager(this.persistentStorage, hSPushTokenManager, this.genericDataManager, this.hsThreadingService, this.notificationManager);
this.userManager = userManager;
this.configManager = new HSConfigManager(this.persistentStorage, this.analyticsManager, this.device, userManager);
FetchNotificationUpdate fetchNotificationUpdate = new FetchNotificationUpdate(this.device, this.persistentStorage, this.genericDataManager, this.userManager, this.notificationManager, this.httpTransport, this.hsEventProxy);
ConversationPoller conversationPoller = new ConversationPoller(new PollerController(fetchNotificationUpdate, this.userManager, new ExponentialBackoff(5000, MBridgeCommon.DEFAULT_LOAD_TIMEOUT), this.scheduledThreadPoolExecutor), this.userManager);
this.conversationPoller = conversationPoller;
this.userManager.setConversationPoller(conversationPoller);
this.userManager.setFetchNotificationUpdateFunction(fetchNotificationUpdate);
this.analyticsEventDM = new HSAnalyticsEventDM(this.device, this.userManager, this.persistentStorage, this.analyticsManager, this.hsThreadingService, this.httpTransport);
this.jsGenerator = new HSJSGenerator(this.configManager);
this.requestUnreadMessageCountHandler = new RequestUnreadMessageCountHandler(this.persistentStorage, fetchNotificationUpdate, this.userManager, this.hsEventProxy, this.hsThreadingService);
}
public HelpshiftResourceCacheManager getChatResourceCacheManager() {
if (this.chatResourceCacheManager == null) {
this.chatResourceCacheManager = getHelpshiftResourceCacheManager(new SharedPreferencesStore(this.context, "__hs_chat_resource_cache", 0), new ChatResourceEvictStrategy(), SdkURLs.AWS_CACHE_URLS_CONFIG, "chat_cacheURLs", "webchat");
}
return this.chatResourceCacheManager;
}
public HelpshiftResourceCacheManager getHelpcenterResourceCacheManager() {
if (this.helpcenterResourceCacheManager == null) {
this.helpcenterResourceCacheManager = getHelpshiftResourceCacheManager(new SharedPreferencesStore(this.context, "__hs_helpcenter_resource_cache", 0), new HCResourceCacheEvictStrategy(), SdkURLs.HC_CACHE_URLS_CONFIG, "helpcenter_cacheURLs", "helpcenter");
}
return this.helpcenterResourceCacheManager;
}
public HelpcenterCacheEvictionManager getHelpcenterCacheEvictionManager() {
if (this.helpcenterCacheEvictionManager == null) {
this.helpcenterCacheEvictionManager = new HelpcenterCacheEvictionManager(this.persistentStorage, this.context.getCacheDir().getAbsolutePath(), "helpcenter");
}
return this.helpcenterCacheEvictionManager;
}
public final HelpshiftResourceCacheManager getHelpshiftResourceCacheManager(SharedPreferencesStore sharedPreferencesStore, ResourceCacheEvictStrategy resourceCacheEvictStrategy, String str, String str2, String str3) {
return new HelpshiftResourceCacheManager(sharedPreferencesStore, new HSDownloaderNetwork(new URLConnectionProvider()), resourceCacheEvictStrategy, this.context.getCacheDir().getAbsolutePath(), str, str2, str3);
}
public void sendMigrationFailureLogs() {
new MigrationFailureLogProvider(this.context, this.httpTransport, this.persistentStorage, this.device, this.hsThreadingService).sendMigrationFailureLogs();
}
public static boolean verifyInstall() {
return installCallSuccessful.get();
}
}

View File

@@ -0,0 +1,45 @@
package com.helpshift.core;
import android.content.Context;
import com.helpshift.config.HSConfigManager;
import com.helpshift.util.AssetsUtil;
import com.helpshift.util.SdkURLs;
import com.helpshift.util.Utils;
/* loaded from: classes3.dex */
public class HSJSGenerator {
public static String backBtnClickJs = "Helpcenter( JSON.stringify({ \"eventType\": \"backBtnClick\", \"config\": {} }));";
public static String reloadIframeJS = "Helpcenter( JSON.stringify({ \"eventType\": \"reloadHelpcenter\", \"config\": %helpshiftConfig }));";
public static String sendForegroundEvent = "Helpcenter( JSON.stringify({ \"eventType\": \"sdkxIsInForeground\", \"config\": %foreground }));";
public static String sendWebchatData = "Helpcenter( JSON.stringify({ \"eventType\": \"setWebchatData\", \"config\": %data }));";
public static String showNotificationBadgeJS = "Helpcenter(JSON.stringify({ \"eventType\": \"showNotifBadge\", \"config\": { \"notifCount\": %count } }));";
public HSConfigManager configManager;
public String helpcenterEmbeddedCodeString;
public String webchatEmbeddedCodeString;
public HSJSGenerator(HSConfigManager hSConfigManager) {
this.configManager = hSConfigManager;
}
public String getWebchatEmbeddedCodeString(Context context) {
if (Utils.isEmpty(this.webchatEmbeddedCodeString)) {
String readAssetFileContents = AssetsUtil.readAssetFileContents(context, "helpshift/Webchat.js");
if (Utils.isEmpty(readAssetFileContents)) {
return "";
}
this.webchatEmbeddedCodeString = readAssetFileContents.replace("%cdn", SdkURLs.AWS_WEBCHAT_JS);
}
return this.webchatEmbeddedCodeString.replace("%config", this.configManager.getWebchatConfigJs(HSContext.getInstance().isIsWebchatOpenedFromHelpcenter())).replace("%cifs", this.configManager.getCif());
}
public String getHelpcenterEmbeddedCodeString(Context context, String str, String str2, boolean z) {
if (Utils.isEmpty(this.helpcenterEmbeddedCodeString)) {
String readAssetFileContents = AssetsUtil.readAssetFileContents(context, "helpshift/Helpcenter.js");
if (Utils.isEmpty(readAssetFileContents)) {
return "";
}
this.helpcenterEmbeddedCodeString = readAssetFileContents.replace("%cdn", SdkURLs.HELPCENTER_MIDDLEWARE_JS);
}
return this.helpcenterEmbeddedCodeString.replace("%config", this.configManager.getHelpcenterConfigJs(str, str2, z));
}
}