Update core to 1.8.3

This commit is contained in:
Nullptr 2022-05-11 00:59:38 +08:00
parent 3bc39e1e94
commit a9b27b1427
5 changed files with 71 additions and 12 deletions

2
core

@ -1 +1 @@
Subproject commit ee2c1a3320a4173c50c03c1fb3d5e0181840ee77 Subproject commit b36c170b8c6e138b7211371c47764f63c83a6f1e

View File

@ -23,6 +23,7 @@
#include <jni.h> #include <jni.h>
#include "config_impl.h"
#include "patch_loader.h" #include "patch_loader.h"
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
@ -31,6 +32,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
return JNI_ERR; return JNI_ERR;
} }
lspd::PatchLoader::Init(); lspd::PatchLoader::Init();
lspd::ConfigImpl::Init();
lspd::PatchLoader::GetInstance()->Load(env); lspd::PatchLoader::GetInstance()->Load(env);
return JNI_VERSION_1_6; return JNI_VERSION_1_6;
} }

View File

@ -0,0 +1,57 @@
/*
* This file is part of LSPosed.
*
* LSPosed is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LSPosed is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
*
* Copyright (C) 2022 LSPosed Contributors
*/
//
// Created by Nullptr on 2022/5/11.
//
#pragma once
#include <string>
#include "ConfigBridge.h"
namespace lspd {
class ConfigImpl : public ConfigBridge {
public:
inline static void Init() {
instance_ = std::make_unique<ConfigImpl>();
}
virtual obfuscation_map_t& obfuscation_map() override {
return obfuscation_map_;
}
virtual void obfuscation_map(obfuscation_map_t m) override {
obfuscation_map_ = std::move(m);
}
private:
inline static std::map<std::string, std::string> obfuscation_map_ = {
{"de.robv.android.xposed.", "de.robv.android.xposed."},
{ "android.app.AndroidApp", "android.app.AndroidApp"},
{ "android.content.res.XRes", "android.content.res.XRes"},
{ "android.content.res.XModule", "android.content.res.XModule"},
{ "org.lsposed.lspd.core.", "org.lsposed.lspd.core."},
{ "org.lsposed.lspd.nativebridge.", "org.lsposed.lspd.nativebridge."},
{ "org.lsposed.lspd.service.", "org.lsposed.lspd.service."},
};
};
}

View File

@ -25,7 +25,6 @@
#include "art/runtime/jit/profile_saver.h" #include "art/runtime/jit/profile_saver.h"
#include "elf_util.h" #include "elf_util.h"
#include "jni/bypass_sig.h" #include "jni/bypass_sig.h"
#include "native_hook.h"
#include "native_util.h" #include "native_util.h"
#include "patch_loader.h" #include "patch_loader.h"
#include "symbol_cache.h" #include "symbol_cache.h"
@ -100,8 +99,10 @@ namespace lspd {
.art_symbol_resolver = [](auto symbol) { .art_symbol_resolver = [](auto symbol) {
return GetArt()->getSymbAddress<void*>(symbol); return GetArt()->getSymbAddress<void*>(symbol);
}, },
.art_symbol_prefix_resolver = [](auto symbol) {
return GetArt()->getSymbPrefixFirstOffset(symbol);
},
}; };
InstallInlineHooks(env, initInfo);
auto stub = JNI_FindClass(env, "org/lsposed/lspatch/appstub/LSPAppComponentFactoryStub"); auto stub = JNI_FindClass(env, "org/lsposed/lspatch/appstub/LSPAppComponentFactoryStub");
auto dex_field = JNI_GetStaticFieldID(env, stub, "dex", "[B"); auto dex_field = JNI_GetStaticFieldID(env, stub, "dex", "[B");

View File

@ -2,7 +2,7 @@ package org.lsposed.lspatch.share;
public class LSPConfig { public class LSPConfig {
public static final LSPConfig instance = factory(); public static final LSPConfig instance;
public int API_CODE; public int API_CODE;
public int VERSION_CODE; public int VERSION_CODE;
@ -13,13 +13,12 @@ public class LSPConfig {
private LSPConfig() { private LSPConfig() {
} }
private static LSPConfig factory() { static {
LSPConfig config = new LSPConfig(); instance = new LSPConfig();
config.API_CODE = ${apiCode}; instance.API_CODE = ${apiCode};
config.VERSION_CODE = ${verCode}; instance.VERSION_CODE = ${verCode};
config.VERSION_NAME = "${verName}"; instance.VERSION_NAME = "${verName}";
config.CORE_VERSION_CODE = ${coreVerCode}; instance.CORE_VERSION_CODE = ${coreVerCode};
config.CORE_VERSION_NAME = "${coreVerName}"; instance.CORE_VERSION_NAME = "${coreVerName}";
return config;
} }
} }