diff --git a/Builds/Skype4Sharp.dll b/Builds/Skype4Sharp.dll index e66a06c..747301d 100644 Binary files a/Builds/Skype4Sharp.dll and b/Builds/Skype4Sharp.dll differ diff --git a/README.md b/README.md index 890f872..d4fcc6e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # Skype4Sharp # Updates -Please consider this lib broken until further notice; as of now, the issue is getting the SkypeToken, which seems to be empty, causing the RegToken function to throw an error. - -It goes much deeper than just the login page changing; Skype's entire API has been overhauled to an extent (although using the same system) as most (if not all) of the endpoints have been changed. I'm running tests, and may release an entirely new build if there is enough demand for it. +Thanks to [XeroxDev](https://xeroxdev.de) for the fast fix! Simple Web Skype implementation for C#. diff --git a/Skype4Sharp/ExampleBot/ExampleBot.csproj b/Skype4Sharp/ExampleBot/ExampleBot.csproj index 9ba26b5..0b391fd 100644 --- a/Skype4Sharp/ExampleBot/ExampleBot.csproj +++ b/Skype4Sharp/ExampleBot/ExampleBot.csproj @@ -31,12 +31,16 @@ prompt 4 + + + + ..\Skype4Sharp\bin\Debug\Newtonsoft.Json.dll - ..\Skype4Sharp\bin\Debug\Skype4Sharp.dll + ..\..\Builds\Skype4Sharp.dll diff --git a/Skype4Sharp/Skype4Sharp/Events/Poller.cs b/Skype4Sharp/Skype4Sharp/Events/Poller.cs index 3f970f0..bd58639 100644 --- a/Skype4Sharp/Skype4Sharp/Events/Poller.cs +++ b/Skype4Sharp/Skype4Sharp/Events/Poller.cs @@ -62,6 +62,7 @@ public void StartPoll() } } }).Start(); + /* Outdated new Thread(() => // Contact Requests { runningPolls.Add(Thread.CurrentThread); @@ -99,7 +100,7 @@ public void StartPoll() } } } - }).Start(); + }).Start();*/ } public void ProcessPoll(string rawInfo) { diff --git a/Skype4Sharp/Skype4Sharp/Skype4Sharp.csproj b/Skype4Sharp/Skype4Sharp/Skype4Sharp.csproj index 1948749..72065fa 100644 --- a/Skype4Sharp/Skype4Sharp/Skype4Sharp.csproj +++ b/Skype4Sharp/Skype4Sharp/Skype4Sharp.csproj @@ -26,7 +26,7 @@ AnyCPU pdbonly true - bin\Release\ + ..\..\Builds\ TRACE prompt 4 @@ -36,7 +36,7 @@ - ..\packages\Newtonsoft.Json.8.0.2\lib\net40\Newtonsoft.Json.dll + ..\..\..\..\..\Skype\Skype4COM\Newtonsoft.Json.dll True diff --git a/Skype4Sharp/Skype4Sharp/Skype4SharpCore/AuthModule.cs b/Skype4Sharp/Skype4Sharp/Skype4SharpCore/AuthModule.cs index 03bba0e..f300767 100644 --- a/Skype4Sharp/Skype4Sharp/Skype4SharpCore/AuthModule.cs +++ b/Skype4Sharp/Skype4Sharp/Skype4SharpCore/AuthModule.cs @@ -4,6 +4,7 @@ using System.Net; using System.Text; using System.Text.RegularExpressions; +using System.Web; namespace Skype4Sharp.Skype4SharpCore { @@ -50,7 +51,7 @@ private string getSkypeToken() return new Regex("type=\"hidden\" name=\"skypetoken\" value=\"(.*?)\"").Match(new StreamReader(webResponse.GetResponseStream()).ReadToEnd()).Groups[1].ToString(); } case Enums.SkypeTokenType.MSNP24: - HttpWebRequest MSNP24TokenRequest = parentSkype.mainFactory.createWebRequest_POST("https://api.skype.com/login/skypetoken", new string[][] { }, Encoding.ASCII.GetBytes(string.Format("scopes=client&clientVersion=0/7.17.0.105//&username={0}&passwordHash={1}", parentSkype.authInfo.Username, Convert.ToBase64String(Helpers.Misc.hashMD5_Byte(string.Format("{0}\nskyper\n{1}", parentSkype.authInfo.Username, parentSkype.authInfo.Password))))), ""); + HttpWebRequest MSNP24TokenRequest = parentSkype.mainFactory.createWebRequest_POST("https://api.skype.com/login/skypetoken", new string[][] { }, Encoding.ASCII.GetBytes(string.Format("scopes=client&clientVersion=0%2F7.4.85.102%2F259%2F&username={0}&passwordHash={1}", HttpUtility.UrlEncode(parentSkype.authInfo.Username.ToLower()), HttpUtility.UrlEncode(CalculateHash(parentSkype.authInfo.Username.ToLower(), parentSkype.authInfo.Password)))), ""); string rawJSON = ""; using (HttpWebResponse webResponse = (HttpWebResponse)MSNP24TokenRequest.GetResponse()) { @@ -114,5 +115,14 @@ private void setProfile() parentSkype.selfProfile.Username = userName; parentSkype.selfProfile.Type = Enums.UserType.Normal; } + + private string CalculateHash(string username, string password) + { + return Convert.ToBase64String(Helpers.Misc.hashMD5_Byte( + string.Format("{0}\nskyper\n{1}", + username, + password + ))); + } } }