Esempio n. 1
0
        public bool doScene(string userName, string pwd)
        {
            try
            {
                base.beginBuilder();
                mAuthUserName   = userName;
                mAuthUserPwdMD5 = pwd;

                base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(1, 1644430665);//369492260  1644430665

                //string a = Util.byteToHexStr(base.mBuilder.BaseRequest.ToByteArray());
                base.mBuilder.UserName = Util.toSKString(userName);
                base.mBuilder.Pwd      = Util.toSKString(pwd);
                base.mBuilder.Pwd2     = Util.NullAsNil("");
                base.mBuilder.ImgSid   = Util.toSKString("");
                base.mBuilder.ImgCode  = Util.toSKString("");


                //base.mBuilder.ClientSeqID = "WP7" + ((long)Util.getNowMilliseconds());
                //  base.mBuilder.SoftType = "<softtype><k3>9.3.2</k3><k9>iPad</k9><k10>2</k10><k19>AC638664-9598-41F1-ADDB-5791FE4ADB2D</k19><k20>9697B844-9368-4154-A6F7-5A4623B06D27</k20><k21>405-5G</k21><k22>(null)</k22><k24>74:44:1:8d:60:27</k24><k33>\\345\\276\\256\\344\\277\\241</k33><k47>1</k47><k50>0</k50><k51>com.luoming</k51><k54>iPad4,4</k54></softtype>";
                //base.mBuilder.DeviceType = "iPad";
                //base.mBuilder.IPhoneVer = "iPad4,4";

                base.mBuilder.Channel        = 0;// AppInfoHelper.ChannelId;
                base.mBuilder.InputType      = 2;
                base.mBuilder.TimeStamp      = Convert.ToUInt32(Util.getNowSeconds().ToString().Substring(0, 10));
                base.mBuilder.BuiltinIPSeq   = 0;
                base.mBuilder.WTLoginReqBuff = Util.toSKBuffer("");
                base.mBuilder.BundleID       = "com.tencent.xin";
                base.mBuilder.DeviceName     = "Apple Watch";
                base.mBuilder.DeviceType     = ConstantsProtocol.DEVICE_TYPE;

                base.mBuilder.Language       = "zh_CN"; //AccountMgr.GetCurrentLanguage();
                base.mBuilder.DeviceBrand    = "Apple"; //DeviceStatus.get_DeviceManufacturer() ?? "";
                base.mBuilder.RealCountry    = "CN";    //DeviceStatus.get_DeviceManufacturer() ?? "";
                base.mBuilder.DeviceModel    = "";      //DeviceStatus.get_DeviceName() ?? "";
                base.mBuilder.RandomEncryKey = Util.toSKBuffer(new byte[] { 104, 84, 125, 199, 142, 226, 48, 218, 83, 195, 3, 84, 3, 123, 208, 162 });
                base.mBuilder.OSType         = "8.10.12393.0";
                // base.mBuilder.IMEI = "4eff1bfe75a6cb3216004eefb8d78d84";
                base.mBuilder.KSid     = Util.toSKBuffer("");
                base.mBuilder.TimeZone = "8.00";
                // base.mBuilder.ClientSeqID = "4eff1bfe75a6cb3216004eefb8d78d84-" + Util.getNowSeconds().ToString().Substring(0, 10);
                // base.mBuilder.AdSource = "AC638664-9598-41F1-ADDB-5791FE4ADB2D";
                base.mSessionPack.mCmdUri = "/cgi-bin/micromsg-bin/newauth";
                base.mSessionPack.mCmdID  = 0xb2;

                base.endBuilder();
            }
            catch (Exception e)
            {
                throw e;
            }
            return(true);
        }
Esempio n. 2
0
 public void doScene(string account)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
     //base.mBuilder.
     base.mBuilder.UserName         = Util.toSKString(account);
     base.mSessionPack.mConnectMode = 1;
     base.mSessionPack.mCmdID       = 0x22;
     //base.mSessionPack.mCmdUri = "/cgi-bin/micromsg-bin/searchcontact";
     base.endBuilder();
 }
