Rub the chicken with the garlic and thyme and set aside.
Heat the oil in a saucepan until hazy and then add the chopped tomatoes, tomato puree and onion. Cook over a moderately high heat for about 15 minutes until the tomatoes are well reduced, stirring occasionally at first then more frequently as the tomatoes thicken.
Reduce the heat a little, add the chicken pieces and stir well to coat with the sauce. Cook for 10 minutes, stirring, then add the stock or water, the dried shrimp and the chilli. Bring to a boiland simmer for 5 minutes, stirring occasionally.
Put the rice in a separate saucepan. Scoop 1 1/4 cups of the sauce into a measuring jug, top up with water to 450ml and stir the liquid into the rice.
Cook covered until the liquid is absorbed, then place a piece of foil on top of the rice, cover thepan with a lid and cook over a low heat for 20 minutes until the rice is cooked, adding a little more water if necessary.
Transfer the chicken pieces to a warmed serving plate. Simmer the sauce until reduced by half. Pour over the chicken and serve with rice.