mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: 添加native检测绕过模板
This commit is contained in:
parent
4932b36ee1
commit
f63bcabf1b
@ -18,6 +18,8 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Shamrock"
|
||||
android:zygotePreloadName="@string/app_name"
|
||||
android:multiArch="true"
|
||||
android:extractNativeLibs="false"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
|
1
xposed/src/main/assets/native_init
Normal file
1
xposed/src/main/assets/native_init
Normal file
@ -0,0 +1 @@
|
||||
libclover.so
|
@ -10,7 +10,7 @@ cmake_minimum_required(VERSION 3.22.1)
|
||||
# Since this is the top level CMakeLists.txt, the project name is also accessible
|
||||
# with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level
|
||||
# build script scope).
|
||||
project("xposed")
|
||||
project("clover")
|
||||
|
||||
# Creates and names a library, sets it as either STATIC
|
||||
# or SHARED, and provides the relative paths to its source code.
|
||||
@ -27,7 +27,7 @@ project("xposed")
|
||||
# used in the AndroidManifest.xml file.
|
||||
add_library(${CMAKE_PROJECT_NAME} SHARED
|
||||
# List C/C++ source files with relative paths to this CMakeLists.txt.
|
||||
xposed.cpp)
|
||||
clover.cpp)
|
||||
|
||||
# Specifies libraries CMake should link to your target library. You
|
||||
# can link libraries from various origins, such as libraries defined in this
|
||||
|
19
xposed/src/main/cpp/clover.cpp
Normal file
19
xposed/src/main/cpp/clover.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <jni.h>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <sys/auxv.h>
|
||||
#include <dlfcn.h>
|
||||
#include "lsposed.h"
|
||||
|
||||
void on_library_loaded(const char *name, void *handle) {
|
||||
if (std::string(name) == "libc.so") {
|
||||
void *target = dlsym(handle, "__system_property_get");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" [[gnu::visibility("default")]] [[gnu::used]]
|
||||
NativeOnModuleLoaded native_init(const NativeAPIEntries *entries) {
|
||||
|
||||
return on_library_loaded;
|
||||
}
|
20
xposed/src/main/cpp/lsposed.h
Normal file
20
xposed/src/main/cpp/lsposed.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef SHAMROCK_LSPOSED_H
|
||||
#define SHAMROCK_LSPOSED_H
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
typedef int (*HookFunType)(void *func, void *replace, void **backup);
|
||||
|
||||
typedef int (*UnhookFunType)(void *func);
|
||||
|
||||
typedef void (*NativeOnModuleLoaded)(const char *name, void *handle);
|
||||
|
||||
typedef struct {
|
||||
uint32_t version;
|
||||
HookFunType hook_func;
|
||||
UnhookFunType unhook_func;
|
||||
} NativeAPIEntries;
|
||||
|
||||
typedef NativeOnModuleLoaded (*NativeInit)(const NativeAPIEntries *entries);
|
||||
|
||||
#endif //SHAMROCK_LSPOSED_H
|
@ -1,5 +0,0 @@
|
||||
#include <jni.h>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <sys/auxv.h>
|
||||
|
@ -16,8 +16,6 @@ internal object NativeLoader {
|
||||
return externalLibPath.resolve("libffmpegkit.so").exists()
|
||||
}
|
||||
|
||||
private var isInitShamrock = false
|
||||
|
||||
/**
|
||||
* 使目标进程可以使用来自模块的库
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user