diff --git a/.gitmodules b/.gitmodules index bdf0d69ee..3d664332b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,45 +1,45 @@ [submodule "selinux"] - path = native/jni/external/selinux + path = native/src/external/selinux url = https://github.com/topjohnwu/selinux.git [submodule "busybox"] - path = native/jni/external/busybox + path = native/src/external/busybox url = https://github.com/topjohnwu/ndk-busybox.git [submodule "dtc"] - path = native/jni/external/dtc + path = native/src/external/dtc url = https://github.com/dgibson/dtc.git [submodule "lz4"] - path = native/jni/external/lz4 + path = native/src/external/lz4 url = https://github.com/lz4/lz4.git [submodule "bzip2"] - path = native/jni/external/bzip2 + path = native/src/external/bzip2 url = https://github.com/nemequ/bzip2.git [submodule "xz"] - path = native/jni/external/xz + path = native/src/external/xz url = https://github.com/xz-mirror/xz.git [submodule "nanopb"] - path = native/jni/external/nanopb + path = native/src/external/nanopb url = https://github.com/nanopb/nanopb.git [submodule "mincrypt"] - path = native/jni/external/mincrypt + path = native/src/external/mincrypt url = https://github.com/topjohnwu/mincrypt.git [submodule "pcre"] - path = native/jni/external/pcre + path = native/src/external/pcre url = https://android.googlesource.com/platform/external/pcre [submodule "libcxx"] - path = native/jni/external/libcxx + path = native/src/external/libcxx url = https://github.com/topjohnwu/libcxx.git [submodule "zlib"] - path = native/jni/external/zlib + path = native/src/external/zlib url = https://android.googlesource.com/platform/external/zlib [submodule "parallel-hashmap"] - path = native/jni/external/parallel-hashmap + path = native/src/external/parallel-hashmap url = https://github.com/greg7mdp/parallel-hashmap.git +[submodule "zopfli"] + path = native/src/external/zopfli + url = https://github.com/google/zopfli.git +[submodule "cxx-rs"] + path = native/src/external/cxx-rs + url = https://github.com/topjohnwu/cxx.git [submodule "termux-elf-cleaner"] path = tools/termux-elf-cleaner url = https://github.com/termux/termux-elf-cleaner.git -[submodule "zopfli"] - path = native/jni/external/zopfli - url = https://github.com/google/zopfli.git -[submodule "cxx-rs"] - path = native/jni/external/cxx-rs - url = https://github.com/topjohnwu/cxx.git diff --git a/build.py b/build.py index 55bac75a6..224ad1ddd 100755 --- a/build.py +++ b/build.py @@ -211,6 +211,7 @@ def binary_dump(src, var_name): def run_ndk_build(flags): os.chdir('native') + flags = 'NDK_PROJECT_PATH=. NDK_APPLICATION_MK=src/Application.mk ' + flags proc = system(f'{ndk_build} {flags} -j{cpu_count}') if proc.returncode != 0: error('Build binary failed!') @@ -223,7 +224,7 @@ def run_ndk_build(flags): def run_cargo_build(args): - os.chdir(op.join('native', 'rust')) + os.chdir(op.join('native', 'src')) targets = set(args.target) & set(rust_targets) env = os.environ.copy() @@ -242,9 +243,9 @@ def run_cargo_build(args): cxxbridge = op.join(local_cargo_root, 'bin', 'cxxbridge' + EXE_EXT) mkdir(native_gen_path) for p in ['base', 'boot', 'core', 'init', 'sepolicy']: - text = cmd_out([cxxbridge, op.join(p, 'src', 'lib.rs')]) + text = cmd_out([cxxbridge, op.join(p, 'lib.rs')]) write_if_diff(op.join(native_gen_path, f'{p}-rs.cpp'), text) - text = cmd_out([cxxbridge, '--header', op.join(p, 'src', 'lib.rs')]) + text = cmd_out([cxxbridge, '--header', op.join(p, 'lib.rs')]) write_if_diff(op.join(native_gen_path, f'{p}-rs.hpp'), text) # Start building the actual build commands diff --git a/native/README.md b/native/README.md index 291ee6801..f3d010e9d 100644 --- a/native/README.md +++ b/native/README.md @@ -4,24 +4,17 @@ Install the NDK required to build and develop Magisk with `./build.py ndk`. The NDK will be installed to `$ANDROID_SDK_ROOT/ndk/magisk`. You don't need to manually install a Rust toolchain with `rustup`, as the NDK installed already has a Rust toolchain bundled. -## Code Paths - -- `jni`: Magisk's code in C++ -- `jni/external`: external dependencies, mostly submodules -- `rust`: Magisk's code in Rust -- `src`: irrelevant, only exists to setup a native Android Studio project - ## Build Configs -All C/C++ code and its dependencies are built with [`ndk-build`](https://developer.android.com/ndk/guides/ndk-build) and configured with several `*.mk` files scatterred in many places. +All C/C++ code and its dependencies are built with [`ndk-build`](https://developer.android.com/ndk/guides/ndk-build) and configured with several `*.mk` files scattered in many places. -The `rust` folder is a proper Cargo workspace, and all Rust code is built with `cargo` just like any other Rust projects. +The `src` folder is also a proper Cargo workspace, and all Rust code is built with `cargo` just like normal Rust projects. ## Rust + C/C++ To reduce complexity involved in linking, all Rust code is built as `staticlib` and linked to C++ targets to ensure our final product is built with an officially supported NDK build system. Each C++ target can at most link to **one** Rust `staticlib` or else multiple definitions error will occur. -We use the [`cxx`](https://cxx.rs) project for interop between Rust and C++. Although cxx supports interop in both directions, for Magisk, it is strongly advised to avoid calling C++ functions in Rust; if some functionality required in Rust is already implemented in C++, the desired solution is to port the C++ implementation into Rust and export the migrated function back to C++. +We use the [`cxx`](https://cxx.rs) project for Rust and C++ interop. ## Development / IDE @@ -29,6 +22,6 @@ All C++ code should be recognized and properly indexed by Android Studio out of - Install the [Rust plugin](https://www.jetbrains.com/rust/) in Android Studio - In Preferences > Languages & Frameworks > Rust, set `$ANDROID_SDK_ROOT/ndk/magisk/toolchains/rust/bin` as the toolchain location -- Open `native/rust/Cargo.toml`, and select "Attach" in the "No Cargo projects found" banner +- Open `native/src/Cargo.toml`, and select "Attach" in the "No Cargo projects found" banner Note: run `./build.py binary` before developing to make sure generated code is created. diff --git a/native/build.gradle.kts b/native/build.gradle.kts index caf3fdc3a..6381235c6 100644 --- a/native/build.gradle.kts +++ b/native/build.gradle.kts @@ -9,10 +9,14 @@ android { externalNativeBuild { ndkBuild { - path("jni/Android.mk") + path("src/Android.mk") } } + sourceSets.getByName("main") { + manifest.srcFile("src/AndroidManifest.xml") + } + defaultConfig { externalNativeBuild { ndkBuild { diff --git a/native/rust/.gitignore b/native/rust/.gitignore deleted file mode 100644 index 9f970225a..000000000 --- a/native/rust/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target/ \ No newline at end of file diff --git a/native/jni/.gitignore b/native/src/.gitignore similarity index 52% rename from native/jni/.gitignore rename to native/src/.gitignore index d071f4fe6..08095cb94 100644 --- a/native/jni/.gitignore +++ b/native/src/.gitignore @@ -1 +1,2 @@ test.cpp +target/ diff --git a/native/jni/Android-rs.mk b/native/src/Android-rs.mk similarity index 100% rename from native/jni/Android-rs.mk rename to native/src/Android-rs.mk diff --git a/native/jni/Android.mk b/native/src/Android.mk similarity index 94% rename from native/jni/Android.mk rename to native/src/Android.mk index 8e5341b38..5cabd20d4 100644 --- a/native/jni/Android.mk +++ b/native/src/Android.mk @@ -153,7 +153,7 @@ include $(BUILD_EXECUTABLE) endif ifdef B_TEST -ifneq (,$(wildcard jni/test.cpp)) +ifneq (,$(wildcard src/test.cpp)) include $(CLEAR_VARS) LOCAL_MODULE := test @@ -176,7 +176,7 @@ LOCAL_MODULE := libpolicy LOCAL_STATIC_LIBRARIES := \ libbase \ libsepol -LOCAL_C_INCLUDES := jni/sepolicy/include +LOCAL_C_INCLUDES := src/sepolicy/include LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) LOCAL_SRC_FILES := \ sepolicy/api.cpp \ @@ -186,12 +186,12 @@ LOCAL_SRC_FILES := \ sepolicy/statement.cpp include $(BUILD_STATIC_LIBRARY) -include jni/Android-rs.mk -include jni/base/Android.mk -include jni/external/Android.mk +include src/Android-rs.mk +include src/base/Android.mk +include src/external/Android.mk ifdef B_BB -include jni/external/busybox/Android.mk +include src/external/busybox/Android.mk endif diff --git a/native/src/AndroidManifest.xml b/native/src/AndroidManifest.xml new file mode 100644 index 000000000..854e19c1a --- /dev/null +++ b/native/src/AndroidManifest.xml @@ -0,0 +1,2 @@ + + diff --git a/native/jni/Application.mk b/native/src/Application.mk similarity index 85% rename from native/jni/Application.mk rename to native/src/Application.mk index be5423325..06c2657a9 100644 --- a/native/jni/Application.mk +++ b/native/src/Application.mk @@ -1,3 +1,4 @@ +APP_BUILD_SCRIPT := src/Android.mk APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 APP_CFLAGS := -Wall -Oz -fomit-frame-pointer -flto APP_LDFLAGS := -flto @@ -10,7 +11,7 @@ APP_STRIP_MODE := --strip-all # Busybox should use stock libc.a ifdef B_BB APP_PLATFORM := android-24 -APP_LDFLAGS += -T jni/lto_fix.lds +APP_LDFLAGS += -T src/lto_fix.lds ifeq ($(OS),Windows_NT) APP_SHORT_COMMANDS := true endif diff --git a/native/rust/Cargo.lock b/native/src/Cargo.lock similarity index 100% rename from native/rust/Cargo.lock rename to native/src/Cargo.lock diff --git a/native/rust/Cargo.toml b/native/src/Cargo.toml similarity index 87% rename from native/rust/Cargo.toml rename to native/src/Cargo.toml index 56fc4ad3d..78c62a3bf 100644 --- a/native/rust/Cargo.toml +++ b/native/src/Cargo.toml @@ -23,4 +23,4 @@ panic = "abort" strip = true [patch.crates-io] -cxx = { path = "../jni/external/cxx-rs" } +cxx = { path = "../src/external/cxx-rs" } diff --git a/native/jni/base/Android.mk b/native/src/base/Android.mk similarity index 87% rename from native/jni/base/Android.mk rename to native/src/base/Android.mk index 71b515364..673ec289f 100644 --- a/native/jni/base/Android.mk +++ b/native/src/base/Android.mk @@ -4,7 +4,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libbase -LOCAL_C_INCLUDES := jni/include $(LOCAL_PATH)/include out/generated +LOCAL_C_INCLUDES := src/include $(LOCAL_PATH)/include out/generated LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) LOCAL_EXPORT_STATIC_LIBRARIES := libcxx LOCAL_STATIC_LIBRARIES := libcxx @@ -28,5 +28,5 @@ LOCAL_MODULE := libcompat LOCAL_SRC_FILES := compat/compat.cpp # Fix static variables' ctor/dtor when using LTO # See: https://github.com/android/ndk/issues/1461 -LOCAL_EXPORT_LDLIBS := -static -T jni/lto_fix.lds +LOCAL_EXPORT_LDLIBS := -static -T src/lto_fix.lds include $(BUILD_STATIC_LIBRARY) diff --git a/native/rust/base/Cargo.toml b/native/src/base/Cargo.toml similarity index 79% rename from native/rust/base/Cargo.toml rename to native/src/base/Cargo.toml index 5cc231340..7a0d451ea 100644 --- a/native/rust/base/Cargo.toml +++ b/native/src/base/Cargo.toml @@ -3,5 +3,8 @@ name = "base" version = "0.1.0" edition = "2021" +[lib] +path = "lib.rs" + [dependencies] cxx = "1.0.69" diff --git a/native/jni/base/compat/compat.cpp b/native/src/base/compat/compat.cpp similarity index 100% rename from native/jni/base/compat/compat.cpp rename to native/src/base/compat/compat.cpp diff --git a/native/jni/base/compat/fortify.hpp b/native/src/base/compat/fortify.hpp similarity index 100% rename from native/jni/base/compat/fortify.hpp rename to native/src/base/compat/fortify.hpp diff --git a/native/jni/base/files.cpp b/native/src/base/files.cpp similarity index 100% rename from native/jni/base/files.cpp rename to native/src/base/files.cpp diff --git a/native/jni/base/files.hpp b/native/src/base/files.hpp similarity index 100% rename from native/jni/base/files.hpp rename to native/src/base/files.hpp diff --git a/native/jni/base/include/base.hpp b/native/src/base/include/base.hpp similarity index 100% rename from native/jni/base/include/base.hpp rename to native/src/base/include/base.hpp diff --git a/native/jni/base/include/selinux.hpp b/native/src/base/include/selinux.hpp similarity index 100% rename from native/jni/base/include/selinux.hpp rename to native/src/base/include/selinux.hpp diff --git a/native/jni/base/include/stream.hpp b/native/src/base/include/stream.hpp similarity index 100% rename from native/jni/base/include/stream.hpp rename to native/src/base/include/stream.hpp diff --git a/native/rust/base/src/lib.rs b/native/src/base/lib.rs similarity index 100% rename from native/rust/base/src/lib.rs rename to native/src/base/lib.rs diff --git a/native/jni/base/logging.cpp b/native/src/base/logging.cpp similarity index 100% rename from native/jni/base/logging.cpp rename to native/src/base/logging.cpp diff --git a/native/jni/base/logging.hpp b/native/src/base/logging.hpp similarity index 100% rename from native/jni/base/logging.hpp rename to native/src/base/logging.hpp diff --git a/native/rust/base/src/logging.rs b/native/src/base/logging.rs similarity index 100% rename from native/rust/base/src/logging.rs rename to native/src/base/logging.rs diff --git a/native/jni/base/misc.cpp b/native/src/base/misc.cpp similarity index 100% rename from native/jni/base/misc.cpp rename to native/src/base/misc.cpp diff --git a/native/jni/base/misc.hpp b/native/src/base/misc.hpp similarity index 100% rename from native/jni/base/misc.hpp rename to native/src/base/misc.hpp diff --git a/native/rust/base/src/misc.rs b/native/src/base/misc.rs similarity index 100% rename from native/rust/base/src/misc.rs rename to native/src/base/misc.rs diff --git a/native/jni/base/missing.hpp b/native/src/base/missing.hpp similarity index 100% rename from native/jni/base/missing.hpp rename to native/src/base/missing.hpp diff --git a/native/jni/base/new.cpp b/native/src/base/new.cpp similarity index 100% rename from native/jni/base/new.cpp rename to native/src/base/new.cpp diff --git a/native/jni/base/selinux.cpp b/native/src/base/selinux.cpp similarity index 100% rename from native/jni/base/selinux.cpp rename to native/src/base/selinux.cpp diff --git a/native/jni/base/stream.cpp b/native/src/base/stream.cpp similarity index 100% rename from native/jni/base/stream.cpp rename to native/src/base/stream.cpp diff --git a/native/jni/base/xwrap.cpp b/native/src/base/xwrap.cpp similarity index 100% rename from native/jni/base/xwrap.cpp rename to native/src/base/xwrap.cpp diff --git a/native/jni/base/xwrap.hpp b/native/src/base/xwrap.hpp similarity index 100% rename from native/jni/base/xwrap.hpp rename to native/src/base/xwrap.hpp diff --git a/native/rust/boot/Cargo.toml b/native/src/boot/Cargo.toml similarity index 89% rename from native/rust/boot/Cargo.toml rename to native/src/boot/Cargo.toml index 2e65df4af..b640674d7 100644 --- a/native/rust/boot/Cargo.toml +++ b/native/src/boot/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" [lib] crate-type = ["staticlib"] +path = "lib.rs" [dependencies] base = { path = "../base" } diff --git a/native/jni/boot/bootimg.cpp b/native/src/boot/bootimg.cpp similarity index 100% rename from native/jni/boot/bootimg.cpp rename to native/src/boot/bootimg.cpp diff --git a/native/jni/boot/bootimg.hpp b/native/src/boot/bootimg.hpp similarity index 100% rename from native/jni/boot/bootimg.hpp rename to native/src/boot/bootimg.hpp diff --git a/native/jni/boot/compress.cpp b/native/src/boot/compress.cpp similarity index 100% rename from native/jni/boot/compress.cpp rename to native/src/boot/compress.cpp diff --git a/native/jni/boot/compress.hpp b/native/src/boot/compress.hpp similarity index 100% rename from native/jni/boot/compress.hpp rename to native/src/boot/compress.hpp diff --git a/native/jni/boot/cpio.cpp b/native/src/boot/cpio.cpp similarity index 100% rename from native/jni/boot/cpio.cpp rename to native/src/boot/cpio.cpp diff --git a/native/jni/boot/cpio.hpp b/native/src/boot/cpio.hpp similarity index 100% rename from native/jni/boot/cpio.hpp rename to native/src/boot/cpio.hpp diff --git a/native/jni/boot/dtb.cpp b/native/src/boot/dtb.cpp similarity index 100% rename from native/jni/boot/dtb.cpp rename to native/src/boot/dtb.cpp diff --git a/native/jni/boot/dtb.hpp b/native/src/boot/dtb.hpp similarity index 100% rename from native/jni/boot/dtb.hpp rename to native/src/boot/dtb.hpp diff --git a/native/jni/boot/format.cpp b/native/src/boot/format.cpp similarity index 100% rename from native/jni/boot/format.cpp rename to native/src/boot/format.cpp diff --git a/native/jni/boot/format.hpp b/native/src/boot/format.hpp similarity index 100% rename from native/jni/boot/format.hpp rename to native/src/boot/format.hpp diff --git a/native/jni/boot/hexpatch.cpp b/native/src/boot/hexpatch.cpp similarity index 100% rename from native/jni/boot/hexpatch.cpp rename to native/src/boot/hexpatch.cpp diff --git a/native/rust/boot/src/lib.rs b/native/src/boot/lib.rs similarity index 100% rename from native/rust/boot/src/lib.rs rename to native/src/boot/lib.rs diff --git a/native/jni/boot/magiskboot.hpp b/native/src/boot/magiskboot.hpp similarity index 100% rename from native/jni/boot/magiskboot.hpp rename to native/src/boot/magiskboot.hpp diff --git a/native/jni/boot/main.cpp b/native/src/boot/main.cpp similarity index 100% rename from native/jni/boot/main.cpp rename to native/src/boot/main.cpp diff --git a/native/jni/boot/pattern.cpp b/native/src/boot/pattern.cpp similarity index 100% rename from native/jni/boot/pattern.cpp rename to native/src/boot/pattern.cpp diff --git a/native/jni/boot/ramdisk.cpp b/native/src/boot/ramdisk.cpp similarity index 100% rename from native/jni/boot/ramdisk.cpp rename to native/src/boot/ramdisk.cpp diff --git a/native/rust/core/Cargo.toml b/native/src/core/Cargo.toml similarity index 90% rename from native/rust/core/Cargo.toml rename to native/src/core/Cargo.toml index ff2b982fc..9a9a19597 100644 --- a/native/rust/core/Cargo.toml +++ b/native/src/core/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" [lib] crate-type = ["staticlib"] +path = "lib.rs" [dependencies] base = { path = "../base" } diff --git a/native/jni/core/applet_stub.cpp b/native/src/core/applet_stub.cpp similarity index 100% rename from native/jni/core/applet_stub.cpp rename to native/src/core/applet_stub.cpp diff --git a/native/jni/core/applets.cpp b/native/src/core/applets.cpp similarity index 100% rename from native/jni/core/applets.cpp rename to native/src/core/applets.cpp diff --git a/native/jni/core/bootstages.cpp b/native/src/core/bootstages.cpp similarity index 100% rename from native/jni/core/bootstages.cpp rename to native/src/core/bootstages.cpp diff --git a/native/jni/core/cert.cpp b/native/src/core/cert.cpp similarity index 100% rename from native/jni/core/cert.cpp rename to native/src/core/cert.cpp diff --git a/native/jni/core/core.hpp b/native/src/core/core.hpp similarity index 100% rename from native/jni/core/core.hpp rename to native/src/core/core.hpp diff --git a/native/jni/core/daemon.cpp b/native/src/core/daemon.cpp similarity index 100% rename from native/jni/core/daemon.cpp rename to native/src/core/daemon.cpp diff --git a/native/jni/core/db.cpp b/native/src/core/db.cpp similarity index 100% rename from native/jni/core/db.cpp rename to native/src/core/db.cpp diff --git a/native/rust/core/src/lib.rs b/native/src/core/lib.rs similarity index 100% rename from native/rust/core/src/lib.rs rename to native/src/core/lib.rs diff --git a/native/jni/core/logging.cpp b/native/src/core/logging.cpp similarity index 100% rename from native/jni/core/logging.cpp rename to native/src/core/logging.cpp diff --git a/native/rust/core/src/logging.rs b/native/src/core/logging.rs similarity index 100% rename from native/rust/core/src/logging.rs rename to native/src/core/logging.rs diff --git a/native/jni/core/magisk.cpp b/native/src/core/magisk.cpp similarity index 100% rename from native/jni/core/magisk.cpp rename to native/src/core/magisk.cpp diff --git a/native/jni/core/module.cpp b/native/src/core/module.cpp similarity index 100% rename from native/jni/core/module.cpp rename to native/src/core/module.cpp diff --git a/native/jni/core/package.cpp b/native/src/core/package.cpp similarity index 100% rename from native/jni/core/package.cpp rename to native/src/core/package.cpp diff --git a/native/jni/core/restorecon.cpp b/native/src/core/restorecon.cpp similarity index 100% rename from native/jni/core/restorecon.cpp rename to native/src/core/restorecon.cpp diff --git a/native/jni/core/scripting.cpp b/native/src/core/scripting.cpp similarity index 100% rename from native/jni/core/scripting.cpp rename to native/src/core/scripting.cpp diff --git a/native/jni/core/socket.cpp b/native/src/core/socket.cpp similarity index 100% rename from native/jni/core/socket.cpp rename to native/src/core/socket.cpp diff --git a/native/jni/core/thread.cpp b/native/src/core/thread.cpp similarity index 100% rename from native/jni/core/thread.cpp rename to native/src/core/thread.cpp diff --git a/native/jni/external/Android.mk b/native/src/external/Android.mk similarity index 100% rename from native/jni/external/Android.mk rename to native/src/external/Android.mk diff --git a/native/jni/external/busybox b/native/src/external/busybox similarity index 100% rename from native/jni/external/busybox rename to native/src/external/busybox diff --git a/native/jni/external/bzip2 b/native/src/external/bzip2 similarity index 100% rename from native/jni/external/bzip2 rename to native/src/external/bzip2 diff --git a/native/jni/external/cxx-rs b/native/src/external/cxx-rs similarity index 100% rename from native/jni/external/cxx-rs rename to native/src/external/cxx-rs diff --git a/native/jni/external/dtc b/native/src/external/dtc similarity index 100% rename from native/jni/external/dtc rename to native/src/external/dtc diff --git a/native/jni/external/libcxx b/native/src/external/libcxx similarity index 100% rename from native/jni/external/libcxx rename to native/src/external/libcxx diff --git a/native/jni/external/libxhook/.gitignore b/native/src/external/libxhook/.gitignore similarity index 100% rename from native/jni/external/libxhook/.gitignore rename to native/src/external/libxhook/.gitignore diff --git a/native/jni/external/libxhook/LICENSE b/native/src/external/libxhook/LICENSE similarity index 100% rename from native/jni/external/libxhook/LICENSE rename to native/src/external/libxhook/LICENSE diff --git a/native/jni/external/libxhook/LICENSE-docs b/native/src/external/libxhook/LICENSE-docs similarity index 100% rename from native/jni/external/libxhook/LICENSE-docs rename to native/src/external/libxhook/LICENSE-docs diff --git a/native/jni/external/libxhook/README.md b/native/src/external/libxhook/README.md similarity index 100% rename from native/jni/external/libxhook/README.md rename to native/src/external/libxhook/README.md diff --git a/native/jni/external/libxhook/README.zh-CN.md b/native/src/external/libxhook/README.zh-CN.md similarity index 100% rename from native/jni/external/libxhook/README.zh-CN.md rename to native/src/external/libxhook/README.zh-CN.md diff --git a/native/jni/external/libxhook/queue.h b/native/src/external/libxhook/queue.h similarity index 100% rename from native/jni/external/libxhook/queue.h rename to native/src/external/libxhook/queue.h diff --git a/native/jni/external/libxhook/tree.h b/native/src/external/libxhook/tree.h similarity index 100% rename from native/jni/external/libxhook/tree.h rename to native/src/external/libxhook/tree.h diff --git a/native/jni/external/libxhook/xh_core.c b/native/src/external/libxhook/xh_core.c similarity index 100% rename from native/jni/external/libxhook/xh_core.c rename to native/src/external/libxhook/xh_core.c diff --git a/native/jni/external/libxhook/xh_core.h b/native/src/external/libxhook/xh_core.h similarity index 100% rename from native/jni/external/libxhook/xh_core.h rename to native/src/external/libxhook/xh_core.h diff --git a/native/jni/external/libxhook/xh_elf.c b/native/src/external/libxhook/xh_elf.c similarity index 100% rename from native/jni/external/libxhook/xh_elf.c rename to native/src/external/libxhook/xh_elf.c diff --git a/native/jni/external/libxhook/xh_elf.h b/native/src/external/libxhook/xh_elf.h similarity index 100% rename from native/jni/external/libxhook/xh_elf.h rename to native/src/external/libxhook/xh_elf.h diff --git a/native/jni/external/libxhook/xh_errno.h b/native/src/external/libxhook/xh_errno.h similarity index 100% rename from native/jni/external/libxhook/xh_errno.h rename to native/src/external/libxhook/xh_errno.h diff --git a/native/jni/external/libxhook/xh_jni.c b/native/src/external/libxhook/xh_jni.c similarity index 100% rename from native/jni/external/libxhook/xh_jni.c rename to native/src/external/libxhook/xh_jni.c diff --git a/native/jni/external/libxhook/xh_log.c b/native/src/external/libxhook/xh_log.c similarity index 100% rename from native/jni/external/libxhook/xh_log.c rename to native/src/external/libxhook/xh_log.c diff --git a/native/jni/external/libxhook/xh_log.h b/native/src/external/libxhook/xh_log.h similarity index 100% rename from native/jni/external/libxhook/xh_log.h rename to native/src/external/libxhook/xh_log.h diff --git a/native/jni/external/libxhook/xh_util.c b/native/src/external/libxhook/xh_util.c similarity index 100% rename from native/jni/external/libxhook/xh_util.c rename to native/src/external/libxhook/xh_util.c diff --git a/native/jni/external/libxhook/xh_util.h b/native/src/external/libxhook/xh_util.h similarity index 100% rename from native/jni/external/libxhook/xh_util.h rename to native/src/external/libxhook/xh_util.h diff --git a/native/jni/external/libxhook/xh_version.c b/native/src/external/libxhook/xh_version.c similarity index 100% rename from native/jni/external/libxhook/xh_version.c rename to native/src/external/libxhook/xh_version.c diff --git a/native/jni/external/libxhook/xh_version.h b/native/src/external/libxhook/xh_version.h similarity index 100% rename from native/jni/external/libxhook/xh_version.h rename to native/src/external/libxhook/xh_version.h diff --git a/native/jni/external/libxhook/xhook.c b/native/src/external/libxhook/xhook.c similarity index 100% rename from native/jni/external/libxhook/xhook.c rename to native/src/external/libxhook/xhook.c diff --git a/native/jni/external/libxhook/xhook.h b/native/src/external/libxhook/xhook.h similarity index 100% rename from native/jni/external/libxhook/xhook.h rename to native/src/external/libxhook/xhook.h diff --git a/native/jni/external/lz4 b/native/src/external/lz4 similarity index 100% rename from native/jni/external/lz4 rename to native/src/external/lz4 diff --git a/native/jni/external/mincrypt b/native/src/external/mincrypt similarity index 100% rename from native/jni/external/mincrypt rename to native/src/external/mincrypt diff --git a/native/jni/external/nanopb b/native/src/external/nanopb similarity index 100% rename from native/jni/external/nanopb rename to native/src/external/nanopb diff --git a/native/jni/external/parallel-hashmap b/native/src/external/parallel-hashmap similarity index 100% rename from native/jni/external/parallel-hashmap rename to native/src/external/parallel-hashmap diff --git a/native/jni/external/pcre b/native/src/external/pcre similarity index 100% rename from native/jni/external/pcre rename to native/src/external/pcre diff --git a/native/jni/external/pcre2_workaround.c b/native/src/external/pcre2_workaround.c similarity index 100% rename from native/jni/external/pcre2_workaround.c rename to native/src/external/pcre2_workaround.c diff --git a/native/jni/external/selinux b/native/src/external/selinux similarity index 100% rename from native/jni/external/selinux rename to native/src/external/selinux diff --git a/native/jni/external/systemproperties/Android.mk b/native/src/external/systemproperties/Android.mk similarity index 100% rename from native/jni/external/systemproperties/Android.mk rename to native/src/external/systemproperties/Android.mk diff --git a/native/jni/external/systemproperties/context_node.cpp b/native/src/external/systemproperties/context_node.cpp similarity index 100% rename from native/jni/external/systemproperties/context_node.cpp rename to native/src/external/systemproperties/context_node.cpp diff --git a/native/jni/external/systemproperties/contexts_serialized.cpp b/native/src/external/systemproperties/contexts_serialized.cpp similarity index 100% rename from native/jni/external/systemproperties/contexts_serialized.cpp rename to native/src/external/systemproperties/contexts_serialized.cpp diff --git a/native/jni/external/systemproperties/contexts_split.cpp b/native/src/external/systemproperties/contexts_split.cpp similarity index 100% rename from native/jni/external/systemproperties/contexts_split.cpp rename to native/src/external/systemproperties/contexts_split.cpp diff --git a/native/jni/external/systemproperties/include/_system_properties.h b/native/src/external/systemproperties/include/_system_properties.h similarity index 100% rename from native/jni/external/systemproperties/include/_system_properties.h rename to native/src/external/systemproperties/include/_system_properties.h diff --git a/native/jni/external/systemproperties/include/async_safe/log.h b/native/src/external/systemproperties/include/async_safe/log.h similarity index 100% rename from native/jni/external/systemproperties/include/async_safe/log.h rename to native/src/external/systemproperties/include/async_safe/log.h diff --git a/native/jni/external/systemproperties/include/private/ErrnoRestorer.h b/native/src/external/systemproperties/include/private/ErrnoRestorer.h similarity index 100% rename from native/jni/external/systemproperties/include/private/ErrnoRestorer.h rename to native/src/external/systemproperties/include/private/ErrnoRestorer.h diff --git a/native/jni/external/systemproperties/include/private/bionic_defs.h b/native/src/external/systemproperties/include/private/bionic_defs.h similarity index 100% rename from native/jni/external/systemproperties/include/private/bionic_defs.h rename to native/src/external/systemproperties/include/private/bionic_defs.h diff --git a/native/jni/external/systemproperties/include/private/bionic_futex.h b/native/src/external/systemproperties/include/private/bionic_futex.h similarity index 100% rename from native/jni/external/systemproperties/include/private/bionic_futex.h rename to native/src/external/systemproperties/include/private/bionic_futex.h diff --git a/native/jni/external/systemproperties/include/private/bionic_lock.h b/native/src/external/systemproperties/include/private/bionic_lock.h similarity index 100% rename from native/jni/external/systemproperties/include/private/bionic_lock.h rename to native/src/external/systemproperties/include/private/bionic_lock.h diff --git a/native/jni/external/systemproperties/include/private/bionic_macros.h b/native/src/external/systemproperties/include/private/bionic_macros.h similarity index 100% rename from native/jni/external/systemproperties/include/private/bionic_macros.h rename to native/src/external/systemproperties/include/private/bionic_macros.h diff --git a/native/jni/external/systemproperties/include/private/hacks.h b/native/src/external/systemproperties/include/private/hacks.h similarity index 100% rename from native/jni/external/systemproperties/include/private/hacks.h rename to native/src/external/systemproperties/include/private/hacks.h diff --git a/native/jni/external/systemproperties/include/property_info_parser/property_info_parser.h b/native/src/external/systemproperties/include/property_info_parser/property_info_parser.h similarity index 100% rename from native/jni/external/systemproperties/include/property_info_parser/property_info_parser.h rename to native/src/external/systemproperties/include/property_info_parser/property_info_parser.h diff --git a/native/jni/external/systemproperties/include/system_properties.h b/native/src/external/systemproperties/include/system_properties.h similarity index 100% rename from native/jni/external/systemproperties/include/system_properties.h rename to native/src/external/systemproperties/include/system_properties.h diff --git a/native/jni/external/systemproperties/include/system_properties/context_node.h b/native/src/external/systemproperties/include/system_properties/context_node.h similarity index 100% rename from native/jni/external/systemproperties/include/system_properties/context_node.h rename to native/src/external/systemproperties/include/system_properties/context_node.h diff --git a/native/jni/external/systemproperties/include/system_properties/contexts.h b/native/src/external/systemproperties/include/system_properties/contexts.h similarity index 100% rename from native/jni/external/systemproperties/include/system_properties/contexts.h rename to native/src/external/systemproperties/include/system_properties/contexts.h diff --git a/native/jni/external/systemproperties/include/system_properties/contexts_pre_split.h b/native/src/external/systemproperties/include/system_properties/contexts_pre_split.h similarity index 100% rename from native/jni/external/systemproperties/include/system_properties/contexts_pre_split.h rename to native/src/external/systemproperties/include/system_properties/contexts_pre_split.h diff --git a/native/jni/external/systemproperties/include/system_properties/contexts_serialized.h b/native/src/external/systemproperties/include/system_properties/contexts_serialized.h similarity index 100% rename from native/jni/external/systemproperties/include/system_properties/contexts_serialized.h rename to native/src/external/systemproperties/include/system_properties/contexts_serialized.h diff --git a/native/jni/external/systemproperties/include/system_properties/contexts_split.h b/native/src/external/systemproperties/include/system_properties/contexts_split.h similarity index 100% rename from native/jni/external/systemproperties/include/system_properties/contexts_split.h rename to native/src/external/systemproperties/include/system_properties/contexts_split.h diff --git a/native/jni/external/systemproperties/include/system_properties/prop_area.h b/native/src/external/systemproperties/include/system_properties/prop_area.h similarity index 100% rename from native/jni/external/systemproperties/include/system_properties/prop_area.h rename to native/src/external/systemproperties/include/system_properties/prop_area.h diff --git a/native/jni/external/systemproperties/include/system_properties/prop_info.h b/native/src/external/systemproperties/include/system_properties/prop_info.h similarity index 100% rename from native/jni/external/systemproperties/include/system_properties/prop_info.h rename to native/src/external/systemproperties/include/system_properties/prop_info.h diff --git a/native/jni/external/systemproperties/include/system_properties/system_properties.h b/native/src/external/systemproperties/include/system_properties/system_properties.h similarity index 100% rename from native/jni/external/systemproperties/include/system_properties/system_properties.h rename to native/src/external/systemproperties/include/system_properties/system_properties.h diff --git a/native/jni/external/systemproperties/prop_area.cpp b/native/src/external/systemproperties/prop_area.cpp similarity index 100% rename from native/jni/external/systemproperties/prop_area.cpp rename to native/src/external/systemproperties/prop_area.cpp diff --git a/native/jni/external/systemproperties/prop_info.cpp b/native/src/external/systemproperties/prop_info.cpp similarity index 100% rename from native/jni/external/systemproperties/prop_info.cpp rename to native/src/external/systemproperties/prop_info.cpp diff --git a/native/jni/external/systemproperties/property_info_parser.cpp b/native/src/external/systemproperties/property_info_parser.cpp similarity index 100% rename from native/jni/external/systemproperties/property_info_parser.cpp rename to native/src/external/systemproperties/property_info_parser.cpp diff --git a/native/jni/external/systemproperties/system_properties.cpp b/native/src/external/systemproperties/system_properties.cpp similarity index 100% rename from native/jni/external/systemproperties/system_properties.cpp rename to native/src/external/systemproperties/system_properties.cpp diff --git a/native/jni/external/systemproperties/system_property_api.cpp b/native/src/external/systemproperties/system_property_api.cpp similarity index 100% rename from native/jni/external/systemproperties/system_property_api.cpp rename to native/src/external/systemproperties/system_property_api.cpp diff --git a/native/jni/external/systemproperties/system_property_set.cpp b/native/src/external/systemproperties/system_property_set.cpp similarity index 100% rename from native/jni/external/systemproperties/system_property_set.cpp rename to native/src/external/systemproperties/system_property_set.cpp diff --git a/native/jni/external/xz b/native/src/external/xz similarity index 100% rename from native/jni/external/xz rename to native/src/external/xz diff --git a/native/jni/external/xz-embedded/xz.h b/native/src/external/xz-embedded/xz.h similarity index 100% rename from native/jni/external/xz-embedded/xz.h rename to native/src/external/xz-embedded/xz.h diff --git a/native/jni/external/xz-embedded/xz_config.h b/native/src/external/xz-embedded/xz_config.h similarity index 100% rename from native/jni/external/xz-embedded/xz_config.h rename to native/src/external/xz-embedded/xz_config.h diff --git a/native/jni/external/xz-embedded/xz_crc32.c b/native/src/external/xz-embedded/xz_crc32.c similarity index 100% rename from native/jni/external/xz-embedded/xz_crc32.c rename to native/src/external/xz-embedded/xz_crc32.c diff --git a/native/jni/external/xz-embedded/xz_dec_lzma2.c b/native/src/external/xz-embedded/xz_dec_lzma2.c similarity index 100% rename from native/jni/external/xz-embedded/xz_dec_lzma2.c rename to native/src/external/xz-embedded/xz_dec_lzma2.c diff --git a/native/jni/external/xz-embedded/xz_dec_stream.c b/native/src/external/xz-embedded/xz_dec_stream.c similarity index 100% rename from native/jni/external/xz-embedded/xz_dec_stream.c rename to native/src/external/xz-embedded/xz_dec_stream.c diff --git a/native/jni/external/xz-embedded/xz_lzma2.h b/native/src/external/xz-embedded/xz_lzma2.h similarity index 100% rename from native/jni/external/xz-embedded/xz_lzma2.h rename to native/src/external/xz-embedded/xz_lzma2.h diff --git a/native/jni/external/xz-embedded/xz_private.h b/native/src/external/xz-embedded/xz_private.h similarity index 100% rename from native/jni/external/xz-embedded/xz_private.h rename to native/src/external/xz-embedded/xz_private.h diff --git a/native/jni/external/xz-embedded/xz_stream.h b/native/src/external/xz-embedded/xz_stream.h similarity index 100% rename from native/jni/external/xz-embedded/xz_stream.h rename to native/src/external/xz-embedded/xz_stream.h diff --git a/native/jni/external/xz_config/config.h b/native/src/external/xz_config/config.h similarity index 100% rename from native/jni/external/xz_config/config.h rename to native/src/external/xz_config/config.h diff --git a/native/jni/external/zlib b/native/src/external/zlib similarity index 100% rename from native/jni/external/zlib rename to native/src/external/zlib diff --git a/native/jni/external/zopfli b/native/src/external/zopfli similarity index 100% rename from native/jni/external/zopfli rename to native/src/external/zopfli diff --git a/native/jni/include/daemon.hpp b/native/src/include/daemon.hpp similarity index 100% rename from native/jni/include/daemon.hpp rename to native/src/include/daemon.hpp diff --git a/native/jni/include/db.hpp b/native/src/include/db.hpp similarity index 100% rename from native/jni/include/db.hpp rename to native/src/include/db.hpp diff --git a/native/jni/include/magisk.hpp b/native/src/include/magisk.hpp similarity index 100% rename from native/jni/include/magisk.hpp rename to native/src/include/magisk.hpp diff --git a/native/jni/include/resetprop.hpp b/native/src/include/resetprop.hpp similarity index 100% rename from native/jni/include/resetprop.hpp rename to native/src/include/resetprop.hpp diff --git a/native/jni/include/socket.hpp b/native/src/include/socket.hpp similarity index 100% rename from native/jni/include/socket.hpp rename to native/src/include/socket.hpp diff --git a/native/rust/init/Cargo.toml b/native/src/init/Cargo.toml similarity index 90% rename from native/rust/init/Cargo.toml rename to native/src/init/Cargo.toml index d4335596c..a90f3554a 100644 --- a/native/rust/init/Cargo.toml +++ b/native/src/init/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" [lib] crate-type = ["staticlib"] +path = "lib.rs" [dependencies] base = { path = "../base" } diff --git a/native/jni/init/getinfo.cpp b/native/src/init/getinfo.cpp similarity index 100% rename from native/jni/init/getinfo.cpp rename to native/src/init/getinfo.cpp diff --git a/native/jni/init/init.cpp b/native/src/init/init.cpp similarity index 100% rename from native/jni/init/init.cpp rename to native/src/init/init.cpp diff --git a/native/jni/init/init.hpp b/native/src/init/init.hpp similarity index 100% rename from native/jni/init/init.hpp rename to native/src/init/init.hpp diff --git a/native/rust/init/src/lib.rs b/native/src/init/lib.rs similarity index 100% rename from native/rust/init/src/lib.rs rename to native/src/init/lib.rs diff --git a/native/rust/init/src/logging.rs b/native/src/init/logging.rs similarity index 100% rename from native/rust/init/src/logging.rs rename to native/src/init/logging.rs diff --git a/native/jni/init/magiskrc.inc b/native/src/init/magiskrc.inc similarity index 100% rename from native/jni/init/magiskrc.inc rename to native/src/init/magiskrc.inc diff --git a/native/jni/init/mount.cpp b/native/src/init/mount.cpp similarity index 100% rename from native/jni/init/mount.cpp rename to native/src/init/mount.cpp diff --git a/native/jni/init/preload.c b/native/src/init/preload.c similarity index 100% rename from native/jni/init/preload.c rename to native/src/init/preload.c diff --git a/native/jni/init/rootdir.cpp b/native/src/init/rootdir.cpp similarity index 100% rename from native/jni/init/rootdir.cpp rename to native/src/init/rootdir.cpp diff --git a/native/jni/init/selinux.cpp b/native/src/init/selinux.cpp similarity index 100% rename from native/jni/init/selinux.cpp rename to native/src/init/selinux.cpp diff --git a/native/jni/init/twostage.cpp b/native/src/init/twostage.cpp similarity index 100% rename from native/jni/init/twostage.cpp rename to native/src/init/twostage.cpp diff --git a/native/jni/lto_fix.lds b/native/src/lto_fix.lds similarity index 100% rename from native/jni/lto_fix.lds rename to native/src/lto_fix.lds diff --git a/native/src/main/AndroidManifest.xml b/native/src/main/AndroidManifest.xml deleted file mode 100644 index 9b65eb06c..000000000 --- a/native/src/main/AndroidManifest.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/native/jni/resetprop/persist.cpp b/native/src/resetprop/persist.cpp similarity index 100% rename from native/jni/resetprop/persist.cpp rename to native/src/resetprop/persist.cpp diff --git a/native/jni/resetprop/prop.hpp b/native/src/resetprop/prop.hpp similarity index 100% rename from native/jni/resetprop/prop.hpp rename to native/src/resetprop/prop.hpp diff --git a/native/jni/resetprop/resetprop.cpp b/native/src/resetprop/resetprop.cpp similarity index 100% rename from native/jni/resetprop/resetprop.cpp rename to native/src/resetprop/resetprop.cpp diff --git a/native/rust/sepolicy/Cargo.toml b/native/src/sepolicy/Cargo.toml similarity index 90% rename from native/rust/sepolicy/Cargo.toml rename to native/src/sepolicy/Cargo.toml index 1e4bea119..3b1ecaecf 100644 --- a/native/rust/sepolicy/Cargo.toml +++ b/native/src/sepolicy/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" [lib] crate-type = ["staticlib", "rlib"] +path = "lib.rs" [dependencies] base = { path = "../base" } diff --git a/native/jni/sepolicy/api.cpp b/native/src/sepolicy/api.cpp similarity index 100% rename from native/jni/sepolicy/api.cpp rename to native/src/sepolicy/api.cpp diff --git a/native/jni/sepolicy/include/sepolicy.hpp b/native/src/sepolicy/include/sepolicy.hpp similarity index 100% rename from native/jni/sepolicy/include/sepolicy.hpp rename to native/src/sepolicy/include/sepolicy.hpp diff --git a/native/rust/sepolicy/src/lib.rs b/native/src/sepolicy/lib.rs similarity index 100% rename from native/rust/sepolicy/src/lib.rs rename to native/src/sepolicy/lib.rs diff --git a/native/jni/sepolicy/main.cpp b/native/src/sepolicy/main.cpp similarity index 100% rename from native/jni/sepolicy/main.cpp rename to native/src/sepolicy/main.cpp diff --git a/native/jni/sepolicy/policy.hpp b/native/src/sepolicy/policy.hpp similarity index 100% rename from native/jni/sepolicy/policy.hpp rename to native/src/sepolicy/policy.hpp diff --git a/native/jni/sepolicy/policydb.cpp b/native/src/sepolicy/policydb.cpp similarity index 100% rename from native/jni/sepolicy/policydb.cpp rename to native/src/sepolicy/policydb.cpp diff --git a/native/jni/sepolicy/rules.cpp b/native/src/sepolicy/rules.cpp similarity index 100% rename from native/jni/sepolicy/rules.cpp rename to native/src/sepolicy/rules.cpp diff --git a/native/jni/sepolicy/sepolicy.cpp b/native/src/sepolicy/sepolicy.cpp similarity index 100% rename from native/jni/sepolicy/sepolicy.cpp rename to native/src/sepolicy/sepolicy.cpp diff --git a/native/jni/sepolicy/statement.cpp b/native/src/sepolicy/statement.cpp similarity index 100% rename from native/jni/sepolicy/statement.cpp rename to native/src/sepolicy/statement.cpp diff --git a/native/jni/su/connect.cpp b/native/src/su/connect.cpp similarity index 100% rename from native/jni/su/connect.cpp rename to native/src/su/connect.cpp diff --git a/native/jni/su/pts.cpp b/native/src/su/pts.cpp similarity index 100% rename from native/jni/su/pts.cpp rename to native/src/su/pts.cpp diff --git a/native/jni/su/pts.hpp b/native/src/su/pts.hpp similarity index 100% rename from native/jni/su/pts.hpp rename to native/src/su/pts.hpp diff --git a/native/jni/su/su.cpp b/native/src/su/su.cpp similarity index 100% rename from native/jni/su/su.cpp rename to native/src/su/su.cpp diff --git a/native/jni/su/su.hpp b/native/src/su/su.hpp similarity index 100% rename from native/jni/su/su.hpp rename to native/src/su/su.hpp diff --git a/native/jni/su/su_daemon.cpp b/native/src/su/su_daemon.cpp similarity index 100% rename from native/jni/su/su_daemon.cpp rename to native/src/su/su_daemon.cpp diff --git a/native/jni/zygisk/api.hpp b/native/src/zygisk/api.hpp similarity index 100% rename from native/jni/zygisk/api.hpp rename to native/src/zygisk/api.hpp diff --git a/native/jni/zygisk/deny/cli.cpp b/native/src/zygisk/deny/cli.cpp similarity index 100% rename from native/jni/zygisk/deny/cli.cpp rename to native/src/zygisk/deny/cli.cpp diff --git a/native/jni/zygisk/deny/deny.hpp b/native/src/zygisk/deny/deny.hpp similarity index 100% rename from native/jni/zygisk/deny/deny.hpp rename to native/src/zygisk/deny/deny.hpp diff --git a/native/jni/zygisk/deny/revert.cpp b/native/src/zygisk/deny/revert.cpp similarity index 100% rename from native/jni/zygisk/deny/revert.cpp rename to native/src/zygisk/deny/revert.cpp diff --git a/native/jni/zygisk/deny/utils.cpp b/native/src/zygisk/deny/utils.cpp similarity index 100% rename from native/jni/zygisk/deny/utils.cpp rename to native/src/zygisk/deny/utils.cpp diff --git a/native/jni/zygisk/entry.cpp b/native/src/zygisk/entry.cpp similarity index 100% rename from native/jni/zygisk/entry.cpp rename to native/src/zygisk/entry.cpp diff --git a/native/jni/zygisk/gen_jni_hooks.py b/native/src/zygisk/gen_jni_hooks.py similarity index 100% rename from native/jni/zygisk/gen_jni_hooks.py rename to native/src/zygisk/gen_jni_hooks.py diff --git a/native/jni/zygisk/hook.cpp b/native/src/zygisk/hook.cpp similarity index 100% rename from native/jni/zygisk/hook.cpp rename to native/src/zygisk/hook.cpp diff --git a/native/jni/zygisk/jni_hooks.hpp b/native/src/zygisk/jni_hooks.hpp similarity index 100% rename from native/jni/zygisk/jni_hooks.hpp rename to native/src/zygisk/jni_hooks.hpp diff --git a/native/jni/zygisk/main.cpp b/native/src/zygisk/main.cpp similarity index 100% rename from native/jni/zygisk/main.cpp rename to native/src/zygisk/main.cpp diff --git a/native/jni/zygisk/memory.cpp b/native/src/zygisk/memory.cpp similarity index 100% rename from native/jni/zygisk/memory.cpp rename to native/src/zygisk/memory.cpp diff --git a/native/jni/zygisk/memory.hpp b/native/src/zygisk/memory.hpp similarity index 100% rename from native/jni/zygisk/memory.hpp rename to native/src/zygisk/memory.hpp diff --git a/native/jni/zygisk/module.hpp b/native/src/zygisk/module.hpp similarity index 100% rename from native/jni/zygisk/module.hpp rename to native/src/zygisk/module.hpp diff --git a/native/jni/zygisk/ptrace.cpp b/native/src/zygisk/ptrace.cpp similarity index 100% rename from native/jni/zygisk/ptrace.cpp rename to native/src/zygisk/ptrace.cpp diff --git a/native/jni/zygisk/ptrace.hpp b/native/src/zygisk/ptrace.hpp similarity index 100% rename from native/jni/zygisk/ptrace.hpp rename to native/src/zygisk/ptrace.hpp diff --git a/native/jni/zygisk/utils.cpp b/native/src/zygisk/utils.cpp similarity index 100% rename from native/jni/zygisk/utils.cpp rename to native/src/zygisk/utils.cpp diff --git a/native/jni/zygisk/zygisk.hpp b/native/src/zygisk/zygisk.hpp similarity index 100% rename from native/jni/zygisk/zygisk.hpp rename to native/src/zygisk/zygisk.hpp