8000 refactor: hook execution policy by Lablace · Pull Request #1514 · v2rayA/v2rayA · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: hook execution policy #1514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2024
Merged

refactor: hook execution policy #1514

merged 1 commit into from
Sep 26, 2024

Conversation

Lablace
Copy link
Contributor
@Lablace Lablace commented Sep 25, 2024

This changes how the hook programs (mainly scripts) are called. The program used to recognize the core-hook and transparent-hook as a single executable and pass it as a whole to os.exec. The behavior is OK on *nix as we can use shebangs, for scripts written in Python or other interpreter-based languages, we can specify the interpreter at the very beginning of it. But it's quite a different story on Windows, only bat (cmd) scripts are first-class citizens, we need one of that as an intermediate to invoke what we really want to call. With this change, the core-hook and transparent-hook will be split by space and collected into an array, the final executable would be the first element in it and all other elements (if any) follow as arguments. This makes pattern like python core-hook.py and pwsh transparent-hook.ps1 valid.

Copy link
Collaborator
@mzz2017 mzz2017 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mzz2017 mzz2017 merged commit a721fe6 into v2rayA:main Sep 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0