172 lines
8.4 KiB
TypeScript
172 lines
8.4 KiB
TypeScript
/* Metro module 10560; source: lib/native/BundleUpdater.tsx; dependencies: [5, 6, 7, 27, 661, 3, 477, 90, 1962, 4242, 683, 4826, 2] */
|
|
function _fun81412(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#81412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10746:6, offset: 0x01ececf1, size: 297 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_4 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_5 = importDefault(7) /* metro dependency 7 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const NativeModules = value.NativeModules;
|
|
const NativeEventEmitter = value.NativeEventEmitter;
|
|
const env0_6 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('BundleUpdater');
|
|
const BundleUpdaterManager = NativeModules.BundleUpdaterManager;
|
|
let nativeEventEmitter = new NativeEventEmitter(BundleUpdaterManager);
|
|
const env0_10 = {'downloaded': 'BundleDownloaded', 'otaUpdateChecked': 'OtaUpdateChecked'};
|
|
nativeEventEmitter = _fun81413();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('lib/native/BundleUpdater.tsx');
|
|
exports.default = nativeEventEmitter;
|
|
}
|
|
|
|
function _fun81413() { // fn#81413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10746:342, offset: 0x01ecee1a, size: 384 bytes, params: 1, frame: 18
|
|
const closure = BundleUpdater;
|
|
const binding = env0_5;
|
|
const items2 = [{key: 'getInitialBundleDownloaded', value: function() {
|
|
return BundleUpdaterManager.getInitialBundleDownloaded();
|
|
}}];
|
|
items2[1] = {key: 'getInitialOtaUpdateChecked', value: function() {
|
|
return BundleUpdaterManager.getInitialOtaUpdateChecked();
|
|
}};
|
|
items2[2] = {key: 'addEventListener', value: value_81417};
|
|
items2[3] = {key: 'checkForUpdateAndReload', value: function() {
|
|
BundleUpdaterManager.checkForUpdateAndReload();
|
|
}};
|
|
items2[4] = {key: 'verifyOtaFiles', value: function() {
|
|
return BundleUpdaterManager.verifyOtaFiles();
|
|
}};
|
|
items2[5] = {key: 'getBuildOverrideCookieContents', value: function() {
|
|
return BundleUpdaterManager.getBuildOverrideCookieContents();
|
|
}};
|
|
items2[6] = {key: 'setBuildOverrideCookieHeader', value: function(a0) {
|
|
return BundleUpdaterManager.setBuildOverrideCookieHeader(a0);
|
|
}};
|
|
items2[7] = {key: 'getOtaRootPath', value: function() {
|
|
return BundleUpdaterManager.getOtaRootPath();
|
|
}};
|
|
items2[8] = {key: 'getOtaStatus', value: function() {
|
|
return BundleUpdaterManager.getOtaStatus();
|
|
}};
|
|
items2[9] = {key: 'getManifestInfo', value: function() {
|
|
return BundleUpdaterManager.getManifestInfo();
|
|
}};
|
|
let env0_0 = env0_3(_fun81426);
|
|
items2[10] = {key: 'setupOTAAssetFallback', value: value_81428};
|
|
items2[11] = {key: 'emitOtaMetric', value: value_81429};
|
|
items2[12] = {key: 'prepareOtaMetricForDatadog', value: function(a0) {
|
|
var value = a1;
|
|
var env0_0 = a0;
|
|
return {name: a0.type, tags: (value !== undefined ? value : []).map(_fun81433)};
|
|
}};
|
|
return binding(closure, null, items2);
|
|
}
|
|
|
|
function BundleUpdater() { // fn#81414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10746:353, offset: 0x01ecef9a, size: 27 bytes, params: 1, frame: 13
|
|
env1_4(this, BundleUpdater);
|
|
}
|
|
|
|
function value_81417(a0, a1) { // fn#81417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10746:641, offset: 0x01ecefdb, size: 37 bytes, params: 3, frame: 13
|
|
env1_9.addListener(env1_10[a0], a1);
|
|
}
|
|
|
|
function* _fun81426() { // fn#81426, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10746:1268, offset: 0x01ecf096, size: 142 bytes, params: 1, frame: 15
|
|
var environment;
|
|
var binding2;
|
|
var property;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_0;
|
|
var value3 = binding(env2_2[6]);
|
|
if (value3.isIOS()) {
|
|
binding = env2_0;
|
|
binding2 = env2_2;
|
|
value = binding(binding2[8]);
|
|
property = binding2[7];
|
|
yield value(property, binding2.paths);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
property = value.default;
|
|
(property ?? value).addCustomSourceTransformer(_fun81427);
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_81429(a0) { // fn#81429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10746:1643, offset: 0x01ecf180, size: 115 bytes, params: 2, frame: 15
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
value = require(4242) /* metro dependency 4242 */;
|
|
value = value.match(a0);
|
|
value = value.with({type: 'OtaCheckAttempt'}, _fun81430);
|
|
value = value.with({type: 'OtaAssetDownloadAttempt'}, _fun81431);
|
|
value.exhaustive();
|
|
}
|
|
|
|
function value_81432(a0) { // fn#81432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10746:2375, offset: 0x01ecf357, size: 57 bytes, params: 2, frame: 12
|
|
const value = a1;
|
|
const env0_0 = a0;
|
|
const r3 = value !== undefined ? value : [];
|
|
const object2 = {};
|
|
object2.name = a0.type;
|
|
object2.tags = r3.map(_fun81433);
|
|
return object2;
|
|
}
|
|
|
|
function _fun81427(a0) { // fn#81427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10746:1394, offset: 0x01ecf124, size: 92 bytes, params: 2, frame: 13
|
|
var r0;
|
|
var value;
|
|
var value2;
|
|
var binding;
|
|
var resolvedOTAAssetURI;
|
|
var uri;
|
|
var value3;
|
|
var object2;
|
|
if (a0.isLoadedFromFileSystem()) {
|
|
value = a0.scaledAssetURLNearBundle();
|
|
value2 = environment.__proto__.__proto__.__proto__;
|
|
binding = env3_8;
|
|
resolvedOTAAssetURI = binding.resolvedOTAAssetURI;
|
|
uri = value.uri;
|
|
value3 = Reflect.apply(resolvedOTAAssetURI, binding, [uri]);
|
|
uri = value.uri;
|
|
if (value3 === uri) {
|
|
r0 = null;
|
|
} else {
|
|
object2 = {};
|
|
copyDataProperties(object2, value, value3);
|
|
object2['uri'] = value3;
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function _fun81430(a0) { // fn#81430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10746:1703, offset: 0x01ecf1f3, size: 167 bytes, params: 2, frame: 18
|
|
let value = environment.__proto__.__proto__;
|
|
env2_7.verbose('OTA check attempt', a0);
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const MOBILE_OTA_CHECK_ATTEMPT = AnalyticEvents.MOBILE_OTA_CHECK_ATTEMPT;
|
|
Reflect.apply(track, defaultImport, [MOBILE_OTA_CHECK_ATTEMPT, {result: a0.result,
|
|
duration_seconds: a0.durationSeconds, bytes_received: a0.bytesReceived, error: a0.error}]);
|
|
value = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
|
return value.increment(BundleUpdater.prepareOtaMetricForDatadog(a0, ['result']));
|
|
}
|
|
|
|
function _fun81431(a0) { // fn#81431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10746:1998, offset: 0x01ecf29a, size: 189 bytes, params: 2, frame: 18
|
|
let value = environment.__proto__.__proto__;
|
|
env2_7.verbose('OTA asset download attempt', a0);
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const MOBILE_OTA_ASSET_DOWNLOAD_ATTEMPT = AnalyticEvents.MOBILE_OTA_ASSET_DOWNLOAD_ATTEMPT;
|
|
Reflect.apply(track, defaultImport, [MOBILE_OTA_ASSET_DOWNLOAD_ATTEMPT, {result: a0.result,
|
|
duration_seconds: a0.durationSeconds, error: a0.error, url: a0.url, status_code: a0.statusCode,
|
|
bytes_received: a0.bytesReceived}]);
|
|
value = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
|
return value.increment(BundleUpdater.prepareOtaMetricForDatadog(a0, ['result', 'statusCode']));
|
|
}
|
|
|