Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test-app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ tasks.configureEach({ DefaultTask currentTask ->

// // ensure buildMetadata is done before R8 to allow custom proguard from metadata
if (currentTask =~ /minify.*WithR8/) {
buildMetadata.finalizedBy(currentTask)
// buildMetadata.finalizedBy(currentTask)
}
if (currentTask =~ /assemble.*Debug/ || currentTask =~ /assemble.*Release/) {
currentTask.finalizedBy("validateAppIdMatch")
Expand Down
2 changes: 2 additions & 0 deletions test-app/runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ android {
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
}
}

consumerProguardFiles 'consumer-rules.pro'
}

compileOptions {
Expand Down
11 changes: 11 additions & 0 deletions test-app/runtime/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Keep all runtime classes
-keep class com.tns.* { *; }

# Keep SBG-generated classes
-keep class com.tns.gen.** { *; }

# Keep internal support/runtime classes
-keep class com.tns.internal.** { *; }

# Preserve annotation metadata so reflection sees them
-keepattributes RuntimeVisibleAnnotations
9 changes: 3 additions & 6 deletions test-app/runtime/src/main/cpp/NativeScriptException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ void NativeScriptException::ReThrowToJava() {


if (!m_javaException.IsNull()) {
auto objectManager = Runtime::GetObjectManager(isolate);
auto excClassName = objectManager->GetClassName((jobject) m_javaException);
auto excClassName = ObjectManager::GetClassName((jobject) m_javaException);
if (excClassName == "com/tns/NativeScriptException") {
ex = m_javaException;
} else {
Expand All @@ -103,8 +102,7 @@ void NativeScriptException::ReThrowToJava() {
if (ex == nullptr) {
ex = static_cast<jthrowable>(env.NewObject(NATIVESCRIPTEXCEPTION_CLASS, NATIVESCRIPTEXCEPTION_JSVALUE_CTOR_ID, (jstring) msg, (jstring)stackTrace, reinterpret_cast<jlong>(m_javascriptException)));
} else {
auto objectManager = Runtime::GetObjectManager(isolate);
auto excClassName = objectManager->GetClassName(ex);
auto excClassName = ObjectManager::GetClassName(ex);
if (excClassName != "com/tns/NativeScriptException") {
ex = static_cast<jthrowable>(env.NewObject(NATIVESCRIPTEXCEPTION_CLASS, NATIVESCRIPTEXCEPTION_THROWABLE_CTOR_ID, (jstring) msg, (jstring)stackTrace, ex));
}
Expand Down Expand Up @@ -184,9 +182,8 @@ Local<Value> NativeScriptException::WrapJavaToJsException() {
JEnv env;

auto isolate = Isolate::GetCurrent();
auto objectManager = Runtime::GetObjectManager(isolate);

string excClassName = objectManager->GetClassName((jobject) m_javaException);
string excClassName = ObjectManager::GetClassName((jobject) m_javaException);
if (excClassName == "com/tns/NativeScriptException") {
jfieldID fieldID = env.GetFieldID(env.GetObjectClass(m_javaException), "jsValueAddress", "J");
jlong addr = env.GetLongField(m_javaException, fieldID);
Expand Down
Loading
Loading