WALink
实验性 Minecraft 模组,可将游戏内文本聊天链接到 WhatsApp 群聊,且不会像普通 Chrome 标签页那样占用大量内存。
(提到内存占用是因为,某些其他 WhatsApp 自动化实现实际上会打开一个 Chrome 标签页!)
可能会出现错误、崩溃和卡死,目前仍处于实验阶段。(这主要是因为我没有实现足够的错误处理,所以 99% 的情况下如果出现问题,可能会发生任何情况,而不是简单地重启或通知你。)
大多数问题应该已经解决,但始终存在小概率出错的可能。最好的初步修复方法可能是直接重启 walink。
网络短暂中断后应能重新连接,但不保证有效。有时需要手动重启。
免责声明
我不鼓励使用软件篡改自己的 WhatsApp 账户。这仅用于实验目的和概念验证。
使用此软件的风险
现实来说?风险相当低。虽然我不推荐将此模组用于你的账户,因为根据 WhatsApp 的服务条款,在账户上使用自动化软件是违规的,但该政策主要是为了阻止大规模诈骗活动。只要你只在小型服务器中与朋友一起使用,账户被封禁的实际风险极低。此外,我无法百分之百确定,但我认为 baileys 库很好地模拟了 WhatsApp Web 协议,在没有人工审核的情况下不会自动触发重大警报。
还需注意的是,这当然会降低你的 WhatsApp 群聊的安全性。虽然通常是端到端加密的,但这将其链接到了不是端到端加密的 Minecraft 服务器,因此技术上更容易受到黑客攻击。此外,消息会存储在服务器日志中,你可能希望也可能不希望删除旧日志。另外,该模组会创建自己的日志,其中可能包含敏感信息。你可以通过命令删除这些日志,详见下文。
安装/设置
安装 Node.js 以及 npm(重要!),并确保其已添加到系统路径中(在下载页面下方,你可以直接下载适用于你系统的预构建安装程序/二进制文件)。将模组 .jar 文件放入 fabric 模组文件夹中。启动游戏/服务器。启动后,运行 /walink chat_name NAME 以配置你要链接的群聊名称(必须是群聊)(必须与群聊名称完全匹配)。运行 /walink auth,并等待二维码。用你的手机扫描该二维码以将 WALink 与你的 WhatsApp 账户关联。运行 /walink restart 以完全启动后端并使 WALink 生效。
已知问题
偶尔在启动 WALink 时,它可能会尝试同步旧聊天记录,几次显示“0%”,然后卡住不再继续(等待约一分钟以确保它确实卡住了)。这很可能是 WALink 使用的底层库的问题,唯一的解决方法是取消 WALink 的身份验证并重新进行身份验证。
有时它也会在身份验证或启动过程中卡住,在这种情况下,只需停止并重试该过程即可。
一种解决方案是简单地停止 Minecraft,彻底删除 walink-data 文件夹,然后重试。有时会遇到无法解释的问题。调试这些问题是一场噩梦,因为你永远不知道这是库的问题、我自己的代码还是其他完全不同的东西,而当我试图重现问题时,它又完全消失了。
配置
目标群聊可以通过命令设置(见上文和下文的详细说明)。其余配置可通过配置文件编辑(config/walink.json)。要对配置应用手动更改,你需要首先完全关闭服务器!否则,退出时它将覆盖配置。
卸载
只需移除模组即可。可选地,你可能希望删除 walink-data 文件夹,因为它只是 WALink 留下的文件,可能包含也可能不包含敏感信息。在此之前,你可以在游戏中运行 /walink deauth 以省去一些麻烦。
命令
在 Minecraft 中:
/walink help: 获取关于这些命令的小帮助信息。
/walink auth: 将 WALink 与你的 WhatsApp 账户关联。通常只需首次运行,除非需要重新身份验证。在你的 WhatsApp 应用中,WALink 将显示为“Google Chrome (Windows)”,因为底层库模仿了 WhatsApp Web 实例。
/walink deauth: 从你的 WhatsApp 账户中取消 WALink 的身份验证。WALink 必须在运行状态下才能在 WhatsApp 应用中解除链接,否则它将保留在应用中(实际上是一个僵尸状态。下次 WALink 会要求新的身份验证)。当出现与身份验证/登录相关的问题时有用。
/walink vanish on/off: [未实现] 允许你的消息不显示在 WhatsApp 群聊中。
/walink stop: 停止 WALink。可以使用 /restart 重新启动。
/walink restart: 重启 WALink Node.js 后端以解决可能的问题和卡死,或者如果之前未启动则启动它。
/walink chat_name: 设置目标群聊名称。警告:它必须是唯一的群聊名称,并且需要完全匹配名称。如果存在两个具有相同名称的群聊,消息最终出现在哪个群聊 essentially 是一种赌博。
/walink clear_logs: 清除旧日志(当前运行的日志除外)。
在 WhatsApp 中:
.mc help: 获取关于这些命令的小帮助信息。
.mc vanish on/off: [未实现] 允许你的消息不显示在 Minecraft 文本聊天中
.mc players: 显示当前在服务器上的玩家列表。/walink vanish 不能防止出现在此列表中。
技术细节
需要安装 Node.js 和 npm。它捆绑了一个 node 程序以及 baileys,以实现与 WhatsApp 的轻量级通信,而不消耗大量资源。
支持版本
从 1.21.10 及以上版本开始,我会在新版本发布后尽快进行更新。
旧版本可能也支持,但你可能需要手动编辑模组存档中的 fabric.mod.json 文件。不过我无法保证任何内容。
未来可能会移植到主要旧版本(实际上只需更改一个值并重新构建模组,然后检查是否一切正常即可,99% 的情况下都能正常运行)。
如果你需要特定版本的模组,请在 GitHub 上提交 issue,我会尝试为该游戏版本重新编译并测试。
WALink
Experimental Minecraft mod that links the in-game text chat to a WhatsApp group chat without eating up the ram of your average Chrome tab.
(The reason I mention the RAM usage is, some other implementations of WhatsApp automation literally open up a Chrome tab!)
Bugs, crashes and freezes may occur, it's still experimental. (Most of this is just me not implementing enough error handling, so 99% of the time if something goes wrong, anything may happen instead of it just restarting or informing you.)
Most issues should be gone, but there is always a small chance something goes wrong anyway. The best first fix is probably to just restart walink.
Should reconnect after network disrupts for a short time, not guaranteed it works though. Sometimes a manual restart is necessary.
Disclaimer
I do not encourage the use of software to tamper with one's own WhatsApp account. This is merely for purposes of experimentation and a proof-of-concept.
Risks of using this software
Realistically? Quite low. While I do not endorse using this mod, as it is against WhatsApp's TOS to use automation software on your account, this policy is most likely only in place to stop big scam operations. As long as you only use it on a small server with your friends, the real risk of getting your account terminated is extremely low. Besides, I cannot say this with 100% confidence, but I believe the baileys library impersonates the WhatsApp web protocol pretty well, and will not automatically light any major red flags without human review.
Also to be noted is that this of course lowers the security of your WhatsApp group chat. While usually it is end-to-end-encrypted, this links it to the minecraft server which is not end-to-end-encrypted, and therefore technically more prone to hacks. Also, messages get stored in the server logs, you may or may not want to delete old logs. Also, the mod creates its own logs which may contain sensitive information. You have the ability to delete these logs via a command, more below.
Installing / Setup
Install Node.js along with npm (important!) and make sure it is on your path (on the download page, below you can just download pre-built installers/binaries for your system). Put the mod .jar in your fabric mod folder. Launch the game/server. Once launched, run /walink chat_name NAME to configure the name of the group chat you want to link (MUST BE A GROUP CHAT) (MUST MATCH THE GROUP CHAT NAME EXACTLY). Run /walink auth, and wait for a QR code. Scan that with your phone to link WALink with your WhatsApp account. Run /walink restart to fully start the backend and make WALink work.
Known Issues
It rarely may happen that when starting WALink, it tries to sync old chats, says "0 percent" a few times, then gets stuck and never continues (wait for about a minute to be 100% sure it's stuck). This is most likely an issue with the underlying library WALink uses, and the only way to fix this is just deauthenticating WALink and re-authenticating.
It also may happen that it just gets stuck while authenticating or starting, in that case just stop and re-try the process.
One fix is always to simply stop minecraft, remove the walink-data folder all together, and try again. It sometimes runs into inexplicable issues. Debugging them is a nightmare as you never know if it's a library, my own code, or something else entirely, and then when I try to reproduce the issue it's just completely gone.
Configuring
The targeted group chat can be set via commands (more above and below). The rest of the config can be edited via the config file (config/walink.json). To apply manual changes to the config, you will need to first shut down the server completely! Otherwise, it will just overwrite the config on exit.
Uninstalling
Just remove the mod. Optionally you may want to delete the walink-data folder, as its just leftover files by WALink that may or may not also contain sensitive information. Before that, in the game you can also run /walink deauth before to save you some work.
Commands
In Minecraft:
- /walink help: Get a small help message about these commands.
- /walink auth: Authenticates WALink with your WhatsApp account. Usually required to run only the first time, unless re-authentication is neccessary. In your WhatsApp app, WALink will appear listed as "Google Chrome (Windows)", as the underlying library imitates a WhatsApp Web instance.
- /walink deauth: Deauthenticate WALink from your WhatsApp account. WALink needs to be running for it to be unlinked in the WhatsApp app, otherwise it will remain in the app (a zombie, really. WALink will ask for new authentication next time). Useful when issues concerning authentication/login occur.
- /walink vanish on/off: [NOT IMPLEMENTED] Allows your messages to not appear in the WhatsApp group chat.
- /walink stop: Stops WALink. Can be restarted with /restart.
- /walink restart: Restarts the WALink Node.js backend to resolve possible issues and freezes, or just starts it if it wasn't started before.
- /walink chat_name: Set the target group chat name. Warning: It has to be a unique group chat name, and needs to exactly match the name. If two group chats with the same name exist, it is essentially a gamble where the messages will end up in.
- /walink clear_logs: Clears old logs (except the one for the current run).
In WhatsApp:
- .mc help: Get a small help message about these commands.
- .mc vanish on/off: [NOT IMPLEMENTED] Allows your messages to not appear in the Minecraft text chat
- .mc players: Shows a list of the players currently on the server. /walink vanish does not protect from appearing in this list.
Technical Details
It requires Node.js and npm to be installed. It bundles a node program along with baileys to allow lightweight communication with WhatsApp without heavy resource usage.
Supported Versions
Anything from 1.21.10 onwards, I try to update for the latest version as soon as one releases.
Older versions may be supported, you'd probably have to edit the fabric.mod.json inside the mod archive. I do not guarantee for anything though.
Backports to major old versions may come (it's really just about rebuilding the mod with like 1 value changed and seeing if everything works as it should, which 99% of the time it should anyway).
If you want the mod for a specific version, open an issue on the GitHub. ill try to recompile and test for that specific version of the game.
评论 0
登录后参与评分
还没有评论,来抢沙发吧