react-native-trustdevice 1.1.0 → 1.1.1

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.
Files changed (66) hide show
  1. package/README.md +98 -275
  2. package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  3. package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  6. package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  8. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  9. package/android/.idea/gradle.xml +13 -0
  10. package/android/.idea/misc.xml +14 -0
  11. package/android/.idea/vcs.xml +6 -0
  12. package/android/.idea/workspace.xml +47 -0
  13. package/android/build/.transforms/3d198a7540692ddfa05d95b171264bc8/results.bin +1 -0
  14. package/android/build/.transforms/3d198a7540692ddfa05d95b171264bc8/transformed/classes/classes.dex +0 -0
  15. package/android/build/.transforms/74431a3a20358e468bfc0732882283b0/results.bin +1 -0
  16. package/android/build/.transforms/74431a3a20358e468bfc0732882283b0/transformed/debug/com/trustdevice/BuildConfig.dex +0 -0
  17. package/android/build/.transforms/74431a3a20358e468bfc0732882283b0/transformed/debug/com/trustdevice/TrustdeviceModule$1.dex +0 -0
  18. package/android/build/.transforms/74431a3a20358e468bfc0732882283b0/transformed/debug/com/trustdevice/TrustdeviceModule.dex +0 -0
  19. package/android/build/.transforms/74431a3a20358e468bfc0732882283b0/transformed/debug/com/trustdevice/TrustdevicePackage.dex +0 -0
  20. package/android/build/.transforms/74431a3a20358e468bfc0732882283b0/transformed/debug/com/trustdevice/utils/TDUniRiskUtils.dex +0 -0
  21. package/android/build/.transforms/74431a3a20358e468bfc0732882283b0/transformed/desugar_graph.bin +0 -0
  22. package/android/build/.transforms/a1c8911952ed0abe57a80ce78259f834/results.bin +1 -0
  23. package/android/build/.transforms/a36126f0a42245443eab402f572111df/results.bin +1 -0
  24. package/android/build/.transforms/a36126f0a42245443eab402f572111df/transformed/classes/classes.dex +0 -0
  25. package/android/build/generated/source/buildConfig/debug/com/trustdevice/BuildConfig.java +10 -0
  26. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +7 -0
  27. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +18 -0
  28. package/android/build/intermediates/aar_main_jar/debug/classes.jar +0 -0
  29. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +5 -0
  30. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
  31. package/android/build/intermediates/annotations_typedef_file/debug/typedefs.txt +0 -0
  32. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  33. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  34. package/android/build/intermediates/compile_symbol_list/debug/R.txt +1961 -0
  35. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  36. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  37. package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
  38. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  39. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  40. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  41. package/android/build/intermediates/javac/debug/classes/com/trustdevice/BuildConfig.class +0 -0
  42. package/android/build/intermediates/javac/debug/classes/com/trustdevice/TrustdeviceModule$1.class +0 -0
  43. package/android/build/intermediates/javac/debug/classes/com/trustdevice/TrustdeviceModule.class +0 -0
  44. package/android/build/intermediates/javac/debug/classes/com/trustdevice/TrustdevicePackage.class +0 -0
  45. package/android/build/intermediates/javac/debug/classes/com/trustdevice/utils/TDUniRiskUtils.class +0 -0
  46. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +2 -0
  47. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +8 -0
  48. package/android/build/intermediates/merged_java_res/debug/feature-react-native-trustdevice.jar +0 -0
  49. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +7 -0
  50. package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
  51. package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +18 -0
  52. package/android/build/intermediates/runtime_library_classes_dir/debug/com/trustdevice/BuildConfig.class +0 -0
  53. package/android/build/intermediates/runtime_library_classes_dir/debug/com/trustdevice/TrustdeviceModule$1.class +0 -0
  54. package/android/build/intermediates/runtime_library_classes_dir/debug/com/trustdevice/TrustdeviceModule.class +0 -0
  55. package/android/build/intermediates/runtime_library_classes_dir/debug/com/trustdevice/TrustdevicePackage.class +0 -0
  56. package/android/build/intermediates/runtime_library_classes_dir/debug/com/trustdevice/utils/TDUniRiskUtils.class +0 -0
  57. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  58. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +1454 -0
  59. package/android/build/intermediates/variant_model/debug/variant_model.json +0 -0
  60. package/android/build/outputs/aar/react-native-trustdevice-debug.aar +0 -0
  61. package/android/build/outputs/logs/manifest-merger-debug-report.txt +25 -0
  62. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  63. package/android/build.gradle +1 -1
  64. package/package.json +1 -1
  65. package/ios/TrustDevice.xcodeproj/project.xcworkspace/xcuserdata/lee.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  66. package/ios/TrustDevice.xcodeproj/xcuserdata/lee.xcuserdatad/xcschemes/xcschememanagement.plist +0 -19
package/README.md CHANGED
@@ -6,81 +6,110 @@ Please note that when integrating SDK products provided by the TrustDecision in
6
6
 
7
7
  1.1 According to the user's information protection regulations, before your users start the App for the first time and start collecting information, your company should fully inform the user of the purpose, method, and scope of collecting, using, and sharing the user's personal information with a third party through an interactive interface or design (such as a pop-up window of the privacy policy), and obtain the express consent of the end user.
8
8
 
9
- 1.2 To provide business security and risk control services to your company, the TrustDecision SDK will collect, process, and use the identification information(IMEI/IDFA), AndroidID, IMSI, MEID, MAC address, SIM card serial number, device type, device model, system type, geographical location, login IP address, application list, running process, sensor information(light sensor, gravity sensor, magnetic field sensor, acceleration sensor, gyroscope sensor) and other device information of the user's device. To ensure compliance with your use of related services, the aforementioned privacy policy should cover the authorization of TrustDecision SDK to provide services and collect, process, and use relevant information. The following terms are for your reference. The specific expression can be determined by your company according to the overall framework and content of your privacy agreement:
9
+ 1.2 To provide business security and risk control services to your company, the TrustDecision SDK will collect, process, and use the identification information IDFA, AndroidID, OAID, MAC address, Wireless IP address, WIFI list, wireless router identification (BSSID, SSID),device type, device model, system type, geographical location(Rough location information, precise location information), login IP address and other device information of the user's device. To ensure compliance with your use of related services, the aforementioned privacy policy should cover the authorization of TrustDecision SDK to provide services and collect, process, and use relevant information. The following terms are for your reference. The specific expression can be determined by your company according to the overall framework and content of your privacy agreement:
10
10
 
11
11
  <table border="1">
12
12
  <tr>
13
- <td style="background-color:#FAFAFA"><font size="2">TrustDecision SDK: For business security and risk control, our company uses the TrustDecision SDK. The SDK needs to obtain the information of your devices, such as (IMEI/IDFA), AndroidID, IMSI, MAC address, SIM card serial number, device type, device model, system type, geographic location, login IP address, application list, running process, sensor information(light sensor, gravity sensor, magnetic field sensor, acceleration sensor, gyroscope sensor) and other related device information, for fraud risk identification.</font></td>
13
+ <td style="background-color:#FAFAFA"><font size="2">TrustDecision SDK: For business security and risk control, our company uses the TrustDecision SDK. The SDK needs to obtain the information of your devices, such as IDFA, AndroidID, OAID, GAID,MAC address, Wireless IP address, WIFI list, wireless router identification (BSSID, SSID),device type, device model, system type, geographical location(Rough location information, precise location information), login IP address, application list, running process, network type,device software version,sensor information(light sensor, gravity sensor, magnetic field sensor, acceleration sensor, gyroscope sensor) and other related device information, for fraud risk identification.</font></td>
14
14
  </tr>
15
15
  </table>
16
16
 
