93 lines
2.2 KiB
TypeScript
93 lines
2.2 KiB
TypeScript
// Metro module 4359 (f4360).
|
|
import DetectableGameStore from "../../stores/DetectableGameStore";
|
|
import { getSubgameMetadata } from "../roblox_subgame_detection/RobloxSubgameUtils";
|
|
import { getPlatformName } from "../../utils/PlatformUtils";
|
|
export function removeExecutablePathPrefix(a0) {
|
|
const r5 = a0.toLowerCase();
|
|
return (r5.endsWith("/") ? r5.slice(0, -1) : r5).split("/").slice(-2).join("/");
|
|
}
|
|
export function getRunningGameAnalytics(a0) {
|
|
if (a0 == null) {
|
|
return {
|
|
gameName: void 0,
|
|
gameId: void 0,
|
|
exe: void 0,
|
|
distributor: void 0,
|
|
sku: void 0,
|
|
gameMetadata: void 0,
|
|
rawExePath: void 0
|
|
};
|
|
}
|
|
const rawExePath = "exePath" in a0 ? a0.exePath : a0.exe;
|
|
let id = a0.id;
|
|
if (id == null) {
|
|
id = void 0;
|
|
}
|
|
let name = a0.name;
|
|
if (name == null) {
|
|
name = void 0;
|
|
}
|
|
const exePath = rawExePath == null ? "" : rawExePath;
|
|
let cmdLine = rawExePath;
|
|
if (cmdLine == null) {
|
|
cmdLine = "";
|
|
}
|
|
const r11 = DetectableGameStore.findGame({
|
|
id,
|
|
name,
|
|
exePath,
|
|
cmdLine,
|
|
lastFocused: 0
|
|
});
|
|
let name2 = a0.name;
|
|
if (name2 == null) {
|
|
name2 = void 0;
|
|
}
|
|
let id2 = a0.id;
|
|
if (id2 == null) {
|
|
id2 = r11?.id;
|
|
}
|
|
if (id2 == null) {
|
|
id2 = void 0;
|
|
}
|
|
const r4 = rawExePath != null;
|
|
let exe = void 0;
|
|
if (r4) {
|
|
const r13 = rawExePath.toLowerCase();
|
|
exe = (r13.endsWith("/") ? r13.slice(0, -1) : r13).split("/").slice(-2).join("/");
|
|
}
|
|
let distributor = a0.distributor;
|
|
if (distributor == null) {
|
|
distributor = void 0;
|
|
}
|
|
let sku = a0.sku;
|
|
if (sku == null) {
|
|
sku = void 0;
|
|
}
|
|
return {
|
|
gameName: name2,
|
|
gameId: id2,
|
|
exe,
|
|
distributor,
|
|
sku,
|
|
gameMetadata: a0 != null ? getSubgameMetadata(a0) : void 0,
|
|
rawExePath
|
|
};
|
|
}
|
|
export function isVerifiedGameExecutable(a0, a1) {
|
|
if (a0 != null && a1 != null) {
|
|
const r7 = a0.toLowerCase();
|
|
const r10 = r7.endsWith("/") ? r7.slice(0, -1) : r7;
|
|
let c14141_0 = r10;
|
|
const platformName = getPlatformName();
|
|
return a1.some((item) => {
|
|
let r6 = item.os === platformName;
|
|
if (r6) {
|
|
r6 = c14141_0 == null ? void 0 : c14141_0.endsWith(item.name);
|
|
}
|
|
return r6;
|
|
});
|
|
}
|
|
return false;
|
|
}
|