コード例 #1
0
ファイル: NetSceneBase.cs プロジェクト: kxlcn/android-weixin
        //1678050096
        //1711278097
        public static BaseRequest makeBaseRequest(int scene, int version = 1711278097)
        {
            BaseRequest.Builder builder = BaseRequest.CreateBuilder();
            Account             account = AccountMgr.getCurAccount();

            if (account.nUin == 0)
            {
                byte[] bytes = new byte[0x24];
                builder.SessionKey = ByteString.CopyFrom(bytes);
                builder.Uin        = 0;
            }
            else
            {
                builder.SessionKey = ByteString.CopyFrom(account.bytesSessionkey);
                builder.Uin        = account.nUin;
            }
            builder.DeviceID = ByteString.CopyFromUtf8(Util.getDeviceUniqueId());
            // builder.ClientVersion =(int)ConstantsProtocol.CLIENT_VERSION;
            // builder.DeviceID = ByteString.CopyFrom(Util.getDeviceUniqueId());
            builder.ClientVersion = version;
            builder.DeviceType    = ByteString.CopyFromUtf8(ConstantsProtocol.DEVICE_TYPE);//ByteString.CopyFrom(Util.toFixLenString(ConstantsProtocol.DEVICE_TYPE, 0x84));
            builder.Scene         = (uint)scene;
            //  Log.e("BaseRequest", " hex deviceid " + Util.byteToHexStr(builder.Build().ToByteArray()));
            return(builder.Build());
        }
コード例 #2
0
 public static BaseRequest CreateBaseRequestEntity(string deviceID, string sessionKey, uint uIn, string osType, int scene)
 {
     BaseRequest.Builder builder = new BaseRequest.Builder();
     builder.SetSessionKey(ByteString.CopyFrom(sessionKey, Encoding.Default));
     builder.SetUin(uIn);
     byte[] array = new byte[16];
     array = Encoding.Default.GetBytes(deviceID + "\0");
     builder.SetDeviceID(ByteString.CopyFrom(array));
     builder.SetClientVersion(637929271);
     builder.SetDeviceType(ByteString.CopyFrom(osType, Encoding.Default));
     builder.SetScene(scene);
     return(builder.Build());
 }
コード例 #3
0
 public static BaseRequest GetBasePack(byte[] sessionKey, long uin = 0, int Scene = 0)
 {
     BaseRequest.Builder pack = new BaseRequest.Builder();
     byte[] deviceid          = "49aa7db2f4a3ffe0e96218f6b92cde32".ToByteArray(16, 2);
     pack.SetDeviceID(ByteString.CopyFrom(deviceid));
     pack.SetDeviceType(ByteString.CopyFromUtf8("iPad iPhone OS8.4"));
     pack.SetScene(Scene);
     pack.SetSessionKey(ByteString.CopyFrom(sessionKey));
     Console.WriteLine(uin);
     Console.WriteLine((uint)uin);
     pack.SetUin((uint)uin);
     pack.SetClientVersion(0x16070124);
     return(pack.Build());
 }
コード例 #4
0
ファイル: GoogleProto.cs プロジェクト: kxlcn/android-weixin
        public static BaseRequest CreateBaseRequestEntity(string deviceID, string sessionKey, uint uIn, string osType, int scene)
        {
            BaseRequest.Builder brb = new BaseRequest.Builder();
            byte[] byt = new byte[36];
            brb.SetSessionKey(ByteString.CopyFrom(sessionKey, Encoding.Default));
            brb.SetUin(uIn);
            byte[] bytSD = new byte[16];
            bytSD = Encoding.Default.GetBytes(deviceID + "\x00");
            brb.SetDeviceID(ByteString.CopyFrom(bytSD));
            brb.SetClientVersion(VERSION);
            brb.SetDeviceType(ByteString.CopyFrom(osType, Encoding.Default));
            brb.SetScene(scene);
            BaseRequest br = brb.Build();

            return(br);
        }
