Skip to content

Commit

Permalink
解密运动步数
Browse files Browse the repository at this point in the history
  • Loading branch information
dong900512 committed Mar 28, 2019
1 parent 9256f1a commit 270431a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.WxOpen.Entities
{
class DecodedRunData
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#endif
using Senparc.Weixin.Exceptions;
using Senparc.Weixin.Helpers;
using Senparc.Weixin.MP.Sample.Models;
using Senparc.Weixin.WxOpen.Containers;
using Senparc.Weixin.WxOpen.Entities;

Expand Down Expand Up @@ -243,7 +244,24 @@ public static DecodedPhoneNumber DecryptPhoneNumber(string sessionId, string enc
return phoneNumber;

}

/// <summary>
/// 解密微信运动步数
/// </summary>
/// <param name="sessionId"></param>
/// <param name="encryptedData"></param>
/// <param name="iv"></param>
/// <returns></returns>
public static DecodedRunData DecodedRunDataBySessionid(string sessionId, string encryptedData, string iv)
{
var jsonStr = EncryptHelper.DecodeEncryptedDataBySessionId(sessionId, encryptedData, iv);
#if NET45
JavaScriptSerializer js = new JavaScriptSerializer();
var rundateInfo = js.Deserialize<DecodedRunData>(jsonStr);
#else
var rundateInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<DecodedRunData>(jsonStr);
#endif
return rundateInfo;
}
/// <summary>
/// 检查解密消息水印
/// </summary>
Expand Down

0 comments on commit 270431a

Please sign in to comment.