decord/alpha/source/modules/chat/native/NativeExperimentBridgeManager.tsx

97 lines
4.5 KiB
TypeScript
Raw Normal View History

// Module ID: 17904
// Function ID: 17905
// Name: NativeExperimentBridgeManager
// Dependencies: [17, 2111, 502, 1364, 17905, 5773, 17906, 1241, 17907, 1271, 6725, 2]
2026-07-20 16:05:17 +00:00
// Module 17904 (NativeExperimentBridgeManager)
import _mod17 from "module_17" /* 17 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
import HTTPUtils from "HTTPUtils" /* 1271 */;
import PlatformUtils from "PlatformUtils" /* 1364 */;
import YYTextReplacementExperiment from "YYTextReplacementExperiment" /* 17905 */;
import NotificationLoadMessagesExperimentDefault from "NotificationLoadMessagesExperiment" /* 17907 */;
import LocaleStore from "LocaleStore" /* 2111 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6725 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
function syncYYTextReplacementExperiment() {
if (obj.isIOS()) {
const NSUserDefaultsBridge = NativeModules.NSUserDefaultsBridge;
2026-07-29 08:29:29 +00:00
if (NSUserDefaultsBridge != null) {
const setShouldEnableYYTextReplacement = NSUserDefaultsBridge.setShouldEnableYYTextReplacement;
if (setShouldEnableYYTextReplacement != null) {
const result = setShouldEnableYYTextReplacement(YYTextReplacementExperiment.shouldEnableYYTextReplacement({ location: "NativeExperimentBridgeManager" }));
const tmpResult = YYTextReplacementExperiment;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
}
}
function updateIOSExperiments() {
2026-07-29 08:29:29 +00:00
if (obj.isIOS()) {
const NSUserDefaultsBridge = NativeModules.NSUserDefaultsBridge;
if (NSUserDefaultsBridge != null) {
const setShouldEnableYYTextReplacement = NSUserDefaultsBridge.setShouldEnableYYTextReplacement;
if (setShouldEnableYYTextReplacement != null) {
const result = setShouldEnableYYTextReplacement(tmp(17905).shouldEnableYYTextReplacement({ location: "NativeExperimentBridgeManager" }));
const tmpResult = tmp(17905);
2026-07-29 08:29:29 +00:00
}
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const NSUserDefaultsBridge2 = NativeModules.NSUserDefaultsBridge;
if (NSUserDefaultsBridge2 != null) {
const setShouldFixPushNotificationRawPayload = NSUserDefaultsBridge2.setShouldFixPushNotificationRawPayload;
if (setShouldFixPushNotificationRawPayload != null) {
const result1 = setShouldFixPushNotificationRawPayload(tmp(5773).isIOSPushNotificationRawPayloadFixExperimentEnabled());
const tmpResult2 = tmp(5773);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
obj = PlatformUtils;
2026-07-29 08:29:29 +00:00
if (obj4.getConfig({ location: "NativeExperimentBridgeManager" }).enabled) {
const RNVVideo = tmp6.RNVVideo;
if (RNVVideo != null) {
const result2 = RNVVideo.setOptimizeConfigureAudio(true);
}
const RNVVideo2 = tmp6.RNVVideo;
if (RNVVideo2 != null) {
const result3 = RNVVideo2.setUseBackgroundProgressQueue(true);
2026-07-20 16:05:17 +00:00
}
}
}
function updateAndroidExperiments() {
const obj = { "X-Super-Properties": AnalyticsUtilsDefault.getSuperPropertiesBase64(), "X-Fingerprint": AuthenticationStore.getFingerprint(), "X-Installation-ID": AuthenticationStore.getInstallationForTracking(), "X-Discord-Locale": LocaleStore.locale };
const obj3 = AuthenticationStore;
const config = NotificationLoadMessagesExperimentDefault.getConfig({ location: "NativeExperimentBridgeManager" });
2026-07-20 16:05:17 +00:00
const NativeCacheModule = NativeModules.NativeCacheModule;
2026-07-29 08:29:29 +00:00
if (NativeCacheModule != null) {
2026-07-20 16:05:17 +00:00
const _JSON = JSON;
const obj5 = { headers: obj, userId: obj3.getId(), enabled: tmp3, apiBaseUrl: HTTPUtils.getAPIBaseURL(), urlQueryParams: null, cooldownMs: null, debounceMs: null };
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
obj5.urlQueryParams = "?limit=" + tmp4;
obj5.cooldownMs = tmp5;
obj5.debounceMs = tmp6;
const result = NativeCacheModule.setItem("notificationNetworkRequest", JSON.stringify(obj5));
2026-07-29 08:29:29 +00:00
}
}
const NativeModules = _mod17.NativeModules;
const prototype = function NativeExperimentBridgeManager() {
2026-07-29 08:29:29 +00:00
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
if (obj.isIOS()) {
let tmp5 = updateIOSExperiments;
} else {
tmp5 = PlatformUtils.isAndroid() ? updateAndroidExperiments : (() => {
2026-07-29 08:29:29 +00:00
});
const tmp3Result = PlatformUtils;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
applyArgumentsResult.handleUpdate = tmp5;
applyArgumentsResult.actions = { APP_STATE_UPDATE: syncYYTextReplacementExperiment, POST_CONNECTION_OPEN: applyArgumentsResult.handleUpdate };
2026-07-29 08:29:29 +00:00
return applyArgumentsResult;
}.prototype;
class prototype extends tmp2 {
2026-07-20 16:05:17 +00:00
}
const prototype1 = new prototype();
let result = size.fileFinishedImporting("modules/chat/native/NativeExperimentBridgeManager.tsx");
2026-07-20 16:05:17 +00:00
export default prototype1;