decord/source/modules/chat/native/NativeExperimentBridgeManager.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

96 lines
4.5 KiB
TypeScript

// Module ID: 17911
// Function ID: 17912
// Name: NativeExperimentBridgeManager
// Dependencies: [17, 2025, 502, 1115, 17912, 5325, 17913, 1242, 17914, 1272, 7170, 2]
// Module 17911 (NativeExperimentBridgeManager)
import _mod17 from "module_17" /* 17 */;
import PlatformUtils from "PlatformUtils" /* 1115 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1242 */;
import HTTPUtils from "HTTPUtils" /* 1272 */;
import YYTextReplacementExperiment from "YYTextReplacementExperiment" /* 17912 */;
import NotificationLoadMessagesExperimentDefault from "NotificationLoadMessagesExperiment" /* 17914 */;
import LocaleStore from "LocaleStore" /* 2025 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7170 */;
import size from "module_2" /* 2 */;
function syncYYTextReplacementExperiment() {
if (obj.isIOS()) {
const NSUserDefaultsBridge = NativeModules.NSUserDefaultsBridge;
if (NSUserDefaultsBridge != null) {
const setShouldEnableYYTextReplacement = NSUserDefaultsBridge.setShouldEnableYYTextReplacement;
if (setShouldEnableYYTextReplacement != null) {
const result = setShouldEnableYYTextReplacement(YYTextReplacementExperiment.shouldEnableYYTextReplacement({ location: "NativeExperimentBridgeManager" }));
const tmpResult = YYTextReplacementExperiment;
}
}
}
}
function updateIOSExperiments() {
if (obj.isIOS()) {
const NSUserDefaultsBridge = NativeModules.NSUserDefaultsBridge;
if (NSUserDefaultsBridge != null) {
const setShouldEnableYYTextReplacement = NSUserDefaultsBridge.setShouldEnableYYTextReplacement;
if (setShouldEnableYYTextReplacement != null) {
const result = setShouldEnableYYTextReplacement(tmp(17912).shouldEnableYYTextReplacement({ location: "NativeExperimentBridgeManager" }));
const tmpResult = tmp(17912);
}
}
}
const NSUserDefaultsBridge2 = NativeModules.NSUserDefaultsBridge;
if (NSUserDefaultsBridge2 != null) {
const setShouldFixPushNotificationRawPayload = NSUserDefaultsBridge2.setShouldFixPushNotificationRawPayload;
if (setShouldFixPushNotificationRawPayload != null) {
const result1 = setShouldFixPushNotificationRawPayload(tmp(5325).isIOSPushNotificationRawPayloadFixExperimentEnabled());
const tmpResult2 = tmp(5325);
}
}
obj = PlatformUtils;
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);
}
}
}
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" });
const NativeCacheModule = NativeModules.NativeCacheModule;
if (NativeCacheModule != null) {
const _JSON = JSON;
const obj5 = { headers: obj, userId: obj3.getId(), enabled: tmp3, apiBaseUrl: HTTPUtils.getAPIBaseURL(), urlQueryParams: null, cooldownMs: null, debounceMs: null };
const _HermesInternal = HermesInternal;
obj5.urlQueryParams = "?limit=" + tmp4;
obj5.cooldownMs = tmp5;
obj5.debounceMs = tmp6;
const result = NativeCacheModule.setItem("notificationNetworkRequest", JSON.stringify(obj5));
}
}
const NativeModules = _mod17.NativeModules;
const prototype = function NativeExperimentBridgeManager() {
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
if (obj.isIOS()) {
let tmp5 = updateIOSExperiments;
} else {
tmp5 = PlatformUtils.isAndroid() ? updateAndroidExperiments : (() => {
});
const tmp3Result = PlatformUtils;
}
applyArgumentsResult.handleUpdate = tmp5;
applyArgumentsResult.actions = { APP_STATE_UPDATE: syncYYTextReplacementExperiment, POST_CONNECTION_OPEN: applyArgumentsResult.handleUpdate };
return applyArgumentsResult;
}.prototype;
class prototype extends tmp2 {
}
const prototype1 = new prototype();
let result = size.fileFinishedImporting("modules/chat/native/NativeExperimentBridgeManager.tsx");
export default prototype1;