1571 lines
74 KiB
TypeScript
1571 lines
74 KiB
TypeScript
/* Metro module 15577; source: modules/app_startup/native/NativeAppStartup.tsx; dependencies: [57, 5, 15578, 15628, 27, 15648, 1950, 1934, 7030, 4874, 15649, 661, 14, 3, 16223, 4904, 16224, 10560, 566, 690, 1218, 16226, 12835, 477, 20, 16227, 8070, 694, 16228, 4020, 4884, 1216, 16229, 16230, 10741, 587, 683, 479, 1926, 7864, 1961, 1282, 16231, 1962, 7717, 16233, 12945, 5254, 16251, 16252, 16253, 9597, 4900, 4885, 4009, 1310, 4502, 1357, 12993, 15311, 15312, 692, 12830, 4873, 12998, 13012, 5214, 16254, 5321, 4875, 4885, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import TTITracker from '../../tti_analytics/TTITracker.tsx'; /* Metro dependency 14 */
|
|
import AppStartPerformance from '../../../external/discord_common/js/packages/app-start-performance/AppStartPerformance.tsx'; /* Metro dependency 20 */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Flux from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import SentryUtilsNative from '../../../utils/SentryUtils.native.tsx'; /* Metro dependency 1216 */
|
|
import SelectedChannelStore from '../../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
|
|
import AppStateStore from '../../../stores/native/AppStateStore.tsx'; /* Metro dependency 7030 */
|
|
import NativeAppLifecycleModule from '../../../external/discord_common/js/packages/rtn-codegen/js/NativeAppLifecycleModule.tsx'; /* Metro dependency 8070 */
|
|
import BundleUpdater from '../../../lib/native/BundleUpdater.tsx'; /* Metro dependency 10560 */
|
|
import PushNotification from '../../../lib/pushnotification/PushNotification.tsx'; /* Metro dependency 10741 */
|
|
import BundleUpdaterActionCreators from '../../../actions/native/BundleUpdaterActionCreators.tsx'; /* Metro dependency 16227 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as StorageModule from '../../../external/discord_common/js/packages/storage/Storage.tsx'; /* Metro dependency 587 */
|
|
import * as ReactBatchUpdatesNativeModule from '../../../external/discord_common/js/shared/utils/ReactBatchUpdates.native.tsx'; /* Metro dependency 690 */
|
|
import * as TokenManagerModule from '../../../external/discord_common/js/shared/lib/TokenManager.tsx'; /* Metro dependency 692 */
|
|
import * as NativeModule from '../../telemetry_ring/native/index.tsx'; /* Metro dependency 1218 */
|
|
import * as IntlLoaderStoreModule from '../../../intl/IntlLoaderStore.tsx'; /* Metro dependency 1950 */
|
|
import * as AnalyticsTrackingStoreModule from '../../../stores/AnalyticsTrackingStore.tsx'; /* Metro dependency 4874 */
|
|
import * as TTIAnalyticsUtilsModule from '../../tti_analytics/native/TTIAnalyticsUtils.tsx'; /* Metro dependency 4884 */
|
|
import * as FutureModule from '../../../external/discord_common/js/shared/utils/Future.tsx'; /* Metro dependency 7864 */
|
|
import * as NativeModule2 from '../../../i18n/native/index.tsx'; /* Metro dependency 15578 */
|
|
import * as SuperagentPatchModule from '../../../lib/superagentPatch.tsx'; /* Metro dependency 15628 */
|
|
import * as LogThirdPartyImportsDoneModule from '../../debug/logThirdPartyImportsDone.tsx'; /* Metro dependency 15648 */
|
|
import * as ManagerRegistryNativeModule from '../ManagerRegistry.native.tsx'; /* Metro dependency 15649 */
|
|
import * as DeepLinkTypesModule from '../../deep_link/DeepLinkTypes.tsx'; /* Metro dependency 16223 */
|
|
|
|
function _fun119332(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#119332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:6, offset: 0x0250681f, size: 828 bytes, params: 8, frame: 24
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_119335 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const getInitialURLs = function() {
|
|
return _getInitialURLs.apply(this, arguments);
|
|
};
|
|
const loadStorage = function() {
|
|
return _loadStorage.apply(this, arguments);
|
|
};
|
|
const initializeIntl = function() {
|
|
return _initializeIntl.apply(this, arguments);
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
NativeModule2;
|
|
SuperagentPatchModule;
|
|
let value = ReactNativeModule;
|
|
const env0_6 = value.AppState;
|
|
const env0_7 = value.NativeEventEmitter;
|
|
const env0_8 = value.Linking;
|
|
const env0_9 = value.LogBox;
|
|
const env0_10 = value.NativeModules;
|
|
LogThirdPartyImportsDoneModule;
|
|
AnalyticsTrackingStoreModule;
|
|
ManagerRegistryNativeModule;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_14 = value.AppStates;
|
|
const env0_15 = value.AnalyticEvents;
|
|
const env0_16 = value.FIRST_RUN_DATE_KEY;
|
|
const env0_17 = value.TOKEN_KEY;
|
|
const env0_18 = value.STORAGE_SECURE_KEYS;
|
|
const env0_19 = value.Platforms;
|
|
(TTITracker).loadImports.recordEnd();
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('index.native.tsx');
|
|
const Future = (FutureModule).Future;
|
|
const future = new Future();
|
|
const env0_26 = ({None: 0, [0]: 'None', HeadlessRan: 1, [1]: 'HeadlessRan', Full: 2, [2]: 'Full'}).None;
|
|
const Promise = global.Promise;
|
|
const promise = new Promise(function(a0) {
|
|
env0_23 = a0;
|
|
});
|
|
(TTITracker).loadIndex.recordEnd();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/app_startup/native/NativeAppStartup.tsx');
|
|
exports.applicationReady = future;
|
|
exports.init = function() {
|
|
return _init.apply(this, arguments);
|
|
};
|
|
exports.initHeadlessTask = function() {
|
|
return _initHeadlessTask.apply(this, arguments);
|
|
};
|
|
function _createForOfIteratorHelperLoose_119333(a0, a1) { // fn#119333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:447, offset: 0x02506b5b, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun119334;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_119335(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_119335(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_119335(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun119334;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun119334() { // fn#119334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:1018, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function linkFromAppsFlyer(a0) { // fn#119336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:1435, offset: 0x02506ccf, size: 106 bytes, params: 2, frame: 14
|
|
var URL;
|
|
var prototype;
|
|
var value;
|
|
var uRL;
|
|
var searchParams;
|
|
var error;
|
|
var binding;
|
|
try {
|
|
URL = global.URL;
|
|
prototype = URL.prototype;
|
|
value = Object.create(prototype, {constructor: {value: URL}});
|
|
uRL = new URL(a0);
|
|
value = uRL instanceof Object ? uRL : value;
|
|
searchParams = value.searchParams;
|
|
value = searchParams.get('fromAppsFlyer');
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_20;
|
|
binding.error('Failed to parse URL in linkFromAppsFlyer', {url: a0, error: error});
|
|
return false;
|
|
}
|
|
return value === 'true';
|
|
}
|
|
|
|
function _getInitialURLs() { // fn#119338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:1688, offset: 0x02506d39, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun119340).apply(this, arguments);
|
|
function* _fun119340() { // fn#119340, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:1741, offset: 0x02506d76, size: 323 bytes, params: 1, frame: 18
|
|
var binding;
|
|
var push;
|
|
var object;
|
|
var DeeplinkSource;
|
|
var object2;
|
|
var isDeferred;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const items2 = [];
|
|
value = environment.__proto__.__proto__;
|
|
const DeepLinkManager = env2_10.DeepLinkManager;
|
|
const getInitialURL = DeepLinkManager.getInitialURL;
|
|
yield Reflect.apply(getInitialURL, DeepLinkManager, []);
|
|
const value3 = undefined;
|
|
if (false) {
|
|
return value3;
|
|
}
|
|
if (value3 == null) {
|
|
binding = env2_8;
|
|
yield binding.getInitialURL();
|
|
} else {
|
|
if (value3.url != null) {
|
|
if (env2_30(value3.url)) {
|
|
isDeferred = value3.isDeferred;
|
|
DeeplinkSource = env2_0(env2_3[14]).DeeplinkSource;
|
|
items2.push({url: value3.url,
|
|
source: isDeferred ? DeeplinkSource.AppsFlyerDeferred : DeeplinkSource.AppsFlyer});
|
|
} else {
|
|
push = items2.push;
|
|
object2 = {};
|
|
object2.url = value3.url;
|
|
object2.source = env2_0(env2_3[14]).DeeplinkSource.OS;
|
|
Reflect.apply(push, items2, [object2]);
|
|
}
|
|
return items2;
|
|
}
|
|
binding = env2_8;
|
|
yield binding.getInitialURL();
|
|
}
|
|
const value5 = undefined;
|
|
if (false) {
|
|
return value5;
|
|
}
|
|
if (value5 != null) {
|
|
push = items2.push;
|
|
object = {url: value5};
|
|
object.source = env2_0(env2_3[14]).DeeplinkSource.ReactNativeLinking;
|
|
Reflect.apply(push, items2, [object]);
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
}
|
|
|
|
function handleURL_119341(a0, a1) { // fn#119341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:2189, offset: 0x02506eb9, size: 65 bytes, params: 3, frame: 13
|
|
(importDefault(4904) /* metro dependency 4904: timeRequireNative */)('handleURL', function() {
|
|
return require(dependencyMap[16]);
|
|
}).default(a0, a1);
|
|
}
|
|
|
|
function sharedInit() { // fn#119343, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:2279, offset: 0x02506f15, size: 960 bytes, params: 1, frame: 22
|
|
var moduleValue2;
|
|
var setHosts;
|
|
var location;
|
|
var protocol;
|
|
var window;
|
|
var GLOBAL_ENV;
|
|
var value7;
|
|
const handleLocalNotification2 = handleLocalNotification;
|
|
(BundleUpdater).setupOTAAssetFallback();
|
|
const Emitter = (Flux).Emitter;
|
|
Emitter.injectBatchEmitChanges((ReactBatchUpdatesNativeModule).batchUpdates);
|
|
const TelemetryRingLifecycle = (NativeModule).TelemetryRingLifecycle;
|
|
TelemetryRingLifecycle.initialize();
|
|
(require(16226) /* metro dependency 16226: websocketTelemetryHookAndroid */).installWebsocketTelemetryHook(function(a0) {
|
|
importDefault(dependencyMap[22]).append(AnalyticEvents.WEBSOCKET_MESSAGE_RECEIVED, a0);
|
|
});
|
|
Linking.addEventListener('url', _fun119349);
|
|
LogBox.ignoreLogs(['Non-serializable values were found in the navigation state',
|
|
'Overriding previous layout animation with new one before the first began',
|
|
'Check the render method of `SceneView`', 'Open debugger to view warnings.']);
|
|
(BundleUpdater).getInitialBundleDownloaded().then(_fun119351);
|
|
(BundleUpdater).addEventListener('downloaded', _fun119352);
|
|
(BundleUpdater).getInitialOtaUpdateChecked().then(_fun119353);
|
|
(BundleUpdater).addEventListener('otaUpdateChecked', _fun119354);
|
|
const defaultImport6 = NativeAppLifecycleModule;
|
|
const value4 = Object.create(NativeEventEmitter.prototype, {constructor: {value: NativeEventEmitter}});
|
|
const nativeEventEmitter = new NativeEventEmitter(defaultImport6);
|
|
(nativeEventEmitter instanceof Object ? nativeEventEmitter : value4).addListener('appWillEnterForeground',
|
|
_fun119355);
|
|
if (AppStateStore.getState() !== AppState.currentState) {
|
|
(importDefault(4904) /* metro dependency 4904: timeRequireNative */)('handleAppStateChange', function() {
|
|
return require(dependencyMap[28]);
|
|
}).default(AppState.currentState);
|
|
} else if ((require(4020) /* metro dependency 4020: FabricUtils */).isBridgeless) {
|
|
moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */;
|
|
if (!moduleValue2.isAndroid()) {
|
|
if (!env0_21) {
|
|
if (AppState.currentState === AppStates.ACTIVE) {
|
|
(importDefault(4904) /* metro dependency 4904: timeRequireNative */)('trackAppOpened',
|
|
_fun119357).trackAppOpened('launcher');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
AppState.addEventListener('change', _fun119358);
|
|
let Hosts = NativeModules.Hosts;
|
|
if (Hosts != null) {
|
|
Hosts = NativeModules.Hosts;
|
|
setHosts = Hosts.setHosts;
|
|
location = global.location;
|
|
protocol = location.protocol;
|
|
window = global.window;
|
|
GLOBAL_ENV = window.GLOBAL_ENV;
|
|
value7 = '' + protocol + GLOBAL_ENV.API_ENDPOINT;
|
|
location = global.location;
|
|
protocol = location.protocol;
|
|
window = global.window;
|
|
GLOBAL_ENV = window.GLOBAL_ENV;
|
|
Reflect.apply(setHosts, Hosts, [value7, '' + protocol + '//' + GLOBAL_ENV.CDN_HOST]);
|
|
}
|
|
const env0_1 = [];
|
|
const env0_2 = [];
|
|
(PushNotification).addNotificationEventListener('notification',
|
|
_fun119360);
|
|
(PushNotification).addNotificationEventListener('localNotification',
|
|
handleLocalNotification2);
|
|
return {onStorageInitialize: onStorageInitialize};
|
|
function handleNotification(a0) { // fn#119344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:4665, owner: sharedInit.handleNotification, offset: 0x025072d5, size: 115 bytes, params: 2, frame: 16
|
|
var environment;
|
|
var value;
|
|
if (env0_0) {
|
|
value = environment.__proto__;
|
|
value = importDefault(4904) /* metro dependency 4904: timeRequireNative */;
|
|
(0, value('receiveNotification', function() {
|
|
return require(dependencyMap[32]);
|
|
}).default)(a0);
|
|
(importDefault(14) /* metro dependency 14: TTITracker */).extraProperties.tapped_notification = true;
|
|
} else {
|
|
env0_1.push(a0);
|
|
}
|
|
}
|
|
|
|
function handleLocalNotification(a0) { // fn#119346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:4821, owner: sharedInit.handleLocalNotification, offset: 0x02507363, size: 90 bytes, params: 2, frame: 14
|
|
var environment;
|
|
var value;
|
|
if (env0_0) {
|
|
value = environment.__proto__;
|
|
value = importDefault(4904) /* metro dependency 4904: timeRequireNative */;
|
|
value('LocalPushNotificationActionCreators', function() {
|
|
return require(dependencyMap[33]);
|
|
}).receiveLocalNotification(a0);
|
|
} else {
|
|
env0_2.push(a0);
|
|
}
|
|
}
|
|
|
|
function _fun119349({url}) { // fn#119349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:2569, offset: 0x0250740c, size: 90 bytes, params: 2, frame: 14
|
|
if (!((require(477) /* metro dependency 477: PlatformUtils */).isAndroid() && env1_22 === url)) {
|
|
env1_27.then(_fun119350);
|
|
}
|
|
function _fun119350() { // fn#119350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:2624, offset: 0x02507466, size: 185 bytes, params: 1, frame: 16
|
|
const binding = env2_20;
|
|
const log = binding.log;
|
|
const urlBinding = url;
|
|
Reflect.apply(log, binding, ['Handling URL: ' + urlBinding]);
|
|
const defaultImport = AppStartPerformance;
|
|
defaultImport.mark('❗', 'Handle URL ' + urlBinding);
|
|
const handleURL_119341Binding = handleURL_119341;
|
|
const object = {url: urlBinding};
|
|
const value4 = linkFromAppsFlyer(urlBinding);
|
|
const DeeplinkSource = (DeepLinkTypesModule).DeeplinkSource;
|
|
object.source = value4 ? DeeplinkSource.AppsFlyer : DeeplinkSource.OS;
|
|
handleURL_119341Binding(object, false);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun119351(a0) { // fn#119351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:3087, offset: 0x0250751f, size: 116 bytes, params: 2, frame: 15
|
|
var versionRequired;
|
|
var binding;
|
|
var verbose;
|
|
var prepareUpdate;
|
|
let value = a0 != null;
|
|
if (value && a0.versionRequired != null) {
|
|
value = environment.__proto__;
|
|
binding = env1_20;
|
|
verbose = binding.verbose;
|
|
versionRequired = a0.versionRequired;
|
|
Reflect.apply(verbose, binding, ['Get initial downloaded bundle ' + versionRequired]);
|
|
value = importDefault(16227) /* metro dependency 16227: BundleUpdaterActionCreators */;
|
|
prepareUpdate = value.prepareUpdate;
|
|
versionRequired = a0.versionRequired;
|
|
Reflect.apply(prepareUpdate, value, [versionRequired]);
|
|
}
|
|
}
|
|
|
|
function _fun119352({versionRequired}) { // fn#119352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:3276, offset: 0x02507593, size: 86 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__;
|
|
env1_20.verbose('Bundle Event: bundle downloaded for ' + versionRequired);
|
|
(BundleUpdaterActionCreators).prepareUpdate(versionRequired);
|
|
}
|
|
|
|
function _fun119353({metrics}) { // fn#119353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:3427, offset: 0x025075e9, size: 110 bytes, params: 2, frame: 17
|
|
var r2;
|
|
var value4;
|
|
var defaultImport;
|
|
var value5;
|
|
env1_20.verbose('Initial OTA update check metrics', metrics);
|
|
const value2 = _createForOfIteratorHelperLoose_119333(metrics);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
for (r2 = value3; true; r2 = value5) {
|
|
value4 = r2.value;
|
|
defaultImport = importDefault(10560) /* metro dependency 10560: BundleUpdater */;
|
|
defaultImport.emitOtaMetric(value4);
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun119354({metrics}) { // fn#119354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:3644, offset: 0x02507657, size: 110 bytes, params: 2, frame: 17
|
|
var r2;
|
|
var value4;
|
|
var defaultImport;
|
|
var value5;
|
|
env1_20.verbose('OTA update check metrics', metrics);
|
|
const value2 = _createForOfIteratorHelperLoose_119333(metrics);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
for (r2 = value3; true; r2 = value5) {
|
|
value4 = r2.value;
|
|
defaultImport = importDefault(10560) /* metro dependency 10560: BundleUpdater */;
|
|
defaultImport.emitOtaMetric(value4);
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun119355() { // fn#119355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:3861, offset: 0x025076c5, size: 49 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'APP_STATE_UPDATE_WILL_BECOME_ACTIVE'});
|
|
}
|
|
|
|
function _fun119357() { // fn#119357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:4162, offset: 0x02507711, size: 27 bytes, params: 1, frame: 11
|
|
return TTIAnalyticsUtilsModule;
|
|
}
|
|
|
|
function _fun119358(a0) { // fn#119358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:4235, offset: 0x0250772c, size: 207 bytes, params: 2, frame: 19
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
(TTITracker).imports.appStateChangeStart.record();
|
|
(AppStartPerformance).resumeTracing();
|
|
(SentryUtilsNative).addBreadcrumb({message: 'App state changed to ' + a0,
|
|
category: 'appState'});
|
|
(0, (importDefault(4904) /* metro dependency 4904: timeRequireNative */)('handleAppStateChange', function() {
|
|
return require(dependencyMap[28]);
|
|
}).default)(a0);
|
|
(TTITracker).imports.appStateChangeEnd.record();
|
|
}
|
|
|
|
function _fun119360(a0) { // fn#119360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:5026, offset: 0x02507816, size: 91 bytes, params: 2, frame: 14
|
|
const state = AppStateStore.getState();
|
|
env1_20.log('Push notification received, the app state is ' + state);
|
|
const ACTIVE = AppStates.ACTIVE;
|
|
if (state !== ACTIVE) {
|
|
handleNotification(a0);
|
|
}
|
|
}
|
|
|
|
function onStorageInitialize() { // fn#119361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:5251, owner: sharedInit.onStorageInitialize, offset: 0x02507871, size: 71 bytes, params: 1, frame: 12
|
|
let binding = env0_1;
|
|
binding.forEach(handleNotification);
|
|
binding = env0_2;
|
|
binding.forEach(handleLocalNotification);
|
|
env0_1.length = 0;
|
|
env0_2.length = 0;
|
|
}
|
|
|
|
}
|
|
|
|
function _trackFirstLaunched() { // fn#119362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:5350, offset: 0x025078b8, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun119364).apply(this, arguments);
|
|
function* _fun119364() { // fn#119364, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:5411, offset: 0x025078f5, size: 267 bytes, params: 1, frame: 20
|
|
var r1;
|
|
var binding2;
|
|
var value4;
|
|
var track;
|
|
var object;
|
|
var isAndroid2;
|
|
var InstallReferrer;
|
|
var value7;
|
|
var set;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
let binding = env2_0;
|
|
const value3 = undefined;
|
|
let Storage = binding(env2_3[35]).Storage;
|
|
const get = Storage.get;
|
|
let APP_FIRST_LAUNCHED = env2_15.APP_FIRST_LAUNCHED;
|
|
if (Reflect.apply(get, Storage, [APP_FIRST_LAUNCHED, true])) {
|
|
binding = env2_1;
|
|
binding2 = env2_3;
|
|
value4 = binding(binding2[36]);
|
|
track = value4.track;
|
|
APP_FIRST_LAUNCHED = env2_15.APP_FIRST_LAUNCHED;
|
|
object = {};
|
|
binding = env2_0;
|
|
isAndroid2 = binding(binding2[23]).isAndroid();
|
|
binding = env2_19;
|
|
r1 = isAndroid2 ? binding.ANDROID : binding.IOS;
|
|
object.platform = r1;
|
|
InstallReferrer = env2_10.InstallReferrer;
|
|
r1 = InstallReferrer == null ? value3 : InstallReferrer.get();
|
|
yield r1;
|
|
value7 = undefined;
|
|
if (false) {
|
|
return value7;
|
|
}
|
|
object.referrer = value7;
|
|
Reflect.apply(track, value4, [APP_FIRST_LAUNCHED, object]);
|
|
binding = env2_0;
|
|
Storage = binding(env2_3[35]).Storage;
|
|
set = Storage.set;
|
|
APP_FIRST_LAUNCHED = env2_15.APP_FIRST_LAUNCHED;
|
|
Reflect.apply(set, Storage, [APP_FIRST_LAUNCHED, false]);
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
}
|
|
|
|
function _loadStorage() { // fn#119366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:5761, offset: 0x02507a00, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun119368).apply(this, arguments);
|
|
function* _fun119368() { // fn#119368, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:5808, offset: 0x02507a3d, size: 216 bytes, params: 1, frame: 18
|
|
var environment;
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var value3;
|
|
var loadStorage;
|
|
var recordStart;
|
|
var value4;
|
|
var Storage;
|
|
var refresh;
|
|
var items2;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var binding3;
|
|
var value8;
|
|
var recordEnd;
|
|
var value9;
|
|
var parseStorage;
|
|
var measureAsync;
|
|
var closure;
|
|
var error;
|
|
if (true) {
|
|
var env0_0;
|
|
value = environment.__proto__.__proto__;
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding2 = env2_3;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = binding2[12];
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value3 = binding(property);
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
loadStorage = value3.loadStorage;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
recordStart = loadStorage.recordStart;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
Reflect.apply(recordStart, loadStorage, []);
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = binding2[35];
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value4 = binding(property);
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
Storage = value4.Storage;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
refresh = Storage.refresh;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding = env2_18;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
items2 = [];
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value5 = Reflect.apply(refresh, Storage, [items2, binding]);
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
yield value5;
|
|
try {
|
|
value6 = undefined;
|
|
value7 = false;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
if (value7) {
|
|
return value6;
|
|
}
|
|
try {
|
|
env0_0 = value6;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding3 = env2_3;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = binding3[12];
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value8 = binding(property);
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
loadStorage = value8.loadStorage;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
recordEnd = loadStorage.recordEnd;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
Reflect.apply(recordEnd, loadStorage, []);
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = binding3[12];
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value9 = binding(property);
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
parseStorage = value9.parseStorage;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
measureAsync = parseStorage.measureAsync;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
closure = _fun119369;
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
Reflect.apply(measureAsync, parseStorage, [closure]);
|
|
} catch (error) {
|
|
binding = env2_20;
|
|
binding.error('Unable to load Storage', error);
|
|
}
|
|
}
|
|
function _fun119369() { // fn#119369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:5972, offset: 0x02507b15, size: 51 bytes, params: 1, frame: 11
|
|
const Storage = env3_0(env3_3[35]).Storage;
|
|
return Storage.parse(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function loadKvStorage() { // fn#119370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:6077, offset: 0x02507b48, size: 115 bytes, params: 1, frame: 14
|
|
var value;
|
|
var property;
|
|
var defaultImport;
|
|
var error;
|
|
var binding;
|
|
try {
|
|
value = environment;
|
|
property = dependencyMap[38];
|
|
defaultImport = importDefault(property);
|
|
defaultImport.initialize();
|
|
} catch (error) {
|
|
binding = env0_20;
|
|
binding.warn('DatabaseManager.initialize errored.', error);
|
|
value = importDefault(dependencyMap[31]);
|
|
value.captureException(error);
|
|
}
|
|
const Promise = global.Promise;
|
|
return Promise.resolve();
|
|
}
|
|
|
|
function _initializeIntl() { // fn#119372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:6451, offset: 0x02507bbb, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun119374).apply(this, arguments);
|
|
async function _fun119374({log}) { // fn#119374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:6504, offset: 0x02507c01, size: 289 bytes, params: 2, frame: 22
|
|
var environment;
|
|
if (true) {
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_0;
|
|
var value4 = binding(env2_3[40]);
|
|
await value4.preloadAllIntlMessageFiles();
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
var value7 = env2_0(env2_3[41]);
|
|
await value7.waitForAllDefaultIntlMessagesLoaded();
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
if (log) {
|
|
env2_1(env2_3[24]).markAndLog(env2_20, '🌎', 'i18n loaded');
|
|
}
|
|
binding = env2_0;
|
|
var binding2 = env2_3;
|
|
await binding(binding2[43])(binding2[42], binding2.paths);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
await undefined.default();
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
env2_11(_fun119375);
|
|
}
|
|
function _fun119375() { // fn#119375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:6729, offset: 0x00cefeb4, size: 15 bytes, params: 1, frame: 9
|
|
return env0_0();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _init() { // fn#119376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:6795, offset: 0x02507d22, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun119378).apply(this, arguments);
|
|
function* _fun119378() { // fn#119378, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:6828, offset: 0x02507d5f, size: 1866 bytes, params: 1, frame: 35
|
|
var onStorageInitialize;
|
|
var r13;
|
|
var r16;
|
|
var r14;
|
|
var object;
|
|
var value5;
|
|
var isAndroid2;
|
|
var value7;
|
|
var binding2;
|
|
var imports;
|
|
var Promise;
|
|
var all;
|
|
var value12;
|
|
var property;
|
|
var paths;
|
|
var value13;
|
|
var value14;
|
|
var value16;
|
|
var property2;
|
|
var binding3;
|
|
var value17;
|
|
var property3;
|
|
var Storage;
|
|
var set;
|
|
var Date;
|
|
var value26;
|
|
var binding4;
|
|
var binding5;
|
|
var channelId;
|
|
var binding6;
|
|
var value32;
|
|
var fetchMessages;
|
|
var binding7;
|
|
var promise;
|
|
var value35;
|
|
var value36;
|
|
var binding8;
|
|
var value40;
|
|
var value42;
|
|
var value43;
|
|
var value44;
|
|
var value45;
|
|
var value46;
|
|
var value48;
|
|
var property4;
|
|
var property5;
|
|
var property6;
|
|
var binding9;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = undefined;
|
|
let binding = env2_26;
|
|
let Full = env2_25.Full;
|
|
if (binding !== Full) {
|
|
binding = env2_26;
|
|
value5 = binding === env2_25.HeadlessRan;
|
|
Full = env2_25.Full;
|
|
onStorageInitialize = value5 ? value : env2_34().onStorageInitialize;
|
|
binding = env2_0;
|
|
isAndroid2 = binding(env2_3[23]).isAndroid();
|
|
binding = env2_0;
|
|
value7 = binding(env2_3[44]);
|
|
if (isAndroid2) {
|
|
value7.unlockOrientation({unlockAfterRotatingToPreviousLock: false});
|
|
} else {
|
|
value7.lockOrientationForiOS();
|
|
}
|
|
binding = env2_1;
|
|
binding2 = env2_3;
|
|
binding(binding2[12]).didBackgroundApp = env2_6.currentState === env2_14.BACKGROUND;
|
|
imports = binding(binding2[12]).imports;
|
|
imports.loadStorageStart.record();
|
|
Promise = global.Promise;
|
|
all = Promise.all;
|
|
object = [env2_31()];
|
|
object[1] = binding(binding2[34]).getInitialNotification().catch(function() {
|
|
return null;
|
|
});
|
|
object[2] = env2_36();
|
|
object[3] = env2_38();
|
|
binding = env2_0;
|
|
value12 = binding(binding2[43]);
|
|
property = binding2[45];
|
|
paths = binding2.paths;
|
|
value13 = value12(property, paths);
|
|
object[4] = value13.then(_fun119380);
|
|
yield Reflect.apply(all, Promise, [object]);
|
|
value14 = undefined;
|
|
if (false) {
|
|
return value14;
|
|
}
|
|
value16 = env2_4(value14, 2);
|
|
property = value16[0];
|
|
property2 = value16[1];
|
|
binding = env2_1;
|
|
binding3 = env2_3;
|
|
imports = binding(binding3[12]).imports;
|
|
imports.loadStorageEnd.record();
|
|
binding = env2_0;
|
|
value17 = binding(binding3[23]);
|
|
if (value17.isAndroid()) {
|
|
binding = env2_0;
|
|
if (binding(env2_3[46]).isTTITest) {
|
|
binding = env2_0;
|
|
property3 = binding(env2_3[47]).default;
|
|
yield property3.yieldConfig();
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
r13 = value5 ? global.Promise.resolve() : env2_39({log: true});
|
|
binding = env2_1;
|
|
binding(env2_3[24]).markAndLog(env2_20, '🏃', 'The initial promise has resolved');
|
|
r16 = property != null && property.length > 0;
|
|
if (r16) {
|
|
env2_20.log('initialURLs', property);
|
|
}
|
|
if (property2 != null) {
|
|
env2_20.log('initialNotification', property2);
|
|
}
|
|
binding = env2_0;
|
|
Storage = binding(env2_3[35]).Storage;
|
|
if (Storage.get(env2_16) == null) {
|
|
binding = env2_0;
|
|
Storage = binding(env2_3[35]).Storage;
|
|
set = Storage.set;
|
|
binding = env2_16;
|
|
Date = global.Date;
|
|
Reflect.apply(set, Storage, [binding, Date.now()]);
|
|
}
|
|
trackFirstLaunched();
|
|
if (!value5) {
|
|
env2_43();
|
|
if (onStorageInitialize != null) {
|
|
onStorageInitialize();
|
|
}
|
|
}
|
|
binding = env2_1;
|
|
binding(env2_3[15])('DispatcherBridge', _fun119382);
|
|
binding = env2_1;
|
|
value26 = binding(env2_3[24]);
|
|
if (value5) {
|
|
value26.markAndLog(env2_20, '🏃', 'Flux already initialized.');
|
|
} else {
|
|
value26.time('🏃', 'Flux.initialize()', _fun119383);
|
|
}
|
|
binding = env2_1;
|
|
binding4 = env2_3;
|
|
binding(binding4[49])();
|
|
binding = env2_0;
|
|
binding(binding4[50]).setupLibdiscoreTimersMonitor();
|
|
property.forEach(_fun119384);
|
|
if (property2 != null) {
|
|
binding = env2_1;
|
|
binding5 = env2_3;
|
|
property = binding(binding5[15])('receiveNotification', _fun119385).default;
|
|
binding(binding5[12]).extraProperties.tapped_notification = true;
|
|
r14 = property(property2);
|
|
} else {
|
|
r14 = false;
|
|
}
|
|
if (!r14) {
|
|
binding = env2_12;
|
|
channelId = binding.getChannelId();
|
|
if (channelId != null) {
|
|
binding = env2_1;
|
|
binding6 = env2_3;
|
|
value32 = binding(binding6[51]);
|
|
fetchMessages = value32.fetchMessages;
|
|
object = {'channelId': null, 'isPreload': true, 'skipLocalFetch': true};
|
|
object.channelId = channelId;
|
|
binding = env2_0;
|
|
object.fetchKey = binding(binding6[52]).INITIAL_MESSAGE_FETCH_KEY;
|
|
Reflect.apply(fetchMessages, value32, [object]);
|
|
}
|
|
}
|
|
binding = env2_1;
|
|
binding7 = env2_3;
|
|
binding(binding7[12]).imports.loadMiniCacheStart.record();
|
|
Promise = global.Promise;
|
|
promise = new Promise(_fun119386);
|
|
binding = env2_2;
|
|
value35 = binding(binding7[61]);
|
|
if (value35.getToken() != null) {
|
|
r16 = global.Promise.resolve();
|
|
} else {
|
|
value36 = env2_0(env2_3[62]);
|
|
value36.beginLoadedExperimentsTimeout();
|
|
r16 = value36.getPromise();
|
|
}
|
|
Promise = global.Promise;
|
|
all = Promise.all;
|
|
Reflect.apply(all, Promise, [[promise, r16]]).then(_fun119389);
|
|
Promise = global.Promise;
|
|
all = Promise.all;
|
|
binding = env2_0;
|
|
binding8 = env2_3;
|
|
value40 = binding(binding8[43]);
|
|
property = binding8[63];
|
|
paths = binding8.paths;
|
|
object = [value40(property, paths)];
|
|
value42 = binding(binding8[43]);
|
|
property = binding8[64];
|
|
paths = binding8.paths;
|
|
object[1] = value42(property, paths);
|
|
value43 = binding(binding8[43]);
|
|
property = binding8[65];
|
|
paths = binding8.paths;
|
|
object[2] = value43(property, paths);
|
|
value44 = binding(binding8[43]);
|
|
property = binding8[66];
|
|
paths = binding8.paths;
|
|
object[3] = value44(property, paths);
|
|
value45 = binding(binding8[43]);
|
|
property = binding8[67];
|
|
paths = binding8.paths;
|
|
object[4] = value45(property, paths);
|
|
object[5] = r13;
|
|
yield Reflect.apply(all, Promise, [object]);
|
|
value46 = undefined;
|
|
if (false) {
|
|
return value46;
|
|
}
|
|
value48 = env2_4(value46, 5);
|
|
value48[0];
|
|
property = value48[1].default;
|
|
property4 = value48[2].default;
|
|
property5 = value48[3].default;
|
|
property6 = value48[4];
|
|
property.registerNotificationCategories();
|
|
property.registerListener();
|
|
property4.loadServer();
|
|
property5.addChangeListener(_fun119390);
|
|
if (!value5) {
|
|
property6.init();
|
|
}
|
|
binding = env2_0;
|
|
binding9 = env2_3;
|
|
binding(binding9[68]);
|
|
binding(binding9[69]).initSessionHeartbeatScheduler();
|
|
return value;
|
|
}
|
|
r13 = value5 ? global.Promise.resolve() : env2_39({log: true});
|
|
binding = env2_1;
|
|
binding(env2_3[24]).markAndLog(env2_20, '🏃', 'The initial promise has resolved');
|
|
r16 = property != null && property.length > 0;
|
|
if (r16) {
|
|
env2_20.log('initialURLs', property);
|
|
}
|
|
if (property2 != null) {
|
|
env2_20.log('initialNotification', property2);
|
|
}
|
|
binding = env2_0;
|
|
Storage = binding(env2_3[35]).Storage;
|
|
if (Storage.get(env2_16) == null) {
|
|
binding = env2_0;
|
|
Storage = binding(env2_3[35]).Storage;
|
|
set = Storage.set;
|
|
binding = env2_16;
|
|
Date = global.Date;
|
|
Reflect.apply(set, Storage, [binding, Date.now()]);
|
|
}
|
|
trackFirstLaunched();
|
|
if (!value5) {
|
|
env2_43();
|
|
if (onStorageInitialize != null) {
|
|
onStorageInitialize();
|
|
}
|
|
}
|
|
binding = env2_1;
|
|
binding(env2_3[15])('DispatcherBridge', _fun119382);
|
|
binding = env2_1;
|
|
value26 = binding(env2_3[24]);
|
|
if (value5) {
|
|
value26.markAndLog(env2_20, '🏃', 'Flux already initialized.');
|
|
} else {
|
|
value26.time('🏃', 'Flux.initialize()', _fun119383);
|
|
}
|
|
binding = env2_1;
|
|
binding4 = env2_3;
|
|
binding(binding4[49])();
|
|
binding = env2_0;
|
|
binding(binding4[50]).setupLibdiscoreTimersMonitor();
|
|
property.forEach(_fun119384);
|
|
if (property2 != null) {
|
|
binding = env2_1;
|
|
binding5 = env2_3;
|
|
property = binding(binding5[15])('receiveNotification', _fun119385).default;
|
|
binding(binding5[12]).extraProperties.tapped_notification = true;
|
|
r14 = property(property2);
|
|
} else {
|
|
r14 = false;
|
|
}
|
|
if (!r14) {
|
|
binding = env2_12;
|
|
channelId = binding.getChannelId();
|
|
if (channelId != null) {
|
|
binding = env2_1;
|
|
binding6 = env2_3;
|
|
value32 = binding(binding6[51]);
|
|
fetchMessages = value32.fetchMessages;
|
|
object = {'channelId': null, 'isPreload': true, 'skipLocalFetch': true};
|
|
object.channelId = channelId;
|
|
binding = env2_0;
|
|
object.fetchKey = binding(binding6[52]).INITIAL_MESSAGE_FETCH_KEY;
|
|
Reflect.apply(fetchMessages, value32, [object]);
|
|
}
|
|
}
|
|
binding = env2_1;
|
|
binding7 = env2_3;
|
|
binding(binding7[12]).imports.loadMiniCacheStart.record();
|
|
Promise = global.Promise;
|
|
promise = new Promise(_fun119386);
|
|
binding = env2_2;
|
|
value35 = binding(binding7[61]);
|
|
if (value35.getToken() != null) {
|
|
r16 = global.Promise.resolve();
|
|
} else {
|
|
value36 = env2_0(env2_3[62]);
|
|
value36.beginLoadedExperimentsTimeout();
|
|
r16 = value36.getPromise();
|
|
}
|
|
Promise = global.Promise;
|
|
all = Promise.all;
|
|
Reflect.apply(all, Promise, [[promise, r16]]).then(_fun119389);
|
|
Promise = global.Promise;
|
|
all = Promise.all;
|
|
binding = env2_0;
|
|
binding8 = env2_3;
|
|
value40 = binding(binding8[43]);
|
|
property = binding8[63];
|
|
paths = binding8.paths;
|
|
object = [value40(property, paths)];
|
|
value42 = binding(binding8[43]);
|
|
property = binding8[64];
|
|
paths = binding8.paths;
|
|
object[1] = value42(property, paths);
|
|
value43 = binding(binding8[43]);
|
|
property = binding8[65];
|
|
paths = binding8.paths;
|
|
object[2] = value43(property, paths);
|
|
value44 = binding(binding8[43]);
|
|
property = binding8[66];
|
|
paths = binding8.paths;
|
|
object[3] = value44(property, paths);
|
|
value45 = binding(binding8[43]);
|
|
property = binding8[67];
|
|
paths = binding8.paths;
|
|
object[4] = value45(property, paths);
|
|
object[5] = r13;
|
|
yield Reflect.apply(all, Promise, [object]);
|
|
value46 = undefined;
|
|
if (false) {
|
|
return value46;
|
|
}
|
|
value48 = env2_4(value46, 5);
|
|
value48[0];
|
|
property = value48[1].default;
|
|
property4 = value48[2].default;
|
|
property5 = value48[3].default;
|
|
property6 = value48[4];
|
|
property.registerNotificationCategories();
|
|
property.registerListener();
|
|
property4.loadServer();
|
|
property5.addChangeListener(_fun119390);
|
|
if (!value5) {
|
|
property6.init();
|
|
}
|
|
binding = env2_0;
|
|
binding9 = env2_3;
|
|
binding(binding9[68]);
|
|
binding(binding9[69]).initSessionHeartbeatScheduler();
|
|
return value;
|
|
}
|
|
r13 = value5 ? global.Promise.resolve() : env2_39({log: true});
|
|
binding = env2_1;
|
|
binding(env2_3[24]).markAndLog(env2_20, '🏃', 'The initial promise has resolved');
|
|
r16 = property != null && property.length > 0;
|
|
if (r16) {
|
|
env2_20.log('initialURLs', property);
|
|
}
|
|
if (property2 != null) {
|
|
env2_20.log('initialNotification', property2);
|
|
}
|
|
binding = env2_0;
|
|
Storage = binding(env2_3[35]).Storage;
|
|
if (Storage.get(env2_16) == null) {
|
|
binding = env2_0;
|
|
Storage = binding(env2_3[35]).Storage;
|
|
set = Storage.set;
|
|
binding = env2_16;
|
|
Date = global.Date;
|
|
Reflect.apply(set, Storage, [binding, Date.now()]);
|
|
}
|
|
trackFirstLaunched();
|
|
if (!value5) {
|
|
env2_43();
|
|
if (onStorageInitialize != null) {
|
|
onStorageInitialize();
|
|
}
|
|
}
|
|
binding = env2_1;
|
|
binding(env2_3[15])('DispatcherBridge', _fun119382);
|
|
binding = env2_1;
|
|
value26 = binding(env2_3[24]);
|
|
if (value5) {
|
|
value26.markAndLog(env2_20, '🏃', 'Flux already initialized.');
|
|
} else {
|
|
value26.time('🏃', 'Flux.initialize()', _fun119383);
|
|
}
|
|
binding = env2_1;
|
|
binding4 = env2_3;
|
|
binding(binding4[49])();
|
|
binding = env2_0;
|
|
binding(binding4[50]).setupLibdiscoreTimersMonitor();
|
|
property.forEach(_fun119384);
|
|
if (property2 != null) {
|
|
binding = env2_1;
|
|
binding5 = env2_3;
|
|
property = binding(binding5[15])('receiveNotification', _fun119385).default;
|
|
binding(binding5[12]).extraProperties.tapped_notification = true;
|
|
r14 = property(property2);
|
|
} else {
|
|
r14 = false;
|
|
}
|
|
if (!r14) {
|
|
binding = env2_12;
|
|
channelId = binding.getChannelId();
|
|
if (channelId != null) {
|
|
binding = env2_1;
|
|
binding6 = env2_3;
|
|
value32 = binding(binding6[51]);
|
|
fetchMessages = value32.fetchMessages;
|
|
object = {'channelId': null, 'isPreload': true, 'skipLocalFetch': true};
|
|
object.channelId = channelId;
|
|
binding = env2_0;
|
|
object.fetchKey = binding(binding6[52]).INITIAL_MESSAGE_FETCH_KEY;
|
|
Reflect.apply(fetchMessages, value32, [object]);
|
|
}
|
|
}
|
|
binding = env2_1;
|
|
binding7 = env2_3;
|
|
imports = binding(binding7[12]).imports;
|
|
imports.loadMiniCacheStart.record();
|
|
Promise = global.Promise;
|
|
promise = new Promise(_fun119386);
|
|
binding = env2_2;
|
|
value35 = binding(binding7[61]);
|
|
if (value35.getToken() != null) {
|
|
r16 = global.Promise.resolve();
|
|
} else {
|
|
value36 = env2_0(env2_3[62]);
|
|
value36.beginLoadedExperimentsTimeout();
|
|
r16 = value36.getPromise();
|
|
}
|
|
Promise = global.Promise;
|
|
all = Promise.all;
|
|
Reflect.apply(all, Promise, [[promise, r16]]).then(_fun119389);
|
|
Promise = global.Promise;
|
|
all = Promise.all;
|
|
binding = env2_0;
|
|
binding8 = env2_3;
|
|
value40 = binding(binding8[43]);
|
|
property = binding8[63];
|
|
paths = binding8.paths;
|
|
object = [value40(property, paths)];
|
|
value42 = binding(binding8[43]);
|
|
property = binding8[64];
|
|
paths = binding8.paths;
|
|
object[1] = value42(property, paths);
|
|
value43 = binding(binding8[43]);
|
|
property = binding8[65];
|
|
paths = binding8.paths;
|
|
object[2] = value43(property, paths);
|
|
value44 = binding(binding8[43]);
|
|
property = binding8[66];
|
|
paths = binding8.paths;
|
|
object[3] = value44(property, paths);
|
|
value45 = binding(binding8[43]);
|
|
property = binding8[67];
|
|
paths = binding8.paths;
|
|
object[4] = value45(property, paths);
|
|
object[5] = r13;
|
|
yield Reflect.apply(all, Promise, [object]);
|
|
value46 = undefined;
|
|
if (false) {
|
|
return value46;
|
|
}
|
|
value48 = env2_4(value46, 5);
|
|
value48[0];
|
|
property = value48[1].default;
|
|
property4 = value48[2].default;
|
|
property5 = value48[3].default;
|
|
property6 = value48[4];
|
|
property.registerNotificationCategories();
|
|
property.registerListener();
|
|
property4.loadServer();
|
|
property5.addChangeListener(_fun119390);
|
|
if (!value5) {
|
|
property6.init();
|
|
}
|
|
binding = env2_0;
|
|
binding9 = env2_3;
|
|
binding(binding9[68]);
|
|
binding(binding9[69]).initSessionHeartbeatScheduler();
|
|
} else {
|
|
env2_1(env2_3[31]).addBreadcrumb({message: 'Init called when already initialized'});
|
|
}
|
|
return value;
|
|
function trackFirstLaunched() { // fn#119381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:7768, offset: 0x010fe097, size: 30 bytes, params: 1, frame: 13
|
|
return env3_35.apply(this, arguments);
|
|
}
|
|
|
|
function _fun119382() { // fn#119382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:7922, offset: 0x025084b9, size: 27 bytes, params: 1, frame: 11
|
|
env3_0(env3_3[48]);
|
|
}
|
|
|
|
function _fun119383() { // fn#119383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:8042, offset: 0x025084d4, size: 58 bytes, params: 1, frame: 12
|
|
env3_1(env3_3[18]).initialize();
|
|
env3_20.verbose('Flux has initialized');
|
|
}
|
|
|
|
function _fun119384(a0) { // fn#119384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:8169, offset: 0x0250850e, size: 31 bytes, params: 2, frame: 13
|
|
const url = a0.url;
|
|
env3_33(a0, true);
|
|
}
|
|
|
|
function _fun119385() { // fn#119385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:8259, offset: 0x0250852d, size: 27 bytes, params: 1, frame: 11
|
|
return env3_0(env3_3[32]);
|
|
}
|
|
|
|
function _fun119386(a0) { // fn#119386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:8555, offset: 0x02508548, size: 71 bytes, params: 2, frame: 14
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
const binding = env3_0;
|
|
const binding2 = env3_3;
|
|
value = binding(binding2[43]);
|
|
value = value(binding2[53], binding2.paths);
|
|
value.then(_fun119387);
|
|
function _fun119387({default: property}) { // fn#119387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:8590, offset: 0x0250858f, size: 85 bytes, params: 2, frame: 14
|
|
var environment;
|
|
const value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
return property.loadCacheAsync(env4_4(env4_0(env4_3[54]).computeInitialNavigationState(), 1)[0], _fun119388);
|
|
function _fun119388() { // fn#119388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:8693, offset: 0x025085e4, size: 170 bytes, params: 1, frame: 16
|
|
let value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
|
|
const binding = env5_0;
|
|
const binding2 = env5_3;
|
|
const property = binding(binding2[55]).default;
|
|
const property2 = binding(binding2[56]).default;
|
|
const isMobileVisualRefreshEnabled = binding(binding2[57]).isMobileVisualRefreshEnabled;
|
|
value = binding(binding2[58]);
|
|
value.updateSaturation(property2.saturation);
|
|
binding(binding2[59]).updateVisualRefresh(isMobileVisualRefreshEnabled('NativeAppStartup'));
|
|
value = binding(binding2[60]);
|
|
value.updateTheme(property.theme);
|
|
value = environment.__proto__;
|
|
env1_0();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun119389() { // fn#119389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:9075, offset: 0x0250868e, size: 20 bytes, params: 1, frame: 9
|
|
env3_24.resolve();
|
|
}
|
|
|
|
function _fun119390() { // fn#119390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:9409, offset: 0x025086a2, size: 55 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
let binding = env3_1;
|
|
value = binding(env3_3[34]);
|
|
const setApplicationIconBadgeNumber = value.setApplicationIconBadgeNumber;
|
|
binding = env0_0;
|
|
const getTotalMentionCount = binding.getTotalMentionCount;
|
|
Reflect.apply(setApplicationIconBadgeNumber, value, [Reflect.apply(getTotalMentionCount, binding, [])]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _initHeadlessTask() { // fn#119391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:9655, offset: 0x025086d9, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun119393).apply(this, arguments);
|
|
function* _fun119393() { // fn#119393, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:9712, offset: 0x02508716, size: 394 bytes, params: 1, frame: 20
|
|
var environment;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var binding = HeadlessRan;
|
|
var None = env2_25.None;
|
|
if (binding === None) {
|
|
HeadlessRan = env2_25.HeadlessRan;
|
|
var onStorageInitialize = env2_34().onStorageInitialize;
|
|
var Promise = global.Promise;
|
|
var all = Promise.all;
|
|
var items2 = [env2_36(), env2_38()];
|
|
binding = env2_39;
|
|
items2[2] = binding({log: false});
|
|
yield Reflect.apply(all, Promise, [items2]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
env2_43();
|
|
onStorageInitialize();
|
|
binding = env2_0;
|
|
var binding2 = env2_3;
|
|
binding(binding2[70]);
|
|
binding(binding2[48]);
|
|
env2_1(binding2[18]).initialize();
|
|
var value7 = binding(binding2[43]);
|
|
var property = binding2[53];
|
|
var paths = binding2.paths;
|
|
value7(property, paths).then(function({default: property}) {
|
|
property.loadCacheAsync({page: 'other'}, _fun119395);
|
|
});
|
|
Promise = global.Promise;
|
|
all = Promise.all;
|
|
var value9 = binding(binding2[43]);
|
|
property = binding2[67];
|
|
paths = binding2.paths;
|
|
items2 = [value9(property, paths)];
|
|
yield Reflect.apply(all, Promise, [items2]);
|
|
var value11 = undefined;
|
|
if (false) {
|
|
return value11;
|
|
}
|
|
property = env2_4(value11, 1)[0];
|
|
property.init();
|
|
binding = env2_1;
|
|
binding(env2_3[49])();
|
|
}
|
|
}
|
|
function _fun119394({default: property}) { // fn#119394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:9972, offset: 0x025088a0, size: 44 bytes, params: 2, frame: 13
|
|
property.loadCacheAsync({page: 'other'}, _fun119395);
|
|
function _fun119395() { // fn#119395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:10021, offset: 0x025088cc, size: 20 bytes, params: 1, frame: 9
|
|
env4_24.resolve();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function initializeTokenStorage() { // fn#119396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:10151, offset: 0x025088e0, size: 384 bytes, params: 1, frame: 18
|
|
var token;
|
|
var moduleValue;
|
|
var defaultImport;
|
|
const Storage = (StorageModule).Storage;
|
|
let get = Storage.get;
|
|
if (Reflect.apply(get, Storage, [TOKEN_KEY]) == null) {
|
|
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
|
|
if (moduleValue.isAndroid()) {
|
|
defaultImport = importDefault(479) /* metro dependency 479: NativeFastConnectModule */;
|
|
token = defaultImport.getConstants().token;
|
|
} else {
|
|
token = NativeModules.DCDFastConnectManager.token;
|
|
}
|
|
if (token != null) {
|
|
env0_20.log('Applying token storage fix.');
|
|
Storage.set(TOKEN_KEY, token);
|
|
} else {
|
|
env0_20.log('Cannot apply token storage fix as token not in NSUserDefaults.');
|
|
}
|
|
} else {
|
|
env0_20.verbose('No need to apply token storage fix as token already exists.');
|
|
}
|
|
(TokenManagerModule).init();
|
|
const getToken = TokenManagerModule.getToken;
|
|
const value3 = Reflect.apply(getToken, TokenManagerModule, []) != null;
|
|
get = Storage.get;
|
|
const value4 = Reflect.apply(get, Storage, [TOKEN_KEY]) != null;
|
|
const binding = env0_20;
|
|
binding.verbose('Token manager has initialized', {storageHasToken: value4, tokenManagerHasToken: value3});
|
|
env0_23();
|
|
}
|
|
|
|
}
|
|
|
|
function _fun119380(a0) { // fn#119380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15774:7320, offset: 0x025084a9, size: 16 bytes, params: 2, frame: 9
|
|
return (0, a0.default)();
|
|
}
|
|
|
|
global.__d(_fun119332, 15577, [57, 5, 15578, 15628, 27, 15648, 1950, 1934, 7030, 4874, 15649, 661, 14, 3, 16223,
|
|
4904, 16224, 10560, 566, 690, 1218, 16226, 12835, 477, 20, 16227, 8070, 694, 16228, 4020, 4884, 1216, 16229,
|
|
16230, 10741, 587, 683, 479, 1926, 7864, 1961, 1282, 16231, 1962, 7717, 16233, 12945, 5254, 16251, 16252, 16253,
|
|
9597, 4900, 4885, 4009, 1310, 4502, 1357, 12993, 15311, 15312, 692, 12830, 4873, 12998, 13012, 5214, 16254,
|
|
5321, 4875, 4885,
|
|
2]) /* metro module 15577, dependencies: [57, 5, 15578, 15628, 27, 15648, 1950, 1934, 7030, 4874, 15649, 661, 14, 3, 16223, 4904, 16224, 10560, 566, 690, 1218, 16226, 12835, 477, 20, 16227, 8070, 694, 16228, 4020, 4884, 1216, 16229, 16230, 10741, 587, 683, 479, 1926, 7864, 1961, 1282, 16231, 1962, 7717, 16233, 12945, 5254, 16251, 16252, 16253, 9597, 4900, 4885, 4009, 1310, 4502, 1357, 12993, 15311, 15312, 692, 12830, 4873, 12998, 13012, 5214, 16254, 5321, 4875, 4885, 2] */;
|