Involved in the pathway of N-acetyl-D-galactosamine degradation. Catalyzes the conversion of N-acetyl-D-galactosamine 6-phosphate to D-galactosamine 6-phosphate and acetate. It can also catalyze the conversion of N-acetyl-D-glucosamine 6-phosphate. H2O + N-acetyl-D-galactosamine 6-phosphate = acetate + D-galactosamine 6-phosphate H2O + N-acetyl-D-glucosamine 6-phosphate = acetate + D-glucosamine 6-phosphate In Shewanella sp., the active phosphotransferase system (PTS) specific for the transport of GalNAc and GalN is replaced by a set of GalNAc- and GalN-specific permeases and kinases (AgaP and AgaK, respectively). Belongs to the metallo-dependent hydrolases superfamily. NagA family.