here it's a question that I've posted in MSE but unfortunately got no answers:

Let $A$ and $B$ be matrices of finite order with integer coefficients.

Let $n\in\mathbb{N}$ and let $G_A=\mathbb{Z}\ltimes_A \mathbb{Z}^n$ be the semidirect product, where the action is $\varphi(n)\cdot (m_1,\ldots,m_n)=A^n (m_1,\ldots,m_n)$, and similarly with $B$.

It is easy to construct an isomorphism between $G_A$ and $G_B$ if $A$ is conjugate in $\mathrm{GL}(n,\mathbb{Z})$ to $B$ or $B^{-1}$.

But, this is also a necessary condition? I mean, does $G_A\cong G_B$ implies $A\cong B$ or $A\cong B^{-1}$ in $\mathrm{GL}(n,\mathbb{Z})$ or is there a counterexample?

I've seen at this MSE question that it is true if $A$ and $B$ are hyperbolic, i.e none of their eigenvalues have module 1, but it isn't the case.

Thank you very much!