17
- **Privacy Protocol:** [https://www.trustdecision.com/legal/privacy-policy](https://www.trustdecision.com/legal/privacy-policy)
17
+ **Privacy Protocol:** <https://www.trustdecision.com/legal/privacy-policy>
18
18
 
19
- **Precautions**
19
+ ## Environment
20
20
 
21
- When the installation starts for the first time, the SDK initialization is performed after the user agrees with the privacy agreement.
22
- Avoid SDK initialization collection without the user agreeing to the privacy agreement, causing compliance risk accidents.
21
+ | | Android | iOS |
22
+ | ------------------------- | ------------------------------------ | :----------------- |
23
+ | Supported System Versions | Android 5.0 and above | iOS 9.0 and above |
24
+ | Supported Architectures | armeabi, armeabi-v7a, arm64-v8a, x86 | armv7,arm64,x86_64 |
23
25
 
26
+ # Integrate
24
27
 
25
- # Integrate Steps
28
+ ## Install
26
29
 
27
- ## Integrated SDK
30
+ ### Plugin Install
28
31
 
29
- Execute in your react native project root directory
32
+ Please execute in your react native project root directory
30
33
 
34
+ ```shell
35
+ npm install --save react-native-trustdevice@1.1.1
31
36
  ```
32
37
 
33
- npm install --save react-native-trustdevice@1.1.0
34
-
35
- ```
36
-
37
- ### iOS
38
-
39
- Update cocoapods
40
-
41
- ```
42
- npx pod-install
43
- ```
44
-
45
- ## Android permission application
38
+ ### AndroidManifest.xml
46
39
 
47
40
  Declare the following permissions in the AndroidManifest.xml file under the application module
48
41
 
49
42
  ```xml
50
43
  <manifest>
51
- <!--Compulsory permissions-->
44
+ <!-- required -->
52
45
  <uses-permission android:name="android.permission.INTERNET"/>
53
46
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
54
47
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
48
+ <!-- Outside the Chinese Mainland -->
49
+ <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
55
50
 
56
- <!--The following permissions are optional. If this part of the authority is not declared, the acquisition of some device information will be abandoned, which will have a certain effect on data analysis and the accuracy of the fingerprint of the device fingerprint-->
57
- <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
58
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
51
+ <!--optional, If not declared, some device information will be abandoned -->
59
52
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
53
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
60
54
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
61
- <!-- This permission is required for Android 11 and above to obtain the installation package list. Collecting the installation package list involves risk and compliance. Whether this permission is required is optional for the business party
62
- select -->
63
- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
55
+ <!-- required for Android 11 and above to obtain the installed packages -->
56
+ <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
57
+ tools:ignore="QueryAllPackagesPermission" />
64
58
  </manifest>
65
59
  ```
66
60
 
67
- Dynamic application permissions: Android 6.0 or above requires dynamic application permissions. Dynamic application permissions code must be placed before the initial.
61
+ ### Permissions
62
+
63
+ | Name | Description |
64
+ | ---------------------------------- | ------------------------------------------------------------------------------------------------- |
65
+ | **INTERNET**(required) | Allows the app to access the network connection and send requests to communicate with the server. |
66
+ | **ACCESS_NETWORK_STATE**(required) | Collect network connection status information. |
67
+ | **ACCESS_WIFI_STATE**(required) | Collect the current WiFi access status and WLAN hotspot information. |
68
+ | **AD_ID**(required) | Collect the Google advertising ID, required outside the Chinese Mainland. |
69
+ | ACCESS_COARSE_LOCATION | Get location information, with an accuracy of approximately 30 to 1500 meters. |
70
+ | ACCESS_FINE_LOCATION | Get location information, with positioning accuracy within 10 meters. |
71
+ | READ_PHONE_STATE | Collect information on SIM card |
72
+ | QUERY_ALL_PACKAGES | Collect installed packages |
68
73
 
69
74
  ## Initialization
70
75
 
76
+ ### Cautions
71
77
 
72
- ## get TrustDevice Module
78
+ - Ensure that it is initialized after the user agrees to the privacy agreement.
73
79
 
80
+ ### Definition
74
81
 
82
+ ```tsx
83
+ async function initWithOptions(options: {[key: string]: any})
75
84
  ```
76
- const TrustDevice = NativeModules.TrustDevice;
77
85
 
86
+ ## Get blackBox
87
+
88
+ ### Cautions
89
+
90
+ - Call `getBlackBox` after `initWithOptions`.
91
+ - Don't cache blackBox returned by getBlackBox in the app. Please rely on this function to get blackBox.
92
+
93
+ ### Definition
94
+
95
+ ```tsx
96
+ // get by synchronous call
97
+ async function getBlackBox();
98
+ // get by asynchronous call
99
+ async function getBlackBoxAsync();
78
100
  ```
79
101
 
80
- **Sample Code**
102
+ ## Best Practices
81
103
 
104
+ 1. Get TrustDevice Module
105
+
106
+ ```tsx
107
+ const TrustDevice = NativeModules.TrustDevice;
82
108
  ```
83
109
 
110
+ 2. Initialize and get blackBox
111
+
112
+ ```tsx
84
113
  async function initWithOptions() {
85
114
 
86
115
  var options = {
@@ -98,260 +127,54 @@ Dynamic application permissions: Android 6.0 or above requires dynamic applicati
98
127
  }
99
128
 
100
129
  TrustDevice.initWithOptions(options);
130
+ const blackBox = await TrustDevice.getBlackBoxAsync()
101
131
  }
102
-
103
-
104
132
  ```
105
133
 
106
- **Required Configuration**
107
-
108
- <table>
109
- <tr>
110
- <th>Key</th>
111
- <th>Definition</th>
112
- <th>Description</th>
113
- <th>Platform</th>
114
- <th>Sample code</th>
115
- </tr>
116
- <tr>
117
- <td>partner</td>
118
- <td>Partner code </td>
119
- <td>Partner, please contact TrustDecision to obtain</td>
120
- <td>All</td>
121
- <td>
122
- options["partner"] = "[Your partner]"
123
- </td>
124
- </tr>
125
- <tr>
126
- <td>appKey</td>
127
- <td>App key</td>
128
- <td>Appkey, please offer your App bundleId for TrustDecision to obtain<br>
129
- appkey creation requires the user to provide the application bundleId.<br>
130
- ⚠️ Different values for bundleId are used for different applications
131
- </td>
132
- <td>All</td>
133
- <td>
134
- options["appKey"] = "[Your appKey]"
135
- </td>
136
- </tr>
137
- <tr>
138
- <td>appName</td>
139
- <td>App name</td>
140
- <td>AppName, please contact TrustDecision to obtain</td>
141
- <td>All</td>
142
- <td>
143
- options["appName"] = "[Your appName]"
144
- </td>
145
- </tr>
146
- <tr>
147
- <td>country</td>
148
- <td> Country code</td>
149
- <td> cn: means China;<br>sg: means Singapore;<br>us: means North America;<br>fra: means Europe</td>
150
- <td>All</td>
151
- <td>
152
- options["country"] = "[Your country code]"
153
- </td>
154
- </tr>
155
- </table>
156
-
157
-
158
- ## Get SDK Version
159
-
160
- Sample Code
161
-
162
- ```
163
- // Get SDK Version
164
- async function getSDKVersion() {
165
- const version = await TrustDevice.getSDKVersion();
166
- console.log(version);
167
- }
168
- ```
134
+ 3. Obtain blackBox in actual business scenarios
169
135
 
170
- ## Other Instructions
171
-
172
- Android obfuscated packaging If developers need to use proguard for obfuscated packaging, please add the following code to the proguard configuration file:
173
-
174
- ```java
175
- -keep class cn.tongdun.**{*;}
176
- ```
177
-
178
- # Fingerprint
179
-
180
- ## initWithOptions Optional Parameter
181
-
182
- <table>
183
- <tr>
184
- <th>Key</th>
185
- <th>Definition</th>
186
- <th>Description</th>
187
- <th>Platform</th>
188
- <th>Sample code</th>
189
- </tr>
190
- <tr>
191
- <td>debug</td>
192
- <td>Whether allow debug</td>
193
- <td>default is false,After the SDK is integrated, the app has the anti-debugging function by default. <br><b>Develop: </b>Please set value to true.<br><b>Release: </b>Please not set this key or set value to false <br><b>Options:</b><br>true: allow debug;<br>false: not allow debug</td>
194
- <td>All</td>
195
- <td>
196
- options["debug"] = true
197
- </td>
198
- </tr>
199
- <tr>
200
- <td>timeLimit</td>
201
- <td>SDK timeout interval Configuration (unit: seconds)</td>
202
- <td>Timeout interval of network request callback after SDK initialization. Default is 15s.</td>
203
- <td>All</td>
204
- <td>
205
- options["timeLimit"] = 5
206
- </td>
207
- </tr>
208
- <tr>
209
- <td>location</td>
210
- <td>Whether collect location information</td>
211
- <td>default is true,SDK will collect location if the app has been authorized to get location information. <br><b>Options:</b><br>true: allow collect location information;<br>false: not allow collect location information</td>
212
- <td>All</td>
213
- <td>
214
- options["location"] = true
215
- </td>
216
- </tr>
217
- <tr>
218
- <td>collectLevel</td>
219
- <td>Degraded blackbox length configuration</td>
220
- <td>Degraded blackbox will be longer. This configuration allows you to control the length of the degraded blackbox. <br><b>Options:</b><br>"M": After setting, the degraded blackbox length is about 2000 characters;<br>"L": default value, after setting, the degraded length is about 5000 characters</td>
221
- <td>All</td>
222
- <td>
223
- options["collectLevel"] = "M"
224
- </td>
225
- </tr>
226
- <tr>
227
- <td>IDFA</td>
228
- <td>Whether collect Advertising Identifier (IDFA) information</td>
229
- <td>default is true,SDK will collect IDFA information if the app has been authorized to get IDFA information. <br><b>Options:</b><br>true: allow collect IDFA information;<br>false: not allow collect IDFA information</td>
230
- <td>iOS</td>
231
- <td>
232
- options["IDFA"] = true
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>deviceName</td>
237
- <td>Whether collect device's name information</td>
238
- <td>default is true,SDK will collect device's name information. <br><b>Options:</b><br>true: allow collect device's name information;<br>false: not allow collect device's name information</td>
239
- <td>iOS</td>
240
- <td>
241
- options["deviceName"] = true
242
- </td>
243
- </tr>
244
- <tr>
245
- <td>blackBoxMaxSize</td>
246
- <td>blackbox maximum length</td>
247
- <td>The default length is Integer.MAX_VALUE, it will increase according to the actual device situation </td>
248
- <td>Android</td>
249
- <td>
250
- options["blackBoxMaxSize"] = 3000
251
- </td>
252
- </tr>
253
- <tr>
254
- <td>customProcessName</td>
255
- <td>custom process name</td>
256
- <td>change the name of the SDK's process</td>
257
- <td>Android</td>
258
- <td>
259
- options["customProcessName"] = "td"
260
- </td>
261
- </tr>
262
- <tr>
263
- <td>forceTLSVersion</td>
264
- <td>Whether https is mandatory to use TLS-v1.1 version</td>
265
- <td>default is false, and the developer can set the corresponding settings according to the specific situation. <br><b>Options:</b><br>true: use TLS-v1.1 version;<br>false: not use TLS-v1.1 version</td>
266
- <td>Android</td>
267
- <td>
268
- options["forceTLSVersion"] = true
269
- </td>
270
- </tr>
271
- <tr>
272
- <td>runningTasks</td>
273
- <td>Whether allow getting running tasks</td>
274
- <td>default is true. <br><b>Options:</b><br>true: allow getting running tasks;<br>false: not allow getting running tasks</td>
275
- <td>Android</td>
276
- <td>
277
- options["runningTasks"] = true
278
- </td>
279
- </tr>
280
- <tr>
281
- <td>sensor</td>
282
- <td>Whether collect sensor information</td>
283
- <td>default is true,SDK will collect sensor-related information. <br><b>Options:</b><br>true: collect sensor information;<br>false: not collect sensor information</td>
284
- <td>Android</td>
285
- <td>
286
- options["sensor"] = true
287
- </td>
288
- </tr>
289
- <tr>
290
- <td>readPhone</td>
291
- <td>Whether collect READ_PHONE_STATE related information</td>
292
- <td>default is true,SDK will collect READ_PHONE_STATE information if app gained READ_PHONE_STATE permission<br><b>Options:</b><br>true: collect READ_PHONE_STATE related information;<br>false: not collect READ_PHONE_STATE related information</td>
293
- <td>Android</td>
294
- <td>
295
- options["readPhone"] = true
296
- </td>
297
- <tr>
298
- <td>installPackageList</td>
299
- <td>Whether collect the list of installation packages</td>
300
- <td>default is true,SDK will collect the list of installation packages.
301
- <br><b>Options:</b><br>true: collect the list of installation packages;<br>false: not collect the list of installation packages</td>
302
- <td>Android</td>
303
- <td>
304
- options["installPackageList"] = true
305
- </td>
306
- </tr>
307
- </table>
308
-
309
-
310
- ## Get Blackbox
311
-
312
- **Attention**
313
-
314
- - Please `getBlackBox` after `initWithOptions`, otherwise SDK exceptions will be caused.
315
- - We suggest that developers do not cache the results returned by `getBlackBox` in the app. Please rely on this function to get blackbox.
316
-
317
- ### Synchronous method getBlackBox
318
-
319
- #### Usage Scenario Description
320
-
321
- **Advantages:** The blackBox will be returned immediately, not affected by the network status;<br/> **Disadvantages:** After the device fingerprint SDK is integrated, if the non-degraded blackBox has not been obtained before, it will return to the degraded blackBox will increase the amount of data uploaded by the subsequent query interface, and the data size is about 5000 bytes;<br/>**Applicable scenarios:** Scenes where blackBox needs to be obtained immediately;<br/>
322
-
323
- **Sample Code**
324
-
325
- ```
326
- async function getBlackBox() {
136
+ ```tsx
137
+ async function register() {
327
138
  const blackBox = await TrustDevice.getBlackBox()
328
- console.log(blackBox);
139
+ // ...
329
140
  }
330
141
  ```
331
142
 
332
- ### Asynchronous method getBlackBoxAsync
143
+ ## Status Check
333
144
 
145
+ 1. getBlackBox() will return a 26-bit string while initialization successfully: `rGPGX1678775227I9NCwcuVJCb`。
146
+ 2. getBlackBox() will return a string of around 5000 bits while initialization Failed, please refer to [overview-definition](https://en-doc.trustdecision.com/reference/terminal-sdk-overview-2-0-en)
334
147
 
335
- #### Usage Scenario Description
148
+ # Other
336
149
 
337
- **Advantages:** Under normal circumstances, the network returns a non-degraded blackBox, which will reduce the amount of data uploaded by the subsequent query interface, and the data size is about 26 bytes;<br/>**Disadvantages:** Not returned immediately, according to the network It usually takes about 300ms to return;<br/> **Applicable scenario:** Need to get the latest and non-degraded blackBox scenario;<br/>
338
-
339
- **Sample Code**
150
+ ## Get SDK Version
340
151
 
152
+ ```tsx
153
+ async function getSDKVersion();
341
154
  ```
342
- async function getBlackBoxAsync() {
343
- const blackBox = await TrustDevice.getBlackBoxAsync()
344
- console.log(blackBox);
345
- }
346
- ```
347
-
348
- # FAQ
349
155
 
350
- **Q1**:After Integrating the TrustDecision SDK, the project cannot be debugged in Xcode. How to solve it?
351
-
352
- **A1**:Please refer to [Initialization](#initialization) When the TrustDecision SDK is initialized, add the following parameters
353
-
354
- ```
355
- options["debug"] = true
356
- ```
156
+ ## Keep Configuration
357
157
 
158
+ ```xml
159
+ -keep class cn.tongdun.**{*;}
160
+ -keep class com.trustdecision.**{*;}
161
+ ```
162
+
163
+ ## All Configuration
164
+
165
+ | Key | Description | 平台 | Sample |
166
+ | ------------------ | ----------------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------ |
167
+ | partner(required) | Partner code, contact operator to obtain. | All | options["partner"] = "your partner" |
168
+ | appKey(required) | Application identification, please refer to[how to get appKey](https://en-doc.trustdecision.com/reference/android-get-appkey) | All | options["appKey"] = "your appKey" |
169
+ | country(required) | Data-center: **cn** for China **fra** for Europe **sg** for Singapore **inda** for Indonesia **us** for the USA | All | options["country"] = "your country" |
170
+ | appName | Application name, contact operator to obtain | All | options["appName"] = "your appName" |
171
+ | debug | Allow debugging, default false, must be closed before the application release. | All | options["debug"] = true |
172
+ | timeLimit | Network timeout configuration, in seconds, default 15s | All | options["timeLimit"] = 5 |
173
+ | location | whether collecting GPS location information, default allowed | All | options["location"] = true |
174
+ | collectLevel | You can set M to control the maximum length of blackBox to 2000, default around 5000 | All | options["collectLevel"] = "M" |
175
+ | IDFA | Whether collecting IDFA information, default allowed | iOS | options["IDFA"] = true |
176
+ | deviceName | Whether collecting device name, default allowed | iOS | options["deviceName"] = true |
177
+ | runningTasks | Whether collecting running tasks, default allowed | Android | options["runningTasks"] = true |
178
+ | sensor | Whether collecting sensor information, default allowed | Android | options["sensor"] = true |
179
+ | readPhone | Whether collecting READ _PHONE_ STATE permission-related information, default allowed | Android | options["readPhone"] = true |
180
+ | installPackageList | Whether collecting application list information, default allowed | Android | options["installPackageList"] = true |
@@ -0,0 +1,2 @@
1
+ #Tue Jul 16 13:55:59 CST 2024
2
+ gradle.version=7.5.1
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="GradleSettings">
4
+ <option name="linkedExternalProjectsSettings">
5
+ <GradleProjectSettings>
6
+ <option name="testRunner" value="GRADLE" />
7
+ <option name="distributionType" value="DEFAULT_WRAPPED" />
8
+ <option name="externalProjectPath" value="$PROJECT_DIR$" />
9
+ <option name="gradleJvm" value="jbr-17" />
10
+ </GradleProjectSettings>
11
+ </option>
12
+ </component>
13
+ </project>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ASMIdeaPluginConfiguration">
4
+ <asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
5
+ <groovy codeStyle="LEGACY" />
6
+ </component>
7
+ <component name="ExternalStorageConfigurationManager" enabled="true" />
8
+ <component name="ProjectRootManager" version="2" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
9
+ <output url="file://$PROJECT_DIR$/build/classes" />
10
+ </component>
11
+ <component name="ProjectType">
12
+ <option name="id" value="Android" />
13
+ </component>
14
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,47 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="AutoImportSettings">
4
+ <option name="autoReloadType" value="NONE" />
5
+ </component>
6
+ <component name="ChangeListManager">
7
+ <list default="true" id="2e165b33-73fa-443a-9471-8d800bcc964e" name="Changes" comment="">
8
+ <change beforePath="$PROJECT_DIR$/../README.md" beforeDir="false" afterPath="$PROJECT_DIR$/../README.md" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/../index.js" beforeDir="false" afterPath="$PROJECT_DIR$/../index.js" afterDir="false" />
10
+ <change beforePath="$PROJECT_DIR$/../package.json" beforeDir="false" afterPath="$PROJECT_DIR$/../package.json" afterDir="false" />
11
+ </list>
12
+ <option name="SHOW_DIALOG" value="false" />
13
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
14
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
15
+ <option name="LAST_RESOLUTION" value="IGNORE" />
16
+ </component>
17
+ <component name="Git.Settings">
18
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." />
19
+ </component>
20
+ <component name="ProjectId" id="2jJdwuxlHeleUdJVKTgxmiSc6PL" />
21
+ <component name="ProjectViewState">
22
+ <option name="showLibraryContents" value="true" />
23
+ <option name="showMembers" value="true" />
24
+ </component>
25
+ <component name="PropertiesComponent"><![CDATA[{
26
+ "keyToString": {
27
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
28
+ "RunOnceActivity.ShowReadmeOnStart": "true",
29
+ "RunOnceActivity.cidr.known.project.marker": "true",
30
+ "android.gradle.sync.needed": "true",
31
+ "cidr.known.project.marker": "true",
32
+ "dart.analysis.tool.window.visible": "false",
33
+ "show.migrate.to.gradle.popup": "false"
34
+ }
35
+ }]]></component>
36
+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
37
+ <component name="TaskManager">
38
+ <task active="true" id="Default" summary="Default task">
39
+ <changelist id="2e165b33-73fa-443a-9471-8d800bcc964e" name="Changes" comment="" />
40
+ <created>1721109356557</created>
41
+ <option name="number" value="Default" />
42
+ <option name="presentableId" value="Default" />
43
+ <updated>1721109356557</updated>
44
+ </task>
45
+ <servers />
46
+ </component>
47
+ </project>
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Automatically generated file. DO NOT MODIFY
3
+ */
4
+ package com.trustdevice;
5
+
6
+ public final class BuildConfig {
7
+ public static final boolean DEBUG = Boolean.parseBoolean("true");
8
+ public static final String LIBRARY_PACKAGE_NAME = "com.trustdevice";
9
+ public static final String BUILD_TYPE = "debug";
10
+ }
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.trustdevice" >
4
+
5
+ <uses-sdk android:minSdkVersion="21" />
6
+
7
+ </manifest>
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": 3,
3
+ "artifactType": {
4
+ "type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
5
+ "kind": "Directory"
6
+ },
7
+ "applicationId": "com.trustdevice",
8
+ "variantName": "debug",
9
+ "elements": [
10
+ {
11
+ "type": "SINGLE",
12
+ "filters": [],
13
+ "attributes": [],
14
+ "outputFile": "AndroidManifest.xml"
15
+ }
16
+ ],
17
+ "elementType": "File"
18
+ }
@@ -0,0 +1,5 @@
1
+ aarFormatVersion=1.0
2
+ aarMetadataVersion=1.0
3
+ minCompileSdk=1
4
+ minCompileSdkExtension=0
5
+ minAndroidGradlePluginVersion=1.0.0