Dry-fry the grated coconut until golden brown and grind to make kerisik.
Soak the dried chillies in hot water for 20 minutes; drain.
Heat oil and fry the shallots until golden and crisp; remove. Grind the dried chillies, fried shallots, onions, garlic, lemongrass, ginger, galangal and turmeric to a smooth paste.
Stir-fry the cinnamon, star anise and cardamom for 1 minute. Add the spice paste and stir-fry until fragrant.
Stir in the chicken, coconut milk and dried assam. Bring to the boil, then simmer, stirring frequently, until the gravy has reduced by half.
Stir in the kerisik, turmeric leaves, lime leaves, salt and pepper and cook until the gravy is very thick and the chicken is very tender.