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,33 @@
// Metro module 10630 (f10631).
import { TransportTypes } from "../../Constants";
import { RPCCloseCodes } from "../../../../Constants";
import { validateOriginAndUpdateSocket, processSocketThrottlers, validateSocketApplication, getDeprecatedVoiceSettingsWithShortcut, getVoiceSettingsWithShortcut } from "../../RPCHelpers";
import RPCError from "../../RPCError";
let env7131 = {};
let c7132_0 = async (c26763_0, c26763_1, c26763_2) => {
let r49;
let c26763_4;
let c30269_0, c30269_1, c30269_2;
L12: {
c26763_4 = void 0;
c30269_0 = c26763_0;
c30269_1 = c26763_1;
c30269_2 = c26763_2;
validateOriginAndUpdateSocket(c26763_0, c26763_1);
if (c26763_2 == null) {
r49 = Promise.reject(new RPCError({
closeCode: RPCCloseCodes.INVALID_CLIENTID
}, "No Client ID Specified"));
break L12;
}
await processSocketThrottlers(c26763_2, c26763_0.transport !== TransportTypes.POST_MESSAGE, c26763_0.abortController.signal);
return validateSocketApplication(c30269_0, c30269_2, c30269_1);
}
return r49;
};
export const validateSocketClient = function() {
const apply = c7132_0.apply;
return c7132_0.apply(this, arguments);
};
export const getDeprecatedVoiceSettings = () => getDeprecatedVoiceSettingsWithShortcut(() => []);
export const getVoiceSettings = (a0) => getVoiceSettingsWithShortcut(a0, () => "");
@@ -0,0 +1,5 @@
// Metro module 13521 (f13522).
import RPCServerManager from "../../server/RPCServerManager";
import NativeRPCImplementation from "../NativeRPCImplementation";
const rPCServerManager = new RPCServerManager(NativeRPCImplementation);
export default rPCServerManager;
@@ -0,0 +1,112 @@
// Metro module 13569 (f13570).
import * as _Constants from "../../../Constants";
import { RPCCommands, RPCErrors, InstantInviteSources } from "../../../../../Constants";
import { NativePermissionTypes } from "../../../../native_permissions/NativePermissionConstants";
import { OAuth2Scopes } from "../../../../../_bundle/Module8174";
import { validateOpenInviteDialog } from "../../../helpers/validateOpenInviteDialog";
import RPCError from "../../../RPCError";
import { showInstantInviteActionSheet } from "../../../../instant_invite/native/InstantInviteUtils";
import getCurrentEmbeddedActivityChannel from "../../../helpers/getCurrentEmbeddedActivityChannel";
import NativePermissionUtils from "../../../../native_permissions/NativePermissionUtils";
import ImagePicker from "../../../../image/native/ImagePicker";
import { uploadImageAttachment } from "../../../../activities/EmbeddedActivitiesActionCreators";
import APIError from "../../../../../errors/APIError";
let env9426 = {};
const { RPC_AUTHENTICATED_SCOPE, RPC_LOCAL_SCOPE, RPC_SCOPE_CONFIG } = _Constants;
const r31 = {};
const OPEN_INVITE_DIALOG = RPCCommands.OPEN_INVITE_DIALOG;
const scope = {};
scope[RPC_SCOPE_CONFIG.ANY] = [OAuth2Scopes.RPC, RPC_LOCAL_SCOPE, RPC_AUTHENTICATED_SCOPE];
r31[OPEN_INVITE_DIALOG] = {
scope,
handler: ({ socket: socket2 }) => {
const r15 = validateOpenInviteDialog();
const channel = r15.channel;
if (r15.frame != null) {
throw new RPCError({
errorCode: RPCErrors.UNKNOWN_ERROR
}, "Cannot support frames (yet)");
}
let id = socket2.application.id;
if (id == null) {
id = void 0;
}
showInstantInviteActionSheet(channel, {
source: InstantInviteSources.ACTIVITY_INVITE,
targetApplicationId: id
});
}
};
const INITIATE_IMAGE_UPLOAD = RPCCommands.INITIATE_IMAGE_UPLOAD;
const scope2 = {};
scope2[RPC_SCOPE_CONFIG.ANY] = [OAuth2Scopes.RPC, RPC_LOCAL_SCOPE, RPC_AUTHENTICATED_SCOPE];
r31[INITIATE_IMAGE_UPLOAD] = {
scope: scope2,
handler: async ({ socket }) => {
let r216;
let c27514_0, c27514_1;
L27: {
let env30648;
c27514_1 = void 0;
const r13 = env30648 = {
$parent: env9426
};
c27514_0 = r13;
env30648[0] = void 0;
env30648[1] = void 0;
env30648[2] = void 0;
env30648[3] = void 0;
const id = socket.application.id;
env30648[0] = id;
if (id == null) {
throw new RPCError({
errorCode: RPCErrors.INVALID_COMMAND
}, "No application.");
}
const id2 = getCurrentEmbeddedActivityChannel()?.id;
env30648[1] = id2;
if (id2 == null) {
throw new RPCError({
errorCode: RPCErrors.UNKNOWN_ERROR
}, "Unable to find selected channel");
}
if (await NativePermissionUtils.requestPermission(NativePermissionTypes.PHOTOS).catch(() => {
throw new RPCError({
errorCode: RPCErrors.UNKNOWN_ERROR
}, "Failed requesting photo permissions");
})) {
env30648[2] = (await ImagePicker.launchImageLibraryAsync({
mediaType: "photo",
includeBase64: false,
selectionLimit: 1
})).assets[0];
if (env30648[2] == null) {
throw new RPCError({
errorCode: RPCErrors.UNKNOWN_ERROR
}, "No image selected");
}
env30648[3] = await uploadImageAttachment(env30648[0], env30648[1], {
name: env30648[2].fileName,
type: env30648[2].type,
uri: env30648[2].uri
});
if (env30648[3] != null && env30648[3].url != null) {
if (!(env30648[3] instanceof APIError)) {
r216 = {
image_url: env30648[3].url
};
break L27;
}
}
throw new RPCError({
errorCode: RPCErrors.UNKNOWN_ERROR
}, JSON.stringify(env30648[3]));
}
throw new RPCError({
errorCode: RPCErrors.UNKNOWN_ERROR
}, "Missing photo permissions");
}
return r216;
}
};
export default r31;
@@ -0,0 +1,45 @@
// Metro module 13570 (f13571).
import ApplicationStore from "../../../../applications/ApplicationStore";
import { ApplicationFlags, ComponentActions, RPCErrors } from "../../../../../Constants";
import RPCError from "../../../RPCError";
import { hasApplicationFlag } from "../../../../applications/utils/ApplicationFlagUtils";
import { ComponentDispatch } from "../../../../../utils/ComponentDispatchUtils";
import AuthCommandsFactory from "../../../server/commands/AuthCommandsFactory";
const r23 = AuthCommandsFactory(({ clientId, authorizations, scopes, parsedPermissions, responseType, redirectUri, codeChallenge, codeChallengeMethod, state, guildId, channelId, prompt, disableGuildSelect, disclosures, integrationType }) => new Promise((c27515_0, c27515_1) => {
let r12 = (integrationType != null ? authorizations == null ? void 0 : authorizations.get(integrationType) : void 0)?.application;
if (r12 == null) {
r12 = ApplicationStore.getApplication(clientId);
}
let scopes2 = scopes;
if (scopes == null) {
scopes2 = [];
}
ComponentDispatch.dispatch(ComponentActions.SHOW_OAUTH2_MODAL, {
clientId,
scopes: scopes2,
responseType,
redirectUri,
codeChallenge,
codeChallengeMethod,
state,
guildId,
channelId,
permissions: parsedPermissions,
prompt,
disableGuildSelect: typeof disableGuildSelect !== "boolean" ? disableGuildSelect === "true" : disableGuildSelect,
showLogout: false,
callback: function callback(a0) {
if (a0.location != null) {
c27515_0(a0.location);
} else {
c27515_1(new RPCError({
errorCode: RPCErrors.OAUTH2_ERROR
}, "User cancelled authorization"));
}
},
isEmbeddedFlow: hasApplicationFlag(r12, ApplicationFlags.EMBEDDED),
disclosures,
integrationType
});
}), function onAuthorizeValidationPassed() {});
export default r23;
@@ -0,0 +1,39 @@
// Metro module 13573 (f13574).
import { RPCCommands } from "../../../../../Constants";
import { unsupportedCommand, deprecatedCommand } from "../../../helpers/unavailableCommand";
const r13 = {};
r13[RPCCommands.SET_USER_VOICE_SETTINGS] = unsupportedCommand;
r13[RPCCommands.SET_USER_VOICE_SETTINGS_2] = unsupportedCommand;
r13[RPCCommands.PUSH_TO_TALK] = unsupportedCommand;
r13[RPCCommands.SET_VOICE_SETTINGS_2] = unsupportedCommand;
r13[RPCCommands.SET_VOICE_SETTINGS] = unsupportedCommand;
r13[RPCCommands.SEND_ACTIVITY_JOIN_INVITE] = unsupportedCommand;
r13[RPCCommands.CLOSE_ACTIVITY_JOIN_REQUEST] = unsupportedCommand;
r13[RPCCommands.ACTIVITY_INVITE_USER] = unsupportedCommand;
r13[RPCCommands.ACCEPT_ACTIVITY_INVITE] = unsupportedCommand;
r13[RPCCommands.OPEN_SHARE_MOMENT_DIALOG] = unsupportedCommand;
r13[RPCCommands.INVITE_BROWSER] = unsupportedCommand;
r13[RPCCommands.DEEP_LINK] = unsupportedCommand;
r13[RPCCommands.CONNECTIONS_CALLBACK] = unsupportedCommand;
r13[RPCCommands.BILLING_POPUP_BRIDGE_CALLBACK] = unsupportedCommand;
r13[RPCCommands.BRAINTREE_POPUP_BRIDGE_CALLBACK] = unsupportedCommand;
r13[RPCCommands.GIFT_CODE_BROWSER] = unsupportedCommand;
r13[RPCCommands.GUILD_TEMPLATE_BROWSER] = unsupportedCommand;
r13[RPCCommands.BROWSER_HANDOFF] = unsupportedCommand;
r13[RPCCommands.SET_OVERLAY_LOCKED] = unsupportedCommand;
r13[RPCCommands.OPEN_OVERLAY_ACTIVITY_INVITE] = unsupportedCommand;
r13[RPCCommands.OPEN_OVERLAY_GUILD_INVITE] = unsupportedCommand;
r13[RPCCommands.OPEN_OVERLAY_VOICE_SETTINGS] = unsupportedCommand;
r13[RPCCommands.VALIDATE_APPLICATION] = unsupportedCommand;
r13[RPCCommands.GET_ENTITLEMENT_TICKET] = unsupportedCommand;
r13[RPCCommands.START_PURCHASE] = unsupportedCommand;
r13[RPCCommands.START_PREMIUM_PURCHASE] = unsupportedCommand;
r13[RPCCommands.ENCOURAGE_HW_ACCELERATION] = unsupportedCommand;
r13[RPCCommands.TOGGLE_VIDEO] = unsupportedCommand;
r13[RPCCommands.TOGGLE_SCREENSHARE] = unsupportedCommand;
r13[RPCCommands.SEND_GENERIC_EVENT] = deprecatedCommand;
r13[RPCCommands.OPEN_MESSAGE] = unsupportedCommand;
r13[RPCCommands.OPEN_INVITE] = unsupportedCommand;
r13[RPCCommands.SHARE_INTERACTION] = unsupportedCommand;
r13[RPCCommands.SET_SUPPRESS_NOTIFICATIONS] = unsupportedCommand;
export default r13;
@@ -0,0 +1,14 @@
// Metro module 13572 (f13573).
import { RPC_SCOPE_CONFIG } from "../../../Constants";
import { RPCCommands } from "../../../../../Constants";
import { OAuth2Scopes } from "../../../../../_bundle/Module8174";
import { getDeprecatedVoiceSettings } from "../NativeRPCHelpers";
const r19 = {};
const GET_VOICE_SETTINGS = RPCCommands.GET_VOICE_SETTINGS;
const scope = {};
scope[RPC_SCOPE_CONFIG.ANY] = [OAuth2Scopes.RPC, OAuth2Scopes.RPC_VOICE_READ];
r19[GET_VOICE_SETTINGS] = {
scope,
handler: () => getDeprecatedVoiceSettings()
};
export default r19;
@@ -0,0 +1,10 @@
// Metro module 10622 (f10623).
import Logger from "../../../../debug/Logger";
import stripSensitiveLoggingData from "../../../helpers/stripSensitiveLoggingData";
import PostMessageTransport from "../../../transports/PostMessageTransport";
import { validateSocketClient } from "../NativeRPCHelpers";
import WebViewWindowProxySocketFactory from "./WebViewWindowProxySocketFactory";
const postMessageTransport = new PostMessageTransport(validateSocketClient, new Logger("RPCServer:PostMessage"), WebViewWindowProxySocketFactory, (a0, a1, a2) => {
a1.info.call(a1, `Socket Message: ${a2.id}`, stripSensitiveLoggingData(a0));
});
export default postMessageTransport;
@@ -0,0 +1,18 @@
// Metro module 10634 (f10635).
import PostMessageProxySocket from "../../../transports/PostMessageProxySocket";
import stripSensitiveLoggingData from "../../../helpers/stripSensitiveLoggingData";
export default (a0) => {
const { origin, postMessageToRPCClient, frameId, version, encoding, logger } = a0;
return new PostMessageProxySocket({
origin,
postMessageToRPCClient,
frameId,
version,
encoding,
logger,
postClose: a0.postClose,
onSendingToRPCClient: (a0, a1) => {
logger.info(`Socket Emit: ${a1}`, stripSensitiveLoggingData(a0));
}
});
};