Skip to content

Commit

Permalink
Fix: fix call next & build (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr328 authored Oct 22, 2023
1 parent 147d03b commit af6c286
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 70 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

subprojects {
group = "com.github.kr328.gradle.zygote"
version = "3.0"
version = "3.1"

plugins.withId("java") {
extensions.configure<JavaPluginExtension> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public void decorateVariant(final Loader loader, final ApplicationVariant varian

moduleProp.put("version", variantOutput.getVersionName().getOrElse(""));
moduleProp.put("versionCode", variantOutput.getVersionCode().getOrElse(0).toString());
moduleProp.put("minSdkVersion", String.valueOf(variant.getMinSdkVersion().getApiLevel()));
if (variant.getMaxSdkVersion() != null) {
moduleProp.put("maxSdkVersion", String.valueOf(variant.getMaxSdkVersion()));
moduleProp.put("minSdkVersion", String.valueOf(variant.getMaxSdk()));
if (variant.getMaxSdk() != null) {
moduleProp.put("maxSdkVersion", String.valueOf(variant.getMaxSdk()));
}

if (loader == Loader.Riru) {
Expand Down Expand Up @@ -83,7 +83,7 @@ public void decorateVariant(final Loader loader, final ApplicationVariant varian
"mergeMagisk" + StringUtils.capitalize(variant.getName()),
Sync.class,
task -> {
task.setDestinationDir(new File(project.getBuildDir(), "intermediates/merged_magisk/" + variant.getName()));
task.into(project.getLayout().getBuildDirectory().dir("intermediates/merged_magisk/" + variant.getName()));

final Provider<File> apkFile = pack.map(p ->
p.getOutputs().getFiles().getFiles().stream()
Expand Down
1 change: 1 addition & 0 deletions runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ android {
}

buildFeatures {
buildConfig = true
prefab = true
}

Expand Down
16 changes: 15 additions & 1 deletion runtime/src/main/cpp/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <malloc.h>
#include <string.h>
#include <stdarg.h>

static jclass c_binder;
static jmethodID m_exec_transact;
Expand Down Expand Up @@ -38,6 +39,19 @@ static jboolean replaced_call_boolean_method_v(
return original_jni_env->CallBooleanMethodV(env, obj, method, args);
}

static jboolean JNICALL invoke_next_call_boolean_method(
JNIEnv *env,
jobject obj,
jmethodID method,
...
) {
va_list args;
va_start(args, method);
jboolean ret = original_jni_env->CallBooleanMethodV(env, obj, method, args);
va_end(args);
return ret;
}

static jboolean JNICALL jni_call_exec_transact(
JNIEnv *env,
jclass clazz,
Expand All @@ -57,7 +71,7 @@ static jboolean JNICALL jni_call_exec_transact(
reply_ptr = original_jni_env->GetLongField(env, data, f_native_ptr);
}

return original_jni_env->CallBooleanMethod(
return invoke_next_call_boolean_method(
env,
binder,
m_exec_transact,
Expand Down
Loading

0 comments on commit af6c286

Please sign in to comment.