Esempio n. 3
0
 public bool doScene(string ticket)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest      = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.AuthTicket       = ticket;
     base.mBuilder.Name             = Util.ByteArrayToString(base.mBuilder.BaseRequest.DeviceID.ToByteArray());
     base.mBuilder.DeviceType       = ConstantsProtocol.DEVICE_TYPE;
     base.mSessionPack.mCmdUri      = "/cgi-bin/micromsg-bin/addsafedevice";
     base.mSessionPack.mConnectMode = 2;
     base.endBuilder();
     return(true);
 }
 public void doScene(string nickName)
 {
     base.beginBuilder();
     mRegNickName = nickName;
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0x21);
     base.mBuilder.Pwd         = Util.NullAsNil(NetSceneAuth.mAuthUserPwdMD5);
     base.mBuilder.NickName    = Util.NullAsNil(nickName);
     base.mBuilder.BindUin     = (uint)Util.stringToInt(NetSceneAuth.mAuthUserName);
     base.mBuilder.Ticket      = Util.NullAsNil(SessionPackMgr.mAuthTicket1);
     SessionPackMgr.getAccount().setNickname(nickName);
     base.mSessionPack.mCmdID = 0x21;
     base.endBuilder();
 }
Esempio n. 5
0
        public bool doSceneSendAppMsg(string toUsername, int source, string xmlstr)
        {
            AppMsgInfo info = AppMsgMgr.ParseAppXml(xmlstr);

            if (info == null)
            {
                //Log.e("NetSceneSendAppMsg", "invalid AppMsgInfo, msg.strMsg = " + this.mAppMsg.strMsg);
                return(false);
            }
            base.beginBuilder();
            base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
            AppMsg.Builder builder = AppMsg.CreateBuilder();
            builder.AppId = info.appid;
            uint result = 0;

            builder.SdkVersion = uint.TryParse(info.sdkVer, out result) ? result : 0;
            builder.ToUserName = toUsername;
            info.fromUserName  = AccountMgr.curUserName;
            //if (info.fromUserName != AccountMgr.curUserName)
            //{
            //    Log.e("NetSceneSendAppMsg", "invalid from username = "******"appmsg") ?? "";
            if (info.showtype == 2)
            {
                //builder.Content = builder.Content + AppMsgMgr.getXmlNodeString(this.mAppMsg.strMsg, "ShakePageResult");
                builder.Content = builder.Content;
            }
            if (string.IsNullOrEmpty(builder.Content))
            {
                Log.e("NetSceneSendAppMsg", "invalid appmsgBuilder.Content = " + builder.Content);
                return(false);
            }
            builder.CreateTime  = (uint)Util.getNowSeconds();
            builder.ClientMsgId = MD5Core.GetHashString(toUsername + Util.getNowMilliseconds());;
            byte[] inBytes = null;//StorageIO.readFromFile(ChatMsgMgr.getMsgThumbnail(this.mAppMsg));
            if (inBytes != null)
            {
                builder.Thumb = Util.toSKBuffer(inBytes);
            }
            builder.Source           = (int)source;
            base.mBuilder.Msg        = builder.Build();
            base.mSessionPack.mCmdID = 0x6b;
            base.endBuilder();
            return(true);
        }
