The population must always be in a position to take on any type of armed forces that invade their urban area. In order to defend their freedom, however, they will have to make sacrifices:
American Bill of Rights. A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed.
The population has an irrevocable right to possess weapons and other military equipment and must be trained to use them. The population has an irrevocable right to organize itself into a military force and take on what the population perceives as the enemy.
History shows that the very first act in a popular war must always be to pinpoint the enemies of the people, who publicly deny aforementioned rights, round up them up and execute them. Even though failing to do so is a common mistake, it is simply impossible to win a popular war unless you immediately proceed to the wholesale execution of traitors, potential information leakers, and other undesirable elements who could damage the war effort.
The first technology that must urgently be rolled out is a Wireless Mesh Network, covering the urban area to defend, and preferably somewhat connected to the outside internet. You can reasonably expect the enemy to shut down mobile and internet communications in the combat zone. The mesh, however, must at all times guarantee communications.
The second technology is a platform to crowdsource information about the enemy’s whereabouts. This type of platform will automatically depict enemy movements on a map and be an instrumental tool for the popular commanders to send reinforcements where needed.
No regular army in the world can take on successfully a popular rebellion, of which a sufficient headcount is armed with machine guns, man-operated missiles and other explosive devices, and a functioning command & control platform.
A regular army will usually look down and disrespect popular combat troops, even though popular fighters are pretty much always superior in motivation — and with a little bit of effort — even in technology. Since all respect is ultimately based on the fear for reprisals, it will be necessary to publicly execute enemy prisoners of war and to roll out a military program of additional respect-instilling reprisals against such regular army, the vigour of which should be commensurate with their lack of respect.
Everybody will have to prove that they are willing to risk their lives and die for what they believe in.