Mix half the pasted garlic and half the grated ginger with the cornflour and season with salt.
Heat about 2cm of vegetable oil in a large pan over medium/high heat, then dip the chicken into the cornflour to coat all over. Fry the chicken until crispy and golden brown, turning halfway. This wilkl take about 20 minutes. Remove from the oil and place on kitchen paper.
Heat anothger pan over a medium heat with the oil. Add the onion and palm sugar and cook for two minutes, breaking up the sugar once possible.
Once the sugar is fully caramalised and the onions are brown and sticky, add the remaining garlic and ginger. Cook for another two minutes, then add the tomatoes. Cook until the tomatoes burst and become thick and sticky.
Add all the other ingredients and simmer gently until syrupy, around ten minutes.
Slice the chicken and toiss through the sauce. It should be thick enough that it clongs to the chicken like a chilli jam.