lulzsun / blitz-app-adblock

Simple and quick patcher that blocks ads/trackers on the Blitz.gg desktop application.
185 stars 29 forks source link

Mac build not passing patch comparison check on latest release #41

Open lukenamop opened 3 years ago

lukenamop commented 3 years ago
Error: Current Blitz version caused patch comparison check to fail. Look for a new patcher release or create a new issue on Github!

    at Object.modifyFileAtLine (/snapshot/blitz-app-adblock-3.0.3/io.js)
    at start (/snapshot/blitz-app-adblock-3.0.3/blitz-app-adblock.js)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Manually building v3.0.3.

lulzsun commented 3 years ago

Patcher appears to still be working on Windows. Not exactly sure why it Blitz versions would be different between Windows and Mac.

Could you provide the 'app.asar' file so that I could check for differences?

lukenamop commented 3 years ago

Here's the current app.asar for Version 1.13.141.1617 (zipped into a folder because GitHub wouldn't let me upload the file directly). app.asar.zip

lulzsun commented 3 years ago

After manually taking a look at your app.asar, I came to conclusion that both Mac and Windows have the exact same app.asar, or at least the file that needs patching (createWindow.js) are the same.

I think there might be an issue where the string check can fail on MacOS?

The string check is in place to make sure that lines 118 and 105 are empty to prevent any issues with patching over necessary lines of code. If something exists there then that means the patch may fail so it throws the patch comparison error message instead of patching. By removing the third argument from modifyFileAtLine, it will just override those lines without checking.

If you are manually building, fetch latest commit and try removing the third argument from these two lines in blitz-app-adblock.js like so:

(56)            io.modifyFileAtLine(js.filterEngine, `${appPath}/app/src/createWindow.js`, 118);
(57)            io.modifyFileAtLine('session: true,', `${appPath}/app/src/createWindow.js`, 105);
lukenamop commented 3 years ago

Adjusting lines 56 and 57 as you suggested, building, and running worked with no issues. Blitz is now open with no ads again! Thanks for the help.

I'll continue using this edited version of the code and I'll just reinstall if it breaks Blitz or anything! Feel free to close this issue, or keep following up if you want to try to dig deeper for more info.

lukenamop commented 3 years ago

For more information for your own debugging purposes, I am on an M1 Mac but I am running Terminal on Intel architecture via Rosetta (npm fails to build when I try to compile natively, but that's just an npm issue and not related to your code).