コード例 #1
0
        void ManualAuthCallBack(mm.command.NewAuthResponse message)
        {
            if (message.Base.Ret == -301)
            {
                var dns = message.Server.NewHostList;
                if (dns.ListList.Count > 0)
                {
                    string ip = dns.ListList[0].Substitute;

                    mMClient.shortLink = "http://" + dns.ListList[1].Substitute;
                    Console.WriteLine("shortLink:" + mMClient.shortLink + "\n");
                    mMClient.ReConnect(ip);
                    mMClient.CheckLoginQRCode(uuid, CheckLoginQRCodeCallBack);
                }
            }
            else if (message.Base.Ret == 0)
            {
                byte[] strECServrPubKey = message.Auth.SvrPubECDHKey.Key.Buffer.ToByteArray();
                var    aesKey           = MyFuckSSL.SharkEcdhKey(strECServrPubKey, mMClient.pri_key_buf);
                mMClient.CheckEcdh = aesKey.ToString(16, 2);
                mMClient.AESKey    = AES.AESDecrypt(message.Auth.SessionKey.Buffer.ToByteArray(), aesKey).ToString(16, 2);
                mMClient.wxid      = message.User.UserName;
                Console.WriteLine("当前微信号:" + mMClient.wxid + "\n");
                mMClient.uin = message.Auth.Uin;
                Console.WriteLine("uin:" + mMClient.uin + "\n");
                mMClient.cookie = mMClient.getcookie();

                mMClient.deviceID = "49aa7db2f4a3ffe0e96218f6b92cde32".ToByteArray(16, 2);
                Console.WriteLine(ChangeType.ToHexString(mMClient.deviceID));
                mMClient.devicetype = "iPad iPhone OS8.4";
                ShortChanle.NewInit(mMClient);
            }
        }
コード例 #2
0
        public void threadqrcode()
        {
            var bProtobuf = ShortChanle.GetLoginQRCode(mMClient);

            Console.WriteLine(ChangeType.ToHexString(bProtobuf));

            MMPro.MM.GetLoginQRCodeResponse getLoginQRCodeResponse = mMClient.Deserialize <GetLoginQRCodeResponse>(bProtobuf);
            //mm.command.GetLoginQRCodeResponse pb = mm.command.GetLoginQRCodeResponse.ParseFrom(bProtobuf);

            Bitmap bitmap = new Bitmap(new MemoryStream(getLoginQRCodeResponse.qRCode.src));

            ShortQRcode.Image = bitmap;
        }
コード例 #3
0
 public void pushShortInit()
 {
     ShortChanle.NewInit(mMClient);
 }