com.taptap.sdk.compliance 4.4.2 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,12 +4,12 @@
4
4
  <repositories>
5
5
  <repository>https://repo.maven.apache.org/maven2</repository>
6
6
  </repositories>
7
- <androidPackage spec="com.taptap.sdk:tap-compliance:4.4.2"/>
7
+ <androidPackage spec="com.taptap.sdk:tap-compliance:4.5.0"/>
8
8
  </androidPackages>
9
9
  <iosPods>
10
10
  <sources>
11
11
  <source>https://github.com/CocoaPods/Specs.git</source>
12
12
  </sources>
13
- <iosPod name="TapTapComplianceSDK" version="~> 4.4.0" bitcodeEnabled="false" addToAllTargets="false"/>
13
+ <iosPod name="TapTapComplianceSDK" version="~> 4.5.0" bitcodeEnabled="false" addToAllTargets="false"/>
14
14
  </iosPods>
15
15
  </dependencies>
@@ -10,7 +10,7 @@ namespace TapSDK.Compliance
10
10
  public static class TapTapCompliance
11
11
  {
12
12
 
13
- public static readonly string Version = "4.4.2";
13
+ public static readonly string Version = "4.5.0";
14
14
 
15
15
  public static void RegisterComplianceCallback(Action<int, string> callback)
16
16
  {
@@ -17,10 +17,6 @@ namespace TapSDK.Compliance
17
17
  get => _moduleName;
18
18
  }
19
19
 
20
- public AndroidJavaObject androidObject =>
21
- new AndroidJavaObject("com.taptap.sdk.compilance.option.TapTapComplianceOptions", showSwitchAccount, useAgeRange);
22
-
23
-
24
20
  internal string clientId;
25
21
 
26
22
 
@@ -152,32 +152,32 @@ namespace TapSDK.Compliance
152
152
  }
153
153
  }
154
154
 
155
- private static async Task<ComplianceCodeData> GetComplianceCode(string clientId, AccessToken token) {
156
- string url = TapTapSdk.CurrentRegion.ApiHost() + "/account/compliance/v1?client_id=" + clientId;
157
- var uri = new Uri(url);
158
- var sign = GetMacToken(token, uri);
159
- var headers = new Dictionary<string, object> {
160
- { "Authorization", sign }
161
- };
162
- ComplianceCodeResponse response = await LoginService.HttpClient.Get<ComplianceCodeResponse>(url, headers: headers);
163
- return response.Data;
164
- }
155
+ // private static async Task<ComplianceCodeData> GetComplianceCode(string clientId, AccessToken token) {
156
+ // string url = TapTapSdk.CurrentRegion.ApiHost() + "/account/compliance/v1?client_id=" + clientId;
157
+ // var uri = new Uri(url);
158
+ // var sign = GetMacToken(token, uri);
159
+ // var headers = new Dictionary<string, object> {
160
+ // { "Authorization", sign }
161
+ // };
162
+ // ComplianceCodeResponse response = await LoginService.HttpClient.Get<ComplianceCodeResponse>(url, headers: headers);
163
+ // return response.Data;
164
+ // }
165
165
 
166
- private static string GetMacToken(AccessToken token, Uri uri, int timestamp = 0) {
167
- var ts = timestamp;
168
- if (ts == 0) {
169
- var dt = DateTime.UtcNow - new DateTime(1970, 1, 1);
170
- ts = (int)dt.TotalSeconds;
171
- }
172
- var sign = "MAC " + LoginService.GetAuthorizationHeader(token.kid,
173
- token.macKey,
174
- token.macAlgorithm,
175
- "GET",
176
- uri.PathAndQuery,
177
- uri.Host,
178
- "443", ts);
179
- return sign;
180
- }
166
+ // private static string GetMacToken(AccessToken token, Uri uri, int timestamp = 0) {
167
+ // var ts = timestamp;
168
+ // if (ts == 0) {
169
+ // var dt = DateTime.UtcNow - new DateTime(1970, 1, 1);
170
+ // ts = (int)dt.TotalSeconds;
171
+ // }
172
+ // var sign = "MAC " + LoginService.GetAuthorizationHeader(token.kid,
173
+ // token.macKey,
174
+ // token.macAlgorithm,
175
+ // "GET",
176
+ // uri.PathAndQuery,
177
+ // uri.Host,
178
+ // "443", ts);
179
+ // return sign;
180
+ // }
181
181
 
