Skip to content

Commit

Permalink
Fix dex2oat fallback (LSPosed#2320)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-TSNG authored Jan 15, 2023
1 parent 182ec5c commit 0969a25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion daemon/src/main/jni/dex2oat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <sys/sendfile.h>
#include <sys/stat.h>
#include <sys/system_properties.h>
#include <sys/wait.h>
#include <unistd.h>

#include "logging.h"
Expand Down Expand Up @@ -112,7 +113,9 @@ Java_org_lsposed_lspd_service_Dex2OatService_initNative(JNIEnv *env, jobject thi
extern "C"
JNIEXPORT void JNICALL
Java_org_lsposed_lspd_service_Dex2OatService_setEnabled(JNIEnv *env, jobject thiz, jboolean enabled) {
if (vfork() == 0) {
if (pid_t pid = fork(); pid > 0) { // parent
waitpid(pid, nullptr, 0);
} else { // child
int ns = open("/proc/1/ns/mnt", O_RDONLY);
setns(ns, CLONE_NEWNS);
close(ns);
Expand Down

0 comments on commit 0969a25

Please sign in to comment.