@digitalshieldfe/react-native-backup-card-sdk 0.1.1 → 0.1.3
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.
- package/README.md +17 -25
- package/android/build.gradle +49 -4
- package/android/consumer-rules.pro +0 -0
- package/android/proguard-rules.pro +21 -0
- package/android/src/main/AndroidManifest.xml +4 -1
- package/android/src/main/java/com/ziancube/backupcardsdk/BackupCardSdk.kt +478 -0
- package/android/src/main/java/com/ziancube/backupcardsdk/GPChannelNatives.java +41 -0
- package/android/src/main/java/com/ziancube/backupcardsdk/listener/ApiAsyncListener.java +13 -0
- package/android/src/main/java/com/ziancube/backupcardsdk/nfc/ApiNfc.java +173 -0
- package/android/src/main/java/com/ziancube/backupcardsdk/nfc/ImplNfc.java +39 -0
- package/android/src/main/java/com/ziancube/backupcardsdk/nfc/NfcComm.java +115 -0
- package/android/src/main/java/com/ziancube/backupcardsdk/utils/ApduParam.java +67 -0
- package/android/src/main/java/com/ziancube/backupcardsdk/utils/CommList.java +41 -0
- package/android/src/main/java/com/ziancube/backupcardsdk/utils/Utils.java +109 -0
- package/android/src/main/jni/CMakeLists.txt +60 -0
- package/android/src/main/jni/GPChannel/include/GPChannelSDK.h +306 -0
- package/android/src/main/jni/GPChannel/include/context/BaseContext.h +56 -0
- package/android/src/main/jni/GPChannel/include/device/ApduBuilder.hpp +72 -0
- package/android/src/main/jni/GPChannel/include/utility/Apdu.hpp +166 -0
- package/android/src/main/jni/GPChannel/include/utility/Debug.hpp +59 -0
- package/android/src/main/jni/GPChannel/include/utility/Singleton.h +34 -0
- package/android/src/main/jni/GPChannel/include/utility/mutex.h +24 -0
- package/android/src/main/jni/GPChannel/include/utility/trim.hpp +155 -0
- package/android/src/main/jni/GPChannel/include/utility/util.h +104 -0
- package/android/src/main/jni/GPChannel/include/utility/xFactory.hpp +26 -0
- package/android/src/main/jni/GPChannel/include/utility/xManager.hpp +84 -0
- package/android/src/main/jni/GPChannel/src/arm64-v8a/libJUB_GPC_APDU_SDK.a +0 -0
- package/android/src/main/jni/GPChannel/src/arm64-v8a/libTrezorCrypto.a +0 -0
- package/android/src/main/jni/GPChannel/src/armeabi-v7a/libJUB_GPC_APDU_SDK.a +0 -0
- package/android/src/main/jni/GPChannel/src/armeabi-v7a/libTrezorCrypto.a +0 -0
- package/android/src/main/jni/GPChannel/src/x86/libJUB_GPC_APDU_SDK.a +0 -0
- package/android/src/main/jni/GPChannel/src/x86/libTrezorCrypto.a +0 -0
- package/android/src/main/jni/src/implJni.cpp +313 -0
- package/android/src/main/jni/src/implJni.h +9 -0
- package/android/src/main/jni/utils/jsoncpp/AUTHORS +111 -0
- package/android/src/main/jni/utils/jsoncpp/CMakeLists.txt +159 -0
- package/android/src/main/jni/utils/jsoncpp/LICENSE +55 -0
- package/android/src/main/jni/utils/jsoncpp/README.md +135 -0
- package/android/src/main/jni/utils/jsoncpp/amalgamate.py +155 -0
- package/android/src/main/jni/utils/jsoncpp/appveyor.yml +22 -0
- package/android/src/main/jni/utils/jsoncpp/dev.makefile +35 -0
- package/android/src/main/jni/utils/jsoncpp/devtools/__init__.py +6 -0
- package/android/src/main/jni/utils/jsoncpp/devtools/agent_vmw7.json +33 -0
- package/android/src/main/jni/utils/jsoncpp/devtools/agent_vmxp.json +26 -0
- package/android/src/main/jni/utils/jsoncpp/devtools/antglob.py +205 -0
- package/android/src/main/jni/utils/jsoncpp/devtools/batchbuild.py +278 -0
- package/android/src/main/jni/utils/jsoncpp/devtools/fixeol.py +70 -0
- package/android/src/main/jni/utils/jsoncpp/devtools/licenseupdater.py +94 -0
- package/android/src/main/jni/utils/jsoncpp/devtools/tarball.py +52 -0
- package/android/src/main/jni/utils/jsoncpp/doxybuild.py +189 -0
- package/android/src/main/jni/utils/jsoncpp/include/CMakeLists.txt +2 -0
- package/android/src/main/jni/utils/jsoncpp/include/json/allocator.h +98 -0
- package/android/src/main/jni/utils/jsoncpp/include/json/assertions.h +54 -0
- package/android/src/main/jni/utils/jsoncpp/include/json/autolink.h +25 -0
- package/android/src/main/jni/utils/jsoncpp/include/json/config.h +187 -0
- package/android/src/main/jni/utils/jsoncpp/include/json/features.h +61 -0
- package/android/src/main/jni/utils/jsoncpp/include/json/forwards.h +37 -0
- package/android/src/main/jni/utils/jsoncpp/include/json/json.h +15 -0
- package/android/src/main/jni/utils/jsoncpp/include/json/reader.h +411 -0
- package/android/src/main/jni/utils/jsoncpp/include/json/value.h +888 -0
- package/android/src/main/jni/utils/jsoncpp/include/json/version.h +20 -0
- package/android/src/main/jni/utils/jsoncpp/include/json/writer.h +357 -0
- package/android/src/main/jni/utils/jsoncpp/makefiles/vs71/jsontest.vcproj +119 -0
- package/android/src/main/jni/utils/jsoncpp/makefiles/vs71/lib_json.vcproj +205 -0
- package/android/src/main/jni/utils/jsoncpp/makefiles/vs71/test_lib_json.vcproj +130 -0
- package/android/src/main/jni/utils/jsoncpp/makerelease.py +390 -0
- package/android/src/main/jni/utils/jsoncpp/meson.build +103 -0
- package/android/src/main/jni/utils/jsoncpp/pkg-config/jsoncpp.pc.in +9 -0
- package/android/src/main/jni/utils/jsoncpp/src/CMakeLists.txt +5 -0
- package/android/src/main/jni/utils/jsoncpp/src/jsontestrunner/CMakeLists.txt +25 -0
- package/android/src/main/jni/utils/jsoncpp/src/jsontestrunner/main.cpp +333 -0
- package/android/src/main/jni/utils/jsoncpp/src/lib_json/CMakeLists.txt +117 -0
- package/android/src/main/jni/utils/jsoncpp/src/lib_json/json_reader.cpp +2060 -0
- package/android/src/main/jni/utils/jsoncpp/src/lib_json/json_tool.h +114 -0
- package/android/src/main/jni/utils/jsoncpp/src/lib_json/json_value.cpp +1661 -0
- package/android/src/main/jni/utils/jsoncpp/src/lib_json/json_valueiterator.inl +167 -0
- package/android/src/main/jni/utils/jsoncpp/src/lib_json/json_writer.cpp +1233 -0
- package/android/src/main/jni/utils/jsoncpp/src/lib_json/version.h.in +20 -0
- package/android/src/main/jni/utils/jsoncpp/src/test_lib_json/CMakeLists.txt +38 -0
- package/android/src/main/jni/utils/jsoncpp/src/test_lib_json/jsontest.cpp +457 -0
- package/android/src/main/jni/utils/jsoncpp/src/test_lib_json/jsontest.h +286 -0
- package/android/src/main/jni/utils/jsoncpp/src/test_lib_json/main.cpp +2606 -0
- package/android/src/main/jni/utils/jsoncpp/travis.sh +23 -0
- package/android/src/main/jni/utils/jsoncpp/version +1 -0
- package/android/src/main/jni/utils/jsoncpp/version.in +1 -0
- package/android/src/main/jni/utils/logUtils.cpp +108 -0
- package/android/src/main/jni/utils/logUtils.h +87 -0
- package/android/src/main/jni/utils/mSIGNA/stdutils/uchar_vector.h +614 -0
- package/package.json +2 -3
- package/android/libs/backupcardsdk-1.0.0.aar +0 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by FT on 2018/4/16.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#include <jni.h>
|
|
6
|
+
#include <logUtils.h>
|
|
7
|
+
#include <GPChannelSDK.h>
|
|
8
|
+
#include <jsoncpp/include/json/json.h>
|
|
9
|
+
#include <jsoncpp/include/json/value.h>
|
|
10
|
+
#include <mSIGNA/stdutils/uchar_vector.h>
|
|
11
|
+
|
|
12
|
+
// 保存 JavaVM
|
|
13
|
+
JavaVM *g_vm = NULL;
|
|
14
|
+
int errorCode = 0;
|
|
15
|
+
|
|
16
|
+
JNIEXPORT jint JNICALL native_getErrorCode(JNIEnv *env, jclass obj) {
|
|
17
|
+
return errorCode;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
JNIEXPORT jint JNICALL native_GPC_Initialize(JNIEnv *env, jclass obj,
|
|
21
|
+
jstring jJSON) {
|
|
22
|
+
if (NULL == jJSON) {
|
|
23
|
+
return JUBR_ARGUMENTS_BAD;
|
|
24
|
+
}
|
|
25
|
+
int length = env->GetStringLength(jJSON);
|
|
26
|
+
if (0 == length) {
|
|
27
|
+
return JUBR_ARGUMENTS_BAD;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
JUB_CHAR_PTR pJSON = const_cast<JUB_CHAR_PTR>(env->GetStringUTFChars(jJSON, NULL));
|
|
31
|
+
|
|
32
|
+
Json::Reader reader;
|
|
33
|
+
Json::Value root;
|
|
34
|
+
reader.parse(pJSON, root);
|
|
35
|
+
|
|
36
|
+
GPC_SCP11_SHAREDINFO sharedInfo = {0};
|
|
37
|
+
sharedInfo.scpID = root["scpID"].asUInt();
|
|
38
|
+
sharedInfo.keyUsage = root["keyUsage"].asUInt();
|
|
39
|
+
sharedInfo.keyType = root["keyType"].asUInt();
|
|
40
|
+
sharedInfo.keyLength = root["keyLength"].asUInt();
|
|
41
|
+
strcpy(sharedInfo.hostID,(JUB_CHAR_PTR) root["hostID"].asCString());
|
|
42
|
+
uchar_vector groupID = uchar_vector(root["cardGroupID"].asCString());
|
|
43
|
+
std::string str_groupID(groupID.begin(),groupID.end());
|
|
44
|
+
JUB_RV ret = JUB_GPC_Initialize(sharedInfo,
|
|
45
|
+
str_groupID.c_str(),
|
|
46
|
+
"",
|
|
47
|
+
"");
|
|
48
|
+
if (ret != JUBR_OK) {
|
|
49
|
+
LOG_ERR("JUB_GPC_Initialize: %08x", ret);
|
|
50
|
+
}
|
|
51
|
+
env->ReleaseStringUTFChars(jJSON, (const char *) pJSON);
|
|
52
|
+
return static_cast<jint>(ret);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
JNIEXPORT jint JNICALL native_GPC_Finalize(JNIEnv *env, jclass obj) {
|
|
56
|
+
JUB_RV ret = JUB_GPC_Finalize();
|
|
57
|
+
if (ret != JUBR_OK) {
|
|
58
|
+
LOG_ERR("JUB_GPC_Finalize: %08x", ret);
|
|
59
|
+
}
|
|
60
|
+
return static_cast<jint>(ret);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
JNIEXPORT jstring JNICALL native_GPC_BuildMutualAuthData(JNIEnv *env, jclass obj) {
|
|
64
|
+
JUB_CHAR_PTR mutualAuthData;
|
|
65
|
+
JUB_RV ret = JUB_GPC_BuildMutualAuthData(&mutualAuthData);
|
|
66
|
+
if (ret != JUBR_OK) {
|
|
67
|
+
LOG_ERR("JUB_GPC_BuildMutualAuthData: %08x", ret);
|
|
68
|
+
errorCode = static_cast<int>(ret);
|
|
69
|
+
return NULL;
|
|
70
|
+
} else {
|
|
71
|
+
jstring result = env->NewStringUTF(mutualAuthData);
|
|
72
|
+
JUB_FreeMemory(mutualAuthData);
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
JNIEXPORT jint JNICALL native_GPC_OpenSecureChannel(JNIEnv *env, jclass obj, jstring jResponse) {
|
|
78
|
+
JUB_CHAR_PTR pResponse = const_cast<JUB_CHAR_PTR>(env->GetStringUTFChars(jResponse, NULL));
|
|
79
|
+
JUB_RV ret = JUB_GPC_OpenSecureChannel(pResponse);
|
|
80
|
+
if (ret != JUBR_OK) {
|
|
81
|
+
LOG_ERR("JUB_GPC_OpenSecureChannel: %08x", ret);
|
|
82
|
+
}
|
|
83
|
+
return static_cast<jint>(ret);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
JNIEXPORT jstring JNICALL
|
|
87
|
+
native_GPC_BuildAPDU(JNIEnv *env, jclass obj, jlong jCla, jlong jIns, jlong jP1, jlong jP2,
|
|
88
|
+
jstring jData) {
|
|
89
|
+
|
|
90
|
+
JUB_CHAR_PTR pData = const_cast<JUB_CHAR_PTR>(env->GetStringUTFChars(jData, NULL));
|
|
91
|
+
|
|
92
|
+
JUB_CHAR_PTR apdu;
|
|
93
|
+
JUB_RV ret = JUB_GPC_BuildAPDU(jCla, jIns, jP1, jP2, pData, &apdu);
|
|
94
|
+
env->ReleaseStringUTFChars(jData, (const char *) pData);
|
|
95
|
+
if (ret != JUBR_OK) {
|
|
96
|
+
LOG_ERR("JUB_GPC_BuildAPDU: %08x", ret);
|
|
97
|
+
errorCode = static_cast<int>(ret);
|
|
98
|
+
return NULL;
|
|
99
|
+
} else {
|
|
100
|
+
jstring result = env->NewStringUTF(apdu);
|
|
101
|
+
JUB_FreeMemory(apdu);
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
JNIEXPORT jstring JNICALL
|
|
107
|
+
native_GPC_BuildSafeAPDU(JNIEnv *env, jclass obj, jlong jCla, jlong jIns, jlong jP1, jlong jP2,
|
|
108
|
+
jstring jData) {
|
|
109
|
+
JUB_CHAR_PTR pData = const_cast<JUB_CHAR_PTR>(env->GetStringUTFChars(jData, NULL));
|
|
110
|
+
|
|
111
|
+
JUB_CHAR_PTR apdu;
|
|
112
|
+
JUB_RV ret = JUB_GPC_BuildSafeAPDU(jCla, jIns, jP1, jP2, pData, &apdu);
|
|
113
|
+
env->ReleaseStringUTFChars(jData, (const char *) pData);
|
|
114
|
+
if (ret != JUBR_OK) {
|
|
115
|
+
LOG_ERR("JUB_GPC_BuildSafeAPDU: %08x", ret);
|
|
116
|
+
errorCode = static_cast<int>(ret);
|
|
117
|
+
return NULL;
|
|
118
|
+
} else {
|
|
119
|
+
jstring result = env->NewStringUTF(apdu);
|
|
120
|
+
JUB_FreeMemory(apdu);
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
JNIEXPORT jstring JNICALL
|
|
126
|
+
native_GPC_ParseSafeAPDUResponse(JNIEnv *env, jclass obj, jstring jResponse) {
|
|
127
|
+
|
|
128
|
+
JUB_CHAR_PTR pResponse = const_cast<JUB_CHAR_PTR>(env->GetStringUTFChars(jResponse, NULL));
|
|
129
|
+
JUB_UINT16 wRet = 0;
|
|
130
|
+
JUB_CHAR_PTR response;
|
|
131
|
+
JUB_RV ret = JUB_GPC_ParseSafeAPDUResponse(pResponse, &wRet, &response);
|
|
132
|
+
env->ReleaseStringUTFChars(jResponse, (const char *) pResponse);
|
|
133
|
+
if (ret != JUBR_OK) {
|
|
134
|
+
LOG_ERR("JUB_GPC_ParseSafeAPDUResponse: %08x", ret);
|
|
135
|
+
errorCode = static_cast<int>(ret);
|
|
136
|
+
return NULL;
|
|
137
|
+
} else {
|
|
138
|
+
Json::FastWriter writer;
|
|
139
|
+
Json::Value root;
|
|
140
|
+
root["wRet"] = wRet;
|
|
141
|
+
root["response"] = response;
|
|
142
|
+
jstring result = env->NewStringUTF(writer.write(root).c_str());
|
|
143
|
+
JUB_FreeMemory(response);
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
JNIEXPORT jstring JNICALL
|
|
149
|
+
native_GPC_ParseAPDUResponse(JNIEnv *env, jclass obj, jstring jResponse) {
|
|
150
|
+
|
|
151
|
+
JUB_CHAR_PTR pResponse = const_cast<JUB_CHAR_PTR>(env->GetStringUTFChars(jResponse, NULL));
|
|
152
|
+
JUB_UINT16 wRet = 0;
|
|
153
|
+
JUB_CHAR_PTR resp;
|
|
154
|
+
JUB_RV ret = JUB_GPC_ParseAPDUResponse(pResponse, &wRet, &resp);
|
|
155
|
+
env->ReleaseStringUTFChars(jResponse, (const char *) pResponse);
|
|
156
|
+
if (ret != JUBR_OK) {
|
|
157
|
+
LOG_ERR("JUB_GPC_ParseAPDUResponse: %08x", ret);
|
|
158
|
+
errorCode = static_cast<int>(ret);
|
|
159
|
+
return NULL;
|
|
160
|
+
} else {
|
|
161
|
+
Json::FastWriter writer;
|
|
162
|
+
Json::Value root;
|
|
163
|
+
root["wRet"] = wRet;
|
|
164
|
+
root["response"] = resp;
|
|
165
|
+
jstring result = env->NewStringUTF(writer.write(root).c_str());
|
|
166
|
+
JUB_FreeMemory(resp);
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
JNIEXPORT jstring JNICALL
|
|
172
|
+
native_GPC_TLVDecode(JNIEnv *env, jclass obj, jstring jApdu) {
|
|
173
|
+
JUB_CHAR_PTR pApdu = const_cast<JUB_CHAR_PTR>(env->GetStringUTFChars(jApdu, NULL));
|
|
174
|
+
JUB_ULONG tag = 0;
|
|
175
|
+
JUB_CHAR_PTR value;
|
|
176
|
+
JUB_RV ret = JUB_GPC_TLVDecode(pApdu, &tag, &value);
|
|
177
|
+
env->ReleaseStringUTFChars(jApdu, (const char *) pApdu);
|
|
178
|
+
if (ret != JUBR_OK) {
|
|
179
|
+
LOG_ERR("JUB_GPC_TLVDecode: %08x", ret);
|
|
180
|
+
errorCode = static_cast<int>(ret);
|
|
181
|
+
return NULL;
|
|
182
|
+
} else {
|
|
183
|
+
Json::FastWriter writer;
|
|
184
|
+
Json::Value root;
|
|
185
|
+
Json::Int64 tmTag = tag;
|
|
186
|
+
root["tag"] = tmTag;
|
|
187
|
+
root["value"] = value;
|
|
188
|
+
jstring result = env->NewStringUTF(writer.write(root).c_str());
|
|
189
|
+
JUB_FreeMemory(value);
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
JNIEXPORT jstring JNICALL
|
|
195
|
+
native_GPC_ParseCertificate(JNIEnv *env, jclass obj, jstring jCert) {
|
|
196
|
+
JUB_CHAR_PTR pCert = const_cast<JUB_CHAR_PTR>(env->GetStringUTFChars(jCert, NULL));
|
|
197
|
+
JUB_CHAR_PTR sn;
|
|
198
|
+
JUB_CHAR_PTR subjectID;
|
|
199
|
+
JUB_RV ret = JUB_GPC_ParseCertificate(pCert, &sn, &subjectID);
|
|
200
|
+
env->ReleaseStringUTFChars(jCert, (const char *) pCert);
|
|
201
|
+
if (ret != JUBR_OK) {
|
|
202
|
+
LOG_ERR("JUB_GPC_ParseCertificate: %08x", ret);
|
|
203
|
+
errorCode = static_cast<int>(ret);
|
|
204
|
+
return NULL;
|
|
205
|
+
} else {
|
|
206
|
+
Json::FastWriter writer;
|
|
207
|
+
Json::Value root;
|
|
208
|
+
root["sn"] = sn;
|
|
209
|
+
root["subjectID"] = subjectID;
|
|
210
|
+
jstring result = env->NewStringUTF(writer.write(root).c_str());
|
|
211
|
+
JUB_FreeMemory(sn);
|
|
212
|
+
JUB_FreeMemory(subjectID);
|
|
213
|
+
return result;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* JNINativeMethod由三部分组成:
|
|
219
|
+
* (1)Java中的函数名;
|
|
220
|
+
* (2)函数签名,格式为(输入参数类型)返回值类型;
|
|
221
|
+
* (3)native函数名
|
|
222
|
+
*/
|
|
223
|
+
static JNINativeMethod gMethods[] = {
|
|
224
|
+
{
|
|
225
|
+
"nativeGetErrorCode",
|
|
226
|
+
"()I",
|
|
227
|
+
(void *) native_getErrorCode
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"nativeGPCInitialize",
|
|
231
|
+
"(Ljava/lang/String;)I",
|
|
232
|
+
(void *) native_GPC_Initialize
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"nativeGPCFinalize",
|
|
236
|
+
"()I",
|
|
237
|
+
(void *) native_GPC_Finalize
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"nativeGPCBuildMutualAuthData",
|
|
241
|
+
"()Ljava/lang/String;",
|
|
242
|
+
(void *) native_GPC_BuildMutualAuthData
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"nativeGPCOpenSecureChannel",
|
|
246
|
+
"(Ljava/lang/String;)I",
|
|
247
|
+
(void *) native_GPC_OpenSecureChannel
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"nativeGPCBuildAPDU",
|
|
251
|
+
"(JJJJLjava/lang/String;)Ljava/lang/String;",
|
|
252
|
+
(void *) native_GPC_BuildAPDU
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"nativeGPCBuildSafeAPDU",
|
|
256
|
+
"(JJJJLjava/lang/String;)Ljava/lang/String;",
|
|
257
|
+
(void *) native_GPC_BuildSafeAPDU
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"nativeGPCParseSafeAPDUResponse",
|
|
261
|
+
"(Ljava/lang/String;)Ljava/lang/String;",
|
|
262
|
+
(void *) native_GPC_ParseSafeAPDUResponse
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"nativeGPCParseAPDUResponse",
|
|
266
|
+
"(Ljava/lang/String;)Ljava/lang/String;",
|
|
267
|
+
(void *) native_GPC_ParseAPDUResponse
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"nativeGPCTLVDecode",
|
|
271
|
+
"(Ljava/lang/String;)Ljava/lang/String;",
|
|
272
|
+
(void *) native_GPC_TLVDecode
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"nativeGPCParseCertificate",
|
|
276
|
+
"(Ljava/lang/String;)Ljava/lang/String;",
|
|
277
|
+
(void *) native_GPC_ParseCertificate
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
//#define NATIVE_API_CLASS "com/jubiter/sdk/gpchannel/GPChannelNatives"
|
|
283
|
+
#define NATIVE_API_CLASS "com/ziancube/backupcardsdk/GPChannelNatives"
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* JNI_OnLoad 默认会在 System.loadLibrary 过程中自动调用到,因而可利用此函数,进行动态注册
|
|
287
|
+
* JNI 版本的返回视对应 JDK 版本而定
|
|
288
|
+
*/
|
|
289
|
+
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
|
|
290
|
+
JNIEnv *env = NULL;
|
|
291
|
+
jint ret = JNI_FALSE;
|
|
292
|
+
|
|
293
|
+
// 获取 env 指针
|
|
294
|
+
if (vm->GetEnv((void **) &env, JNI_VERSION_1_6) != JNI_OK) {
|
|
295
|
+
return ret;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// 保存全局 JVM 以便在动态注册的皆空中使用 env 环境
|
|
299
|
+
env->GetJavaVM(&g_vm);
|
|
300
|
+
|
|
301
|
+
// 获取类引用
|
|
302
|
+
jclass clazz = env->FindClass(NATIVE_API_CLASS);
|
|
303
|
+
if (clazz == NULL) {
|
|
304
|
+
return ret;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// 注册 JNI 方法
|
|
308
|
+
if (env->RegisterNatives(clazz, gMethods, sizeof(gMethods) / sizeof(gMethods[0])) < JNI_OK) {
|
|
309
|
+
return ret;
|
|
310
|
+
}
|
|
311
|
+
// 成功
|
|
312
|
+
return JNI_VERSION_1_6;
|
|
313
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Baptiste Lepilleur <blep@users.sourceforge.net>
|
|
2
|
+
|
|
3
|
+
Aaron Jacobs <aaronjjacobs@gmail.com>
|
|
4
|
+
Aaron Jacobs <jacobsa@google.com>
|
|
5
|
+
Adam Boseley <ABoseley@agjunction.com>
|
|
6
|
+
Adam Boseley <adam.boseley@gmail.com>
|
|
7
|
+
Aleksandr Derbenev <13alexac@gmail.com>
|
|
8
|
+
Alexander Gazarov <DrMetallius@users.noreply.github.com>
|
|
9
|
+
Alexander V. Brezgin <abrezgin@appliedtech.ru>
|
|
10
|
+
Alexandr Brezgin <albrezgin@mail.ru>
|
|
11
|
+
Alexey Kruchinin <alexey@mopals.com>
|
|
12
|
+
Anton Indrawan <anton.indrawan@gmail.com>
|
|
13
|
+
Baptiste Jonglez <git@bitsofnetworks.org>
|
|
14
|
+
Baptiste Lepilleur <baptiste.lepilleur@gmail.com>
|
|
15
|
+
Baruch Siach <baruch@tkos.co.il>
|
|
16
|
+
Ben Boeckel <mathstuf@gmail.com>
|
|
17
|
+
Benjamin Knecht <bknecht@logitech.com>
|
|
18
|
+
Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
19
|
+
Billy Donahue <billydonahue@google.com>
|
|
20
|
+
Braden McDorman <bmcdorman@gmail.com>
|
|
21
|
+
Brandon Myers <bmyers1788@gmail.com>
|
|
22
|
+
Brendan Drew <brendan.drew@daqri.com>
|
|
23
|
+
chason <cxchao802@gmail.com>
|
|
24
|
+
Chris Gilling <cgilling@iparadigms.com>
|
|
25
|
+
Christopher Dawes <christopher.dawes.1981@googlemail.com>
|
|
26
|
+
Christopher Dunn <cdunn2001@gmail.com>
|
|
27
|
+
Chuck Atkins <chuck.atkins@kitware.com>
|
|
28
|
+
Cody P Schafer <dev@codyps.com>
|
|
29
|
+
Connor Manning <connor@hobu.co>
|
|
30
|
+
Cory Quammen <cory.quammen@kitware.com>
|
|
31
|
+
Cristóvão B da Cruz e Silva <CrisXed@gmail.com>
|
|
32
|
+
Daniel Krügler <daniel.kruegler@gmail.com>
|
|
33
|
+
Dani-Hub <daniel.kruegler@googlemail.com>
|
|
34
|
+
Dan Liu <gzliudan>
|
|
35
|
+
datadiode <datadiode@users.noreply.github.com>
|
|
36
|
+
datadiode <jochen.neubeck@vodafone.de>
|
|
37
|
+
David Seifert <soap@gentoo.org>
|
|
38
|
+
David West <david-west@idexx.com>
|
|
39
|
+
dawesc <chris.dawes@eftlab.co.uk>
|
|
40
|
+
Dmitry Marakasov <amdmi3@amdmi3.ru>
|
|
41
|
+
dominicpezzuto <dom@dompezzuto.com>
|
|
42
|
+
Don Milham <dmilham@gmail.com>
|
|
43
|
+
drgler <daniel.kruegler@gmail.com>
|
|
44
|
+
ds283 <D.Seery@sussex.ac.uk>
|
|
45
|
+
Egor Tensin <Egor.Tensin@gmail.com>
|
|
46
|
+
eightnoteight <mr.eightnoteight@gmail.com>
|
|
47
|
+
Evince <baneyue@gmail.com>
|
|
48
|
+
filipjs <filipjs@users.noreply.github.com>
|
|
49
|
+
findblar <ft@finbarr.ca>
|
|
50
|
+
Florian Meier <florian.meier@koalo.de>
|
|
51
|
+
Gaëtan Lehmann <gaetan.lehmann@gmail.com>
|
|
52
|
+
Gaurav <g.gupta@samsung.com>
|
|
53
|
+
Gergely Nagy <ngg@ngg.hu>
|
|
54
|
+
Gida Pataki <gida.pataki@prezi.com>
|
|
55
|
+
I3ck <buckmartin@buckmartin.de>
|
|
56
|
+
Iñaki Baz Castillo <ibc@aliax.net>
|
|
57
|
+
Jacco <jacco@geul.net>
|
|
58
|
+
Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
|
|
59
|
+
Jonas Platte <mail@jonasplatte.de>
|
|
60
|
+
Jörg Krause <joerg.krause@embedded.rocks>
|
|
61
|
+
Keith Lea <keith@whamcitylights.com>
|
|
62
|
+
Kevin Grant <kbradleygrant@gmail.com>
|
|
63
|
+
Kirill V. Lyadvinsky <jia3ep@gmail.com>
|
|
64
|
+
Kirill V. Lyadvinsky <mail@codeatcpp.com>
|
|
65
|
+
Kobi Gurkan <kobigurk@gmail.com>
|
|
66
|
+
Magnus Bjerke Vik <mbvett@gmail.com>
|
|
67
|
+
Malay Shah <malays@users.sourceforge.net>
|
|
68
|
+
Mara Kim <hacker.root@gmail.com>
|
|
69
|
+
Marek Kotewicz <marek.kotewicz@gmail.com>
|
|
70
|
+
Mark Lakata <mark@lakata.org>
|
|
71
|
+
Mark Zeren <mzeren@vmware.com>
|
|
72
|
+
Martin Buck <buckmartin@buckmartin.de>
|
|
73
|
+
Martyn Gigg <martyn.gigg@gmail.com>
|
|
74
|
+
Mattes D <github@xoft.cz>
|
|
75
|
+
Matthias Loy <matthias.loy@hbm.com>
|
|
76
|
+
Merlyn Morgan-Graham <kavika@gmail.com>
|
|
77
|
+
Michael Shields <mshields@google.com>
|
|
78
|
+
Michał Górny <mgorny@gentoo.org>
|
|
79
|
+
Mike Naberezny <mike@naberezny.com>
|
|
80
|
+
mloy <matthias.loy@googlemail.com>
|
|
81
|
+
Motti <lanzkron@gmail.com>
|
|
82
|
+
nnkur <nnkur@mail.ru>
|
|
83
|
+
Omkar Wagh <owagh@owaghlinux.ny.tower-research.com>
|
|
84
|
+
paulo <paulobrizolara@users.noreply.github.com>
|
|
85
|
+
pavel.pimenov <pavel.pimenov@gmail.com>
|
|
86
|
+
Paweł Bylica <chfast@gmail.com>
|
|
87
|
+
Péricles Lopes Machado <pericles.raskolnikoff@gmail.com>
|
|
88
|
+
Peter Spiess-Knafl <psk@autistici.org>
|
|
89
|
+
pffang <pffang@vip.qq.com>
|
|
90
|
+
Rémi Verschelde <remi@verschelde.fr>
|
|
91
|
+
renu555 <renu.tyagi@samsung.com>
|
|
92
|
+
Robert Dailey <rcdailey@gmail.com>
|
|
93
|
+
Sam Clegg <sbc@chromium.org>
|
|
94
|
+
selaselah <selah@outlook.com>
|
|
95
|
+
Sergiy80 <sil2004@gmail.com>
|
|
96
|
+
sergzub <sergzub@gmail.com>
|
|
97
|
+
Stefan Schweter <stefan@schweter.it>
|
|
98
|
+
Steffen Kieß <Steffen.Kiess@ipvs.uni-stuttgart.de>
|
|
99
|
+
Steven Hahn <hahnse@ornl.gov>
|
|
100
|
+
Stuart Eichert <stuart@fivemicro.com>
|
|
101
|
+
SuperManitu <supermanitu@gmail.com>
|
|
102
|
+
Techwolf <dring@g33kworld.net>
|
|
103
|
+
Tengiz Sharafiev <btolfa+github@gmail.com>
|
|
104
|
+
Tomasz Maciejewski <tmaciejewsk@gmail.com>
|
|
105
|
+
Vicente Olivert Riera <Vincent.Riera@imgtec.com>
|
|
106
|
+
xiaoyur347 <xiaoyur347@gmail.com>
|
|
107
|
+
ycqiu <429148848@qq.com>
|
|
108
|
+
yiqiju <fred_ju@selinc.com>
|
|
109
|
+
Yu Xiaolei <dreifachstein@gmail.com>
|
|
110
|
+
|
|
111
|
+
Google Inc.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# vim: et ts=4 sts=4 sw=4 tw=0
|
|
2
|
+
|
|
3
|
+
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
|
|
4
|
+
PROJECT(jsoncpp)
|
|
5
|
+
ENABLE_TESTING()
|
|
6
|
+
|
|
7
|
+
OPTION(JSONCPP_WITH_TESTS "Compile and (for jsoncpp_check) run JsonCpp test executables" ON)
|
|
8
|
+
OPTION(JSONCPP_WITH_POST_BUILD_UNITTEST "Automatically run unit-tests as a post build step" ON)
|
|
9
|
+
OPTION(JSONCPP_WITH_WARNING_AS_ERROR "Force compilation to fail if a warning occurs" OFF)
|
|
10
|
+
OPTION(JSONCPP_WITH_STRICT_ISO "Issue all the warnings demanded by strict ISO C and ISO C++" ON)
|
|
11
|
+
OPTION(JSONCPP_WITH_PKGCONFIG_SUPPORT "Generate and install .pc files" ON)
|
|
12
|
+
OPTION(JSONCPP_WITH_CMAKE_PACKAGE "Generate and install cmake package files" OFF)
|
|
13
|
+
OPTION(BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." OFF)
|
|
14
|
+
OPTION(BUILD_STATIC_LIBS "Build jsoncpp_lib static library." ON)
|
|
15
|
+
|
|
16
|
+
# Ensures that CMAKE_BUILD_TYPE is visible in cmake-gui on Unix
|
|
17
|
+
IF(NOT WIN32)
|
|
18
|
+
IF(NOT CMAKE_BUILD_TYPE)
|
|
19
|
+
SET(CMAKE_BUILD_TYPE Release CACHE STRING
|
|
20
|
+
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage."
|
|
21
|
+
FORCE)
|
|
22
|
+
ENDIF()
|
|
23
|
+
ENDIF()
|
|
24
|
+
|
|
25
|
+
# Enable runtime search path support for dynamic libraries on OSX
|
|
26
|
+
IF(APPLE)
|
|
27
|
+
SET(CMAKE_MACOSX_RPATH 1)
|
|
28
|
+
ENDIF()
|
|
29
|
+
|
|
30
|
+
# Adhere to GNU filesystem layout conventions
|
|
31
|
+
INCLUDE(GNUInstallDirs)
|
|
32
|
+
|
|
33
|
+
SET(DEBUG_LIBNAME_SUFFIX "" CACHE STRING "Optional suffix to append to the library name for a debug build")
|
|
34
|
+
|
|
35
|
+
# Set variable named ${VAR_NAME} to value ${VALUE}
|
|
36
|
+
FUNCTION(set_using_dynamic_name VAR_NAME VALUE)
|
|
37
|
+
SET( "${VAR_NAME}" "${VALUE}" PARENT_SCOPE)
|
|
38
|
+
ENDFUNCTION()
|
|
39
|
+
|
|
40
|
+
# Extract major, minor, patch from version text
|
|
41
|
+
# Parse a version string "X.Y.Z" and outputs
|
|
42
|
+
# version parts in ${OUPUT_PREFIX}_MAJOR, _MINOR, _PATCH.
|
|
43
|
+
# If parse succeeds then ${OUPUT_PREFIX}_FOUND is TRUE.
|
|
44
|
+
MACRO(jsoncpp_parse_version VERSION_TEXT OUPUT_PREFIX)
|
|
45
|
+
SET(VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+(-[a-zA-Z0-9_]+)?")
|
|
46
|
+
IF( ${VERSION_TEXT} MATCHES ${VERSION_REGEX} )
|
|
47
|
+
STRING(REGEX MATCHALL "[0-9]+|-([A-Za-z0-9_]+)" VERSION_PARTS ${VERSION_TEXT})
|
|
48
|
+
LIST(GET VERSION_PARTS 0 ${OUPUT_PREFIX}_MAJOR)
|
|
49
|
+
LIST(GET VERSION_PARTS 1 ${OUPUT_PREFIX}_MINOR)
|
|
50
|
+
LIST(GET VERSION_PARTS 2 ${OUPUT_PREFIX}_PATCH)
|
|
51
|
+
set_using_dynamic_name( "${OUPUT_PREFIX}_FOUND" TRUE )
|
|
52
|
+
ELSE( ${VERSION_TEXT} MATCHES ${VERSION_REGEX} )
|
|
53
|
+
set_using_dynamic_name( "${OUPUT_PREFIX}_FOUND" FALSE )
|
|
54
|
+
ENDIF()
|
|
55
|
+
ENDMACRO()
|
|
56
|
+
|
|
57
|
+
# Read out version from "version" file
|
|
58
|
+
#FILE(STRINGS "version" JSONCPP_VERSION)
|
|
59
|
+
#SET( JSONCPP_VERSION_MAJOR X )
|
|
60
|
+
#SET( JSONCPP_VERSION_MINOR Y )
|
|
61
|
+
#SET( JSONCPP_VERSION_PATCH Z )
|
|
62
|
+
SET( JSONCPP_VERSION 1.8.4 )
|
|
63
|
+
jsoncpp_parse_version( ${JSONCPP_VERSION} JSONCPP_VERSION )
|
|
64
|
+
#IF(NOT JSONCPP_VERSION_FOUND)
|
|
65
|
+
# MESSAGE(FATAL_ERROR "Failed to parse version string properly. Expect X.Y.Z")
|
|
66
|
+
#ENDIF(NOT JSONCPP_VERSION_FOUND)
|
|
67
|
+
SET( JSONCPP_SOVERSION 19 )
|
|
68
|
+
SET( JSONCPP_USE_SECURE_MEMORY "0" CACHE STRING "-D...=1 to use memory-wiping allocator for STL" )
|
|
69
|
+
|
|
70
|
+
MESSAGE(STATUS "JsonCpp Version: ${JSONCPP_VERSION_MAJOR}.${JSONCPP_VERSION_MINOR}.${JSONCPP_VERSION_PATCH}")
|
|
71
|
+
# File version.h is only regenerated on CMake configure step
|
|
72
|
+
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/src/lib_json/version.h.in"
|
|
73
|
+
"${PROJECT_SOURCE_DIR}/include/json/version.h"
|
|
74
|
+
NEWLINE_STYLE UNIX )
|
|
75
|
+
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/version.in"
|
|
76
|
+
"${PROJECT_SOURCE_DIR}/version"
|
|
77
|
+
NEWLINE_STYLE UNIX )
|
|
78
|
+
|
|
79
|
+
MACRO(UseCompilationWarningAsError)
|
|
80
|
+
IF(MSVC)
|
|
81
|
+
# Only enabled in debug because some old versions of VS STL generate
|
|
82
|
+
# warnings when compiled in release configuration.
|
|
83
|
+
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /WX ")
|
|
84
|
+
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
85
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
|
86
|
+
IF(JSONCPP_WITH_STRICT_ISO)
|
|
87
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors")
|
|
88
|
+
ENDIF()
|
|
89
|
+
ENDIF()
|
|
90
|
+
ENDMACRO()
|
|
91
|
+
|
|
92
|
+
# Include our configuration header
|
|
93
|
+
INCLUDE_DIRECTORIES( ${jsoncpp_SOURCE_DIR}/include )
|
|
94
|
+
|
|
95
|
+
IF(MSVC)
|
|
96
|
+
# Only enabled in debug because some old versions of VS STL generate
|
|
97
|
+
# unreachable code warning when compiled in release configuration.
|
|
98
|
+
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W4 ")
|
|
99
|
+
ENDIF()
|
|
100
|
+
|
|
101
|
+
# Require C++11 support, prefer ISO C++ over GNU variants,
|
|
102
|
+
# as relying solely on ISO C++ is more portable.
|
|
103
|
+
SET(CMAKE_CXX_STANDARD 11)
|
|
104
|
+
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
105
|
+
SET(CMAKE_CXX_EXTENSIONS OFF)
|
|
106
|
+
|
|
107
|
+
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
108
|
+
# using regular Clang or AppleClang
|
|
109
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wconversion -Wshadow -Werror=conversion -Werror=sign-compare")
|
|
110
|
+
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
111
|
+
# using GCC
|
|
112
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wconversion -Wshadow -Wextra")
|
|
113
|
+
# not yet ready for -Wsign-conversion
|
|
114
|
+
|
|
115
|
+
IF(JSONCPP_WITH_STRICT_ISO)
|
|
116
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
|
|
117
|
+
ENDIF()
|
|
118
|
+
IF(JSONCPP_WITH_WARNING_AS_ERROR)
|
|
119
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=conversion")
|
|
120
|
+
ENDIF()
|
|
121
|
+
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
|
122
|
+
# using Intel compiler
|
|
123
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wconversion -Wshadow -Wextra -Werror=conversion")
|
|
124
|
+
|
|
125
|
+
IF(JSONCPP_WITH_STRICT_ISO AND NOT JSONCPP_WITH_WARNING_AS_ERROR)
|
|
126
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
|
|
127
|
+
ENDIF()
|
|
128
|
+
ENDIF()
|
|
129
|
+
|
|
130
|
+
FIND_PROGRAM(CCACHE_FOUND ccache)
|
|
131
|
+
IF(CCACHE_FOUND)
|
|
132
|
+
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
|
133
|
+
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
|
134
|
+
ENDIF(CCACHE_FOUND)
|
|
135
|
+
|
|
136
|
+
IF(JSONCPP_WITH_WARNING_AS_ERROR)
|
|
137
|
+
UseCompilationWarningAsError()
|
|
138
|
+
ENDIF()
|
|
139
|
+
|
|
140
|
+
IF(JSONCPP_WITH_PKGCONFIG_SUPPORT)
|
|
141
|
+
CONFIGURE_FILE(
|
|
142
|
+
"pkg-config/jsoncpp.pc.in"
|
|
143
|
+
"pkg-config/jsoncpp.pc"
|
|
144
|
+
@ONLY)
|
|
145
|
+
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/pkg-config/jsoncpp.pc"
|
|
146
|
+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
|
147
|
+
ENDIF()
|
|
148
|
+
|
|
149
|
+
IF(JSONCPP_WITH_CMAKE_PACKAGE)
|
|
150
|
+
INSTALL(EXPORT jsoncpp
|
|
151
|
+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/jsoncpp
|
|
152
|
+
FILE jsoncppConfig.cmake)
|
|
153
|
+
ENDIF()
|
|
154
|
+
|
|
155
|
+
# Build the different applications
|
|
156
|
+
ADD_SUBDIRECTORY( src )
|
|
157
|
+
|
|
158
|
+
#install the includes
|
|
159
|
+
ADD_SUBDIRECTORY( include )
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
The JsonCpp library's source code, including accompanying documentation,
|
|
2
|
+
tests and demonstration applications, are licensed under the following
|
|
3
|
+
conditions...
|
|
4
|
+
|
|
5
|
+
Baptiste Lepilleur and The JsonCpp Authors explicitly disclaim copyright in all
|
|
6
|
+
jurisdictions which recognize such a disclaimer. In such jurisdictions,
|
|
7
|
+
this software is released into the Public Domain.
|
|
8
|
+
|
|
9
|
+
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
|
|
10
|
+
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur and
|
|
11
|
+
The JsonCpp Authors, and is released under the terms of the MIT License (see below).
|
|
12
|
+
|
|
13
|
+
In jurisdictions which recognize Public Domain property, the user of this
|
|
14
|
+
software may choose to accept it either as 1) Public Domain, 2) under the
|
|
15
|
+
conditions of the MIT License (see below), or 3) under the terms of dual
|
|
16
|
+
Public Domain/MIT License conditions described here, as they choose.
|
|
17
|
+
|
|
18
|
+
The MIT License is about as close to Public Domain as a license can get, and is
|
|
19
|
+
described in clear, concise terms at:
|
|
20
|
+
|
|
21
|
+
http://en.wikipedia.org/wiki/MIT_License
|
|
22
|
+
|
|
23
|
+
The full text of the MIT License follows:
|
|
24
|
+
|
|
25
|
+
========================================================================
|
|
26
|
+
Copyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
|
|
27
|
+
|
|
28
|
+
Permission is hereby granted, free of charge, to any person
|
|
29
|
+
obtaining a copy of this software and associated documentation
|
|
30
|
+
files (the "Software"), to deal in the Software without
|
|
31
|
+
restriction, including without limitation the rights to use, copy,
|
|
32
|
+
modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
33
|
+
of the Software, and to permit persons to whom the Software is
|
|
34
|
+
furnished to do so, subject to the following conditions:
|
|
35
|
+
|
|
36
|
+
The above copyright notice and this permission notice shall be
|
|
37
|
+
included in all copies or substantial portions of the Software.
|
|
38
|
+
|
|
39
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
40
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
41
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
42
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
43
|
+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
44
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
45
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
46
|
+
SOFTWARE.
|
|
47
|
+
========================================================================
|
|
48
|
+
(END LICENSE TEXT)
|
|
49
|
+
|
|
50
|
+
The MIT license is compatible with both the GPL and commercial
|
|
51
|
+
software, affording one all of the rights of Public Domain with the
|
|
52
|
+
minor nuisance of being required to keep the above copyright notice
|
|
53
|
+
and license text in the source code. Note also that by accepting the
|
|
54
|
+
Public Domain "license" you can re-license your copy using whatever
|
|
55
|
+
license you like.
|