vscodium icon indicating copy to clipboard operation
vscodium copied to clipboard

1.74 Intentionally Breaks Monkeypatch + CustomizeUI

Open shellscape opened this issue 2 years ago • 31 comments

Describe the bug

A microsoft employee merged a build change that effectively targets and breaks Monkeypatch and CustomizeUI. See: https://github.com/microsoft/vscode/pull/166126. This was a purposeful and malicious commit to further control users of the app.

Please confirm that this problem is VSCodium-specific

  • [ ] This bug doesn't happen if I use Microsoft's Visual Studio Code. It only happens in VSCodium.

Please confirm that the issue/resolution isn't already documented

  • [x] I checked the Docs page and my issue is not mentioned there.

To Reproduce Steps to reproduce the behavior:

  1. Install 1.74
  2. Install Monkeypatch
  3. Exit
  4. Run code --verbose from the terminal, or try to start VSCodium from the applications menu

Expected behavior

I was half expecting the project not to pick up malicious changes from MS like this. But it's understandable that this went under the radar.

I would love to see this change excluded, as I view this kind of this as harmful as the telemetry.

Screenshots

n/a

Desktop (please complete the following information):

  • OS: MacOS
  • Architecture x64
  • Version 1.74
  • App Manager n/a
  • Sandboxed no

Additional context

Here's the stack that code produces, which is identical to the stack that vscodium produces:

→ code --verbose
[58028:0125/195311.492768:ERROR:node_bindings.cc(289)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
Loading monkey-patch
(node:58028) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading 'crypto')
    at P (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:25:24056)
    at i (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:25:33504)
    at get mainIPCHandle (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:32:6945)
    at p.<computed> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:3:53298)
    at Oe.c (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:84:7310)
    at Oe.b (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:84:5809)
    at Oe.a (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:84:4864)
    at Oe.main (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:84:4709)
    at Object.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:85:1732)
    at s._safeInvokeFunction (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1337)
    at s._invokeFactory (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1522)
    at s.complete (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1801)
    at s._onModuleComplete (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:1112)
    at s._onModuleComplete (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:1358)
    at s._resolve (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:510)
    at s.defineModule (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:6066)
    at n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:10527)
    at Object.R (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:6036)
    at s._safeInvokeFunction (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1337)
    at s._invokeFactory (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1522)
    at s.complete (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1801)
    at s._onModuleComplete (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:1112)
    at s._onModuleComplete (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:1358)
    at s._resolve (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:510)
    at s.defineModule (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:6066)
    at y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:1825)
    at h (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:2554)
    at Object.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.nls.js:3:61)
    at e._createAndEvalScript (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:2598)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:2237
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-amd.js:82:14
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
(Use `Electron --trace-warnings ...` to show where the warning was created)
(node:58028) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

shellscape avatar Jan 26 '23 01:01 shellscape

I really hope this project pushes back on PRs like the one causing this issue. It shows an egregious disregard for the community as a whole.

trvswgnr avatar Jan 26 '23 04:01 trvswgnr

We might disable the mangle since it also breaking the build process on Windows... I have to think about that.

daiyam avatar Jan 26 '23 08:01 daiyam

@daiyam that would be wonderful. thanks for taking a look

shellscape avatar Jan 26 '23 12:01 shellscape

@daiyam yes, please do. Thanks.

battaglia01 avatar Jan 27 '23 02:01 battaglia01

OK, I've removed the mangle in the latest Insiders version. Can you test it?

daiyam avatar Jan 29 '23 18:01 daiyam

I will be able to test this evening

shellscape avatar Jan 29 '23 18:01 shellscape

Monkey Patch and / or Customize UI do not appear to function with this release.

If there is an area that I can provide logs from to help the team please let me know and I'll be happy to share.

Thanks!

owenfiscus avatar Jan 29 '23 21:01 owenfiscus

