Stir fry pork to give it some colour, then remove from wok.
With the leftover oil (if too oily, remove some), over low heat, add the sugar. Cook the sugar until it starts to melt and then add the onions. Turn up the heat to medium high and stir-fry the onions for a minute. Add the mushrooms and stir-fry for another couple minutes.
Add the pork, shaoxing wine, light soy sauce, dark soy sauce and water.
Stir and bring the mixture to a boil. Once boiling, add the spices, along with the peeled hardboiled eggs and turn the heat to the lowest setting. Simmer for 1 1/2 hours, stirring occasionally to prevent sticking.
To finish the dish, turn up the heat to medium high to thicken the sauce, stirring occasionally. This process should take about 5-minutes. The sauce should be thick enough to coat a spoon, but there should still be plenty of it left. Serve over steamed white rice.