feat: bump version to 1.0.8.4 - fix QR code pairing and post-update hang

This commit is contained in:
kitbyte
2026-06-10 16:59:08 +03:00
parent 544b9f0fb0
commit 8756e41fb9
4 changed files with 91 additions and 41 deletions
+7
View File
@@ -3,6 +3,13 @@
This file is the source of truth for release notes. This file is the source of truth for release notes.
The newest entry must match the version in `WandEnhancer/Properties/AssemblyInfo.cs`. The newest entry must match the version in `WandEnhancer/Properties/AssemblyInfo.cs`.
## [1.0.8.4] - 2026-06-10
### Fixes
- Fixed QR code issues on the latest Wand version.
- Fixed application hang that occurred after Wand updates with pending patches.
## [1.0.8.3] - 2026-06-06 ## [1.0.8.3] - 2026-06-06
### Fixes ### Fixes
-26
View File
@@ -7,9 +7,6 @@ namespace WandEnhancer.Core
{ {
public static class EnhancerConfig public static class EnhancerConfig
{ {
private const int RemoteWebPanelDefaultPort = 3223;
private static readonly string RemoteWebPanelFallbackUrl = $"http://localhost:{RemoteWebPanelDefaultPort}/remote/";
public class ResolveContext public class ResolveContext
{ {
public string Placeholder { get; set; } public string Placeholder { get; set; }
@@ -227,29 +224,6 @@ namespace WandEnhancer.Core
SearchHints = new[] { "client-value-changed" }, SearchHints = new[] { "client-value-changed" },
Target = new Regex(@"#ct\(e,t\)\{t\.push\(e\.onValueSet\(e=>\{this\.status===i\.Connected&&e\.source!==g\.kL\.Remote&&this\.#Me\?\.send\(""client-value-changed"",\{instanceId:this\.#Pe,name:e\.name,value:e\.value,cheatId:e\.cheatId\}\)\}\)\),this\.#Be\(\)\}"), Target = new Regex(@"#ct\(e,t\)\{t\.push\(e\.onValueSet\(e=>\{this\.status===i\.Connected&&e\.source!==g\.kL\.Remote&&this\.#Me\?\.send\(""client-value-changed"",\{instanceId:this\.#Pe,name:e\.name,value:e\.value,cheatId:e\.cheatId\}\)\}\)\),this\.#Be\(\)\}"),
Patch = "#ct(e,t){t.push(e.onValueSet(e=>{this.status===i.Connected&&e.source!==g.kL.Remote&&this.#Me?.send(\"client-value-changed\",{instanceId:this.#Pe,name:e.name,value:e.value,cheatId:e.cheatId}),this.__wandRemoteBridge?.valueChanged({trainerId:this.#ke,target:e.name,value:e.value,oldValue:e.oldValue,source:String(e.source??\"desktop\"),cheatId:e.cheatId})})),this.#Be()}" Patch = "#ct(e,t){t.push(e.onValueSet(e=>{this.status===i.Connected&&e.source!==g.kL.Remote&&this.#Me?.send(\"client-value-changed\",{instanceId:this.#Pe,name:e.name,value:e.value,cheatId:e.cheatId}),this.__wandRemoteBridge?.valueChanged({trainerId:this.#ke,target:e.name,value:e.value,oldValue:e.oldValue,source:String(e.source??\"desktop\"),cheatId:e.cheatId})})),this.#Be()}"
},
new PatchEntry
{
Name = "remoteTooltipPreviewUrl",
SearchHints = new[] { "remote_tooltip.scan_the_qr_code_or_visit_the_site", "remote_tooltip.connect_to_wand_remote" },
Target = new Regex(@"remoteUrl=""wemodwebsite://remote"""),
Patch = "remoteUrl=globalThis.__wandRemoteBridgeUrl||\"" + RemoteWebPanelFallbackUrl + "\""
},
new PatchEntry
{
Name = "remoteQrPreviewUrl",
SearchHints = new[] { "resources/elements/remote-qr-code" },
Resolver = new ResolveContext
{
Handler = (matchContent) =>
{
var match = Regex.Match(matchContent, @"this\.canvasElement&&(\w+)\.mo");
return match.Success ? match.Groups[1].Value : null;
},
Placeholder = "<qr_writer>"
},
Target = new Regex(@"this\.canvasElement&&\w+\.mo\(this\.canvasElement,`\$\{\w+\.A\.wemodWebsiteUrl\}/remote`,this\.options\)"),
Patch = "this.canvasElement&&<qr_writer>.mo(this.canvasElement,globalThis.__wandRemoteBridgeUrl||\"" + RemoteWebPanelFallbackUrl + "\",this.options)"
} }
} }
} }
+2 -2
View File
@@ -51,5 +51,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.8.3")] [assembly: AssemblyVersion("1.0.8.4")]
[assembly: AssemblyFileVersion("1.0.8.3")] [assembly: AssemblyFileVersion("1.0.8.4")]
@@ -1,3 +1,8 @@
import {
getWebpackRequire,
isRecord,
} from "./installed-apps-sync/runtime.js"
;(function installRemotePopupCleanup(WandEnhancer) { ;(function installRemotePopupCleanup(WandEnhancer) {
if (globalThis.__wandRemotePopupCleanupInstalled) { if (globalThis.__wandRemotePopupCleanupInstalled) {
return return
@@ -8,14 +13,13 @@
const style = document.createElement("style") const style = document.createElement("style")
style.id = "wand-remote-popup-cleanup-style" style.id = "wand-remote-popup-cleanup-style"
style.textContent = ` style.textContent = `
.pro-onboarding-card--remote { article.pro-onboarding-card--remote {
display: none !important; display: none !important;
} }
remote-tooltip .remote-tooltip .top-wrapper, remote-tooltip .remote-tooltip .top-wrapper,
remote-tooltip .remote-tooltip .remote-tooltip-section-divider, remote-tooltip .remote-tooltip .remote-tooltip-section-divider,
remote-tooltip .remote-tooltip .instructions .header, remote-tooltip .remote-tooltip .instructions .header,
remote-tooltip .remote-tooltip .instructions .content .text,
remote-tooltip .remote-tooltip .instructions .platforms { remote-tooltip .remote-tooltip .instructions .platforms {
display: none !important; display: none !important;
} }
@@ -29,15 +33,15 @@
remote-tooltip .remote-tooltip .instructions, remote-tooltip .remote-tooltip .instructions,
remote-tooltip .remote-tooltip .instructions .content { remote-tooltip .remote-tooltip .instructions .content {
display: flex !important; display: flex !important;
flex-direction: column !important;
align-items: center !important; align-items: center !important;
justify-content: center !important; justify-content: center !important;
padding: 0 !important; padding: 0 !important;
gap: 0 !important; gap: 12px !important;
} }
remote-tooltip .remote-tooltip .instructions remote-qr-code { remote-tooltip .remote-tooltip .instructions remote-qr-code {
all: unset !important; --wand-qr-size: clamp(180px, 70vw, 240px);
--wand-qr-size: clamp(220px, 100vw, 300px);
width: var(--wand-qr-size) !important; width: var(--wand-qr-size) !important;
height: var(--wand-qr-size) !important; height: var(--wand-qr-size) !important;
min-width: var(--wand-qr-size) !important; min-width: var(--wand-qr-size) !important;
@@ -53,6 +57,12 @@
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35) !important; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35) !important;
} }
remote-tooltip .remote-tooltip .instructions .content .text {
display: block !important;
max-width: 250px !important;
overflow-wrap: anywhere !important;
}
remote-tooltip .remote-tooltip .instructions remote-qr-code canvas { remote-tooltip .remote-tooltip .instructions remote-qr-code canvas {
width: 100% !important; width: 100% !important;
height: 100% !important; height: 100% !important;
@@ -64,6 +74,8 @@
transform: none !important; transform: none !important;
} }
` `
let qrRenderer = null
let refreshScheduled = false
const installStyle = () => { const installStyle = () => {
if (!document.getElementById(style.id)) { if (!document.getElementById(style.id)) {
@@ -71,9 +83,31 @@
} }
} }
const updateLinks = () => { const getRemoteUrl = () =>
const remoteUrl = globalThis.__wandRemoteBridgeUrl || WandEnhancer?.remoteUrl
globalThis.__wandRemoteBridgeUrl || WandEnhancer?.remoteUrl
const resolveQrRenderer = () => {
if (qrRenderer) {
return qrRenderer
}
const webpackRequire = getWebpackRequire()
for (const record of Object.values(webpackRequire?.c || {})) {
const exports = record?.exports
if (
isRecord(exports) &&
typeof exports.create === "function" &&
typeof exports.mo === "function"
) {
qrRenderer = exports.mo
return qrRenderer
}
}
return null
}
const updateLinks = (remoteUrl) => {
if (!remoteUrl) { if (!remoteUrl) {
return return
} }
@@ -84,13 +118,48 @@
} }
} }
installStyle() const updateQrCodes = async (remoteUrl) => {
updateLinks() const renderQr = remoteUrl && resolveQrRenderer()
if (!renderQr) {
return
}
const observer = new MutationObserver(() => { for (const canvas of document.querySelectorAll("remote-qr-code canvas")) {
if (canvas.dataset.wandRemoteUrl === remoteUrl) {
continue
}
try {
await renderQr(canvas, remoteUrl)
canvas.dataset.wandRemoteUrl = remoteUrl
} catch (error) {
WandEnhancer?.log("Failed to render local remote QR code", error)
}
}
}
const refresh = () => {
const remoteUrl = getRemoteUrl()
installStyle() installStyle()
updateLinks() updateLinks(remoteUrl)
}) void updateQrCodes(remoteUrl)
}
const scheduleRefresh = () => {
if (refreshScheduled) {
return
}
refreshScheduled = true
setTimeout(() => {
refreshScheduled = false
refresh()
}, 0)
}
refresh()
const observer = new MutationObserver(scheduleRefresh)
observer.observe(document.documentElement, { observer.observe(document.documentElement, {
childList: true, childList: true,