Esempio n. 6
0
        private bool doSceneEx(List <ChatMsg> chatMsgList, int emojiType = 1)
        {
            if ((chatMsgList == null) || (chatMsgList.Count <= 0))
            {
                Log.e("NetSceneSendMsg", "sendMsg list is null");
                return(false);
            }
            this.mSendingList = chatMsgList;
            int count = chatMsgList.Count;

            if (chatMsgList.Count > 10)
            {
                count = 10;
                int num2 = chatMsgList.Count - this.mListSendedLen;
                count = (num2 > 10) ? 10 : num2;
            }
            base.beginBuilder();
            base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(2);
            for (int i = this.mListSendedLen; i < (this.mListSendedLen + count); i++)
            {
                ChatMsg local1 = chatMsgList[i];
                MicroMsgRequest.Builder builder = MicroMsgRequest.CreateBuilder();
                builder.SetCreateTime((uint)chatMsgList[i].nCreateTime);
                if (chatMsgList[i].strMsg == null)
                {
                    chatMsgList[i].strMsg = "";
                }
                builder.SetContent(chatMsgList[i].strMsg);
                if (chatMsgList[i].strClientMsgId == null)
                {
                    chatMsgList[i].strClientMsgId = "";
                }
                builder.SetClientMsgId(chatMsgList[i].strClientMsgId);
                builder.SetFromUserName(Util.toSKString(AccountMgr.curUserName));
                builder.SetToUserName(Util.toSKString(chatMsgList[i].strTalker));
                //builder.SetToUserName(Util.toSKString("ntsafe-hkk"));

                builder.SetType((uint)chatMsgList[i].nMsgType);
                builder.SetEmojiFlag((uint)emojiType);
                MicroMsgRequest item = builder.Build();
                base.mBuilder.ListList.Add(item);
            }
            base.mBuilder.Count      = (uint)base.mBuilder.ListList.Count;
            base.mSessionPack.mCmdID = 2;
            base.endBuilder();
            this.mListSendedLen += count;
            return(true);
        }
Esempio n. 7
0
 private bool doSceneEx(List <string> userNameList)
 {
     //   Log.i("NetSceneBatchGetContact", "doscene in");
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0, 369298705);
     //base.mBuilder.BaseRequest.ClientVersion = 1678050096;
     foreach (string str in userNameList)
     {
         base.mBuilder.UserNameListList.Add(Util.toSKString(str));
     }
     base.mBuilder.UserCount = (uint)base.mBuilder.UserNameListList.Count;
     //string aa = Util.byteToHexStr(base.mBuilder.Build().ToByteArray());
     base.mSessionPack.mCmdID = 0x47;
     base.endBuilder();
     return(true);
 }
Esempio n. 8
0
 public bool doScene(string strContent, SendCardType type, uint style, string strContentEx = "")
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest     = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.UserName        = AccountMgr.getCurAccount().strUsrName;
     base.mBuilder.Content         = strContent;
     base.mBuilder.SendCardBitFlag = (uint)type;
     base.mBuilder.Style           = style;
     if (type == SendCardType.MM_SENDCARD_READER)
     {
         base.mBuilder.ContentEx = strContentEx;
     }
     base.mSessionPack.mCmdID = 0x2a;
     base.endBuilder();
     return(true);
 }
Esempio n. 9
0
 private void doSceneEx(string account, string password, string password2, string nickName, int bindUin, string bindEmail, string bindMobile, string imgSid, string imgCode, int regMode, string ticket)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0x20);
     base.mBuilder.UserName    = Util.NullAsNil(account);
     base.mBuilder.Pwd         = Util.NullAsNil(password);
     base.mBuilder.NickName    = Util.NullAsNil(nickName);
     base.mBuilder.BindUin     = (uint)bindUin;
     base.mBuilder.BindEmail   = Util.NullAsNil(bindEmail);
     base.mBuilder.BindMobile  = Util.NullAsNil(bindMobile);
     base.mBuilder.RegMode     = (uint)regMode;
     base.mBuilder.SetTicket(Util.NullAsNil(ticket));
     base.mBuilder.Language         = AccountMgr.GetCurrentLanguage();
     base.mBuilder.DLSrc            = 1;
     base.mSessionPack.mCmdID       = 0x20;
     base.mSessionPack.mConnectMode = 2;
     base.endBuilder();
 }
Esempio n. 10
0
 private void doScene(string account, string password, string password2, string nickName, int bindUin, string bindEmail, string bindMobile, string imgSid, string imgCode)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0x1f);
     base.mBuilder.UserName    = Util.toSKString(account);
     base.mBuilder.Pwd         = Util.toSKString(password);
     base.mBuilder.NickName    = Util.toSKString(nickName);
     base.mBuilder.BindUin     = (uint)bindUin;
     base.mBuilder.BindEmail   = Util.toSKString(bindEmail);
     base.mBuilder.BindMobile  = Util.toSKString(bindMobile);
     base.mBuilder.Ticket      = Util.toSKString("");
     base.mBuilder.ImgSid      = Util.toSKString(imgSid);
     base.mBuilder.ImgCode     = Util.toSKString(imgCode);
     base.mBuilder.Pwd2        = password2;
     base.mBuilder.Language    = AccountMgr.GetCurrentLanguage();
     base.mBuilder.DLSrc       = 1;
     base.mSessionPack.mCmdID  = 0x1f;
     base.endBuilder();
 }
