You've already forked PlayIntegrityFork
mirror of
https://github.com/osm0sis/PlayIntegrityFork.git
synced 2025-09-06 06:37:06 +00:00
Add advanced Build classes field logging
Co-authored-by: Nicholas Bissell <thefreeman193@hotmail.com>
This commit is contained in:
@@ -23,6 +23,7 @@ public final class EntryPoint {
|
||||
public static void init() {
|
||||
spoofProvider();
|
||||
spoofDevice();
|
||||
if (verboseLogs > 99) logFields();
|
||||
}
|
||||
|
||||
public static void readJson(String data) {
|
||||
@@ -141,6 +142,27 @@ public final class EntryPoint {
|
||||
LOG(String.format("[%s]: %s -> %s", name, oldValue, value));
|
||||
}
|
||||
|
||||
private static String logParseField(Field field) {
|
||||
Object value = null;
|
||||
String type = field.getType().getName();
|
||||
String name = field.getName();
|
||||
try {
|
||||
value = field.get(null);
|
||||
} catch (IllegalAccessException|NullPointerException e) {
|
||||
return String.format("Couldn't access '%s' field value: " + e, name);
|
||||
}
|
||||
return String.format("<%s> %s: %s", type, name, String.valueOf(value));
|
||||
}
|
||||
|
||||
private static void logFields() {
|
||||
for (Field field : Build.class.getDeclaredFields()) {
|
||||
LOG("Build " + logParseField(field));
|
||||
}
|
||||
for (Field field : Build.VERSION.class.getDeclaredFields()) {
|
||||
LOG("Build.VERSION " + logParseField(field));
|
||||
}
|
||||
}
|
||||
|
||||
static void LOG(String msg) {
|
||||
Log.d("PIF/Java", msg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user