Notations and definitions.
For all $A\in\textrm{GL}_n(\mathbb{Z})$, $A$ is hyperbolic if and only if none of its complex eigenvalue has module $1$.
For all $(A,B)\in\textrm{GL}_n(\mathbb{Z})^2$, one says that: $$A\sim B\iff\exists P\in\textrm{GL}_n(\mathbb{Z}),\exists\varepsilon\in\{\pm 1\}\textrm{ s.t. }A=PB^{\varepsilon}P^{-1}.$$
For all $A\in\textrm{GL}_n(\mathbb{Z})$, one defines the following group: $$G_A:=\mathbb{Z}^n\rtimes_{\alpha_A}\mathbb{Z},$$ where $\alpha_A\colon\mathbb{Z}\rightarrow\textrm{Aut}(\mathbb{Z}^n)$ is the group homomorphism given by: $$\alpha_A(n)(x):=A^nx.$$
Theorem. Let $(A,B)\in\textrm{GL}_n(\mathbb{Z})^2$ be two hyperbolic matrices such that $G_A\cong G_B$, then $A\sim B$.
Proof. Let $\phi\colon G_A\rightarrow G_B$ a group isomorphism, I have already proved that $\mathbb{Z}^n\times\{0\}$ is the only maximal abelian subgroup of rank $n$ of $G_A$. From there, I am asked to establish that $\phi$ gives rise through quotient to an isomorphism $\overline{\phi}\colon\mathbb{Z}\rightarrow\mathbb{Z}$ and conclude. $\Box$
I get that $\overline{\phi}$ will be either $\textrm{id}$ or $-\textrm{id}$, but I don't understand how to build $\overline{\phi}$ and how to conclude. Any help will be greatly appreciated.