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 16103 (f16104).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-04-http-request-sample",
defaultConfig: {
sampleRate: 0
},
variations: {
1: {
sampleRate: 0.0001
}
}
});
export default apexExperiment;
export function getHttpRequestSampleRate() {
return apexExperiment.getConfig({
location: "track_http_request"
}).sampleRate;
}
@@ -0,0 +1,58 @@
// Metro module 1211 (f1212).
import ApexExperimentStore from "../../experiments/apex/ApexExperimentStore";
import UserStore from "../../../stores/UserStore";
import AppStateStore from "../../../stores/native/AppStateStore";
import { AppStates } from "../../../Constants";
import LifecycleManager from "../../../lib/LifecycleManager";
import ZoomedInTelemetry from "./channels/ZoomedInTelemetry";
import ProcessUtils_native from "../../../utils/ProcessUtils.native";
import Dispatcher from "../../../Dispatcher";
import TelemetryRingNative_android from "./TelemetryRingNative.android";
class TelemetryRingLifecycleImpl extends LifecycleManager {
_initialized = false;
_experimentUnsubscribe = null;
_handleEligibilityChange = () => {
this._updateZoomedInExport();
};
_handleLogout = () => {
TelemetryRingNative_android.clear();
ZoomedInTelemetry.reset();
};
_updateZoomedInExport() {
const state = AppStateStore.getState();
ProcessUtils_native.setShouldCollectHermesInstrumentedStats(state === AppStates.ACTIVE && ZoomedInTelemetry.shouldRun());
if (state === AppStates.ACTIVE) {
ZoomedInTelemetry.start();
} else {
ZoomedInTelemetry.stop();
}
}
_initialize() {
if (!this._initialized) {
this._initialized = true;
Dispatcher.subscribe("LOGOUT", this._handleLogout);
AppStateStore.addChangeListener(this._handleEligibilityChange);
UserStore.addChangeListener(this._handleEligibilityChange);
ApexExperimentStore.addChangeListener(this._handleEligibilityChange);
this._experimentUnsubscribe = () => {
ApexExperimentStore.removeChangeListener(this._handleEligibilityChange);
};
ZoomedInTelemetry.initialize();
this._updateZoomedInExport();
}
}
_terminate() {
Dispatcher.unsubscribe("LOGOUT", this._handleLogout);
AppStateStore.removeChangeListener(this._handleEligibilityChange);
UserStore.removeChangeListener(this._handleEligibilityChange);
if (this._experimentUnsubscribe != null) {
this._experimentUnsubscribe();
this._experimentUnsubscribe = null;
}
ZoomedInTelemetry.stop();
ProcessUtils_native.setShouldCollectHermesInstrumentedStats(false);
this._initialized = false;
}
}
const telemetryRingLifecycleImpl = new TelemetryRingLifecycleImpl();
export default telemetryRingLifecycleImpl;
@@ -0,0 +1,18 @@
// Metro module 13251 (f13252).
import Module13252 from "../../../_bundle/Module13252";
const r11 = {
SENTRY: "SENTRY",
NORMAL: "NORMAL",
ZOOMED: "ZOOMED"
};
const r16 = {
append: (a0, a1, a2, a3, a4) => {
Module13252.append(a0, a1, a2, a3, a4);
},
snapshot: (a0, a1, a2, a3) => Module13252.snapshot(a0, a1, a2, a3),
clear: () => {
Module13252.clear();
}
};
export default r16;
export { r11 as TelemetryChannel };
@@ -0,0 +1,20 @@
// Metro module 13248 (f13249).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2025-12-zoomed-analytics",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export default apexExperiment;
export function isZoomedExperimentEnabled() {
return apexExperiment.getConfig({
location: "zoomed_in_telemetry_consumer"
}).enabled;
}
@@ -0,0 +1,23 @@
// Metro module 13250 (f13251).
class BaseTelemetryChannel {
constructor(a0, a1) {
this.native = a0;
this.channels = a1;
}
append(a0, a1, a2, a3) {
const r7 = a3 == null ? Date.now() : a3;
let r6 = a2;
const native = this.native;
if (a2 == null) {
r6 = null;
}
native.append(a0, r7, r6, a1 == null ? null : a1, this.channels);
}
snapshot(a0, a1, a2) {
return this.native.snapshot(this.channels, a0, a1, a2);
}
clearAll() {
this.native.clear();
}
}
export default BaseTelemetryChannel;
@@ -0,0 +1,220 @@
// Metro module 13249 (f13250).
import BaseTelemetryChannel from "./BaseTelemetryChannel";
import Logger from "../../../debug/Logger";
import { Storage } from "../../../../_bundle/Module595";
class BaseTelemetryExportChannel extends BaseTelemetryChannel {
_initialized = false;
_timer = null;
_inflight = null;
_resetting = false;
_logger = new Logger("TelemetryRing");
getIntervalMs() {
return 500;
}
getExportBatchSize() {
return null;
}
initialize() {
if (!this._initialized) {
this._initialized = true;
}
}
reset() {
this.stop();
if (!this._resetting) {
this._resetting = true;
this._clearAckedEndOffset();
const _inflight = this._inflight;
if (_inflight == null) {
this._resetting = false;
} else {
_inflight.finally(() => {
this._resetting = false;
});
}
}
}
start() {
if (this.shouldRun() && this._timer == null) {
this._kick({
mode: "backlog",
flush: false
});
this._timer = setInterval(() => this._kick({
mode: "stream",
flush: false
}), this.getIntervalMs());
}
}
stop() {
if (this._timer != null) {
clearInterval(this._timer);
this._timer = null;
}
}
async flushNow() {
const _this = this;
L11: {
if (_this.shouldRun()) {
await _this._kick({
mode: "stream",
flush: true
});
break L11;
}
return void 0;
}
}
_readAckedEndOffset() {
const r12 = Storage.get(this.getAckedEndOffsetStorageKey());
return typeof r12 === "number" ? Number.isFinite(r12) ? r12 : -1 : -1;
}
_writeAckedEndOffset(a0) {
Storage.set(this.getAckedEndOffsetStorageKey(), a0);
}
_clearAckedEndOffset() {
Storage.remove(this.getAckedEndOffsetStorageKey());
}
_kick(a0) {
let _inflight;
if (this.shouldRun()) {
if (this._inflight == null) {
this._inflight = this._drainOnce(a0).catch((error) => {
this._logger.warn("TelemetryRing export failed", error);
}).finally(() => {
this._inflight = null;
});
}
_inflight = this._inflight;
} else {
_inflight = Promise.resolve();
}
return _inflight;
}
async _drainOnce(c20433_0) {
const _this2 = this;
let c27437_1;
let c30616_1;
c27437_1 = void 0;
let r12 = void 0;
c30616_1 = void 0;
const budget = _this2.getBudget(c20433_0.mode);
const r32 = _this2._readAckedEndOffset();
if (r32 >= 0) {
r12 = r32;
}
let c30616_0 = await _this2._collectPages(budget, r12);
if (c30616_0.length !== 0) {
if (await _this2._exportPages(c30616_0, c20433_0.flush)) {
c30616_1 = c30616_0[0].maxReturnedEndOffset;
if (!_this2._resetting) {
const r83 = c30616_1;
if ((typeof r83 === "number" ? Number.isFinite(c30616_1) : typeof r83 === "number") && c30616_1 >= 0) {
_this2._writeAckedEndOffset(c30616_1);
}
}
}
}
}
async _collectPages(c20434_0, c20434_1) {
let r58, r91;
const _this3 = this;
let c27438_1;
let c30617_0, c30617_1, c30617_2;
L17: {
c27438_1 = void 0;
c30617_0 = void 0;
c30617_1 = [];
c30617_2 = -1;
let r42 = await _this3.snapshot(c30617_2, c20434_0, c20434_1);
while (true) {
c30617_0 = r42;
if (Array.isArray(c30617_0.entries) && c30617_0.entries.length !== 0) {
c30617_1.push({
entries: c30617_0.entries,
maxReturnedEndOffset: c30617_0.maxReturnedEndOffset,
nextBeforeOffset: c30617_0.nextBeforeOffset
});
c30617_2 = c30617_0.nextBeforeOffset;
if (c30617_0.hasMore) {
r42 = await _this3.snapshot(c30617_2, c20434_0, c20434_1);
continue;
}
r91 = c30617_1;
break;
}
r58 = c30617_1;
break L17;
}
return r91;
}
return r58;
}
async _exportPages(c20435_0, c20435_1) {
const _this4 = this;
let c27439_1;
let c30618_0, c30618_1, c30618_2, c30618_3, c30618_4, c30618_5, c30618_6, c30618_7;
L39: {
L29: {
L23: {
c27439_1 = void 0;
c30618_0 = void 0;
c30618_1 = void 0;
c30618_2 = void 0;
c30618_3 = void 0;
c30618_4 = void 0;
c30618_5 = void 0;
c30618_6 = void 0;
c30618_7 = void 0;
c30618_0 = _this4.getExportBatchSize();
c30618_1 = c20435_0.length - 1;
if (!(c30618_1 >= 0)) {
break L39;
}
while (true) {
c30618_2 = c20435_0[c30618_1];
c30618_3 = c30618_0 != null && c30618_0 > 0 ? c30618_0 : c30618_2.entries.length;
c30618_4 = 0;
if (c30618_4 < c30618_2.entries.length) {
c30618_5 = Math.min(c30618_4 + c30618_3, c30618_2.entries.length);
c30618_6 = c30618_2.entries.slice(c30618_4, c30618_5);
c30618_7 = c30618_1 === 0 && c30618_5 === c30618_2.entries.length;
let r94 = await _this4.exportEntries(c30618_6, c20435_1 && c30618_7);
while (true) {
if (!r94) {
break L23;
}
c30618_4 = c30618_4 + c30618_3;
if (!(c30618_4 < c30618_2.entries.length)) {
do {
c30618_1 = c30618_1 - 1;
if (!(c30618_1 >= 0)) {
break L29;
}
c30618_2 = c20435_0[c30618_1];
c30618_3 = c30618_0 != null && c30618_0 > 0 ? c30618_0 : c30618_2.entries.length;
c30618_4 = 0;
} while (!(c30618_4 < c30618_2.entries.length));
}
c30618_5 = Math.min(c30618_4 + c30618_3, c30618_2.entries.length);
c30618_6 = c30618_2.entries.slice(c30618_4, c30618_5);
c30618_7 = c30618_1 === 0 && c30618_5 === c30618_2.entries.length;
r94 = await _this4.exportEntries(c30618_6, c20435_1 && c30618_7);
}
} else {
c30618_1 = c30618_1 - 1;
if (!(c30618_1 >= 0)) {
break L39;
}
}
}
break L39;
}
return false;
}
return true;
}
return true;
}
}
export default BaseTelemetryExportChannel;
@@ -0,0 +1,18 @@
// Metro module 13255 (f13256).
import BaseTelemetryChannel from "./BaseTelemetryChannel";
import TelemetryRingNative_android, { TelemetryChannel } from "../TelemetryRingNative.android";
import { $callWithNewTarget } from "../../../../_hermes/prelude";
let NormalTelemetryImpl;
const NormalTelemetryImpl2 = class NormalTelemetryImpl extends BaseTelemetryChannel {
constructor() {
const r17 = [TelemetryChannel.NORMAL];
super(TelemetryRingNative_android, r17);
}
};
NormalTelemetryImpl2.prototype;
NormalTelemetryImpl = NormalTelemetryImpl2;
const prototypeOf = Object.getPrototypeOf(NormalTelemetryImpl);
const r27 = [TelemetryChannel.NORMAL];
const r28 = Object.create(NormalTelemetryImpl.prototype);
const r29 = $callWithNewTarget(prototypeOf, r28, NormalTelemetryImpl, TelemetryRingNative_android, r27);
export default r29 instanceof Object ? r29 : r28;
@@ -0,0 +1,22 @@
// Metro module 13254 (f13255).
import BaseTelemetryChannel from "./BaseTelemetryChannel";
import TelemetryRingNative_android, { TelemetryChannel } from "../TelemetryRingNative.android";
import { $callWithNewTarget } from "../../../../_hermes/prelude";
let c9196_3 = {
type: "BYTES",
limit: 1048576
};
class SentryTelemetryImpl extends BaseTelemetryChannel {
constructor() {
const r17 = [TelemetryChannel.SENTRY];
super(TelemetryRingNative_android, r17);
}
snapshotForBreadcrumbs() {
return this.snapshot(-1, c9196_3);
}
}
const prototypeOf = Object.getPrototypeOf(SentryTelemetryImpl);
const r31 = [TelemetryChannel.SENTRY];
const r32 = Object.create(SentryTelemetryImpl.prototype);
const r33 = $callWithNewTarget(prototypeOf, r32, SentryTelemetryImpl, TelemetryRingNative_android, r31);
export default r33 instanceof Object ? r33 : r32;
@@ -0,0 +1,527 @@
// Metro module 13253 (f13254).
import { AnalyticEvents } from "../../../../Constants";
import ProcessUtils_native from "../../../../utils/ProcessUtils.native";
import { Opcode } from "../../../gateway/GatewaySocketOpcode";
import { RTCSocketOpcode } from "../../../../lib/RTCControlSocket";
let c9195_4, c9195_5;
let c9195_3 = {
Gateway: "gateway",
RtcControl: "rtc_control",
RemoteAuth: "remote_auth",
Spotify: "spotify",
Rpc: "rpc",
GameServerPing: "game_server_ping"
};
const r22 = {};
r22[AnalyticEvents.DEVICE_EVENT] = (a0) => {
const data = a0.data;
const r1 = data == null;
let r2 = null;
if (!r1) {
const length = Object.keys(data).length;
r2 = null;
if (length !== 0) {
const action = data.action;
let action2 = typeof action === "string" ? action : null;
if (action2 == null) {
const message = a0.message;
action2 = typeof message === "string" ? message : null;
}
const message2 = a0.message;
let description2 = typeof message2 === "string" ? message2 : null;
if (description2 == null) {
const description = data.description;
description2 = typeof description === "string" ? description : null;
}
const r25 = Object.entries(data).filter((item) => {
const [, r2] = item;
return r2 != null;
});
r2 = {
action: action2,
description: description2,
metadata: r25.length !== 0 ? r25.map((item) => {
const [r7, r24] = item;
return `${r7}=${r24}`;
}).join(", ") : null
};
}
}
return r2;
};
r22[AnalyticEvents.REACT_SOFT_EXCEPTION] = ({ data }) => {
const r0 = data == null;
let r7 = null;
if (!r0) {
const error_message = data.error_message;
let error_message2 = typeof error_message === "string" ? error_message : null;
if (error_message2 == null) {
const message = data.message;
error_message2 = typeof message === "string" ? message : null;
}
if (error_message2 == null) {
error_message2 = void 0;
}
const component = data.component;
const component2 = typeof component === "string" ? component : null;
const stacktrace = data.stacktrace;
r7 = {
error_message: error_message2,
component: component2,
stacktrace: typeof stacktrace === "string" ? stacktrace : null
};
}
return r7;
};
r22[AnalyticEvents.NETWORK_CAPABILITIES_CHANGED] = ({ data }) => {
const r0 = data == null;
let r9 = null;
if (!r0) {
const action = data.action;
const action2 = typeof action === "string" ? action : null;
const network_type = data.network_type;
const network_type2 = typeof network_type === "string" ? network_type : null;
const upload_bandwidth = data.upload_bandwidth;
const upload_bandwidth2 = typeof upload_bandwidth === "number" ? Number.isFinite(upload_bandwidth) ? upload_bandwidth : null : null;
const download_bandwidth = data.download_bandwidth;
r9 = {
action: action2,
network_type: network_type2,
upload_bandwidth: upload_bandwidth2,
download_bandwidth: typeof download_bandwidth === "number" ? Number.isFinite(download_bandwidth) ? download_bandwidth : null : null,
vpn_active: typeof data.vpn_active === "boolean" ? data.vpn_active : null
};
}
return r9;
};
r22[AnalyticEvents.FOREGROUND_SERVICE] = (a0) => {
const data = a0.data;
const r0 = data == null;
let r1 = null;
if (!r0) {
const service_name = data.service_name;
const service_name2 = typeof service_name === "string" ? service_name : null;
const action = data.action;
const action2 = typeof action === "string" ? action : null;
const detail = data.detail;
let detail2 = typeof detail === "string" ? detail : null;
if (detail2 == null) {
const message = a0.message;
detail2 = typeof message === "string" ? message : null;
}
const fgs_operation = data.fgs_operation;
const fgs_operation2 = typeof fgs_operation === "string" ? fgs_operation : null;
const fgs_configuration_type = data.fgs_configuration_type;
const fgs_configuration_type2 = typeof fgs_configuration_type === "string" ? fgs_configuration_type : null;
const guard_allowed = typeof data.guard_allowed === "boolean" ? data.guard_allowed : null;
const fgs_guard_reason = data.fgs_guard_reason;
r1 = {
service_name: service_name2,
action: action2,
detail: detail2,
fgs_operation: fgs_operation2,
fgs_configuration_type: fgs_configuration_type2,
guard_allowed,
fgs_guard_reason: typeof fgs_guard_reason === "string" ? fgs_guard_reason : null
};
}
return r1;
};
r22[AnalyticEvents.APP_LIFECYCLE] = (a0) => {
const data = a0.data;
const r0 = data == null;
let r1 = null;
if (!r0) {
const state = data.state;
let state2 = typeof state === "string" ? state : null;
if (state2 == null) {
const message = a0.message;
state2 = typeof message === "string" ? message : null;
}
const previous_state = data.previous_state;
const previous_state2 = typeof previous_state === "string" ? previous_state : null;
const details = data.details;
r1 = {
state: state2,
previous_state: previous_state2,
details: typeof details === "string" ? details : null
};
}
return r1;
};
r22[AnalyticEvents.UI_LIFECYCLE] = ({ data }) => {
const r0 = data == null;
let r8 = null;
if (!r0) {
const activity_name = data.activity_name;
let activity_name2 = typeof activity_name === "string" ? activity_name : null;
if (activity_name2 == null) {
const screen = data.screen;
activity_name2 = typeof screen === "string" ? screen : null;
}
const stage = data.stage;
let stage2 = typeof stage === "string" ? stage : null;
if (stage2 == null) {
const state = data.state;
stage2 = typeof state === "string" ? state : null;
}
const extra = data.extra;
let extra2 = typeof extra === "string" ? extra : null;
if (extra2 == null) {
const details = data.details;
extra2 = typeof details === "string" ? details : null;
}
if (extra2 == null) {
const detail = data.detail;
extra2 = typeof detail === "string" ? detail : null;
}
r8 = {
activity_name: activity_name2,
stage: stage2,
extra: extra2
};
}
return r8;
};
c9195_4 = r22;
const r35 = {};
r35[AnalyticEvents.TOUCH_EVENT] = ({ data }) => {
const r1 = data == null;
let r10 = null;
if (!r1) {
const touch_action_type = data.touch_action_type;
const touch_action_type2 = typeof touch_action_type === "string" ? touch_action_type : null;
let hermes_instrumented_stats_summary = ProcessUtils_native.getCurrentHermesInstrumentedStatsSummary();
if (hermes_instrumented_stats_summary == null) {
hermes_instrumented_stats_summary = null;
}
const client_timestamp_ms = data.client_timestamp_ms;
const client_timestamp_ms2 = typeof client_timestamp_ms === "number" ? Number.isFinite(client_timestamp_ms) ? client_timestamp_ms : null : null;
const screen_x = data.screen_x;
const screen_x2 = typeof screen_x === "number" ? Number.isFinite(screen_x) ? screen_x : null : null;
const screen_y = data.screen_y;
const screen_y2 = typeof screen_y === "number" ? Number.isFinite(screen_y) ? screen_y : null : null;
const view_x = data.view_x;
const view_x2 = typeof view_x === "number" ? Number.isFinite(view_x) ? view_x : null : null;
const view_y = data.view_y;
const view_y2 = typeof view_y === "number" ? Number.isFinite(view_y) ? view_y : null : null;
const total_memory_mb = data.total_memory_mb;
const total_memory_mb2 = typeof total_memory_mb === "number" ? Number.isFinite(total_memory_mb) ? total_memory_mb : null : null;
const memory_breakdown = data.memory_breakdown;
const memory_breakdown2 = typeof memory_breakdown === "string" ? memory_breakdown : null;
const view_hierarchy = data.view_hierarchy;
const view_hierarchy2 = typeof view_hierarchy === "string" ? view_hierarchy : null;
const gesture = data.gesture;
const gesture2 = typeof gesture === "string" ? gesture : null;
const window_name = data.window_name;
const window_name2 = typeof window_name === "string" ? window_name : null;
const hit_test_duration_us = data.hit_test_duration_us;
const hit_test_duration_us2 = typeof hit_test_duration_us === "number" ? Number.isFinite(hit_test_duration_us) ? hit_test_duration_us : null : null;
const distance = data.distance;
const distance2 = typeof distance === "number" ? Number.isFinite(distance) ? distance : null : null;
const duration_ms = data.duration_ms;
const duration_ms2 = typeof duration_ms === "number" ? Number.isFinite(duration_ms) ? duration_ms : null : null;
const velocity = data.velocity;
const velocity2 = typeof velocity === "number" ? Number.isFinite(velocity) ? velocity : null : null;
const scale_factor = data.scale_factor;
r10 = {
touch_action_type: touch_action_type2,
client_timestamp_ms: client_timestamp_ms2,
screen_x: screen_x2,
screen_y: screen_y2,
view_x: view_x2,
view_y: view_y2,
total_memory_mb: total_memory_mb2,
memory_breakdown: memory_breakdown2,
hermes_instrumented_stats_summary,
view_hierarchy: view_hierarchy2,
gesture: gesture2,
window_name: window_name2,
hit_test_duration_us: hit_test_duration_us2,
distance: distance2,
duration_ms: duration_ms2,
velocity: velocity2,
scale_factor: typeof scale_factor === "number" ? Number.isFinite(scale_factor) ? scale_factor : null : null
};
}
return r10;
};
r35[AnalyticEvents.HTTP_REQUEST] = ({ data }) => {
const r0 = data == null;
let r10 = null;
if (!r0) {
const url = data.url;
let url2 = typeof url === "string" ? url : null;
if (url2 == null) {
const uri = data.uri;
url2 = typeof uri === "string" ? uri : null;
}
if (url2 == null) {
const request_url = data.request_url;
url2 = typeof request_url === "string" ? request_url : null;
}
const method = data.method;
let method2 = typeof method === "string" ? method : null;
if (method2 == null) {
const http_method = data.http_method;
method2 = typeof http_method === "string" ? http_method : null;
}
const r17 = url2 == null;
let r18 = null;
if (!r17) {
const status_code = data.status_code;
const status_code2 = typeof status_code === "number" ? Number.isFinite(status_code) ? status_code : null : null;
const duration_ms = data.duration_ms;
const duration_ms2 = typeof duration_ms === "number" ? Number.isFinite(duration_ms) ? duration_ms : null : null;
const source = data.source;
r18 = {
url: url2,
method: method2,
status_code: status_code2,
duration_ms: duration_ms2,
source: typeof source === "string" ? source : null
};
}
r10 = r18;
}
return r10;
};
r35[AnalyticEvents.WEBSOCKET_MESSAGE_RECEIVED] = ({ data }) => {
let r56, r67, r78, r105, r127, r154, r190, r198, Gateway;
if (data == null) {
r198 = {
message_identity: "unknown",
socket_kind: void 0
};
} else {
const url = data.url;
const r15 = typeof url === "string" ? url : null;
const socket_kind = data.socket_kind;
let socket_kind2 = typeof socket_kind === "string" ? socket_kind : null;
if (socket_kind2 == null) {
const r1 = r15 == null;
let r17 = null;
if (!r1) {
L29: {
const r10 = r15.toLowerCase();
if (r10.includes("gateway")) {
Gateway = c9195_3.Gateway;
} else if (r10.includes("discord.media")) {
Gateway = c9195_3.RtcControl;
} else if (r10.includes("remote-auth")) {
Gateway = c9195_3.RemoteAuth;
} else if (r10.includes("spotify")) {
Gateway = c9195_3.Spotify;
} else if (r10.includes("rtc")) {
Gateway = c9195_3.RtcControl;
} else {
if (!r10.includes("127.0.0.1") && !r10.includes("localhost")) {
const r40 = r10.includes("game");
Gateway = null;
if (!r40) {
break L29;
}
const r43 = r10.includes("ping");
Gateway = null;
if (!r43) {
break L29;
}
Gateway = c9195_3.GameServerPing;
break L29;
}
Gateway = c9195_3.Rpc;
}
}
r17 = Gateway;
}
socket_kind2 = r17;
}
if (socket_kind2 == null) {
L39: {
if (data.cmd == null && data.evt == null) {
if (data.t == null) {
const r55 = data.s != null;
r56 = null;
if (!r55) {
break L39;
}
}
r56 = c9195_3.Gateway;
} else {
r56 = c9195_3.Rpc;
}
}
socket_kind2 = r56;
}
const message_identity = data.message_identity;
let message_identity2 = typeof message_identity === "string" ? message_identity : null;
if (message_identity2 == null) {
let r61 = data.t;
if (r61 == null) {
r61 = data.type;
}
if (r61 == null) {
r61 = data.evt;
}
const r12 = typeof r61 === "string" ? r61 : null;
if (socket_kind2 === c9195_3.Gateway) {
L89: {
const op3 = data.op;
if (typeof op3 === "number") {
const isFinite4 = Number.isFinite(op3);
r127 = op3;
if (isFinite4) {
break L89;
}
}
r127 = null;
if (typeof op3 === "string") {
const r129 = op3.trim();
r127 = null;
if (r129 !== "") {
const r134 = Number(op3);
r127 = Number.isFinite(r134) ? r134 : null;
}
}
}
const r139 = r127 == null;
let r140 = null;
if (!r139) {
const r147 = Opcode[r127];
r140 = typeof r147 === "string" ? r147 : null;
}
if (r140 != null) {
r67 = r140 === "DISPATCH" ? r12 != null ? `${r140}/${r12}` : r140 : r140;
} else {
L101: {
const op4 = data.op;
if (typeof op4 === "number") {
const isFinite5 = Number.isFinite(op4);
r154 = op4;
if (isFinite5) {
break L101;
}
}
r154 = null;
if (typeof op4 === "string") {
const r156 = op4.trim();
r154 = null;
if (r156 !== "") {
const r161 = Number(op4);
r154 = Number.isFinite(r161) ? r161 : null;
}
}
}
r67 = r154 != null ? r12 != null ? `${r154}/${r12}` : String(r154) : r12;
}
} else if (socket_kind2 === c9195_3.RtcControl) {
L67: {
const op = data.op;
if (typeof op === "number") {
const isFinite2 = Number.isFinite(op);
r78 = op;
if (isFinite2) {
break L67;
}
}
r78 = null;
if (typeof op === "string") {
const r80 = op.trim();
r78 = null;
if (r80 !== "") {
const r85 = Number(op);
r78 = Number.isFinite(r85) ? r85 : null;
}
}
}
const r90 = r78 == null;
let r91 = null;
if (!r90) {
const r98 = RTCSocketOpcode[r78];
r91 = typeof r98 === "string" ? r98 : null;
}
r67 = r91;
if (r67 == null) {
L79: {
const op2 = data.op;
if (typeof op2 === "number") {
const isFinite3 = Number.isFinite(op2);
r105 = op2;
if (isFinite3) {
break L79;
}
}
r105 = null;
if (typeof op2 === "string") {
const r107 = op2.trim();
r105 = null;
if (r107 !== "") {
const r112 = Number(op2);
r105 = Number.isFinite(r112) ? r112 : null;
}
}
}
r67 = r105 != null ? String(r105) : null;
}
} else {
const cmd = data.cmd;
const r14 = typeof cmd === "string" ? cmd : null;
const evt = data.evt;
const r13 = typeof evt === "string" ? evt : null;
r67 = r14 != null ? r13 != null ? `${r14}/${r13}` : r14 : r12;
}
message_identity2 = r67;
}
if (message_identity2 == null) {
const category = data.category;
const r184 = typeof category === "string" ? category : null;
const type = data.type;
const r186 = typeof type === "string" ? type : null;
const name = data.name;
const r188 = typeof name === "string" ? name : null;
L123: {
if (r184 == null && r186 == null) {
const r189 = r188 == null;
r190 = null;
if (r189) {
break L123;
}
}
r190 = [r184, r186, r188].filter((item) => item != null).join("/");
}
message_identity2 = r190;
}
if (message_identity2 == null) {
message_identity2 = r15;
}
if (message_identity2 == null) {
message_identity2 = "unknown";
}
r198 = {
message_identity: message_identity2,
socket_kind: socket_kind2
};
}
return r198;
};
c9195_5 = r35;
export function buildZoomedInAnalyticsEvent(a0) {
const r0 = a0.key in c9195_4;
const key2 = a0.key;
if (r0) {
const props2 = c9195_4[key2](a0);
return props2 != null ? {
key: key2,
props: props2
} : null;
}
if (key2 in c9195_5) {
const key = a0.key;
const props = c9195_5[key](a0);
return props == null ? null : {
key,
props
};
}
return null;
}
@@ -0,0 +1,124 @@
// Metro module 13247 (f13248).
import { isZoomedExperimentEnabled } from "../ZoomedInAnalyticsExperiment";
import BaseTelemetryExportChannel from "./BaseTelemetryExportChannel";
import TelemetryRingNative_android, { TelemetryChannel } from "../TelemetryRingNative.android";
import { buildZoomedInAnalyticsEvent } from "./ZoomedInAnalyticBuilder";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
import { $callWithNewTarget } from "../../../../_hermes/prelude";
let c9191_4 = {
type: "ROWS",
limit: 250
};
let c9191_5 = {
type: "ROWS",
limit: 10000
};
class ZoomedInTelemetryImpl extends BaseTelemetryExportChannel {
constructor() {
const r17 = [TelemetryChannel.ZOOMED];
super(TelemetryRingNative_android, r17);
}
shouldRun() {
return isZoomedExperimentEnabled();
}
getBudget(a0) {
return a0 === "backlog" ? c9191_5 : c9191_4;
}
getAckedEndOffsetStorageKey() {
return "telemetry_ring_zoomed_acked_end_offset_v1";
}
getExportBatchSize() {
return 250;
}
async exportEntries(c20428_0, c20428_1) {
let r32;
let c27435_0, c27435_1, c27435_4;
let c27435_5 = 0;
L17: {
try {
c27435_5 = 1;
const r18 = [];
let c30615_0 = r18;
c27435_1 = c20428_0;
const r41 = c20428_0[Symbol.iterator]();
c27435_1 = r41.next;
c27435_0 = r41;
while (true) {
const r43 = c27435_1;
let r44 = c27435_0;
const r20 = r44 === void 0 ? void 0 : (r32 = r43.call(r44)).done ? r44 = void 0 : r32.value;
c27435_0 = r44;
if (r44 === void 0) {
if (r18.length === 0) {
c27435_5 = 0;
break L17;
}
await Promise.all(r18.map((item, index) => AnalyticsUtils.track(item.key, item.props, {
flush: c20428_1 && index === c30615_0.length - 1
})));
c27435_5 = 0;
break;
}
c27435_5 = 2;
const r51 = buildZoomedInAnalyticsEvent(r20);
if (r51 != null) {
r18.push({
key: r51.key,
props: r51.props
});
}
c27435_5 = 1;
}
} catch ($e) {
const r38 = $e;
let r8 = r38;
c27435_4 = r38;
let r39 = c27435_5;
if (r39 !== 0) {
while (true) {
if (r39 === 1) {
try {
c27435_5 = 0;
} catch (r91) {
r8 = r91;
c27435_4 = r91;
r39 = c27435_5;
if (r39 === 0) {
break;
}
continue;
}
return false;
}
try {
const r86 = c27435_4;
c27435_5 = 1;
const r88 = c27435_0;
if (r88 !== void 0 && typeof r88.return === "function") {
try {
r88.return();
} catch {}
}
throw r86;
} catch (r85) {
r8 = r85;
c27435_4 = r85;
r39 = c27435_5;
if (r39 === 0) {
break;
}
}
}
}
throw r8;
}
return true;
}
return true;
}
}
const prototypeOf = Object.getPrototypeOf(ZoomedInTelemetryImpl);
const r42 = [TelemetryChannel.ZOOMED];
const r43 = Object.create(ZoomedInTelemetryImpl.prototype);
const r44 = $callWithNewTarget(prototypeOf, r43, ZoomedInTelemetryImpl, TelemetryRingNative_android, r42);
export default r44 instanceof Object ? r44 : r43;
+13
View File
@@ -0,0 +1,13 @@
// Metro module 1210 (f1211).
import TelemetryRingLifecycle from "./TelemetryRingLifecycle";
import ZoomedInTelemetry from "./channels/ZoomedInTelemetry";
import SentryTelemetry from "./channels/SentryTelemetry";
import NormalTelemetry from "./channels/NormalTelemetry";
import * as _ZoomedInAnalyticsExperiment from "./ZoomedInAnalyticsExperiment";
import * as _TelemetryRingNative_android from "./TelemetryRingNative.android";
exports.TelemetryRingLifecycle = TelemetryRingLifecycle;
exports.ZoomedInTelemetry = ZoomedInTelemetry;
exports.SentryTelemetry = SentryTelemetry;
exports.NormalTelemetry = NormalTelemetry;
export const isZoomedExperimentEnabled = _ZoomedInAnalyticsExperiment.isZoomedExperimentEnabled;
export const TelemetryChannel = _TelemetryRingNative_android.TelemetryChannel;
@@ -0,0 +1,23 @@
// Metro module 16102 (f16103).
import { AnalyticEvents } from "../../Constants";
import { getHttpRequestSampleRate } from "./HttpRequestSampleExperiment";
import trackZoomedInHttpRequest_android from "./trackZoomedInHttpRequest.android";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
export default function trackHttpRequest(a0) {
const url = a0.url;
let url2 = url;
if (url2 != null) {
url2 = url.split(/[?#]/)[0].replace(/\d+/g, "#");
}
const r5 = {
...a0,
url: url2
};
trackZoomedInHttpRequest_android(r5);
if (Math.random() < getHttpRequestSampleRate()) {
AnalyticsUtils.track(AnalyticEvents.HTTP_REQUEST, {
...r5,
source: "sample"
});
}
};
@@ -0,0 +1,11 @@
// Metro module 16104 (f16105).
import { AnalyticEvents } from "../../Constants";
import ZoomedInTelemetry from "./native/channels/ZoomedInTelemetry";
export default function trackZoomedInHttpRequest(a0) {
try {
ZoomedInTelemetry.append(AnalyticEvents.HTTP_REQUEST, {
...a0,
source: "zoomed_in"
});
} catch ($e) {}
};