Skip to content

Commit 035cbd9

Browse files
Efraín EspadaEfraín Espada
authored andcommitted
test logging
1 parent d4272eb commit 035cbd9

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

library/src/main/cpp/native-lib.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
#include <string>
33

44
extern "C" JNIEXPORT jstring JNICALL
5-
Java_com_stringcare_library_SC_stringFromJNI(
5+
Java_com_stringcare_library_SC_sign(
66
JNIEnv *env,
7-
jobject /* this */) {
7+
jobject /* this */,
8+
jstring key) {
89
std::string hello = "Hello from C++";
9-
return env->NewStringUTF(hello.c_str());
10+
// return env->NewStringUTF(hello.c_str());
11+
return key;
1012
}

library/src/main/java/com/stringcare/library/SC.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private SC () {
5252
* A native method that is implemented by the 'native-lib' native library,
5353
* which is packaged with this application.
5454
*/
55-
public static native String stringFromJNI();
55+
public static native String sign(String key);
5656

5757
public static void init(Context c) {
5858
context = c;
@@ -69,7 +69,7 @@ public static void onContextReady(ContextListener listener) {
6969

7070
private static String getCertificateSHA1Fingerprint() {
7171
String packageName = context.getPackageName();
72-
return getCertificateSHA1Fingerprint(packageName);
72+
return sign(getCertificateSHA1Fingerprint(packageName));
7373
}
7474

7575
private static String getCertificateSHA1Fingerprint(String packageName) {
@@ -182,7 +182,6 @@ private static String byteArrayToHexString(byte[] bytes) {
182182
* @return String
183183
*/
184184
public static String getString(@StringRes int id) {
185-
if (true) return SC.stringFromJNI();
186185
if (context == null) {
187186
Log.e(TAG, "Library not initialized: SC.init(Context)");
188187
return null;

0 commit comments

Comments
 (0)