Place chicken in a large bowl and rub salt all over it. Add the peppercorns and star anise. Then pour water to submerge the chicken. Cover the bowl with a plate or plastic wrap and refrigerate overnight or at least an hour.
Take the chicken from the brine and discard the brine but save the peppercorn and star anise. Poke holes on the opposite sides of the excess skin near the cavity. Pull one leg across the cavity and insert in the hole on the other side, then do the same with the other leg. Tuck the wings on the sides behind the shoulders.
In a pot or wok just big enough to fit the chicken, pour in water, soy sauce, pineapple juice and the juice from the pineapple slices. Add the brown sugar, garlic, peppercorns, and star anise. Stir to dissolve sugar.
Place the chicken in the pot with the liquids and cover with the lid. Bring to a boil over high heat then immediately lower heat to medium-low and just let it simmer for 10 minutes.
Remove the lid and baste (take some of the sauce with a spoon or ladle and pour over the top exposed part of the meat) with the sauce several times then cover and simmer again for 10 minutes.
Remove the lid and baste several times then scatter the pineapple slices and red bell pepper around the pot. Cover and simmer again for another 5 minutes.
Take the lid off and fish out the pineapple slices and some of red bell peppers. Let simmer, uncovered, to reduce the sauce, basting from time to time.
Once the sauce has been reduced to half, lower heat to low and add the cornstarch slurry and simmer until sauce gets thick while basting regularly.
Once sauce is nicely thick, cover with the lid again and turn the heat off and just let it sit in the hot pot/wok for another 10-15 minutes to make sure that chicken is cooked through and to give the flavors time to be fully absorbed.
Carefully lift the chicken and transfer to a serving plate and decorate with pineapple and red bell peppers. Pour some of the sauce over the top and around the chicken and serve.