RZ_API ut64 rz_bin_dex_resolve_method_offset_by_idx(RZ_NONNULL RzBinDex *dex, ut32 method_idx) {
	rz_return_val_if_fail(dex, UT64_MAX);

	if (method_idx >= rz_pvector_len(dex->method_ids)) {
		RZ_LOG_INFO("cannot find method with index %u\n", method_idx);
		return UT64_MAX;
	}

	DexMethodId *method = (DexMethodId *)rz_pvector_at(dex->method_ids, method_idx);
	if (method->code_offset) {
		if (method->code_offset < RZ_DEX_RELOC_ADDRESS) {
			return RZ_DEX_VIRT_ADDRESS + method->code_offset;
		}
		return method->code_offset;
	}
	return UT64_MAX;
}
RZ_API ut64 rz_bin_dex_resolve_method_offset_by_idx(RZ_NONNULL RzBinDex *dex, ut32 method_idx) {
	rz_return_val_if_fail(dex, UT64_MAX);

	if (method_idx >= rz_pvector_len(dex->method_ids)) {
		RZ_LOG_INFO("cannot find method with index %u\n", method_idx);
		return UT64_MAX;
	}

	DexMethodId *method = (DexMethodId *)rz_pvector_at(dex->method_ids, method_idx);
	if (method->code_offset) {
		if (method->code_offset < RZ_DEX_RELOC_ADDRESS) {
			return RZ_DEX_VIRT_ADDRESS + method->code_offset;
		}
		return method->code_offset;
	}
	return UT64_MAX;
}