先作为主站备份 源站:https://my.toho.red

About how to set up a third-party QQ push server for my newly purchased LG V50

It's been a while since the last update (oops). First of all, I want to say hello to the (non-existent) friends who follow this site. It's been a long time, and I apologize for keeping you waiting.

Reason for changing phones

Last month, when I just retrieved my phone from school, it was immediately taken by my family when I got home. So I had to buy another phone for daily use. As someone who has previously bought LG G7 & V30, the first brand that came to my mind was LG. So, after some negotiation and frugal living, I finally managed to buy a V50 at a very low price.

Can you believe the 855 for 448?
Enter image description here

TX, the eternal troublemaker

However, shortly after I got it, I found that the battery life of the phone was very poor. The 4000mAh battery couldn't even last a day with a single charge. Just when I thought something was wrong and was about to confront JS, I opened the power management page and saw the following scene:

Ding Dong
Enter image description here

No wonder I was losing so much battery in standby mode. It turned out to be caused by QQ, which was somewhat expected. As we all know, the QQ client caches all group messages in the background (whether or not they are notified). So theoretically, the more groups you join, the more battery it will consume. And since the Android version of QQ does not support third-party push notifications, it can only run in the background. For heavy QQ users like me, QQ is definitely a big troublemaker. If you try to force it to close, it won't go away, but if you don't close it, it will consume a lot of battery, which is very frustrating for me.

About this software

So, is there any way to make QQ use third-party push notifications? Actually, there has been a method for a long time, which is message forwarding. However, message forwarding requires a spare device, which is not an option for someone like me who uses a spare device as the main device. But currently, there are no tutorials on using virtual machines for forwarding on the entire internet, so what should I do? Do it myself. Thinking back to my experience of writing QQ bots in the past, I immediately used a few scripts to create a tool that can forward messages without a spare device.

This software is written in go-cqhttp, Xiaomi Push, and Python scripts. It should work on both Windows and Linux, but currently, I have only written the Linux version. This software is completely open-source and does not have any backdoors, trojans, or viruses, so feel free to use it.

Setup tutorial

This tutorial is not intended for complete beginners who have never used Linux and Python. If you are a beginner who doesn't have time to study this program, you have the following options:

  1. Do not use this software.
  2. Pay 10 yuan for setup.
  3. Add QQ 1015256551 for free push service.

Preparation before setup:

  1. A phone that can register Xiaomi Push normally.
  2. A Linux virtual machine/cloud server with Python 3.8.3 installed, as well as the aiocqhttp and httpx libraries.

Configuration on the phone

Go to Coolapk, download and install "Message Receiver" (that's the name of the app), and then open it. If your phone's Xiaomi Push is working properly, you should see the following prompt:
Enter image description here
If it doesn't appear, please check if Xiaomi Push is working properly. Non-Xiaomi phones can use third-party frameworks.

Then click on "Set Alias" and try to set a complex alias. It is recommended to use a password generator, and 15 characters should be enough. After setting it, remember to save the alias you set, as you will need it later.

Server-side configuration

Click here to download the latest version of the compressed package to your Linux server, then unzip it. You should see two folders:
Enter image description here
Go into the "mirai" folder and run "./go-cqhttp". If everything is correct, you should see the following options:
Enter image description here
Enter "3" and press Enter to select reverse WebSocket communication. The software will automatically close, and you should see "config.yml" generated in the root directory. Open it and configure these two parts:
Enter image description here
Enter image description here
After configuring, run the program again and follow the prompts to log in to QQ. When the screen displays messages, it means the configuration is complete. Keep go-cqhttp running in the background, and now you need to configure the forwarding script.

Go to the "script" directory, where you will find "forward.py". When you open it for editing, you only need to pay attention to these two parts:
Enter image description here
For the first "alias", just fill in the alias you set earlier. Make sure you don't make any mistakes, and remember to enclose it in double quotation marks (""). It's simple, isn't it?

As for "group_whitelist", it's a bit more complicated. What is it used for? It is actually the whitelist for receiving group messages. Since the QQ bot framework does not support obtaining the list of blocked group messages or directly obtaining the group name, I can only come up with a workaround and let users configure it themselves. As you can see, there are two values that need to be filled in. The first value is the QQ group number to be added to the whitelist. Only groups in this list will receive group messages. The second value is the group name, which will be displayed in the message bar when the message is pushed, making it easy for users to identify which group the message belongs to. In this example, I added the group with the group number 1077550597 (my user group) and the group name "gkd" to the whitelist, so I can receive messages from this group. If the QQ number is 123456 and the group name is "abcd", you should configure it like this:

What? You have more than one group to push? Then you can configure it like this:
Enter image description here
After setting everything up, run forward.py. When you see this log line, it means the configuration is successful:
Enter image description here
If everything is correct, you will soon receive the push notifications. Now you can happily close QQ in the background and enjoy a smooth and power-saving Android experience.


Q: Why can I still receive messages from the push in the foreground when QQ is active?
A: Because there is no detection of which device is using the QQ API, the push will not pause when you are using QQ. Currently, there is no solution.

Q: Can I reply directly in the pop-up window?
A: Technically feasible, but implementation is a bit difficult. Maybe I will consider it when I have time.

Q: When will it support Windows?
A: We may release a third-party push solution that can be used for both WeChat and QQ in the future, and we will consider it at that time.

Q: Where can I provide feedback or suggestions?
A: Have you carefully read the tutorial?

Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.