[core] Remove redundant code (#65)
This commit is contained in:
parent
0dbfe5ac35
commit
7757c5d19b
|
|
@ -35,26 +35,20 @@ namespace lspd {
|
||||||
constexpr int SHARED_RELRO_UID = 1037;
|
constexpr int SHARED_RELRO_UID = 1037;
|
||||||
constexpr int PER_USER_RANGE = 100000;
|
constexpr int PER_USER_RANGE = 100000;
|
||||||
|
|
||||||
void Context::CallPostFixupStaticTrampolinesCallback(void *class_ptr, jmethodID callback_mid) {
|
void Context::CallOnPostFixupStaticTrampolines(void *class_ptr) {
|
||||||
if (UNLIKELY(!callback_mid || !class_linker_class_)) {
|
if (UNLIKELY(!class_ptr || !class_linker_class_ || !post_fixup_static_mid_)) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!class_ptr) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEnv *env;
|
JNIEnv *env;
|
||||||
vm_->GetEnv((void **) (&env), JNI_VERSION_1_4);
|
vm_->GetEnv((void **) (&env), JNI_VERSION_1_4);
|
||||||
art::JNIEnvExt env_ext(env);
|
art::JNIEnvExt env_ext(env);
|
||||||
ScopedLocalRef clazz(env, env_ext.NewLocalRefer(class_ptr));
|
ScopedLocalRef clazz(env, env_ext.NewLocalRefer(class_ptr));
|
||||||
if (clazz != nullptr) {
|
if (clazz != nullptr) {
|
||||||
JNI_CallStaticVoidMethod(env, class_linker_class_, callback_mid, clazz.get());
|
JNI_CallStaticVoidMethod(env, class_linker_class_, post_fixup_static_mid_, clazz.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Context::CallOnPostFixupStaticTrampolines(void *class_ptr) {
|
|
||||||
CallPostFixupStaticTrampolinesCallback(class_ptr, post_fixup_static_mid_);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Context::PreLoadDex(const fs::path &dex_path) {
|
void Context::PreLoadDex(const fs::path &dex_path) {
|
||||||
if (LIKELY(!dexes.empty())) return;
|
if (LIKELY(!dexes.empty())) return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,8 +107,6 @@ namespace lspd {
|
||||||
static jclass
|
static jclass
|
||||||
FindClassFromLoader(JNIEnv *env, jobject class_loader, const char *class_name);
|
FindClassFromLoader(JNIEnv *env, jobject class_loader, const char *class_name);
|
||||||
|
|
||||||
void CallPostFixupStaticTrampolinesCallback(void *class_ptr, jmethodID mid);
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
ShouldSkipInject(const std::string &package_name, uid_t user, uid_t uid, bool res,
|
ShouldSkipInject(const std::string &package_name, uid_t user, uid_t uid, bool res,
|
||||||
const std::function<bool()>& empty_list,
|
const std::function<bool()>& empty_list,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue