@digitalshieldfe/react-native-backup-card-sdk 0.1.4 → 0.1.6

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 (115) hide show
  1. package/android/build.gradle +33 -49
  2. package/android/libs/backupcardsdk.aar +0 -0
  3. package/android/src/main/AndroidManifest.xml +1 -4
  4. package/android/src/main/java/com/ziancube/reactnativebackupcardsdk/BackupCardSdkModule.kt +244 -74
  5. package/android/src/main/java/com/ziancube/reactnativebackupcardsdk/BackupCardSdkPackage.kt +1 -1
  6. package/android/src/main/java/com/ziancube/reactnativebackupcardsdk/nfc/NfcExceptions.kt +11 -0
  7. package/android/src/main/java/com/ziancube/reactnativebackupcardsdk/nfc/NfcUtils.kt +30 -0
  8. package/android/src/main/java/com/ziancube/reactnativebackupcardsdk/utils/MiUtil.kt +74 -0
  9. package/android/src/main/java/com/ziancube/reactnativebackupcardsdk/utils/NfcPermissionUtils.kt +23 -0
  10. package/lib/module/NativeBackupCardSdk.js +3 -0
  11. package/lib/module/NativeBackupCardSdk.js.map +1 -1
  12. package/lib/module/cardOperations.js +27 -0
  13. package/lib/module/cardOperations.js.map +1 -0
  14. package/lib/module/index.js +2 -0
  15. package/lib/module/index.js.map +1 -1
  16. package/lib/module/nfc.js +75 -0
  17. package/lib/module/nfc.js.map +1 -0
  18. package/lib/typescript/src/NativeBackupCardSdk.d.ts +50 -4
  19. package/lib/typescript/src/NativeBackupCardSdk.d.ts.map +1 -1
  20. package/lib/typescript/src/cardOperations.d.ts +7 -0
  21. package/lib/typescript/src/cardOperations.d.ts.map +1 -0
  22. package/lib/typescript/src/index.d.ts +5 -2
  23. package/lib/typescript/src/index.d.ts.map +1 -1
  24. package/lib/typescript/src/nfc.d.ts +28 -0
  25. package/lib/typescript/src/nfc.d.ts.map +1 -0
  26. package/package.json +7 -5
  27. package/src/NativeBackupCardSdk.ts +62 -4
  28. package/src/cardOperations.ts +61 -0
  29. package/src/index.tsx +22 -2
  30. package/src/nfc.ts +74 -0
  31. package/android/consumer-rules.pro +0 -0
  32. package/android/proguard-rules.pro +0 -21
  33. package/android/src/main/java/com/ziancube/backupcardsdk/BackupCardSdk.kt +0 -478
  34. package/android/src/main/java/com/ziancube/backupcardsdk/GPChannelNatives.java +0 -41
  35. package/android/src/main/java/com/ziancube/backupcardsdk/listener/ApiAsyncListener.java +0 -13
  36. package/android/src/main/java/com/ziancube/backupcardsdk/nfc/ApiNfc.java +0 -173
  37. package/android/src/main/java/com/ziancube/backupcardsdk/nfc/ImplNfc.java +0 -39
  38. package/android/src/main/java/com/ziancube/backupcardsdk/nfc/NfcComm.java +0 -115
  39. package/android/src/main/java/com/ziancube/backupcardsdk/utils/ApduParam.java +0 -67
  40. package/android/src/main/java/com/ziancube/backupcardsdk/utils/CommList.java +0 -41
  41. package/android/src/main/java/com/ziancube/backupcardsdk/utils/Utils.java +0 -109
  42. package/android/src/main/jni/CMakeLists.txt +0 -60
  43. package/android/src/main/jni/GPChannel/include/GPChannelSDK.h +0 -306
  44. package/android/src/main/jni/GPChannel/include/context/BaseContext.h +0 -56
  45. package/android/src/main/jni/GPChannel/include/device/ApduBuilder.hpp +0 -72
  46. package/android/src/main/jni/GPChannel/include/utility/Apdu.hpp +0 -166
  47. package/android/src/main/jni/GPChannel/include/utility/Debug.hpp +0 -59
  48. package/android/src/main/jni/GPChannel/include/utility/Singleton.h +0 -34
  49. package/android/src/main/jni/GPChannel/include/utility/mutex.h +0 -24
  50. package/android/src/main/jni/GPChannel/include/utility/trim.hpp +0 -155
  51. package/android/src/main/jni/GPChannel/include/utility/util.h +0 -104
  52. package/android/src/main/jni/GPChannel/include/utility/xFactory.hpp +0 -26
  53. package/android/src/main/jni/GPChannel/include/utility/xManager.hpp +0 -84
  54. package/android/src/main/jni/GPChannel/src/arm64-v8a/libJUB_GPC_APDU_SDK.a +0 -0
  55. package/android/src/main/jni/GPChannel/src/arm64-v8a/libTrezorCrypto.a +0 -0
  56. package/android/src/main/jni/GPChannel/src/armeabi-v7a/libJUB_GPC_APDU_SDK.a +0 -0
  57. package/android/src/main/jni/GPChannel/src/armeabi-v7a/libTrezorCrypto.a +0 -0
  58. package/android/src/main/jni/GPChannel/src/x86/libJUB_GPC_APDU_SDK.a +0 -0
  59. package/android/src/main/jni/GPChannel/src/x86/libTrezorCrypto.a +0 -0
  60. package/android/src/main/jni/src/implJni.cpp +0 -313
  61. package/android/src/main/jni/src/implJni.h +0 -9
  62. package/android/src/main/jni/utils/jsoncpp/AUTHORS +0 -111
  63. package/android/src/main/jni/utils/jsoncpp/CMakeLists.txt +0 -159
  64. package/android/src/main/jni/utils/jsoncpp/LICENSE +0 -55
  65. package/android/src/main/jni/utils/jsoncpp/README.md +0 -135
  66. package/android/src/main/jni/utils/jsoncpp/amalgamate.py +0 -155
  67. package/android/src/main/jni/utils/jsoncpp/appveyor.yml +0 -22
  68. package/android/src/main/jni/utils/jsoncpp/dev.makefile +0 -35
  69. package/android/src/main/jni/utils/jsoncpp/devtools/__init__.py +0 -6
  70. package/android/src/main/jni/utils/jsoncpp/devtools/agent_vmw7.json +0 -33
  71. package/android/src/main/jni/utils/jsoncpp/devtools/agent_vmxp.json +0 -26
  72. package/android/src/main/jni/utils/jsoncpp/devtools/antglob.py +0 -205
  73. package/android/src/main/jni/utils/jsoncpp/devtools/batchbuild.py +0 -278
  74. package/android/src/main/jni/utils/jsoncpp/devtools/fixeol.py +0 -70
  75. package/android/src/main/jni/utils/jsoncpp/devtools/licenseupdater.py +0 -94
  76. package/android/src/main/jni/utils/jsoncpp/devtools/tarball.py +0 -52
  77. package/android/src/main/jni/utils/jsoncpp/doxybuild.py +0 -189
  78. package/android/src/main/jni/utils/jsoncpp/include/CMakeLists.txt +0 -2
  79. package/android/src/main/jni/utils/jsoncpp/include/json/allocator.h +0 -98
  80. package/android/src/main/jni/utils/jsoncpp/include/json/assertions.h +0 -54
  81. package/android/src/main/jni/utils/jsoncpp/include/json/autolink.h +0 -25
  82. package/android/src/main/jni/utils/jsoncpp/include/json/config.h +0 -187
  83. package/android/src/main/jni/utils/jsoncpp/include/json/features.h +0 -61
  84. package/android/src/main/jni/utils/jsoncpp/include/json/forwards.h +0 -37
  85. package/android/src/main/jni/utils/jsoncpp/include/json/json.h +0 -15
  86. package/android/src/main/jni/utils/jsoncpp/include/json/reader.h +0 -411
  87. package/android/src/main/jni/utils/jsoncpp/include/json/value.h +0 -888
  88. package/android/src/main/jni/utils/jsoncpp/include/json/version.h +0 -20
  89. package/android/src/main/jni/utils/jsoncpp/include/json/writer.h +0 -357
  90. package/android/src/main/jni/utils/jsoncpp/makefiles/vs71/jsontest.vcproj +0 -119
  91. package/android/src/main/jni/utils/jsoncpp/makefiles/vs71/lib_json.vcproj +0 -205
  92. package/android/src/main/jni/utils/jsoncpp/makefiles/vs71/test_lib_json.vcproj +0 -130
  93. package/android/src/main/jni/utils/jsoncpp/makerelease.py +0 -390
  94. package/android/src/main/jni/utils/jsoncpp/meson.build +0 -103
  95. package/android/src/main/jni/utils/jsoncpp/pkg-config/jsoncpp.pc.in +0 -9
  96. package/android/src/main/jni/utils/jsoncpp/src/CMakeLists.txt +0 -5
  97. package/android/src/main/jni/utils/jsoncpp/src/jsontestrunner/CMakeLists.txt +0 -25
  98. package/android/src/main/jni/utils/jsoncpp/src/jsontestrunner/main.cpp +0 -333
  99. package/android/src/main/jni/utils/jsoncpp/src/lib_json/CMakeLists.txt +0 -117
  100. package/android/src/main/jni/utils/jsoncpp/src/lib_json/json_reader.cpp +0 -2060
  101. package/android/src/main/jni/utils/jsoncpp/src/lib_json/json_tool.h +0 -114
  102. package/android/src/main/jni/utils/jsoncpp/src/lib_json/json_value.cpp +0 -1661
  103. package/android/src/main/jni/utils/jsoncpp/src/lib_json/json_valueiterator.inl +0 -167
  104. package/android/src/main/jni/utils/jsoncpp/src/lib_json/json_writer.cpp +0 -1233
  105. package/android/src/main/jni/utils/jsoncpp/src/lib_json/version.h.in +0 -20
  106. package/android/src/main/jni/utils/jsoncpp/src/test_lib_json/CMakeLists.txt +0 -38
  107. package/android/src/main/jni/utils/jsoncpp/src/test_lib_json/jsontest.cpp +0 -457
  108. package/android/src/main/jni/utils/jsoncpp/src/test_lib_json/jsontest.h +0 -286
  109. package/android/src/main/jni/utils/jsoncpp/src/test_lib_json/main.cpp +0 -2606
  110. package/android/src/main/jni/utils/jsoncpp/travis.sh +0 -23
  111. package/android/src/main/jni/utils/jsoncpp/version +0 -1
  112. package/android/src/main/jni/utils/jsoncpp/version.in +0 -1
  113. package/android/src/main/jni/utils/logUtils.cpp +0 -108
  114. package/android/src/main/jni/utils/logUtils.h +0 -87
  115. package/android/src/main/jni/utils/mSIGNA/stdutils/uchar_vector.h +0 -614
