Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[CRITICAL] Migrating PHEx to Manifest V3 #1231

Open
LeoBadeaux opened this issue Dec 13, 2021 · 15 comments · May be fixed by #1316
Open

[CRITICAL] Migrating PHEx to Manifest V3 #1231

LeoBadeaux opened this issue Dec 13, 2021 · 15 comments · May be fixed by #1316
Assignees
Labels
Priority: High High priority Research Research further into this issue.

Comments

@LeoBadeaux
Copy link
Contributor

LeoBadeaux commented Dec 13, 2021

Recently, Chrome announced Manifest V3, a change to how chrome extensions work. Manifest V3 removes many core functions/methods that we use in our PHEx extension. More specifically, Manifest V3 removes and deprecates the networkRequest API, and a new API that does not allow extensions to intercept and modify data sent back to the client. We have to modify network request data in order for the hacks to work.

Why does the extension still work?

Chrome is slowly rolling out this change through stages. Based on our research, the extension will continue to work until 2023, which is when the Chrome browser will no longer run extensions that do not follow manifest V3.

What if I do not use Chrome?

Most browsers are based on Chromium, which is Chrome without Google. Chromium is still managed and ran by Chrome, and chromium will follow this change as well, making Manifest V3 extensions not able to run on chromium-based browsers in 2023. However, some chromium-based browsers will actually continue to accept Manifest V2 extensions. The only browsers I know at this moment that will continue to support manifest V3 are Brave and Firefox. Brave is based on chromium, so PHEx already works and will continue to work for Brave. At the moment, PHEx is not supported on Firefox.

What are we going to do?

That is the million-dollar question. We need to figure out methods to hack Prodigy, and that's where we'll need help to come up with viable options to do this. We may have to release multiple methods for different platforms. The following is a list of possible methods that could work:

Desktop Program

We build a desktop program with the hacked version of Prodigy that can run on macOs, Linux, and Windows. This could be achieved using electron, allowing us to easily build a multi-platform program with a programming language we already know- Javascript.

Pros

  • Already allows more freedom than a chrome extension, allowing us to modify Prodigy even more.
  • Easy to create using programming languages the development team already knows.

Cons

  • Cannot be supported on ChromeOS, which is the primary platform our hacks are used on.

Building a Proxy

We program and create a proxy server that anyone can connect to which modifies requests on our remote server. We would need to figure out how to bypass the SSL prodigy uses as well as bypass the SHA check, which may have to be done with a proxy AND extension.

Pros

  • Supported on basically all platforms

Cons

  • School administrators typically restrict the privilege of setting a proxy.
  • Proxy will likely need to be created in a programming language nobody on our team is proficient with.

We need help coming up with methods that will work to keep the hacks alive.

@Prodigy-Hacking Prodigy-Hacking locked and limited conversation to collaborators Dec 13, 2021
@PatheticMustan
Copy link
Member

PatheticMustan commented Dec 14, 2021

hold on, reading the docs, I'm not totally sure if we need to jump to a desktop program or any proxy. Since we're only modifying the game.min.js, and not dynamically editing requests, I don't see why we're not just able to migrate to mv3 normally with chrome.declarativeNetRequest

@PatheticMustan
Copy link
Member

PatheticMustan commented Dec 14, 2021

if ya wanna be nitty gritty about it, technically we don't actually modify the game files with the networkRequest API, it just runs another script that inserts the modified game files. The thing that's actually going to stop us from doing anything is how they're going to handle remote code

MV3 imposes new restrictions that limit an extension's ability to execute unreviewed JavaScript through a combination of platform changes and policy limitations.
Many extensions are unaffected by this change. However, if your MV2 extension executes remotely hosted scripts, injects code strings into pages, or evals strings at runtime, you'll need to update your code execution strategies when migrating to MV3.

If they just flat out reject our extension, we may just have to go back to manually loading the extension with the developer tools