コード例 #5
0
ファイル: AuthPack.cs プロジェクト: kxlcn/android-weixin
        //¶þ´ÎµÇ½
        private static NewAuthRequest makeAuthRequest(int scene)
        {
            if (!SessionPackMgr.getAccount().isValid())
            {
                return(null);
            }
            BaseRequest defaultInstance = BaseRequest.DefaultInstance;

            BaseRequest.Builder builder = BaseRequest.CreateBuilder();
            //builder.SessionKey = ByteString.CopyFrom(SessionPackMgr.getSessionKeyEx());
            builder.SessionKey    = ByteString.CopyFrom(SessionPackMgr.getAccount().SessionKey);
            builder.Uin           = (uint)SessionPackMgr.getAccount().getUin();
            builder.DeviceID      = ByteString.CopyFromUtf8(Util.getDeviceUniqueId());
            builder.ClientVersion = (int)ConstantsProtocol.CLIENT_MIN_VERSION;
            builder.DeviceType    = ByteString.CopyFromUtf8(ConstantsProtocol.DEVICE_TYPE);
            builder.Scene         = (uint)scene;
            defaultInstance       = builder.Build();

            NewAuthRequest.Builder builder2 = NewAuthRequest.CreateBuilder();
            builder2.BaseRequest = defaultInstance;
            builder2.UserName    = Util.toSKString(SessionPackMgr.getAccount().getUsername());
            builder2.Pwd         = Util.toSKString(SessionPackMgr.getAccount().getPassword());
            // builder2.Pwd2 = Util.NullAsNil("");
            builder2.ImgSid       = Util.toSKString("");
            builder2.ImgCode      = Util.toSKString("");
            builder2.Channel      = 0;// AppInfoHelper.ChannelId;
            builder2.InputType    = 0;
            builder2.TimeStamp    = Convert.ToUInt32(Util.getNowSeconds().ToString().Substring(0, 10));
            builder2.BuiltinIPSeq = 0;
            //builder2.WTLoginReqBuff = Util.toSKBuffer("");
            //builder2.BundleID = "com.tencent.xin";
            builder2.DeviceName = "Apple Watch";

            builder2.DeviceType     = ConstantsProtocol.DEVICE_TYPE;
            builder2.AutoAuthTicket = SessionPackMgr.getAccount().AutoAuthKey;
            builder2.Language       = "zh_CN"; //AccountMgr.GetCurrentLanguage();
            builder2.DeviceBrand    = "Apple"; //DeviceStatus.get_DeviceManufacturer() ?? "";
            builder2.RealCountry    = "CN";    //DeviceStatus.get_DeviceManufacturer() ?? "";
            builder2.DeviceModel    = "";      //DeviceStatus.get_DeviceName() ?? "";
            builder2.RandomEncryKey = Util.toSKBuffer(new byte[] { 104, 84, 125, 199, 142, 226, 48, 218, 83, 195, 3, 84, 3, 123, 208, 162 });
            builder2.OSType         = "8.10.12393.0";
            builder2.TimeZone       = "8.00";

            Log.i("Network", "Old AutoAuthTicket = " + SessionPackMgr.getAccount().AutoAuthKey);
            Util.WriteLog("Old AutoAuthTicket = " + SessionPackMgr.getAccount().AutoAuthKey);
            return(builder2.Build());
        }
コード例 #6
0
ファイル: GoogleProto.cs プロジェクト: wuxs/WechatHelper7010
        public static BaseRequest CreateBaseRequestEntity(string deviceID, string osType, int scene, int version)
        {
            BaseRequest.Builder brb = new BaseRequest.Builder();
            byte[] byt = new byte[0];
            brb.SetSessionKey(ByteString.CopyFrom(byt));
            brb.SetUin(0);
            byte[] bytSD = new byte[16];
            bytSD = Encoding.Default.GetBytes(deviceID + "\x00");
            brb.SetDeviceID(ByteString.CopyFrom(bytSD));
            brb.SetClientVersion(version);
            //osType = "iPad iPhone OS7.0.3";
            brb.SetDeviceType(ByteString.CopyFrom(osType, Encoding.Default));
            brb.SetScene(scene);
            BaseRequest br = brb.Build();

            return(br);
        }