Skip to content

Commit 1799f43

Browse files
Efraín EspadaEfraín Espada
authored andcommitted
methods
1 parent 174b178 commit 1799f43

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ buildscript {
1616

1717
dependencies {
1818
// classpath "com.stringcare:plugin:$stringcare_version"
19-
// classpath files('../GradlePlugin/build/libs/plugin-0.9.jar')
20-
classpath files('..\\GradlePlugin\\build\\libs\\plugin-0.9.jar')
19+
classpath files('../GradlePlugin/build/libs/plugin-0.9.jar')
20+
// classpath files('..\\GradlePlugin\\build\\libs\\plugin-0.9.jar')
2121
classpath 'com.android.tools.build:gradle:3.2.1'
2222
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1"
2323
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,27 @@ Java_com_stringcare_library_SC_sign(
1010
// return env->NewStringUTF(hello.c_str());
1111
return key;
1212
}
13+
14+
extern "C" JNIEXPORT jstring JNICALL
15+
Java_com_stringcare_library_SC_obfuscate(
16+
JNIEnv *env,
17+
jclass /* this */,
18+
jobject context,
19+
jstring key,
20+
jstring value) {
21+
std::string hello = "Hello from C++";
22+
// return env->NewStringUTF(hello.c_str());
23+
return key;
24+
}
25+
26+
extern "C" JNIEXPORT jstring JNICALL
27+
Java_com_stringcare_library_SC_deobfuscate(
28+
JNIEnv *env,
29+
jclass /* this */,
30+
jobject context,
31+
jstring key,
32+
jstring value) {
33+
std::string hello = "Hello from C++";
34+
// return env->NewStringUTF(hello.c_str());
35+
return key;
36+
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ private SC () {
5353
*/
5454
public static native String sign(String key);
5555

56+
public static native String obfuscate(Context context, String key, String value);
57+
58+
public static native String deobfuscate(Context context, String key, String value);
59+
5660
public static void init(Context c) {
5761
context = c;
5862
if (!listeners.isEmpty()) {

0 commit comments

Comments
 (0)