@@ -1,286 +0,0 @@
1
- // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
2
- // Distributed under MIT license, or public domain if desired and
3
- // recognized in your jurisdiction.
4
- // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5
-
6
- #ifndef JSONTEST_H_INCLUDED
7
- #define JSONTEST_H_INCLUDED
8
-
9
- #include <json/config.h>
10
- #include <json/value.h>
11
- #include <json/writer.h>
12
- #include <stdio.h>
13
- #include <deque>
14
- #include <sstream>
15
- #include <string>
16
-
17
- // //////////////////////////////////////////////////////////////////
18
- // //////////////////////////////////////////////////////////////////
19
- // Mini Unit Testing framework
20
- // //////////////////////////////////////////////////////////////////
21
- // //////////////////////////////////////////////////////////////////
22
-
23
- /** \brief Unit testing framework.
24
- * \warning: all assertions are non-aborting, test case execution will continue
25
- * even if an assertion namespace.
26
- * This constraint is for portability: the framework needs to compile
27
- * on Visual Studio 6 and must not require exception usage.
28
- */
29
- namespace JsonTest {
30
-
31
- class Failure {
32
- public:
33
- const char* file_;
34
- unsigned int line_;
35
- JSONCPP_STRING expr_;
36
- JSONCPP_STRING message_;
37
- unsigned int nestingLevel_;
38
- };
39
-
40
- /// Context used to create the assertion callstack on failure.
41
- /// Must be a POD to allow inline initialisation without stepping
42
- /// into the debugger.
43
- struct PredicateContext {
44
- typedef unsigned int Id;
45
- Id id_;
46
- const char* file_;
47
- unsigned int line_;
48
- const char* expr_;
49
- PredicateContext* next_;
50
- /// Related Failure, set when the PredicateContext is converted
51
- /// into a Failure.
52
- Failure* failure_;
53
- };
54
-
55
- class TestResult {
56
- public:
57
- TestResult();
58
-
59
- /// \internal Implementation detail for assertion macros
60
- /// Not encapsulated to prevent step into when debugging failed assertions
61
- /// Incremented by one on assertion predicate entry, decreased by one
62
- /// by addPredicateContext().
63
- PredicateContext::Id predicateId_;
64
-
65
- /// \internal Implementation detail for predicate macros
66
- PredicateContext* predicateStackTail_;
67
-
68
- void setTestName(const JSONCPP_STRING& name);
69
-
70
- /// Adds an assertion failure.
71
- TestResult&
72
- addFailure(const char* file, unsigned int line, const char* expr = 0);
73
-
74
- /// Removes the last PredicateContext added to the predicate stack
75
- /// chained list.
76
- /// Next messages will be targed at the PredicateContext that was removed.
77
- TestResult& popPredicateContext();
78
-
79
- bool failed() const;
80
-
81
- void printFailure(bool printTestName) const;
82
-
83
- // Generic operator that will work with anything ostream can deal with.
84
- template <typename T> TestResult& operator<<(const T& value) {
85
- JSONCPP_OSTRINGSTREAM oss;
86
- oss.precision(16);
87
- oss.setf(std::ios_base::floatfield);
88
- oss << value;
89
- return addToLastFailure(oss.str());
90
- }
91
-
92
- // Specialized versions.
93
- TestResult& operator<<(bool value);
94
- // std:ostream does not support 64bits integers on all STL implementation
95
- TestResult& operator<<(Json::Int64 value);
96
- TestResult& operator<<(Json::UInt64 value);
97
-
98
- private:
99
- TestResult& addToLastFailure(const JSONCPP_STRING& message);
100
- unsigned int getAssertionNestingLevel() const;
101
- /// Adds a failure or a predicate context
102
- void addFailureInfo(const char* file,
103
- unsigned int line,
104
- const char* expr,
105
- unsigned int nestingLevel);
106
- static JSONCPP_STRING indentText(const JSONCPP_STRING& text,
107
- const JSONCPP_STRING& indent);
108
-
109
- typedef std::deque<Failure> Failures;
110
- Failures failures_;
111
- JSONCPP_STRING name_;
112
- PredicateContext rootPredicateNode_;
113
- PredicateContext::Id lastUsedPredicateId_;
114
- /// Failure which is the target of the messages added using operator <<
115
- Failure* messageTarget_;
116
- };
117
-
118
- class TestCase {
119
- public:
120
- TestCase();
121
-
122
- virtual ~TestCase();
123
-
124
- void run(TestResult& result);
125
-
126
- virtual const char* testName() const = 0;
127
-
128
- protected:
129
- TestResult* result_;
130
-
131
- private:
132
- virtual void runTestCase() = 0;
133
- };
134
-
135
- /// Function pointer type for TestCase factory
136
- typedef TestCase* (*TestCaseFactory)();
137
-
138
- class Runner {
139
- public:
140
- Runner();
141
-
142
- /// Adds a test to the suite
143
- Runner& add(TestCaseFactory factory);
144
-
145
- /// Runs test as specified on the command-line
146
- /// If no command-line arguments are provided, run all tests.
147
- /// If --list-tests is provided, then print the list of all test cases
148
- /// If --test <testname> is provided, then run test testname.
149
- int runCommandLine(int argc, const char* argv[]) const;
150
-
151
- /// Runs all the test cases
152
- bool runAllTest(bool printSummary) const;
153
-
154
- /// Returns the number of test case in the suite
155
- unsigned int testCount() const;
156
-
157
- /// Returns the name of the test case at the specified index
158
- JSONCPP_STRING testNameAt(unsigned int index) const;
159
-
160
- /// Runs the test case at the specified index using the specified TestResult
161
- void runTestAt(unsigned int index, TestResult& result) const;
162
-
163
- static void printUsage(const char* appName);
164
-
165
- private: // prevents copy construction and assignment
166
- Runner(const Runner& other);
167
- Runner& operator=(const Runner& other);
168
-
169
- private:
170
- void listTests() const;
171
- bool testIndex(const JSONCPP_STRING& testName, unsigned int& index) const;
172
- static void preventDialogOnCrash();
173
-
174
- private:
175
- typedef std::deque<TestCaseFactory> Factories;
176
- Factories tests_;
177
- };
178
-
179
- template <typename T, typename U>
180
- TestResult& checkEqual(TestResult& result,
181
- T expected,
182
- U actual,
183
- const char* file,
184
- unsigned int line,
185
- const char* expr) {
186
- if (static_cast<U>(expected) != actual) {
187
- result.addFailure(file, line, expr);
188
- result << "Expected: " << static_cast<U>(expected) << "\n";
189
- result << "Actual : " << actual;
190
- }
191
- return result;
192
- }
193
-
194
- JSONCPP_STRING ToJsonString(const char* toConvert);
195
- JSONCPP_STRING ToJsonString(JSONCPP_STRING in);
196
- #if JSONCPP_USING_SECURE_MEMORY
197
- JSONCPP_STRING ToJsonString(std::string in);
198
- #endif
199
-
200
- TestResult& checkStringEqual(TestResult& result,
201
- const JSONCPP_STRING& expected,
202
- const JSONCPP_STRING& actual,
203
- const char* file,
204
- unsigned int line,
205
- const char* expr);
206
-
207
- } // namespace JsonTest
208
-
209
- /// \brief Asserts that the given expression is true.
210
- /// JSONTEST_ASSERT( x == y ) << "x=" << x << ", y=" << y;
211
- /// JSONTEST_ASSERT( x == y );
212
- #define JSONTEST_ASSERT(expr) \
213
- if (expr) { \
214
- } else \
215
- result_->addFailure(__FILE__, __LINE__, #expr)
216
-
217
- /// \brief Asserts that the given predicate is true.
218
- /// The predicate may do other assertions and be a member function of the
219
- /// fixture.
220
- #define JSONTEST_ASSERT_PRED(expr) \
221
- { \
222
- JsonTest::PredicateContext _minitest_Context = { \
223
- result_->predicateId_, __FILE__, __LINE__, #expr, NULL, NULL \
224
- }; \
225
- result_->predicateStackTail_->next_ = &_minitest_Context; \
226
- result_->predicateId_ += 1; \
227
- result_->predicateStackTail_ = &_minitest_Context; \
228
- (expr); \
229
- result_->popPredicateContext(); \
230
- }
231
-
232
- /// \brief Asserts that two values are equals.
233
- #define JSONTEST_ASSERT_EQUAL(expected, actual) \
234
- JsonTest::checkEqual(*result_, \
235
- expected, \
236
- actual, \
237
- __FILE__, \
238
- __LINE__, \
239
- #expected " == " #actual)
240
-
241
- /// \brief Asserts that two values are equals.
242
- #define JSONTEST_ASSERT_STRING_EQUAL(expected, actual) \
243
- JsonTest::checkStringEqual(*result_, \
244
- JsonTest::ToJsonString(expected), \
245
- JsonTest::ToJsonString(actual), \
246
- __FILE__, \
247
- __LINE__, \
248
- #expected " == " #actual)
249
-
250
- /// \brief Asserts that a given expression throws an exception
251
- #define JSONTEST_ASSERT_THROWS(expr) \
252
- { \
253
- bool _threw = false; \
254
- try { \
255
- expr; \
256
- } \
257
- catch (...) { \
258
- _threw = true; \
259
- } \
260
- if (!_threw) \
261
- result_->addFailure( \
262
- __FILE__, __LINE__, "expected exception thrown: " #expr); \
263
- }
264
-
265
- /// \brief Begin a fixture test case.
266
- #define JSONTEST_FIXTURE(FixtureType, name) \
267
- class Test##FixtureType##name : public FixtureType { \
268
- public: \
269
- static JsonTest::TestCase* factory() { \
270
- return new Test##FixtureType##name(); \
271
- } \
272
- \
273
- public: /* overidden from TestCase */ \
274
- const char* testName() const JSONCPP_OVERRIDE { return #FixtureType "/" #name; } \
275
- void runTestCase() JSONCPP_OVERRIDE; \
276
- }; \
277
- \
278
- void Test##FixtureType##name::runTestCase()
279
-
280
- #define JSONTEST_FIXTURE_FACTORY(FixtureType, name) \
281
- &Test##FixtureType##name::factory
282
-
283
- #define JSONTEST_REGISTER_FIXTURE(runner, FixtureType, name) \
284
- (runner).add(JSONTEST_FIXTURE_FACTORY(FixtureType, name))
285
-
286
- #endif // ifndef JSONTEST_H_INCLUDED