Esempio n. 11
0
 private void doSceneMultiEx(List <string> accountList, AddContactScene lastScene, VerifyUserOpCode opCode, string content)
 {
     Log.i("NetSceneVerifyUser", "cmd to verify or add multi contacts , content = " + content);
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
     foreach (string str in accountList)
     {
         Log.i("NetSceneVerifyUser", "verify user  = " + str);
         base.mBuilder.AddVerifyUserList(VerifyUser.CreateBuilder().SetValue(str).Build());
         base.mBuilder.AddSceneList((uint)lastScene);
     }
     base.mBuilder.VerifyUserListSize = (uint)base.mBuilder.VerifyUserListList.Count;
     base.mBuilder.SceneListNum       = (uint)base.mBuilder.SceneListList.Count;
     base.mBuilder.Opcode             = (uint)opCode;
     base.mBuilder.VerifyContent      = content;
     base.mSessionPack.mConnectMode   = 2;
     base.mSessionPack.mCmdID         = 0x2c;
     base.endBuilder();
 }
Esempio n. 12
0
 private void doSceneEx(string account, AddContactScene lastScene, VerifyUserOpCode opCode, string content, string key = "")
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
     if (string.IsNullOrEmpty(key))
     {
         base.mBuilder.AddVerifyUserList(VerifyUser.CreateBuilder().SetValue(account).Build());
     }
     else
     {
         base.mBuilder.AddVerifyUserList(VerifyUser.CreateBuilder().SetValue(account).SetVerifyUserTicket(key).Build());
     }
     base.mBuilder.VerifyUserListSize = (uint)base.mBuilder.VerifyUserListCount;
     base.mBuilder.AddSceneList((uint)lastScene);
     base.mBuilder.SceneListNum     = (uint)base.mBuilder.SceneListCount;
     base.mBuilder.Opcode           = (uint)opCode;
     base.mBuilder.VerifyContent    = content;
     base.mSessionPack.mConnectMode = 1;
     base.mSessionPack.mCmdID       = 0x2c;
     base.endBuilder();
 }
Esempio n. 13
0
 public bool doScene(string appId, string scope, string state)
 {
     if ((string.IsNullOrEmpty(appId) || string.IsNullOrEmpty(scope)) || string.IsNullOrEmpty(state))
     {
         return(false);
     }
     // this.delegateNavigat = navigateToUrl; , DelegateNavigateToUrl navigateToUrl = null
     base.beginBuilder();
     base.mBuilder.BaseRequest      = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.A2Key            = Util.toSKBuffer(AccountMgr.getCurAccount().bytesA2Key);
     base.mBuilder.OpCode           = 1;
     base.mBuilder.ReqUrl           = Util.toSKString("");
     base.mBuilder.Scene            = 6;
     base.mBuilder.AppID            = Util.toSKString(appId);
     base.mBuilder.Scope            = Util.toSKString(scope);
     base.mBuilder.State            = Util.toSKString(state);
     base.mBuilder.FriendUserName   = "";
     base.mSessionPack.mCmdUri      = "/cgi-bin/micromsg-bin/geta8key";
     base.mSessionPack.mConnectMode = 2;
     base.endBuilder();
     return(true);
 }