Ya, it seems that Monkey Patch hasn't been updated since it's impossible to maintain for the official version due to the mangling (https://github.com/iocave/customize-ui/issues/156). it looks for vs/code/electron-browser/workbench/workbench.html which isn't there anymore (https://github.com/iocave/monkey-patch/issues/61). I will keep VSCodium not-mangled so you can ask the extensions author to support VSCodium or make your own version.

daiyam avatar Jan 29 '23 22:01 daiyam

Great news! I used the vsce package command to build a VSIX version of the extension, and with this, both iocave/monkey-patch and iocave/customize-ui work as intended with the latest VSCodium Insider, see attached screenshot!

You can download the extension here: monkey-patch-0.1.23.vsix.zip

To install, simply run the command: Extensions: Install from VSIX…

Enjoy!

Screenshot 2023-01-31 at 23 59 14

lehni avatar Jan 31 '23 23:01 lehni

Ya, the git is 2 weeks old while the extension is 3 months old (on VSMarket), 9 months old (on OpenVSX)...

daiyam avatar Jan 31 '23 23:01 daiyam

@lehni

You can download the extension here: monkey-patch-0.1.23.vsix.zip

To install, simply run the command: Extensions: Install from VSIX…

It shows after started:

Cannot activate the 'Customize UI' extension because it depends on the 'Monkey Patch' extension, which is not installed. Would you like to install the extension and reload the window?

Then I click "Install and Reload", it shows up still.

weaming avatar Feb 21 '23 06:02 weaming

@weaming check your extensions. If you don't see Monkey Patch then you didn't install it correctly. Customize UI needs both extensions to run, and only the custom monkey-patch-0.1.23.vsix.zip above will work on VSCodium v1.75

lehni avatar Feb 21 '23 10:02 lehni

@weaming check your extensions. If you don't see Monkey Patch then you didn't install it correctly. Customize UI needs both extensions to run, and only the custom monkey-patch-0.1.23.vsix.zip above will work on VSCodium v1.75

I reinstall them from vsix file (monkey patch) and MS market (custom UI), but my settings seem do not work as expect as before in VSCode.

image

Expect:

image

weaming avatar Feb 22 '23 02:02 weaming

@weaming: but my settings seem do not work as expect as before in VSCode.

have you re-applied "Enable Monkey Patch" ??

samyakbardiya avatar Feb 27 '23 06:02 samyakbardiya

@weaming: but my settings seem do not work as expect as before in VSCode.

have you re-applied "Enable Monkey Patch" ??

It works after re-applied, tks!

weaming avatar Feb 27 '23 06:02 weaming

re-applied

[email protected] not work

zwmmm avatar Mar 26 '23 13:03 zwmmm

[email protected] not work

@zwmmm it works solely on vscodium

ghost avatar Mar 30 '23 04:03 ghost

it seems that there have been no updates for the extensions and VSCodium have been updated to the latest: 1.77.1.23095 It doesn't work with the extensions. Currently, the version is v1.76.2.23074 and it work with the extension.

Xelbayria avatar Apr 10 '23 03:04 Xelbayria

it seems that there have been no updates for the extensions and VSCodium have been updated to the latest: 1.77.1.23095

Ah good, I thought it was just me. It's stopped working on v1.77 for me as well. I had to disable it to get going and had planned to investigate later, thinking I had accidentally changed something to break it.

binaryben avatar Apr 10 '23 04:04 binaryben

Ah good, I thought it was just me. It's stopped working on v1.77 for me as well. I had to disable it to get going and had planned to investigate later, thinking I had accidentally changed something to break it.

That's exactly why i had to post that "post" to let everyone know what's going on with the extension and the latest version. I am glad that you know you are not alone.

Xelbayria avatar Apr 10 '23 06:04 Xelbayria

I've fixed this bug in https://github.com/lehni/customize-ui/commit/215ea7fb76986e625e376d84e5cdbf7191488a4e and you can download a new version of the extension to install from a VSIX file here: https://github.com/iocave/customize-ui/issues/170#issuecomment-1503371606

Enjoy!

lehni avatar Apr 11 '23 13:04 lehni

@lehni If you generate a release in github, users could use VSIX Manager with the following settings to install and keep it up to date.

{
    "vsix.extensions": [
        "github:iocave/customize-ui",
    ],
    "vsix.crons": {
        "update": "0 12 * * *"      // at 12PM, every day
    },
}

daiyam avatar Apr 11 '23 14:04 daiyam

they did it again 1.80.0-insider mangles all exports

drcika avatar Jun 18 '23 08:06 drcika

I will look into it when fixing the patchs for the insiders version

daiyam avatar Jun 18 '23 08:06 daiyam

Will the patch work with 1.79?

ppnoufal avatar Jul 25 '23 03:07 ppnoufal

Will the patch work with 1.79?

if you are talking about VSCodium, then yes. and i am also using v1.80... it's working fine. Both monkeypatch + CustomizeUI will not work on VSCode.

Xelbayria avatar Jul 25 '23 03:07 Xelbayria

Many thanks, it's working..!!

ppnoufal avatar Jul 25 '23 04:07 ppnoufal

@kaku-dev see here for a more future-proof way forward: https://github.com/drcika/apc-extension/issues/52#issue-1806531224

lehni avatar Jul 25 '23 09:07 lehni

Has anyone manage to get this running in the 1.83 release?

wtf403 avatar Oct 12 '23 01:10 wtf403

@wtf403 Yes. Check out apc-extension

ghost avatar Oct 12 '23 02:10 ghost