From d423203d960e6e2340798f00f907d2b1271c3d89 Mon Sep 17 00:00:00 2001 From: nea Date: Thu, 8 Jun 2023 03:47:38 +0200 Subject: Use kotlin buildscript --- nosession_libc/src/main/cpp/libc.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 nosession_libc/src/main/cpp/libc.cpp (limited to 'nosession_libc/src/main/cpp/libc.cpp') diff --git a/nosession_libc/src/main/cpp/libc.cpp b/nosession_libc/src/main/cpp/libc.cpp new file mode 100644 index 0000000..060e83e --- /dev/null +++ b/nosession_libc/src/main/cpp/libc.cpp @@ -0,0 +1,31 @@ +#include +#include "unistd.h" +#include +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: gq_malwarefight_nosession_linux_libc_Libc + * Method: geteuid + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_gq_malwarefight_nosession_linux_libc_Libc_geteuid + (JNIEnv *, jclass) { + return (int) geteuid(); +} + +/* + * Class: gq_malwarefight_nosession_linux_libc_Libc + * Method: unlink + * Signature: (Ljava/lang/String;)I + */ +JNIEXPORT void JNICALL Java_gq_malwarefight_nosession_linux_libc_Libc_unlink + (JNIEnv* env, jclass, jstring string) { + const char* path = env->GetStringUTFChars(string, NULL); + unlink(path); + env->ReleaseStringUTFChars(string, path); +} + +#ifdef __cplusplus +} +#endif -- cgit