Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed #20 fixed #19 fixed #16 fixed #14 fixed #13 fixed #7 #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Builds/Skype4Sharp.dll
Binary file not shown.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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#.

Expand Down
6 changes: 5 additions & 1 deletion Skype4Sharp/ExampleBot/ExampleBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject>
</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>..\Skype4Sharp\bin\Debug\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Skype4Sharp">
<HintPath>..\Skype4Sharp\bin\Debug\Skype4Sharp.dll</HintPath>
<HintPath>..\..\Builds\Skype4Sharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
3 changes: 2 additions & 1 deletion Skype4Sharp/Skype4Sharp/Events/Poller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public void StartPoll()
}
}
}).Start();
/* Outdated
new Thread(() => // Contact Requests
{
runningPolls.Add(Thread.CurrentThread);
Expand Down Expand Up @@ -99,7 +100,7 @@ public void StartPoll()
}
}
}
}).Start();
}).Start();*/
}
public void ProcessPoll(string rawInfo)
{
Expand Down
4 changes: 2 additions & 2 deletions Skype4Sharp/Skype4Sharp/Skype4Sharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\Builds\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -36,7 +36,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
<HintPath>..\..\..\..\..\Skype\Skype4COM\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
12 changes: 11 additions & 1 deletion Skype4Sharp/Skype4Sharp/Skype4SharpCore/AuthModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;

namespace Skype4Sharp.Skype4SharpCore
{
Expand Down Expand Up @@ -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())
{
Expand Down Expand Up @@ -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
)));
}
}
}