You've already forked PlayIntegrityFork
mirror of
https://github.com/osm0sis/PlayIntegrityFork.git
synced 2025-09-06 06:37:06 +00:00
Improve logging messages further
This commit is contained in:
@@ -189,12 +189,12 @@ private:
|
||||
|
||||
std::vector<std::string> eraseKeys;
|
||||
for (auto &jsonList: json.items()) {
|
||||
if (VERBOSE_LOGS > 1) LOGD("Parsing %s...", jsonList.key().c_str());
|
||||
if (VERBOSE_LOGS > 1) LOGD("Parsing %s", jsonList.key().c_str());
|
||||
if (jsonList.key().find_first_of("*.") != std::string::npos) {
|
||||
// Name contains . or * (wildcard) so assume real property name
|
||||
if (!jsonList.value().is_null() && jsonList.value().is_string()) {
|
||||
if (jsonList.value() == "") {
|
||||
LOGD("%s is empty, skipping...", jsonList.key().c_str());
|
||||
LOGD("%s is empty, skipping", jsonList.key().c_str());
|
||||
} else {
|
||||
if (VERBOSE_LOGS > 0) LOGD("Adding '%s' to properties list", jsonList.key().c_str());
|
||||
jsonProps[jsonList.key()] = jsonList.value();
|
||||
@@ -212,30 +212,30 @@ private:
|
||||
}
|
||||
|
||||
void inject() {
|
||||
LOGD("JNI: Get system classloader");
|
||||
LOGD("JNI: Getting system classloader");
|
||||
auto clClass = env->FindClass("java/lang/ClassLoader");
|
||||
auto getSystemClassLoader = env->GetStaticMethodID(clClass, "getSystemClassLoader", "()Ljava/lang/ClassLoader;");
|
||||
auto systemClassLoader = env->CallStaticObjectMethod(clClass, getSystemClassLoader);
|
||||
|
||||
LOGD("JNI: Create class loader");
|
||||
LOGD("JNI: Creating class loader");
|
||||
auto dexClClass = env->FindClass("dalvik/system/InMemoryDexClassLoader");
|
||||
auto dexClInit = env->GetMethodID(dexClClass, "<init>", "(Ljava/nio/ByteBuffer;Ljava/lang/ClassLoader;)V");
|
||||
auto buffer = env->NewDirectByteBuffer(dexVector.data(), static_cast<jlong>(dexVector.size()));
|
||||
auto dexCl = env->NewObject(dexClClass, dexClInit, buffer, systemClassLoader);
|
||||
|
||||
LOGD("JNI: Load class");
|
||||
LOGD("JNI: Loading class");
|
||||
auto loadClass = env->GetMethodID(clClass, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;");
|
||||
auto entryClassName = env->NewStringUTF("es.chiteroman.playintegrityfix.EntryPoint");
|
||||
auto entryClassObj = env->CallObjectMethod(dexCl, loadClass, entryClassName);
|
||||
|
||||
auto entryClass = (jclass) entryClassObj;
|
||||
|
||||
LOGD("JNI: Send JSON");
|
||||
LOGD("JNI: Sending JSON");
|
||||
auto receiveJson = env->GetStaticMethodID(entryClass, "receiveJson", "(Ljava/lang/String;)V");
|
||||
auto javaStr = env->NewStringUTF(json.dump().c_str());
|
||||
env->CallStaticVoidMethod(entryClass, receiveJson, javaStr);
|
||||
|
||||
LOGD("JNI: Call init");
|
||||
LOGD("JNI: Calling init");
|
||||
auto entryInit = env->GetStaticMethodID(entryClass, "init", "(I)V");
|
||||
env->CallStaticVoidMethod(entryClass, entryInit, VERBOSE_LOGS);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public final class EntryPoint {
|
||||
|
||||
private static void setField(String name, String value) {
|
||||
if (value.isEmpty()) {
|
||||
LOG(String.format("%s is empty, skipping...", name));
|
||||
LOG(String.format("%s is empty, skipping", name));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user