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.
The fact that $\bar\phi:\mathbb{Z}\rightarrow\mathbb{Z}$ is an isomorphism implies that $\phi(0,1)=(u,1)$ or $\phi(0,1)=(u,-1)$.
Let $x\in\mathbb{Z}^n$, you have $(0,1)(x,0)(0,-1)=(A(x),0)$. Suppose $\phi(0,1)=(u,1)$
$\phi$ preserves the maximal ideals implies that $\phi$ induces a linear map $P:\mathbb{Z}^n\times\{0\}\rightarrow \mathbb{Z}^n\times\{0\}$. You have: \begin{align}\phi((0,1)(x,0)(0,-1))&=\phi(A(x),0),\\&=(PA(x),0),\\&=\phi(0,1)\phi(x,0)\phi(0,-1),\\&=\phi(0,1)\phi(x,0)\phi(0,1)^{-1},\\&= (u,1)(P(x),0)(-B^{-1}(u),-1),\\&=(BP(x)+u,1)(-B^{-1}(u),-1),\\&=(BP(x),0). \end{align} We deduce that $BP(x)=PA(x)$.
If $\phi(0,1)=(u,-1)$. The same method shows that $B^{-1}P=PA$.