Place the red chile flakes into a large, heatproof pot big enough to hold 8 to 10 cups of liquid. Set aside.
In a separate medium pot, heat the oil over medium heat until a thermometer registers 300 F.
Add the black peppercorns, star anise, cloves, bay leaves and coriander seeds. Then, carefully place the green onions, red onions and ginger into the hot oil. Bring the temperature of the oil up to 350 F. Maintain the temperature by carefully moving the pot off the heat if it gets too hot and putting it back on the heat if it gets too cool. Fry the spices and onions in the oil until they are fragrant but not blackened, about 3 minutes. Strain the solids from the oil, but keep the oil. (You can discard the aromatics or reserve them to enhance a broth or stew later.)
Reheat the oil to 450 F, then turn off the burner and carefully remove the pot from the heat.
While wearing oven mitts and long sleeves, gradually and very carefully pour the hot oil into the pot with the red chile flakes, stirring carefully to make sure the hot oil coats the chile flakes. The oil will bubble and fry; let it cook until the bubbling subsides. NOTE: this will create a lot of smoke, so do this step outdoors, if you can, or in a well-ventilated area.
Add a splash of malt vinegar to add more flavor and bring down the temperature so the chile flakes don’t burn.
Let the oil cool to room temperature, then let it rest, covered, for 10 to 12 hours or overnight. Store in an airtight container at room temperature for up to 1 month.
Try our recipe for Xi'an Famous Foods Ramen