This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,20 @@
// Metro module 4171 (f4172).
import Module3771 from "../../_bundle/Module3771";
import { isIOS, isAndroid } from "../../utils/PlatformUtils";
import URLUtils from "../../utils/URLUtils";
import { getConstants } from "../../utils/native/ClientInfoUtils";
const r19 = Module3771.duration(6, "hours");
const url = globalThis.process.env.INTERNAL_UPDATE_URL !== void 0 ? globalThis.process.env.INTERNAL_UPDATE_URL !== "" ? isIOS() ? URLUtils.toURLSafe(globalThis.process.env.INTERNAL_UPDATE_URL) : isAndroid() ? URLUtils.toURLSafe(globalThis.process.env.INTERNAL_UPDATE_URL) : null : null : null;
const r48 = parseInt(getConstants()?.Build);
const currentBuild = Number.isNaN(r48) ? null : r48 !== 0 ? r48 !== 123456 ? r48 !== 1234567890 ? r48 : null : null : null;
let currentVersion = getConstants()?.Version;
if (currentVersion == null) {
currentVersion = null;
}
const r62 = url !== null ? currentBuild !== null ? currentVersion !== null ? {
url,
currentBuild,
currentVersion
} : null : null : null;
export { r19 as UPDATE_CHECK_INTERVAL };
export { r62 as UPDATE_CONFIG };
@@ -0,0 +1,70 @@
// Metro module 13459 (f13460).
import { UPDATE_CHECK_INTERVAL, UPDATE_CONFIG } from "./MobileNativeUpdateConstants";
import Logger from "../debug/Logger";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
import * as _MobileNativeUpdateUtils from "./MobileNativeUpdateUtils";
let c9338_5 = new Logger("MobileNativeUpdateStore");
let c9338_6 = {
lastCheck: null,
checking: false,
newBuild: null
};
let c9338_7 = null;
class MobileNativeUpdateStore extends Module589.Store {
static displayName = "MobileNativeUpdateStore";
hasUpdatesConfigured = UPDATE_CONFIG !== null;
checkForNewerBuild() {
if (c9338_6.checking !== true) {
Dispatcher.dispatch({
type: "MOBILE_NATIVE_UPDATE_CHECK_STARTED"
});
_MobileNativeUpdateUtils.checkForNewerBuild().then((result) => {
Dispatcher.dispatch({
type: "MOBILE_NATIVE_UPDATE_CHECK_FINISHED",
newBuild: result
});
}, () => {
Dispatcher.dispatch({
type: "MOBILE_NATIVE_UPDATE_CHECK_FAILED"
});
});
}
}
ensureInitialized() {
if (this.hasUpdatesConfigured && c9338_7 === null) {
const backgroundUpdateCheck = () => {
c9338_5.info("Checking for new native builds in the background");
this.checkForNewerBuild();
};
c9338_7 = setInterval(backgroundUpdateCheck, UPDATE_CHECK_INTERVAL.asMilliseconds());
setTimeout(backgroundUpdateCheck, 1000);
}
}
latestFetchedBuild() {
this.ensureInitialized();
return c9338_6;
}
}
const mobileNativeUpdateStore = new MobileNativeUpdateStore(Dispatcher, {
MOBILE_NATIVE_UPDATE_CHECK_STARTED: function handleCheckStarted() {
c9338_6 = {
...c9338_6,
checking: true
};
},
MOBILE_NATIVE_UPDATE_CHECK_FAILED: function handleCheckFailed() {
c9338_6 = {
...c9338_6,
checking: false
};
},
MOBILE_NATIVE_UPDATE_CHECK_FINISHED: function handleCheckFinished({ newBuild }) {
c9338_6 = {
lastCheck: new Date(),
checking: false,
newBuild
};
}
});
export default mobileNativeUpdateStore;
@@ -0,0 +1,73 @@
// Metro module 13044 (f13045).
import { UPDATE_CONFIG } from "./MobileNativeUpdateConstants";
import Logger from "../debug/Logger";
import { HTTP } from "../../_bundle/sendRequest";
import * as _Linking from "../../lib/native/Linking";
import { isIOS } from "../../utils/PlatformUtils";
import { WebBrowserType } from "../../ConstantsIOS";
let c9003_4;
const openBuildInstallerUrl = function openBuildInstallerUrl(a0) {
L9: {
try {
const uRL = new URL(a0);
if (uRL.origin !== (UPDATE_CONFIG == null ? void 0 : UPDATE_CONFIG.url.origin)) {
c9003_4.error(`Attempted to follow invalid install URL ${uRL}`);
break L9;
}
const openURLExternally = _Linking.default.openURLExternally;
if (isIOS()) {
const SAFARI = WebBrowserType.SAFARI;
openURLExternally(uRL.toString(), SAFARI);
} else {
openURLExternally(uRL.toString());
}
} catch ($e) {}
return void 0;
}
};
c9003_4 = new Logger("MobileNativeUpdateUtils");
export async function checkForNewerBuild() {
let r106;
let c27405_1;
let c30609_0, c30609_1;
L18: {
L17: {
c27405_1 = void 0;
c30609_0 = void 0;
c30609_1 = void 0;
if (UPDATE_CONFIG === null) {
break L18;
}
c9003_4.info(`Checking ${UPDATE_CONFIG.url} for updates`);
c30609_0 = await HTTP.get({
url: UPDATE_CONFIG.url.toString(),
headers: {
Accept: "application/json"
},
rejectWithError: false
});
if (!c30609_0.ok) {
throw c30609_0;
}
c30609_1 = {
build: c30609_0.body.build,
version: c30609_0.body.version,
buildTimestamp: new Date(c30609_0.body.build_timestamp),
urls: c30609_0.body.urls
};
if (c30609_1.build > UPDATE_CONFIG.currentBuild && c30609_1.version >= UPDATE_CONFIG.currentVersion) {
c9003_4.info(`Update build ${c30609_1.build} is newer than ${UPDATE_CONFIG.currentBuild}`);
r106 = c30609_1;
break L17;
}
c9003_4.info(`Update build ${c30609_1.build} is older than ${UPDATE_CONFIG.currentBuild}`);
r106 = null;
}
return r106;
}
return null;
}
export function openBuildInstaller(a0) {
openBuildInstallerUrl(a0.urls.install);
}
export { openBuildInstallerUrl };