Fix "skipFeedbackDialog" patch

This commit is contained in:
redphx 2025-05-29 08:21:36 +07:00
parent c829f74dcc
commit 9e851fbd15
3 changed files with 10 additions and 11 deletions

View File

@ -5343,9 +5343,7 @@ if (titleInfo && !titleInfo.details.hasTouchSupport && !titleInfo.details.hasFak
let index = str.indexOf("({onCollapse:");
if (index < 0) return !1;
try {
let canShowTakHUDVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "canShowTakHUD", index, 500, !0) + 1), guideUIVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "guideUI", index, 500, !0) + 1), onShowStreamMenuVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "onShowStreamMenu", index, 500, !0) + 1), offsetVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "offset", index, 500, !0) + 1);
debugger;
let newCode = renderString(stream_hud_default, {
let canShowTakHUDVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "canShowTakHUD", index, 500, !0) + 1), guideUIVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "guideUI", index, 500, !0) + 1), onShowStreamMenuVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "onShowStreamMenu", index, 500, !0) + 1), offsetVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "offset", index, 500, !0) + 1), newCode = renderString(stream_hud_default, {
guideUI: guideUIVar,
onShowStreamMenu: onShowStreamMenuVar,
offset: offsetVar
@ -5430,9 +5428,9 @@ true` + text;
return str = str.replace(text, newCode), str;
},
skipFeedbackDialog(str) {
let text = "shouldTransitionToFeedback(e){";
if (!str.includes(text)) return !1;
return str = str.replace(text, text + "return !1;"), str;
let index = str.indexOf("}shouldTransitionToFeedback(");
if (index > 0 && (index = PatcherUtils.indexOf(str, "}){", index, 200, !0)), index < 0) return !1;
return str = PatcherUtils.insertAt(str, index, "return !1;"), str;
},
enableNativeMkb(str) {
let index = str.indexOf(".mouseSupported&&");

View File

@ -176,7 +176,7 @@ if (gamepadFound) {return;}
${autoOffCode}
const titleInfo = window.BX_EXPOSED.getTitleInfo();
if (titleInfo && !titleInfo.details.hasTouchSupport && !titleInfo.details.hasFakeTouchSupport) {return;}
`;return str = str.replace(text, newCode + text), str;},streamCombineSources(str) {let text = "this.useCombinedAudioVideoStream=!!this.deviceInformation.isTizen";if (!str.includes(text)) return !1;return str = str.replace(text, "this.useCombinedAudioVideoStream=true"), str;},patchStreamHud(str) {let index = str.indexOf("({onCollapse:");if (index < 0) return !1;try {let canShowTakHUDVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "canShowTakHUD", index, 500, !0) + 1), guideUIVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "guideUI", index, 500, !0) + 1), onShowStreamMenuVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "onShowStreamMenu", index, 500, !0) + 1), offsetVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "offset", index, 500, !0) + 1);debugger;let newCode = renderString(stream_hud_default, {guideUI: guideUIVar,onShowStreamMenu: onShowStreamMenuVar,offset: offsetVar});if (getGlobalPref("touchController.mode") === "off") newCode += `${canShowTakHUDVar} = false;`;let bracketIndex = PatcherUtils.indexOf(str, "}){", index, 500, !0);return str = PatcherUtils.insertAt(str, bracketIndex, newCode), str;} catch (e) {return !1;}},broadcastPollingMode(str) {let text = ".setPollingMode=e=>{";if (!str.includes(text)) return !1;let newCode = `
`;return str = str.replace(text, newCode + text), str;},streamCombineSources(str) {let text = "this.useCombinedAudioVideoStream=!!this.deviceInformation.isTizen";if (!str.includes(text)) return !1;return str = str.replace(text, "this.useCombinedAudioVideoStream=true"), str;},patchStreamHud(str) {let index = str.indexOf("({onCollapse:");if (index < 0) return !1;try {let canShowTakHUDVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "canShowTakHUD", index, 500, !0) + 1), guideUIVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "guideUI", index, 500, !0) + 1), onShowStreamMenuVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "onShowStreamMenu", index, 500, !0) + 1), offsetVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "offset", index, 500, !0) + 1), newCode = renderString(stream_hud_default, {guideUI: guideUIVar,onShowStreamMenu: onShowStreamMenuVar,offset: offsetVar});if (getGlobalPref("touchController.mode") === "off") newCode += `${canShowTakHUDVar} = false;`;let bracketIndex = PatcherUtils.indexOf(str, "}){", index, 500, !0);return str = PatcherUtils.insertAt(str, bracketIndex, newCode), str;} catch (e) {return !1;}},broadcastPollingMode(str) {let text = ".setPollingMode=e=>{";if (!str.includes(text)) return !1;let newCode = `
window.BX_STREAM_SETTINGS.xCloudPollingMode = e.toLowerCase();
BxEvent.dispatch(window, BxEvent.XCLOUD_POLLING_MODE_CHANGED);
`;return str = str.replace(text, text + newCode), str;},patchGamepadPolling(str) {let index = str.indexOf(".shouldHandleGamepadInput)())return void");if (index < 0) return !1;return index = str.indexOf("{", index - 20) + 1, str = str.substring(0, index) + "if (window.BX_EXPOSED.disableGamepadPolling) return;" + str.substring(index), str;},patchXcloudTitleInfo(str) {let text = "async cloudConnect", index = str.indexOf(text);if (index < 0) return !1;let backetIndex = str.indexOf("{", index), params = str.substring(index, backetIndex).match(/\(([^)]+)\)/)[1];if (!params) return !1;let titleInfoVar = params.split(",")[0], newCode = `
@ -187,7 +187,7 @@ Object.assign(${configsVar}.inputConfiguration, {enableMouseInput: false,enableK
BxLogger.info('patchRemotePlayMkb', ${configsVar});
`;return str = str.substring(0, backetIndex + 1) + newCode + str.substring(backetIndex + 1), str;},patchAudioMediaStream(str) {let text = ".srcObject=this.audioMediaStream,";if (!str.includes(text)) return !1;let newCode = "window.BX_EXPOSED.setupGainNode(arguments[1], this.audioMediaStream),";return str = str.replace(text, text + newCode), str;},patchCombinedAudioVideoMediaStream(str) {let text = ".srcObject=this.combinedAudioVideoStream";if (!str.includes(text)) return !1;let newCode = ",window.BX_EXPOSED.setupGainNode(arguments[0], this.combinedAudioVideoStream)";return str = str.replace(text, text + newCode), str;},patchTouchControlDefaultOpacity(str) {let text = "opacityMultiplier:1";if (!str.includes(text)) return !1;let newCode = `opacityMultiplier: ${(getGlobalPref("touchController.opacity.default") / 100).toFixed(1)}`;return str = str.replace(text, newCode), str;},patchShowSensorControls(str) {let text = ",{shouldShowSensorControls:";if (!str.includes(text)) return !1;let newCode = ",{shouldShowSensorControls: (window.BX_EXPOSED && window.BX_EXPOSED.shouldShowSensorControls) ||";return str = str.replace(text, newCode), str;},exposeStreamSession(str) {let text = ",this._connectionType=";if (!str.includes(text)) return !1;let newCode = `;
${expose_stream_session_default}
true` + text;return str = str.replace(text, newCode), str;},skipFeedbackDialog(str) {let text = "shouldTransitionToFeedback(e){";if (!str.includes(text)) return !1;return str = str.replace(text, text + "return !1;"), str;},enableNativeMkb(str) {let index = str.indexOf(".mouseSupported&&");if (index < 0) return !1;let varName = str.charAt(index - 1), text = `${varName}.mouseSupported&&${varName}.keyboardSupported&&${varName}.fullscreenSupported;`;if (!str.includes(text)) return !1;return str = str.replace(text, text + "return true;"), str;},patchMouseAndKeyboardEnabled(str) {let text = "get mouseAndKeyboardEnabled(){";if (!str.includes(text)) return !1;return str = str.replace(text, text + "return true;"), str;},exposeInputChannel(str) {let index = str.indexOf("this.flushData=");if (index < 0) return !1;let newCode = "window.BX_EXPOSED.inputChannel = this,";return str = PatcherUtils.insertAt(str, index, newCode), str;},disableNativeRequestPointerLock(str) {let text = "async requestPointerLock(){";if (!str.includes(text)) return !1;return str = str.replace(text, text + "return;"), str;},patchRequestInfoCrash(str) {let text = 'if(!e)throw new Error("RequestInfo.origin is falsy");';if (!str.includes(text)) return !1;return str = str.replace(text, 'if (!e) e = "https://www.xbox.com";'), str;},exposeDialogRoutes(str) {let text = "return{goBack:function(){";if (!str.includes(text)) return !1;return str = str.replace(text, "return window.BX_EXPOSED.dialogRoutes = {goBack:function(){"), str;},enableTvRoutes(str) {let index = str.indexOf(".LoginDeviceCode.path,");if (index < 0) return !1;let match = /render:.*?jsx\)\(([^,]+),/.exec(str.substring(index, index + 100));if (!match) return !1;let funcName = match[1];if (index = str.indexOf(`const ${funcName}=e=>{`), index > -1 && (index = str.indexOf("return ", index)), index > -1 && (index = str.indexOf("?", index)), index < 0) return !1;return str = str.substring(0, index) + "|| true" + str.substring(index), str;},ignoreNewsSection(str) {let index = str.indexOf('Logger("CarouselRow")');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "const ", index, 200)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "return null;"), str;},ignorePlayWithFriendsSection(str) {let index = str.indexOf('location:"PlayWithFriendsRow",');if (index < 0) return !1;if (index = PatcherUtils.lastIndexOf(str, "=>", index, 50), index < 0) return !1;return str = PatcherUtils.replaceWith(str, index, "=>", "=> true ? null :"), str;},ignoreAllGamesSection(str) {let index = str.indexOf('className:"AllGamesRow-module__allGamesRowContainer');if (index > -1 && (index = PatcherUtils.indexOf(str, "grid:!0,", index, 1500)), index > -1 && (index = PatcherUtils.lastIndexOf(str, "(0,", index, 70)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "true ? null :"), str;},ignoreByogSection(str) {let index = str.indexOf('"ByogRow-module__container');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "return", index, 100)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "return null;"), str;},ignorePlayWithTouchSection(str) {let index = str.indexOf('("Play_With_Touch"),');if (index < 0) return !1;if (index = PatcherUtils.lastIndexOf(str, "const ", index, 30), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "return null;"), str;},ignoreSiglSections(str) {let index = str.indexOf("SiglRow-module__heroCard___");if (index < 0) return !1;if (index = PatcherUtils.lastIndexOf(str, "const[", index, 300), index < 0) return !1;let PREF_HIDE_SECTIONS = getGlobalPref("ui.hideSections"), siglIds = [], sections = {"native-mkb": "8fa264dd-124f-4af3-97e8-596fcdf4b486","most-popular": "e7590b22-e299-44db-ae22-25c61405454c","leaving-soon": "393f05bf-e596-4ef6-9487-6d4fa0eab987","recently-added": "44a55037-770f-4bbf-bde5-a9fa27dba1da"};for (let section of PREF_HIDE_SECTIONS) {let galleryId = sections[section];galleryId && siglIds.push(galleryId);}let newCode = `
true` + text;return str = str.replace(text, newCode), str;},skipFeedbackDialog(str) {let index = str.indexOf("}shouldTransitionToFeedback(");if (index > 0 && (index = PatcherUtils.indexOf(str, "}){", index, 200, !0)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "return !1;"), str;},enableNativeMkb(str) {let index = str.indexOf(".mouseSupported&&");if (index < 0) return !1;let varName = str.charAt(index - 1), text = `${varName}.mouseSupported&&${varName}.keyboardSupported&&${varName}.fullscreenSupported;`;if (!str.includes(text)) return !1;return str = str.replace(text, text + "return true;"), str;},patchMouseAndKeyboardEnabled(str) {let text = "get mouseAndKeyboardEnabled(){";if (!str.includes(text)) return !1;return str = str.replace(text, text + "return true;"), str;},exposeInputChannel(str) {let index = str.indexOf("this.flushData=");if (index < 0) return !1;let newCode = "window.BX_EXPOSED.inputChannel = this,";return str = PatcherUtils.insertAt(str, index, newCode), str;},disableNativeRequestPointerLock(str) {let text = "async requestPointerLock(){";if (!str.includes(text)) return !1;return str = str.replace(text, text + "return;"), str;},patchRequestInfoCrash(str) {let text = 'if(!e)throw new Error("RequestInfo.origin is falsy");';if (!str.includes(text)) return !1;return str = str.replace(text, 'if (!e) e = "https://www.xbox.com";'), str;},exposeDialogRoutes(str) {let text = "return{goBack:function(){";if (!str.includes(text)) return !1;return str = str.replace(text, "return window.BX_EXPOSED.dialogRoutes = {goBack:function(){"), str;},enableTvRoutes(str) {let index = str.indexOf(".LoginDeviceCode.path,");if (index < 0) return !1;let match = /render:.*?jsx\)\(([^,]+),/.exec(str.substring(index, index + 100));if (!match) return !1;let funcName = match[1];if (index = str.indexOf(`const ${funcName}=e=>{`), index > -1 && (index = str.indexOf("return ", index)), index > -1 && (index = str.indexOf("?", index)), index < 0) return !1;return str = str.substring(0, index) + "|| true" + str.substring(index), str;},ignoreNewsSection(str) {let index = str.indexOf('Logger("CarouselRow")');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "const ", index, 200)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "return null;"), str;},ignorePlayWithFriendsSection(str) {let index = str.indexOf('location:"PlayWithFriendsRow",');if (index < 0) return !1;if (index = PatcherUtils.lastIndexOf(str, "=>", index, 50), index < 0) return !1;return str = PatcherUtils.replaceWith(str, index, "=>", "=> true ? null :"), str;},ignoreAllGamesSection(str) {let index = str.indexOf('className:"AllGamesRow-module__allGamesRowContainer');if (index > -1 && (index = PatcherUtils.indexOf(str, "grid:!0,", index, 1500)), index > -1 && (index = PatcherUtils.lastIndexOf(str, "(0,", index, 70)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "true ? null :"), str;},ignoreByogSection(str) {let index = str.indexOf('"ByogRow-module__container');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "return", index, 100)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "return null;"), str;},ignorePlayWithTouchSection(str) {let index = str.indexOf('("Play_With_Touch"),');if (index < 0) return !1;if (index = PatcherUtils.lastIndexOf(str, "const ", index, 30), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "return null;"), str;},ignoreSiglSections(str) {let index = str.indexOf("SiglRow-module__heroCard___");if (index < 0) return !1;if (index = PatcherUtils.lastIndexOf(str, "const[", index, 300), index < 0) return !1;let PREF_HIDE_SECTIONS = getGlobalPref("ui.hideSections"), siglIds = [], sections = {"native-mkb": "8fa264dd-124f-4af3-97e8-596fcdf4b486","most-popular": "e7590b22-e299-44db-ae22-25c61405454c","leaving-soon": "393f05bf-e596-4ef6-9487-6d4fa0eab987","recently-added": "44a55037-770f-4bbf-bde5-a9fa27dba1da"};for (let section of PREF_HIDE_SECTIONS) {let galleryId = sections[section];galleryId && siglIds.push(galleryId);}let newCode = `
if (e && e.id) {const siglId = e.id;if (${siglIds.map((item2) => `siglId === "${item2}"`).join(" || ")}) {return null;}}
`;return str = PatcherUtils.insertAt(str, index, newCode), str;},ignoreGenresSection(str) {let index = str.indexOf('="GenresRow"');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "{", index)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index + 1, "return null;"), str;},overrideStorageGetSettings(str) {let text = "}getSetting(e){";if (!str.includes(text)) return !1;let newCode = `
// console.log('setting', this.baseStorageKey, e);

View File

@ -583,12 +583,13 @@ true` + text;
},
skipFeedbackDialog(str: string) {
let text = 'shouldTransitionToFeedback(e){';
if (!str.includes(text)) {
let index = str.indexOf('}shouldTransitionToFeedback(');
index > 0 && (index = PatcherUtils.indexOf(str, '}){', index, 200, true));
if (index < 0) {
return false;
}
str = str.replace(text, text + 'return !1;');
str = PatcherUtils.insertAt(str, index, 'return !1;');
return str;
},