RZ_API RZ_OWN char *rz_bin_dex_resolve_method_by_idx(RZ_NONNULL RzBinDex *dex, ut32 method_idx) {
	rz_return_val_if_fail(dex, NULL);

	if (method_idx >= rz_pvector_len(dex->method_ids)) {
		return NULL;
	}

	DexMethodId *method_id = (DexMethodId *)rz_pvector_at(dex->method_ids, method_idx);
	char *name = dex_resolve_string_id(dex, method_id->name_idx);
	if (!name) {
		return NULL;
	}

	char *proto = dex_resolve_proto_id(dex, name, method_id->proto_idx, false);
	RZ_FREE(name);
	if (!proto) {
		return NULL;
	}

	name = dex_resolve_type_id(dex, method_id->class_idx);
	if (!name) {
		free(proto);
		return NULL;
	}

	char *method = rz_str_newf("%s->%s", name, proto);
	free(name);
	free(proto);
	return method;
}
RZ_API RZ_OWN char *rz_bin_dex_resolve_method_by_idx(RZ_NONNULL RzBinDex *dex, ut32 method_idx) {
	rz_return_val_if_fail(dex, NULL);

	if (method_idx >= rz_pvector_len(dex->method_ids)) {
		return NULL;
	}

	DexMethodId *method_id = (DexMethodId *)rz_pvector_at(dex->method_ids, method_idx);
	char *name = dex_resolve_string_id(dex, method_id->name_idx);
	if (!name) {
		return NULL;
	}

	char *proto = dex_resolve_proto_id(dex, name, method_id->proto_idx, false);
	RZ_FREE(name);
	if (!proto) {
		return NULL;
	}

	name = dex_resolve_type_id(dex, method_id->class_idx);
	if (!name) {
		free(proto);
		return NULL;
	}

	char *method = rz_str_newf("%s->%s", name, proto);
	free(name);
	free(proto);
	return method;
}