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,102 @@
// Metro module 12762 (f12763).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import ConsentStore from "../../../stores/ConsentStore";
import { Consents } from "../../../Constants";
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
import { ALL_DETECTABLE_APP_NAMES } from "../LocalAppDetectionTypes";
import { detectLocalApps } from "./LocalAppDetectionUtils";
import { $callWithNewTarget } from "../../../_hermes/prelude";
function $mk90363($env) {
return () => $env[0].handlePostConnectionOpen();
}
function $mk90364($env) {
return (a0) => $env[0].handleLocalAppDetectionComplete(a0);
}
let c8795_0;
let env8795;
let c8794_6 = {
detected: false,
lastScannedAt: void 0
};
let c8794_7 = {
apps: {}
};
class LocalAppDetectionStore extends Module589.DeviceSettingsStore {
static displayName = "AppDetectionStore";
static persistKey = "AppDetectionStore";
constructor() {
let env20200;
const r2 = env20200 = {};
env20200[0] = void 0;
const r15 = {
POST_CONNECTION_OPEN: $mk90363(r2),
LOCAL_APP_DETECTION_COMPLETE: $mk90364(r2)
};
super(Dispatcher, r15);
env20200[0] = this;
}
initialize(a0) {
c8794_7 = a0 == null ? c8794_7 : a0;
this.waitFor(ConsentStore);
}
getUserAgnosticState() {
return c8794_7;
}
getAppState(a0) {
let r6 = this.getUserAgnosticState().apps[a0];
if (r6 == null) {
r6 = c8794_6;
}
return r6;
}
isAppInstalled(a0) {
return !!ConsentStore.hasConsented(Consents.PERSONALIZATION) && this.getAppState(a0).detected;
}
handlePostConnectionOpen() {
const r3 = [];
for (const item of ALL_DETECTABLE_APP_NAMES) {
const appState = this.getAppState(item);
if (appState.lastScannedAt == null || Date.now() - appState.lastScannedAt > 86400000) {
r3.push(item);
}
}
if (r3.length > 0) {
detectLocalApps(r3);
}
}
handleLocalAppDetectionComplete(a0) {
const r24 = Object.entries(a0.result);
if (r24.length === 0) {
return false;
}
const lastScannedAt = Date.now();
const r30 = {
...c8794_7
};
for (const item of r24) {
const r37 = _slicedToArray(item, 2);
r30.apps[r37[0]] = {
detected: r37[1],
lastScannedAt
};
}
c8794_7 = r30;
}
DEV_resetState() {
c8794_7 = {
apps: {}
};
}
}
const r47 = env8795 = {};
c8795_0 = void 0;
const prototypeOf = Object.getPrototypeOf(LocalAppDetectionStore);
const r52 = {
POST_CONNECTION_OPEN: $mk90363(r47),
LOCAL_APP_DETECTION_COMPLETE: $mk90364(r47)
};
const r54 = Object.create(LocalAppDetectionStore.prototype);
const r55 = $callWithNewTarget(prototypeOf, r54, LocalAppDetectionStore, Dispatcher, r52);
c8795_0 = r55 instanceof Object ? r55 : r54;
export default c8795_0;
@@ -0,0 +1,251 @@
// Metro module 12764 (f12765).
import ConsentStore from "../../../stores/ConsentStore";
import { AnalyticEvents, Consents } from "../../../Constants";
import { GameCommunityUpsellMultiExperiment } from "../../game_community_upsell/native/GameCommunityUpsellExperiment";
import { DetectableAppNames } from "../LocalAppDetectionTypes";
import * as _Module501 from "../../../_bundle/Module501";
import { canOpenUrlScheme } from "../../instant_invite/native/DCDSendUtils";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import Dispatcher from "../../../Dispatcher";
let getDetectableApp;
const isGameCommunityUpsellMultiExperimentEnabled = function isGameCommunityUpsellMultiExperimentEnabled() {
return GameCommunityUpsellMultiExperiment.getConfig({
location: "LocalAppDetectionUtils"
}).enabled;
};
getDetectableApp = function getDetectableApp(a0) {
if (DetectableAppNames.ROBLOX === a0) {
return {
androidScheme: "roblox",
iosScheme: "roblox"
};
}
if (DetectableAppNames.MINECRAFT === a0) {
return {
androidScheme: "minecraft",
iosScheme: "minecraft",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.FORTNITE === a0) {
return {
androidScheme: "fortnite",
iosScheme: "com.epicgames.fortnite",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.GENSHIN === a0) {
return {
androidScheme: "genshin",
iosScheme: "genshin",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.PUBG_MOBILE === a0) {
return {
androidScheme: "pubgmobile",
iosScheme: "igame1320",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.CALL_OF_DUTY_MOBILE === a0) {
return {
androidScheme: "codm",
iosScheme: "codm",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.CLASH_OF_CLANS === a0) {
return {
androidScheme: "clashofclans",
iosScheme: "clashofclans",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.MOBILE_LEGENDS_BANG_BANG === a0) {
return {
androidScheme: "mobilelegends",
iosScheme: "mobilelegends",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.GARENA_FREE_FIRE === a0) {
return {
androidScheme: "garenafreefire",
iosScheme: "freefire",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.POKEMON_GO === a0) {
return {
androidScheme: "pokemongo",
iosScheme: "pokemongo",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.POKEMON_TCG_POCKET === a0) {
return {
androidScheme: "pokemontcgp",
iosScheme: "pokemontcgp",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.CLASH_ROYALE === a0) {
return {
androidScheme: "clashroyale",
iosScheme: "clashroyale",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.AMONG_US === a0) {
return {
androidScheme: "amongus",
iosScheme: "amongus",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.MONOPOLY_GO === a0) {
return {
androidScheme: "monopolygo",
iosScheme: "monopolygo",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.BRAWL_STARS === a0) {
return {
androidScheme: "brawlstars",
iosScheme: "brawlstars",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.BRAWLHALLA === a0) {
return {
androidScheme: "brawlhalla",
iosScheme: null,
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
if (DetectableAppNames.WUTHERING_WAVES === a0) {
return {
androidScheme: "wutheringwaves",
iosScheme: "akioversea",
predicate: isGameCommunityUpsellMultiExperimentEnabled
};
}
};
export async function detectLocalApps(c27367_0) {
let r32;
let c27367_1, c27367_2, c27367_5;
let c27367_6 = 0;
let c30583_1, c30583_2, c30583_3, c30583_4, c30583_0;
L36: {
L34: {
try {
c30583_1 = void 0;
c30583_2 = void 0;
c30583_3 = void 0;
c30583_4 = void 0;
c30583_0 = {};
if (ConsentStore.hasConsented(Consents.PERSONALIZATION)) {
c27367_2 = c27367_0;
const r59 = c27367_0[Symbol.iterator]();
c27367_2 = r59.next;
c27367_1 = r59;
while (true) {
const r61 = c27367_2;
let r62 = c27367_1;
const r63 = r62 === void 0 ? void 0 : (r32 = r61.call(r62)).done ? r62 = void 0 : r32.value;
c27367_1 = r62;
if (r62 === void 0) {
break;
}
c27367_6 = 1;
c30583_1 = r63;
c30583_2 = (0, getDetectableApp)(c30583_1);
const isIOS = _Module501.isIOS();
const r76 = c30583_2;
c30583_3 = isIOS ? r76.iosScheme : r76.androidScheme;
if (c30583_3 != null) {
const r84 = c30583_2;
const predicate = r84.predicate;
if ((predicate == null ? void 0 : predicate.call(r84)) !== false) {
let r102 = await canOpenUrlScheme(c30583_3);
loop20: while (true) {
c30583_4 = r102;
c30583_0[c30583_1] = c30583_4;
AnalyticsUtils.track(AnalyticEvents.CAN_OPEN_URL_REQUESTED, {
scheme: c30583_3,
result: c30583_4
});
while (true) {
c27367_6 = 0;
const r128 = c27367_2;
let r129 = c27367_1;
const r130 = r129 === void 0 ? void 0 : (r32 = r128.call(r129)).done ? r129 = void 0 : r32.value;
c27367_1 = r129;
if (r129 === void 0) {
Dispatcher.dispatch({
type: "LOCAL_APP_DETECTION_COMPLETE",
result: c30583_0
});
break L34;
}
c27367_6 = 1;
c30583_1 = r130;
c30583_2 = (0, getDetectableApp)(c30583_1);
const isIOS2 = _Module501.isIOS();
const r154 = c30583_2;
c30583_3 = isIOS2 ? r154.iosScheme : r154.androidScheme;
if (c30583_3 != null) {
const r162 = c30583_2;
const predicate2 = r162.predicate;
if ((predicate2 == null ? void 0 : predicate2.call(r162)) !== false) {
r102 = await canOpenUrlScheme(c30583_3);
continue loop20;
}
}
c30583_0[c30583_1] = false;
}
}
}
}
c30583_0[c30583_1] = false;
c27367_6 = 0;
}
}
Dispatcher.dispatch({
type: "LOCAL_APP_DETECTION_COMPLETE",
result: c30583_0
});
break L36;
} catch ($e) {
const r40 = $e;
let r8 = r40;
c27367_5 = r40;
if (c27367_6 !== 0) {
while (true) {
try {
const r196 = c27367_5;
c27367_6 = 0;
const r198 = c27367_1;
if (r198 !== void 0 && typeof r198.return === "function") {
try {
r198.return();
} catch {}
}
throw r196;
} catch (r194) {
r8 = r194;
c27367_5 = r194;
if (c27367_6 === 0) {
break;
}
}
}
}
throw r8;
}
}
return void 0;
}
}
@@ -0,0 +1,170 @@
// Metro module 15757 (f15758).
import { useId, useState, useEffect } from "react";
import { View } from "react-native";
import ConnectedAccountsStore from "../../../stores/ConnectedAccountsStore";
import UserStore from "../../../stores/UserStore";
import LocalAppDetectionStore from "./LocalAppDetectionStore";
import { AnalyticsLocations, PlatformTypes, UserSettingsSections } from "../../../Constants";
import { ContentDismissActionType } from "../../dismissible_content/DismissibleContentConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { useThemeContext } from "../../../_bundle/Module3901";
import useSafeAreaInsets_native from "../../safe_area/useSafeAreaInsets.native";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { BottomSheet } from "../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetTitleHeader } from "../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { ActionSheetCloseButton } from "../../../design/components/Sheet/native/ActionSheetCloseButton.native";
import { Stack } from "../../../design/components/Stack/native/Stack.native";
import { Text } from "../../../design/components/Text/native/Text";
import { intl, t } from "../../../intl/index.native";
import { Button } from "../../../design/components/Button/native/Button.native";
import { WindowLaunchIcon } from "../../../design/components/Icon/native/redesign/generated/WindowLaunchIcon";
import authorizeConnection_native from "../../connections/authorizeConnection.native";
import { openUserSettings } from "../../user_settings/core/native/openUserSettings";
import * as _themes from "../../../design/utils/shared/themes";
import Platforms from "../../../lib/Platforms";
import { makeSource } from "../../../utils/AvatarUtils";
import { Icon, IconSizes, Avatar, AvatarSizes } from "../../../design/void/native";
import Module8531, { Path, Defs, LinearGradient, Stop } from "../../../_bundle/Module8531";
import { useStateFromStores, useStateFromStoresObject } from "../../../_bundle/Module589";
import { DetectableAppNames } from "../LocalAppDetectionTypes";
import ConnectedAccountsActionCreators from "../../../actions/ConnectedAccountsActionCreators";
import { UNSAFE_markDismissibleContentAsDismissed } from "../../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../../_bundle/Module1358";
let useStyles, UnionIcon, UserIcon;
const RobloxIcon = function RobloxIcon(props) {
const theme = props.theme;
const styles = useStyles();
const isThemeDark = _themes.isThemeDark(theme);
const r19 = Platforms.get(PlatformTypes.ROBLOX);
const backgroundColor = isThemeDark ? "black" : "white";
const icon = r19.icon;
return <View style={[styles.robloxIconContainer, {
backgroundColor
}]}>
<Icon size={IconSizes.LARGE} source={makeSource(isThemeDark ? icon.darkPNG : icon.lightPNG)} disableColor />
</View>;
};
UnionIcon = function UnionIcon(props) {
const stopColor = _themes.isThemeDark(props.theme) ? "white" : "black";
return <Module8531 width={25} height={4} viewBox="0 0 25 4" id={useId()}>
<Path fill="url(#a)" d="M1.7002 0.799805C2.36285 0.79991 2.90039 1.33732 2.90039 2C2.90029 2.66259 2.36278 3.20009 1.7002 3.2002C1.03752 3.2002 0.500106 2.66265 0.5 2C0.5 1.33726 1.03745 0.799805 1.7002 0.799805ZM8.90039 0.799805C9.56297 0.799989 10.0996 1.33737 10.0996 2C10.0995 2.66254 9.56291 3.20001 8.90039 3.2002C8.23771 3.2002 7.70029 2.66266 7.7002 2C7.7002 1.33726 8.23765 0.799805 8.90039 0.799805ZM16.0996 0.799805C16.7624 0.799805 17.2998 1.33726 17.2998 2C17.2997 2.66266 16.7623 3.2002 16.0996 3.2002C15.4371 3.19996 14.9005 2.66251 14.9004 2C14.9004 1.3374 15.4371 0.800042 16.0996 0.799805ZM23.2998 0.799805C23.9625 0.799805 24.5 1.33726 24.5 2C24.4999 2.66266 23.9625 3.2002 23.2998 3.2002C22.6372 3.20006 22.0997 2.66258 22.0996 2C22.0996 1.33734 22.6372 0.799936 23.2998 0.799805Z" />
<Defs>
<LinearGradient id="a" x1={0.5} y1={2} x2={24.5} y2={2} gradientUnits="userSpaceOnUse">
<Stop stopColor={stopColor} stopOpacity={0.3} />
<Stop offset={1} stopColor={stopColor} stopOpacity={0.7} />
</LinearGradient>
</Defs>
</Module8531>;
};
UserIcon = function UserIcon() {
const styles = useStyles();
return <View style={styles.avatarContainer}>
<View style={styles.avatarInnerBorder} />
<Avatar size={AvatarSizes.NORMAL} user={useStateFromStores([UserStore], () => UserStore.getCurrentUser())} guildId={void 0} />
</View>;
};
useStyles = createStyles({
robloxIconContainer: {
width: 40,
height: 40,
borderRadius: Module712.radii.md,
alignItems: "center",
justifyContent: "center",
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
content: {
paddingHorizontal: Module712.space.PX_16
},
text: {
textAlign: "center"
},
avatarContainer: {
position: "relative"
},
avatarInnerBorder: {
zIndex: 1,
position: "absolute",
borderColor: Module712.colors.BORDER_STRONG,
borderRadius: Module712.radii.round,
borderWidth: 1,
width: "100%",
height: "100%"
}
});
export default function RobloxConnectionActionSheet(props) {
const markAsDismissed = props.markAsDismissed;
const handleCancel = function handleCancel() {
ActionSheetActionCreators.hideActionSheet();
if (markAsDismissed != null) {
markAsDismissed(ContentDismissActionType.DISMISS);
}
};
const styles = useStyles();
const theme = useThemeContext().theme;
return <BottomSheet startExpanded contentStyles={styles.content} header={<BottomSheetTitleHeader title={null} leading={<ActionSheetCloseButton onPress={handleCancel} />} />} onDismiss={() => markAsDismissed(ContentDismissActionType.DISMISS)}>
<Stack spacing={24} style={{
paddingBottom: useSafeAreaInsets_native().bottom
}}>
<Stack justify="center" align="center" direction="horizontal">
<RobloxIcon theme={theme} />
<UnionIcon theme={theme} />
<UserIcon />
</Stack>
<Stack justify="center">
<Text variant="heading-xl/bold" style={styles.text}>
{intl.string(t.t3asUZ)}
</Text>
<Text variant="text-md/medium" style={styles.text}>
{intl.string(t.no96NU)}
</Text>
</Stack>
<Stack>
<Button text={intl.string(t.ItuabN)} icon={<WindowLaunchIcon size="sm" color={Module712.colors.WHITE} />} iconPosition="end" size="lg" onPress={function onPress() {
ActionSheetActionCreators.hideActionSheet();
if (markAsDismissed != null) {
markAsDismissed(ContentDismissActionType.PRIMARY);
}
authorizeConnection_native({
platformType: PlatformTypes.ROBLOX,
location: AnalyticsLocations.ROBLOX_CONNECTION_ACTION_SHEET
});
openUserSettings({
screen: UserSettingsSections.CONNECTIONS
});
}} />
<Button text={intl.string(t.DiGJy3)} variant="secondary" size="lg" onPress={handleCancel} />
</Stack>
</Stack>
</BottomSheet>;
};
export { UnionIcon };
export function useShouldShowRobloxConnectionCoachmark() {
let hasRoloxAccount;
const stateFromStores = useStateFromStores([LocalAppDetectionStore], () => LocalAppDetectionStore.isAppInstalled(DetectableAppNames.ROBLOX));
const [state, setState] = useState(false);
const stateFromStoresObject = useStateFromStoresObject([ConnectedAccountsStore], () => ({
fetchingAccounts: ConnectedAccountsStore.isFetching(),
hasRoloxAccount: ConnectedAccountsStore.getAccounts().find((item) => item.type === PlatformTypes.ROBLOX) != null
}));
const fetchingAccounts = stateFromStoresObject.fetchingAccounts;
hasRoloxAccount = stateFromStoresObject.hasRoloxAccount;
useEffect(() => {
let r3 = stateFromStores;
if (stateFromStores) {
r3 = !state;
}
if (r3) {
setState(true);
ConnectedAccountsActionCreators.fetch();
}
}, [state, stateFromStores]);
useEffect(() => {
if (hasRoloxAccount) {
UNSAFE_markDismissibleContentAsDismissed(DismissibleContent.ROBLOX_CONNECTION_COACHMARK, {
dismissAction: ContentDismissActionType.INDIRECT_ACTION
});
}
}, [hasRoloxAccount]);
return (fetchingAccounts ? !fetchingAccounts : stateFromStores) && !hasRoloxAccount;
}