decord/source/1103_getExpoUpdatesContext.js

124 lines
4.3 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 1103
2026-07-25 08:10:48 +00:00
// Function ID: 12607
2026-07-20 16:05:17 +00:00
// Name: getExpoUpdatesContext
2026-07-23 10:11:24 +00:00
// Dependencies: [978, 977, 794, 979]
2026-07-20 16:05:17 +00:00
// Module 1103 (getExpoUpdatesContext)
2026-07-23 10:11:24 +00:00
const require = arg1;
const dependencyMap = arg6;
2026-07-20 16:05:17 +00:00
function getExpoUpdatesContext() {
2026-07-23 10:11:24 +00:00
let obj = require(979) /* getExpoConstants */;
2026-07-20 16:05:17 +00:00
const expoUpdates = obj.getExpoUpdates();
if (expoUpdates) {
obj = { is_enabled: expoUpdates.isEnabled, is_embedded_launch: expoUpdates.isEmbeddedLaunch, is_emergency_launch: expoUpdates.isEmergencyLaunch, is_using_embedded_assets: expoUpdates.isUsingEmbeddedAssets };
if (tmp2) {
obj.update_id = expoUpdates.updateId.toLowerCase();
const str2 = expoUpdates.updateId;
}
if (tmp3) {
obj.channel = expoUpdates.channel.toLowerCase();
const str3 = expoUpdates.channel;
}
if (tmp4) {
obj.runtime_version = expoUpdates.runtimeVersion.toLowerCase();
const str4 = expoUpdates.runtimeVersion;
}
if (tmp5) {
obj.check_automatically = expoUpdates.checkAutomatically.toLowerCase();
const str5 = expoUpdates.checkAutomatically;
}
if (tmp6) {
obj.emergency_launch_reason = expoUpdates.emergencyLaunchReason;
}
if ("number" === typeof expoUpdates.launchDuration) {
obj.launch_duration = expoUpdates.launchDuration;
}
const _Date = Date;
if (expoUpdates.createdAt instanceof Date) {
const createdAt = expoUpdates.createdAt;
obj.created_at = createdAt.toISOString();
}
return obj;
} else {
obj = { is_enabled: false };
return obj;
}
}
arg5.OTA_UPDATES_CONTEXT_KEY = "ota_updates";
arg5.expoContextIntegration = function expoContextIntegration() {
function getExpoUpdatesContextCached() {
2026-07-23 10:11:24 +00:00
let tmp = closure_0;
if (!closure_0) {
const tmp3 = outer1_2();
closure_0 = tmp3;
2026-07-20 16:05:17 +00:00
tmp = tmp3;
}
return tmp;
}
return {
name: "ExpoContext",
setup(on) {
2026-07-23 10:11:24 +00:00
let closure_0 = on;
2026-07-20 16:05:17 +00:00
on.on("afterInit", () => {
2026-07-23 10:11:24 +00:00
if (options.getOptions().enableNative) {
2026-07-20 16:05:17 +00:00
if (obj.isExpo()) {
if (!obj2.isExpoGo()) {
2026-07-23 10:11:24 +00:00
const tmp6 = outer1_1();
const NATIVE = outer2_0(getExpoUpdatesContextCached[1]).NATIVE;
2026-07-20 16:05:17 +00:00
NATIVE.setContext("ota_updates", tmp6);
}
2026-07-23 10:11:24 +00:00
obj2 = outer2_0(getExpoUpdatesContextCached[0]);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj = outer2_0(getExpoUpdatesContextCached[0]);
2026-07-20 16:05:17 +00:00
}
});
},
processEvent(contexts) {
if (obj.isExpo()) {
2026-07-23 10:11:24 +00:00
(function addExpoGoContext(contexts) {
let obj = outer2_0(getExpoUpdatesContextCached[0]);
2026-07-20 16:05:17 +00:00
if (obj.isExpoGo()) {
2026-07-23 10:11:24 +00:00
const expoDevice = outer2_0(getExpoUpdatesContextCached[3]).getExpoDevice();
2026-07-20 16:05:17 +00:00
let tmp4;
if (expoDevice) {
obj = { name: expoDevice.deviceName };
let isDevice;
if (null != expoDevice) {
isDevice = expoDevice.isDevice;
}
obj.simulator = !isDevice;
({ modelName: obj3.model, manufacturer: obj3.manufacturer, totalMemory: obj3.memory_size } = expoDevice);
tmp4 = obj;
}
if (tmp4) {
contexts.contexts = contexts.contexts || {};
const _Object = Object;
const _Object2 = Object;
contexts.contexts.device = Object.assign(Object.assign({}, tmp4), contexts.contexts.device);
}
2026-07-23 10:11:24 +00:00
const obj2 = outer2_0(getExpoUpdatesContextCached[3]);
const expoDevice1 = outer2_0(getExpoUpdatesContextCached[3]).getExpoDevice();
2026-07-20 16:05:17 +00:00
let tmp11;
if (expoDevice1) {
obj = {};
({ osBuildId: obj5.build, osVersion: obj5.version, osName: obj5.name } = expoDevice1);
tmp11 = obj;
}
if (tmp11) {
contexts.contexts = contexts.contexts || {};
const _Object3 = Object;
const _Object4 = Object;
contexts.contexts.os = Object.assign(Object.assign({}, tmp11), contexts.contexts.os);
}
}
2026-07-23 10:11:24 +00:00
})(contexts);
2026-07-20 16:05:17 +00:00
contexts.contexts = contexts.contexts || {};
2026-07-23 10:11:24 +00:00
let _Object = Object;
2026-07-20 16:05:17 +00:00
contexts.contexts.ota_updates = Object.assign({}, getExpoUpdatesContextCached());
}
return contexts;
}
};
};
arg5.getExpoUpdatesContext = getExpoUpdatesContext;