File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
java/com/stringcare/library Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 22#include < string>
33
44extern " 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}
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments