Most successful resistance by populations against the government have had the resisting part of the population overlapping the military. (Conversely, most popular resistance where this has not been the case has failed.)
So this is, generally, already the case, but in a sense somewhat less significant than is implied.
I suppose if you have an entirely automated and tamper-proof, self-maintaining and reproducing, military with the senior government decision makers as the only humans in the loop the situation becomes a bit different and there becomes a qualitative difference where popular resistance can no longer spread to include the military.
I challenge you to show me any example of a government which was absolutely hated by its people and somehow managed to hold onto power. I don't think there is any. Every government gets popular support from somewhere, or else they wouldn't have an army to maintain their rule with. With occupations, it comes from the occupying nation. With places like Saddam's Iraq, it came from one powerful portion of the population that happily stomped on the other portions. With places like North Korea, it comes from a population that's been brainwashed into thinking the Dear Leader is basically a demigod.