private static void visit(@Nonnull Map<String, Set<String>> formatToAttrs,
	                          @Nonnull Map<String, String> attrToFormat,
	                          @Nonnull Map<String, Object2LongMap<String>> attrToEnum,
	                          @Nonnull Map<String, Object2LongMap<String>> attrToFlags,
	                          @Nonnull JsonObject node) {
		JsonElement nameNode = node.get("name");
		if (nameNode != null && node instanceof JsonObject childObject) {
			String name = nameNode.getAsString();

			// Handle different kinds of entries
			JsonElement formatNode = childObject.get("format");
			if (formatNode != null) {
				String format = formatNode.getAsString();
				attrToFormat.put(name, format);
				formatToAttrs.computeIfAbsent(format, f -> new TreeSet<>()).add(name);
				return;
			} else {
				JsonElement flagNode = childObject.get("flag");
				if (flagNode instanceof JsonArray flagArray) {
					Object2LongMap<String> nameToValue = new Object2LongOpenHashMap<>();
					for (JsonElement flagEntry : flagArray) {
						JsonObject flagObject = flagEntry.getAsJsonObject();
						String flagName = flagObject.get("name").getAsString();
						String flagValueText = flagObject.get("value").getAsString();
						if (flagValueText.startsWith("0x"))
							flagValueText = flagValueText.substring(2);
						long flagValue = Long.parseLong(flagValueText, 16);
						nameToValue.put(flagName, flagValue);
					}
					attrToFlags.put(name, nameToValue);
					return;
				} else {
					JsonElement enumNode = node.get("enum");
					if (enumNode instanceof JsonArray enumArray) {
						Object2LongMap<String> nameToValue = new Object2LongOpenHashMap<>();
						for (JsonElement flagEntry : enumArray) {
							JsonObject flagObject = flagEntry.getAsJsonObject();
							String enumName = flagObject.get("name").getAsString();
							String enumValueText = flagObject.get("value").getAsString();
							if (enumValueText.startsWith("0x"))
								enumValueText = enumValueText.substring(2);
							long enumValue = Long.parseLong(enumValueText);
							nameToValue.put(enumName, enumValue);
						}
						attrToEnum.put(name, nameToValue);
						return;
					}
				}
			}
		}

		// Visit the children if this node is not a child and isn't one of the types we expect.
		for (JsonElement child : node.asMap().values())
			if (child instanceof JsonObject childObject)
				visit(formatToAttrs, attrToFormat, attrToEnum, attrToFlags, childObject);
	}
@param resId
		Resource ID.

@return {@code true} when the resource is a known flag.
recaf-core/src/main/java/software/coley/recaf/util/android/AndroidRes.java