Then Joshua built an altar to Yahweh, the God of Israel, in Mount Ebal,
This tremendous ceremony took place at the two mountains of Gerizim and Ebal, as Moses had directed in  Deuteronomy 27.  In order to get to that place, Joshua had to lead all of Israel "past the fortress of Shechem, guarding the valley,"[30] indicating that Shechem was in friendly hands at that time.  "Several of the Amarna letters declare that around 1380 B.C., the prince of Shechem was in league with some invading army, likely the Hebrews."[31]  There is also the possibility that the Israelites had already subdued it.