mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 13:05:53 +08:00
feat: impl remapper whitelist manage
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
1 parent
ee382817d3
commit
f84e13c14d
3 files changed
+25
-2
No files matched your search
@@ -6,3 +6,5 @@ std::mutex classDataMutex;
|
||||
|
||||
std::unordered_map<std::string, std::vector<unsigned char>> pendingRetransform;
|
||||
std::mutex pendingRetransformMutex;
|
||||
|
||||
std::unordered_set<std::string> remapperWhiteList;
|
||||
@@ -35,4 +35,7 @@ extern std::unordered_map<std::string, ClassFileData> classFileDataMap;
|
||||
extern std::mutex classDataMutex;
|
||||
|
||||
extern std::unordered_map<std::string, std::vector<unsigned char>> pendingRetransform;
|
||||
extern std::mutex pendingRetransformMutex;
|
||||
extern std::mutex pendingRetransformMutex;
|
||||
|
||||
// Remapper WhiteList
|
||||
extern std::unordered_set<std::string> remapperWhiteList;
|
||||
@@ -1,17 +1,35 @@
|
||||
#include <jni_impl.hpp>
|
||||
#include <global.hpp>
|
||||
|
||||
JNIEXPORT void JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_addRemapperWhiteList
|
||||
(JNIEnv *env, jclass, jstring package_name) {
|
||||
std::string pkg_name = env->GetStringUTFChars(package_name, nullptr);
|
||||
if (pkg_name.empty()) {
|
||||
PLOGW << "package name is empty";
|
||||
return;
|
||||
}
|
||||
|
||||
remapperWhiteList.insert(pkg_name);
|
||||
|
||||
PLOGI << "add remapper white list: " << pkg_name;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_removeRemapperWhiteList
|
||||
(JNIEnv *env, jclass, jstring package_name) {
|
||||
std::string pkg_name = env->GetStringUTFChars(package_name, nullptr);
|
||||
if (pkg_name.empty()) {
|
||||
PLOGW << "package name is empty";
|
||||
return;
|
||||
}
|
||||
|
||||
remapperWhiteList.erase(pkg_name);
|
||||
|
||||
PLOGI << "remove remapper white list: " << pkg_name;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_clearRemapperWhiteList
|
||||
(JNIEnv *env, jclass) {
|
||||
remapperWhiteList.clear();
|
||||
|
||||
PLOGI << "clear remapper white list";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user