@PatheticMustan PatheticMustan changed the title [DRAFT IGNORE FOR NOW] Manifest V3 [DRAFT IGNORE FOR NOW] Migrating PHEx to Manifest V3 Dec 14, 2021
@PatheticMustan PatheticMustan added the Priority: High High priority label Dec 14, 2021
@LeoBadeaux LeoBadeaux changed the title [DRAFT IGNORE FOR NOW] Migrating PHEx to Manifest V3 Migrating PHEx to Manifest V3 Dec 14, 2021
@LeoBadeaux LeoBadeaux self-assigned this Dec 14, 2021
@LeoBadeaux LeoBadeaux added the Research Research further into this issue. label Dec 14, 2021
@LeoBadeaux
Copy link
Contributor Author

if ya wanna be nitty gritty about it, technically we don't actually modify the game files with the networkRequest API, it just runs another script that inserts the modified game files. The thing that's actually going to stop us from doing anything is how they're going to handle remote code

MV3 imposes new restrictions that limit an extension's ability to execute unreviewed JavaScript through a combination of platform changes and policy limitations.
Many extensions are unaffected by this change. However, if your MV2 extension executes remotely hosted scripts, injects code strings into pages, or evals strings at runtime, you'll need to update your code execution strategies when migrating to MV3.

If they just flat out reject our extension, we may just have to go back to manually loading the extension with the developer tools

I haven't read too much into the documentation, but we could try, but I'm not sure it'll actually work.

@BoredFishRE
Copy link
Member

is there possibly a way to get code "approved" by google? if so, we can try that.

@PatheticMustan
Copy link
Member

PatheticMustan commented Dec 14, 2021

nope lmao

it might be possible to just completely move PNP into PHEx, since it seems like we can replace script.js directly, kinda. https://stackoverflow.com/a/35372809

I'm almost certain the "no remote code" requirement by google isn't enforced by mv3, but just by the chrome store. Unless they have some wild crazy new stuff...?

cc @ArcerionDev

@BoredFishRE
Copy link
Member

Not sure, we just gotta look at Mv3 and see what happens.

@BoredFishRE
Copy link
Member

could we possibly trick MV3 into thinking it's loading something else but when it gets to the extension, it saves the file in cache, and then executes it?

@BoredFishRE
Copy link
Member

Because we want people to easily get the hacks to make a point to prodigy, and sideloading the extension or using a desktop app isn't really accessible

@LeoBadeaux
Copy link
Contributor Author

Because we want people to easily get the hacks to make a point to prodigy, and sideloading the extension or using a desktop app isn't really accessible

Very aware that these alternative methods can and will be confusing for users. This is unfortunate.

@ArcerionDev
Copy link
Contributor

nope lmao

it might be possible to just completely move PNP into PHEx, since it seems like we can replace script.js directly, kinda. https://stackoverflow.com/a/35372809

I'm almost certain the "no remote code" requirement by google isn't enforced by mv3, but just by the chrome store. Unless they have some wild crazy new stuff...?

cc @ArcerionDev

I don't think this is possible to directly put P-NP into PHEx.
It would definitely keep hacks from being down more often, but the extension will still need to fetch from Prodigy's gamemin to modify it, and if you're fetching the regular gamemin, you might as well just fetch the modified one, it doesn't make a difference.

@ArcerionDev
Copy link
Contributor

wait nvm I just read the stackoverflow

@ArcerionDev
Copy link
Contributor

yeah it's possible

@ArcerionDev ArcerionDev pinned this issue Feb 1, 2022
@LeoBadeaux LeoBadeaux changed the title Migrating PHEx to Manifest V3 [CRITICAL] Migrating PHEx to Manifest V3 Feb 2, 2022
@LeoBadeaux
Copy link
Contributor Author

Little update on this, Arcerion tried getting it to work for 3 hours and apparently couldn't figure it out, but he's going to try to get someone else to do it.

@ArcerionDev
Copy link
Contributor

Little update on this, Arcerion tried getting it to work for 3 hours and apparently couldn't figure it out, but he's going to try to get someone else to do it.

@PatheticMustan is working on it

@PatheticMustan PatheticMustan self-assigned this Feb 2, 2022
@PatheticMustan
Copy link
Member

#1316

@PatheticMustan PatheticMustan linked a pull request Feb 2, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Priority: High High priority Research Research further into this issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants