puppet-oicq icon indicating copy to clipboard operation
puppet-oicq copied to clipboard

Can we disable saving the qrcode img to file?

Open huan opened this issue 4 years ago • 2 comments

请用手机QQ扫描二维码,若打印出错请打开:/home/huan/git/wechaty/wechaty-getting-started/data/12345/qrcode.png

The above image file is not necessary to be created and will generate rubbish files.

Can we disable this feature for the puppet?

huan avatar Oct 01 '21 01:10 huan

qrcode.png with device-{QQnumber}.json will be created on data/{QQnumber} folder.

image

The device json will save random device info for a enumlated phone device. If we keep the device.json, and login for several days. Our QQ accound will be less likely to be banned since QQ server records we login constantly with same IP and device.

Also, since the exist of "device lock(设备锁)", we need to keep the device.json to prevent of allowing new device to login in each time.

image

anaivebird avatar Oct 04 '21 07:10 anaivebird

Yes, we should save the data from device.json and keep it for reuse across sessions.

That information should be saved to MemoryCard that managed by Wechaty.

Please read the below lines of source code to understand how to use MemoryCard (puppet.memory.set()) :

https://github.com/wechaty/wechaty-puppet-wechat/blob/a45a4ab7e20bb9cfc328e904966a550dbdc8e3a0/src/puppet-wechat.ts#L1219

To summarize: the puppet.memory is managed by the Wechaty Puppet system, you can save/load critical data from and to it across sessions.

huan avatar Oct 04 '21 08:10 huan