Skip to content

Commit

Permalink
Fix to ProGuard settings for hardcoded method name in NativeAudioEngi…
Browse files Browse the repository at this point in the history
…ne.cpp
  • Loading branch information
aschober committed May 24, 2020
1 parent cf47623 commit 4625376
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Note: the onAudioData method name is hardcoded in NativeAudioEngine.cpp so need to tell ProGuard to skip it
-keep public interface tech.schober.vinylcast.audio.NativeAudioEngineListener {
void onAudioData(byte[]);
}
1 change: 1 addition & 0 deletions app/src/main/cpp/NativeAudioEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void NativeAudioEngine::setAudioDataListener(JNIEnv *env, jobject instance, jobj
jclass jClassAudioDataListener = env->GetObjectClass(callbackObject);

//declare java method id
//Note: this method name is hardcoded so need to tell ProGuard to skip it
jmethodID jMethodIdOnAudioData = env->GetMethodID(jClassAudioDataListener, "onAudioData", "([B)V");

//check null
Expand Down

0 comments on commit 4625376

Please sign in to comment.