Humans are frequently exposed to N-nitrosamines through various sources, including diet, cigarette smoking, contaminated water, the atmosphere, and endogenous nitrosation. Exposure to these carcinogens may also contribute to the gender-specific incidence of liver cancer, which is significantly higher in males than in females, possibly due to the influence of endogenous hormones such as testosterone. However, the effect of testosterone on N-nitrosamine-induced liver cancer and its underlying mechanism remains unclear. To investigate the effect of testosterone on the development of liver cancer induced by N-nitrosamines exposure. Histopathological and immunohistochemical staining techniques were employed to analyze the expression levels and nuclear localizations of key signaling molecules, including androgen receptor (AR), β-catenin, and HMGB1, in both tumor and non-tumor regions of liver samples obtained from human patients and mice. The findings demonstrated a strong correlation between AR and β-catenin in the nuclear region of tumor areas. AR also showed a significant correlation with HMGB1 in the cytoplasmic region of non-tumor areas in both human and mice samples. The study further analyzed the expression levels and patterns of these three proteins during the progression of liver tumors. This study confirms that AR has the ability to modulate the expression levels and patterns of β-catenin and HMGB1 in vivo, thereby exacerbating the progression of liver cancer induced by environmental N-nitrosamines exposure. Importantly, the effect of testosterone on the formation of liver cancer induced by environmental N-nitrosamine exposure intensifies this progression. These findings have important implications for drug safety in clinical practice and emphasize the significance of reducing N-nitrosamines exposure through conscious choices regarding diet and lifestyle to ensure environmental safety.