I would like to solve the following exercise:
Suppose $R$ is a commutative semisimple ring of characteristic $p^t, t\geq1$, and we have two finite groups $G_1=H_1 \times A_1$ and $G_2=H_2 \times A_2$. Now $H_1$ and $H_2$ are finite $p$-groups, where $p \nmid \vert A_i \vert, i=1,2$. Prove that $RG_1 \cong RG_2$ iff $\mathbb Z A_{1} \cong \mathbb Z A_2$ and $\mathbb{Z} H_1 \cong \mathbb{Z} H_2$.
Having no idea how to start, I first tried solving a different exercise, also related to direct products:
If $G_1=H_1 \times A_1$ is a finite group, where $(\vert H_1 \vert,\vert A_1 \vert)=1$, and $G_2$ is any other group, then: $\mathbb Z G_1 \cong \mathbb Z G_2$ iff $G_2=H_2 \times A_2$, $\mathbb{Z}A_1 \cong \mathbb Z A_2$ and $\mathbb Z H_1 \cong \mathbb Z H_2$.
Proof: One direction is clear, since $\mathbb Z (G \times H) \cong \mathbb Z G \otimes \mathbb Z H$. For the other direction, since $H_1 \trianglelefteq G_1$, by the normal subgroup correspondence, there exists a unique normal subgroup $H_2 \trianglelefteq G_2$ such that $\mathbb Z (G_2 / H_2) \cong \mathbb Z (G_1/H_1) \cong \mathbb Z A_1$. Doing the same for $A_1 \trianglelefteq G_1$ gives $\mathbb{Z}(G_2/A_2) \cong \mathbb Z H_1$. The correspondence respects intersections, so $A_2 \cap H_2= \emptyset$. Since $\vert A_2 \times H_2 \vert= \vert A_2 \vert \cdot \vert H_2 \vert=\vert A_1 \vert \cdot \vert H_1 \vert =\vert G_1 \vert = \vert G_2 \vert$ ($\mathbb Z G_1$ and $\mathbb Z G_2$ have the same rank over $\mathbb Z$), I think we can conclude that $G_2=A_2 \times H_2$. $\square$
EDIT: Does anyone know why the orders are supposed to be coprime?
This doesn't really seem to help for the first exercise though. Since $R=k_1 \times k_2 \times \ldots \times k_n$, where the $k_i$ are fields of characteristic $p$, it is probably helpful to first consider $R=k$. Any help would be appreciated.