static RzList /*<RzBinField *>*/ *dex_resolve_fields_in_class(RzBinDex *dex, DexClassDef *class_def, ut8 *inserted) {
	RzList *fields = rz_list_newf((RzListFree)rz_bin_field_free);
	if (!fields) {
		return NULL;
	}
	DexFieldId *field_id = NULL;
	DexEncodedField *encoded_field = NULL;
	RzListIter *it = NULL;

	rz_list_foreach (class_def->static_fields, it, encoded_field) {
		if (encoded_field->field_idx >= rz_pvector_len(dex->field_ids)) {
			RZ_LOG_INFO("cannot find static field with index %" PFMT64u "\n", encoded_field->field_idx);
			continue;
		} else if (inserted[encoded_field->field_idx]) {
			continue;
		}
		inserted[encoded_field->field_idx] = true;
		field_id = (DexFieldId *)rz_pvector_at(dex->field_ids, encoded_field->field_idx);

		RzBinField *field = dex_field_to_bin_field(dex, encoded_field, field_id, true);
		if (!field || !rz_list_append(fields, field)) {
			rz_bin_field_free(field);
			break;
		}
	}

	rz_list_foreach (class_def->instance_fields, it, encoded_field) {
		if (encoded_field->field_idx >= rz_pvector_len(dex->field_ids)) {
			RZ_LOG_INFO("cannot find instance field with index %" PFMT64u "\n", encoded_field->field_idx);
			continue;
		} else if (inserted[encoded_field->field_idx]) {
			continue;
		}
		inserted[encoded_field->field_idx] = true;
		field_id = (DexFieldId *)rz_pvector_at(dex->field_ids, encoded_field->field_idx);

		RzBinField *field = dex_field_to_bin_field(dex, encoded_field, field_id, false);
		if (!field || !rz_list_append(fields, field)) {
			rz_bin_field_free(field);
			break;
		}
	}
	return fields;
}
static RzList   *dex_resolve_fields_in_class(RzBinDex *dex, DexClassDef *class_def, ut8 *inserted) {
	RzList *fields = rz_list_newf((RzListFree)rz_bin_field_free);
	if (!fields) {
		return NULL;
	}
	DexFieldId *field_id = NULL;
	DexEncodedField *encoded_field = NULL;
	RzListIter *it = NULL;

	rz_list_foreach (class_def->static_fields, it, encoded_field) {
		if (encoded_field->field_idx >= rz_pvector_len(dex->field_ids)) {
			RZ_LOG_INFO("cannot find static field with index %" PFMT64u "\n", encoded_field->field_idx);
			continue;
		} else if (inserted[encoded_field->field_idx]) {
			continue;
		}
		inserted[encoded_field->field_idx] = true;
		field_id = (DexFieldId *)rz_pvector_at(dex->field_ids, encoded_field->field_idx);

		RzBinField *field = dex_field_to_bin_field(dex, encoded_field, field_id, true);
		if (!field || !rz_list_append(fields, field)) {
			rz_bin_field_free(field);
			break;
		}
	}

	rz_list_foreach (class_def->instance_fields, it, encoded_field) {
		if (encoded_field->field_idx >= rz_pvector_len(dex->field_ids)) {
			RZ_LOG_INFO("cannot find instance field with index %" PFMT64u "\n", encoded_field->field_idx);
			continue;
		} else if (inserted[encoded_field->field_idx]) {
			continue;
		}
		inserted[encoded_field->field_idx] = true;
		field_id = (DexFieldId *)rz_pvector_at(dex->field_ids, encoded_field->field_idx);

		RzBinField *field = dex_field_to_bin_field(dex, encoded_field, field_id, false);
		if (!field || !rz_list_append(fields, field)) {
			rz_bin_field_free(field);
			break;
		}
	}
	return fields;
}