Esempio n. 14
0
 public bool doScene(string url, GetA8KeyScene scene, GetA8KeyOpCode opCode)
 {
     if (string.IsNullOrEmpty(url))
     {
         return(false);
     }
     //this.delegateNavigat = navigateToUrl; DelegateNavigateToUrl  navigateToUrl = null,
     base.beginBuilder();
     base.mBuilder.BaseRequest    = NetSceneBase.makeBaseRequest(0, 369298705);
     base.mBuilder.A2Key          = Util.toSKBuffer(AccountMgr.getCurAccount().bytesA2Key);
     base.mBuilder.OpCode         = (uint)opCode;
     base.mBuilder.ReqUrl         = Util.toSKString(url);
     base.mBuilder.Scene          = (uint)scene;
     base.mBuilder.AppID          = Util.toSKString("");
     base.mBuilder.Scope          = Util.toSKString("");
     base.mBuilder.FriendUserName = "";
     base.mSessionPack.mCmdUri    = "/cgi-bin/micromsg-bin/geta8key";
     // base.mSessionPack.mConnectMode = 2;
     base.mSessionPack.mCmdID = 155;
     base.endBuilder();
     return(true);
 }
Esempio n. 15
0
 private bool doSceneEx(string userName, string pwd, string pwd2, string imgSid, string imgCode)
 {
     base.beginBuilder();
     mAuthUserName             = userName;
     mAuthUserPwdMD5           = pwd;
     mAuthUserPwd2MD5          = pwd2;
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(1, 369298705);//369298705
     base.mBuilder.UserName    = Util.toSKString(userName);
     base.mBuilder.Pwd         = Util.toSKString(pwd);
     base.mBuilder.Pwd2        = Util.NullAsNil(pwd2);
     base.mBuilder.ImgSid      = Util.toSKString(imgSid);
     base.mBuilder.ImgCode     = Util.toSKString(imgCode);
     base.mBuilder.Channel     = 1;       // AppInfoHelper.ChannelId;
     base.mBuilder.Language    = "zh_CN"; //AccountMgr.GetCurrentLanguage();
     base.mBuilder.DeviceBrand = "";      //DeviceStatus.get_DeviceManufacturer() ?? "";
     base.mBuilder.DeviceModel = "";      //DeviceStatus.get_DeviceName() ?? "";
     base.mBuilder.OSType      = Environment.OSVersion.Version.ToString();
     base.mBuilder.TimeZone    = Util.getTimeZoneOffsetGwt();
     base.mSessionPack.mCmdID  = 1;
     base.endBuilder();
     return(true);
 }
Esempio n. 16
0
 private void doSceneEx(string mobile, string verifyCode, int opCode, int dialFlag, string dialLang, string strUserName = "")
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0, 369298705);
     base.mBuilder.UserName    = strUserName;
     base.mBuilder.Mobile      = mobile;
     base.mBuilder.Opcode      = opCode;
     base.mBuilder.Verifycode  = verifyCode;
     base.mBuilder.DialFlag    = dialFlag;
     base.mBuilder.DialLang    = dialLang;
     base.mBuilder.AuthTicket  = "";
     if (!string.IsNullOrEmpty(AccountMgr.getCurAccount().strAuthTicket))
     {
         base.mBuilder.AuthTicket = AccountMgr.getCurAccount().strAuthTicket;
     }
     base.mBuilder.ForceReg         = 0;
     base.mBuilder.SafeDeviceName   = ""; //SafeDeviceService.getdeviceName();
     base.mBuilder.SafeDeviceType   = ""; //SafeDeviceService.getdeviceType();
     base.mSessionPack.mConnectMode = 2;
     base.mSessionPack.mCmdUri      = "/cgi-bin/micromsg-bin/bindopmobileforreg";
     base.endBuilder();
 }
Esempio n. 17
0
        private bool continueDoScene()
        {
            base.beginBuilder();
            base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(this.mScene);
            base.mBuilder.UserName    = AccountMgr.getCurAccount().strUsrName;
            // string aa = Util.byteToHexStr();
            // base.mBuilder.CurrentSynckey = Util.toSKBuffer(mInitCurrentSynckey);
            base.mBuilder.CurrentSynckey = Util.toSKBuffer(mInitCurrentSynckey);

            base.mBuilder.MaxSynckey = Util.toSKBuffer(mInitMaxSynckey);
            base.mSessionPack.mCmdID = 0x1b;
            base.endBuilder();
            if (this.mInitCount < 100)
            {
                this.mInitCount++;
            }
            else
            {
                Log.d("NetSceneNewInit", "mInitCount exceed the maximum");
            }
            this.mProgress = 10;
            return(true);
        }