182
182
  /// <summary>
183
183
  /// 使用 TapToken 获取实名信息
@@ -5,12 +5,16 @@ using TapSDK.Compliance.Internal;
5
5
  using TapSDK.Compliance.Model;
6
6
  using System.Collections.Generic;
7
7
  using TapSDK.Compliance.Standalone.Internal;
8
+ using TapSDK.Core;
8
9
 
9
10
  namespace TapSDK.Compliance
10
11
  {
11
12
  public sealed class ComplianceNewJob : IComplianceJob
12
13
  {
13
14
  internal bool UseAgeRange = true;
15
+
16
+ // 是否正在处理用户信息,当调用 startup 接口后设置为 true, 当通知游戏回调时设置为 false
17
+ internal volatile bool isCheckingUser = false;
14
18
  private List<Action<int, string>> _externalCallbackList;
15
19
 
16
20
  public List<Action<int, string>> ExternalCallbackList
@@ -84,6 +88,12 @@ namespace TapSDK.Compliance
84
88
 
85
89
  public async void Startup(string userId)
86
90
  {
91
+ // 如果正在处理中,直接返回
92
+ if (isCheckingUser) {
93
+ TapLogger.Debug(" current user is checking so return");
94
+ return;
95
+ }
96
+ isCheckingUser = true;
87
97
  string sessionId = Guid.NewGuid().ToString();
88
98
  TapComplianceTracker.Instance.TrackStart("startup", sessionId);
89
99
  if(TapTapComplianceManager.UserId != null){
@@ -107,8 +117,6 @@ namespace TapSDK.Compliance
107
117
  TapComplianceTracker.Instance.TrackCancel("startup", sessionId);
108
118
  break;
109
119
  }
110
- if (StartUpResult.Contains(code)){
111
- }
112
120
  OnInvokeExternalCallback(code,null);
113
121
  }
114
122
 
@@ -183,6 +191,15 @@ namespace TapSDK.Compliance
183
191
  TapTapComplianceManager.CanPlay = false;
184
192
  break;
185
193
  }
194
+ if (code == StartUpResult.LOGIN_SUCCESS // 通过校验
195
+ || code == StartUpResult.REAL_NAME_STOP // 取消校验
196
+ || code == StartUpResult.EXITED // 登出用户
197
+ || code == StartUpResult.AGE_LIMIT // 年龄限制
198
+ || code == StartUpResult.SWITCH_ACCOUNT // 切换账号
199
+ || code == StartUpResult.INVALID_CLIENT_OR_NETWORK_ERROR) { // 网络异常
200
+ // 用户结束校验流程
201
+ isCheckingUser = false;
202
+ }
186
203
  if (StartUpResult.Contains(code)){
187
204
  if(_externalCallbackList != null){
188
205
  foreach(Action<int, string> callback in _externalCallbackList){
package/package.json CHANGED
@@ -2,11 +2,11 @@
2
2
  "name": "com.taptap.sdk.compliance",
3
3
  "displayName": "TapTapSDK Compliance",
4
4
  "description": "TapTapSDK Compliance",
5
- "version": "4.4.2",
5
+ "version": "4.5.0",
6
6
  "unity": "2019.4",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "com.taptap.sdk.core": "4.4.2",
10
- "com.taptap.sdk.login": "4.4.2"
9
+ "com.taptap.sdk.core": "4.5.0",
10
+ "com.taptap.sdk.login": "4.5.0"
11
11
  }
12
12
  }
package/link.xml DELETED
@@ -1,5 +0,0 @@
1
- <linker>
2
- <assembly fullname="TapSDK.Compliance" preserve="all" />
3
- <assembly fullname="TapSDK.Compliance.Runtime" preserve="all" />
4
- <assembly fullname="TapSDK.Compliance.Mobile.Runtime" preserve="all" />
5
- </linker>
package/link.xml.meta DELETED
@@ -1,7 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 85e09aeb6ba204417a7ea0169ec55a29
3
- TextScriptImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant: