commit
722f766274
@ -1,9 +1,9 @@ |
||||
cmake_minimum_required(VERSION 3.4.1) |
||||
|
||||
add_library(native-lib SHARED |
||||
native-lib.c) |
||||
add_library(keys SHARED |
||||
keys.c) |
||||
|
||||
# Include libraries needed for native-lib lib |
||||
target_link_libraries(native-lib |
||||
target_link_libraries(keys |
||||
android |
||||
log) |
||||
|
@ -0,0 +1,54 @@ |
||||
|
||||
#include <string.h> |
||||
#include <alloca.h> |
||||
#include <jni.h> |
||||
#if __has_include ("..\..\..\..\keys.secret") |
||||
# define HAS_KEYS 1 |
||||
# include "..\..\..\..\keys.secret" |
||||
#else |
||||
# define HAS_KEYS 0 |
||||
#endif |
||||
|
||||
JNIEXPORT jstring JNICALL |
||||
Java_com_alphawallet_app_repository_EthereumNetworkBase_getAmberDataKey( JNIEnv* env, jobject thiz ) |
||||
{ |
||||
#if (HAS_KEYS == 1) |
||||
return getDecryptedKey(env, amberdataKey); |
||||
#else |
||||
const jstring key = "obtain-api-key-from-amberdata-io"; |
||||
return (*env)->NewStringUTF(env, key); |
||||
#endif |
||||
} |
||||
|
||||
JNIEXPORT jstring JNICALL |
||||
Java_com_alphawallet_app_repository_EthereumNetworkBase_getInfuraKey( JNIEnv* env, jobject thiz ) |
||||
{ |
||||
#if (HAS_KEYS == 1) |
||||
return getDecryptedKey(env, infuraKey); |
||||
#else |
||||
const jstring key = "da3717f25f824cc1baa32d812386d93f"; |
||||
return (*env)->NewStringUTF(env, key); |
||||
#endif |
||||
} |
||||
|
||||
JNIEXPORT jstring JNICALL |
||||
Java_com_alphawallet_app_service_TickerService_getAmberDataKey( JNIEnv* env, jobject thiz ) |
||||
{ |
||||
#if (HAS_KEYS == 1) |
||||
return getDecryptedKey(env, amberdataKey); |
||||
#else |
||||
const jstring key = "obtain-api-key-from-amberdata-io"; |
||||
return (*env)->NewStringUTF(env, key); |
||||
#endif |
||||
} |
||||
|
||||
JNIEXPORT jstring JNICALL |
||||
Java_com_alphawallet_app_service_TickerService_getCMCKey( JNIEnv* env, jobject thiz ) |
||||
{ |
||||
#if (HAS_KEYS == 1) |
||||
return getDecryptedKey(env, cmcKey); |
||||
#else |
||||
const jstring key = "ea2d0a6b-7e77-4015-bccf-4877e5c5b882"; |
||||
return (*env)->NewStringUTF(env, key); |
||||
#endif |
||||
} |
@ -1,21 +0,0 @@ |
||||
|
||||
#include <string.h> |
||||
#include <jni.h> |
||||
|
||||
|
||||
|
||||
JNIEXPORT jstring JNICALL |
||||
Java_com_wallet_crypto_trustapp_controller_PasswordManager_getKeyStringFromNative( JNIEnv* env, jobject thiz ) |
||||
{ |
||||
// TODO: fill in your key - must be 32 bytes
|
||||
const jstring key = "ThisIsNotTheKeyYoureLookingFor!!"; |
||||
return (*env)->NewStringUTF(env, key); |
||||
} |
||||
|
||||
JNIEXPORT jbyteArray JNICALL |
||||
Java_com_wallet_crypto_trustapp_controller_PasswordManager_getIvStringFromNative( JNIEnv* env, jobject thiz ) |
||||
{ |
||||
// TODO: fill in your iv - must be 16 bytes
|
||||
const jstring iv = "NorTheInitVector"; |
||||
return (*env)->NewStringUTF(env, iv); |
||||
} |
Loading…
Reference in new issue