Upgrade cxx (#2780)
This commit is contained in:
parent
cc31605423
commit
888a7dbeb6
|
|
@ -1,6 +1,3 @@
|
|||
[submodule "external/cxx"]
|
||||
path = external/cxx
|
||||
url = https://github.com/LSPosed/libcxx.git
|
||||
[submodule "external/lsplant"]
|
||||
path = external/lsplant
|
||||
url = https://github.com/LSPosed/LSPlant.git
|
||||
|
|
@ -10,3 +7,6 @@
|
|||
[submodule "external/fmt"]
|
||||
path = external/fmt
|
||||
url = https://github.com/fmtlib/fmt.git
|
||||
[submodule "external/cxx"]
|
||||
path = external/cxx
|
||||
url = https://github.com/topjohnwu/libcxx.git
|
||||
|
|
|
|||
|
|
@ -16,18 +16,15 @@
|
|||
*
|
||||
* Copyright (C) 2022 LSPosed Contributors
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
//
|
||||
// Created by Kotori0 on 2022/4/14.
|
||||
//
|
||||
|
||||
#ifndef LSPOSED_CONFIGBRIDGE_H
|
||||
#define LSPOSED_CONFIGBRIDGE_H
|
||||
#include <map>
|
||||
|
||||
using obfuscation_map_t = std::map<std::string, std::string>;
|
||||
class ConfigBridge {
|
||||
public:
|
||||
namespace lspd {
|
||||
using obfuscation_map_t = std::map<std::string, std::string>;
|
||||
|
||||
class ConfigBridge {
|
||||
public:
|
||||
inline static ConfigBridge *GetInstance() {
|
||||
return instance_.get();
|
||||
}
|
||||
|
|
@ -36,12 +33,13 @@ public:
|
|||
return std::move(instance_);
|
||||
}
|
||||
|
||||
virtual obfuscation_map_t& obfuscation_map() = 0;
|
||||
virtual obfuscation_map_t &obfuscation_map() = 0;
|
||||
|
||||
virtual void obfuscation_map(obfuscation_map_t) = 0;
|
||||
|
||||
virtual ~ConfigBridge() = default;
|
||||
protected:
|
||||
inline static std::unique_ptr<ConfigBridge> instance_ = nullptr;
|
||||
};
|
||||
|
||||
#endif //LSPOSED_CONFIGBRIDGE_H
|
||||
protected:
|
||||
static std::unique_ptr<ConfigBridge> instance_;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace lspd {
|
|||
virtual ~Context() = default;
|
||||
|
||||
protected:
|
||||
inline static std::unique_ptr<Context> instance_;
|
||||
static std::unique_ptr<Context> instance_;
|
||||
jobject inject_class_loader_ = nullptr;
|
||||
jclass entry_class_ = nullptr;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,11 @@
|
|||
|
||||
using namespace lsplant;
|
||||
|
||||
|
||||
namespace lspd {
|
||||
std::unique_ptr<lspd::Context> lspd::Context::instance_;
|
||||
std::unique_ptr<ConfigBridge> ConfigBridge::instance_;
|
||||
|
||||
Context::PreloadedDex::PreloadedDex(int fd, std::size_t size) {
|
||||
LOGD("Context::PreloadedDex::PreloadedDex: fd={}, size={}", fd, size);
|
||||
auto *addr = mmap(nullptr, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <sys/mount.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include "logging.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <cinttypes>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <functional>
|
||||
#include <sys/system_properties.h>
|
||||
|
||||
using namespace std::string_view_literals;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#define _LOGGING_H
|
||||
|
||||
#include <android/log.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef LOG_TAG
|
||||
#define LOG_TAG "LSPosed"
|
||||
|
|
|
|||
|
|
@ -9,37 +9,40 @@ SET_OPTION(Plugin.SymbolResolver OFF)
|
|||
|
||||
set(LIBCXX_SOURCES
|
||||
algorithm.cpp
|
||||
any.cpp
|
||||
# any.cpp
|
||||
atomic.cpp
|
||||
barrier.cpp
|
||||
bind.cpp
|
||||
# bind.cpp
|
||||
charconv.cpp
|
||||
chrono.cpp
|
||||
condition_variable.cpp
|
||||
condition_variable_destructor.cpp
|
||||
debug.cpp
|
||||
# debug.cpp
|
||||
exception.cpp
|
||||
filesystem/directory_iterator.cpp
|
||||
filesystem/int128_builtins.cpp
|
||||
filesystem/operations.cpp
|
||||
# filesystem/directory_iterator.cpp
|
||||
# filesystem/int128_builtins.cpp
|
||||
# filesystem/operations.cpp
|
||||
functional.cpp
|
||||
future.cpp
|
||||
# use absl instead
|
||||
# hash.cpp
|
||||
ios.cpp
|
||||
iostream.cpp
|
||||
locale.cpp
|
||||
# ios.cpp
|
||||
# iostream.cpp
|
||||
# locale.cpp
|
||||
memory.cpp
|
||||
mutex.cpp
|
||||
mutex_destructor.cpp
|
||||
new.cpp
|
||||
optional.cpp
|
||||
random.cpp
|
||||
regex.cpp
|
||||
# regex.cpp
|
||||
# ryu/d2fixed.cpp
|
||||
# ryu/d2s.cpp
|
||||
# ryu/f2s.cpp
|
||||
shared_mutex.cpp
|
||||
stdexcept.cpp
|
||||
string.cpp
|
||||
strstream.cpp
|
||||
# strstream.cpp
|
||||
system_error.cpp
|
||||
thread.cpp
|
||||
# typeinfo.cpp
|
||||
|
|
@ -51,17 +54,18 @@ set(LIBCXX_SOURCES
|
|||
|
||||
list(TRANSFORM LIBCXX_SOURCES PREPEND cxx/src/)
|
||||
|
||||
set(LIBCXX_EXPORT_FLAGS)
|
||||
set(LIBCXX_FLAGS
|
||||
-fvisibility-global-new-delete-hidden
|
||||
-fvisibility=hidden
|
||||
-fvisibility-inlines-hidden
|
||||
set(LIBCXX_EXPORT_FLAGS
|
||||
-DLIBCXX_BUILDING_LIBCXXABI
|
||||
-D_LIBCPP_NO_EXCEPTIONS
|
||||
-D_LIBCPP_NO_RTTI
|
||||
-D_LIBCPP_BUILDING_LIBRARY
|
||||
-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
|
||||
-D__STDC_FORMAT_MACROS
|
||||
-D_LIBCXXABI_NO_EXCEPTIONS
|
||||
)
|
||||
set(LIBCXX_FLAGS
|
||||
-fvisibility-global-new-delete-hidden
|
||||
-fvisibility=hidden
|
||||
-fvisibility-inlines-hidden
|
||||
)
|
||||
set(LIBCXX_EXPORT_INCLUDES cxx/include)
|
||||
set(LIBCXX_INCLUDES cxx/src)
|
||||
|
|
@ -84,7 +88,6 @@ set(LIBCXXABI_SOURCES
|
|||
)
|
||||
list(TRANSFORM LIBCXXABI_SOURCES PREPEND cxx/src/abi/)
|
||||
set(LIBCXXABI_FLAGS
|
||||
-D_LIBCXXABI_NO_EXCEPTIONS
|
||||
-Wno-macro-redefined
|
||||
-Wno-unknown-attributes
|
||||
-DHAS_THREAD_LOCAL)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 82090ae75f7d284f2647a67f3f80f28f54eaddfc
|
||||
Subproject commit 12c8f4e93f196a700137e983dcceeac43cf807f2
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 9c33903c87a240ae38dbf7fdf49c0748addd073d
|
||||
Subproject commit bbabd25043f4fd8056cf5df55e2839de824467a1
|
||||
|
|
@ -17,28 +17,24 @@
|
|||
* Copyright (C) 2022 LSPosed Contributors
|
||||
*/
|
||||
|
||||
//
|
||||
// Created by Kotori0 on 2022/4/14.
|
||||
//
|
||||
|
||||
#ifndef LSPOSED_CONFIGIMPL_H
|
||||
#define LSPOSED_CONFIGIMPL_H
|
||||
#pragma once
|
||||
|
||||
#include "config_bridge.h"
|
||||
#include "service.h"
|
||||
|
||||
class ConfigImpl: public ConfigBridge {
|
||||
public:
|
||||
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); }
|
||||
virtual obfuscation_map_t &obfuscation_map() override { return obfuscation_map_; }
|
||||
|
||||
private:
|
||||
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_;
|
||||
};
|
||||
|
||||
|
||||
#endif //LSPOSED_CONFIGIMPL_H
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@
|
|||
using namespace lsplant;
|
||||
|
||||
namespace lspd {
|
||||
std::unique_ptr<Service> Service::instance_;
|
||||
|
||||
jboolean
|
||||
Service::exec_transact_replace(jboolean *res, JNIEnv *env, [[maybe_unused]] jobject obj,
|
||||
va_list args) {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace lspd {
|
|||
std::map<std::string, std::string> RequestObfuscationMap(JNIEnv *env, const lsplant::ScopedLocalRef<jobject> &binder);
|
||||
|
||||
private:
|
||||
inline static std::unique_ptr<Service> instance_ = std::make_unique<Service>();
|
||||
static std::unique_ptr<Service> instance_;
|
||||
bool initialized_ = false;
|
||||
|
||||
Service() = default;
|
||||
|
|
|
|||
Loading…
Reference in New Issue