Stir the soy sauce, vinegar, water, and sugar together in a small cup or container. Set it aside.
Coat the bottom of a medium skillet with 1 tablespoon of oil and place it over medium heat. Give the oil a minute to heat up, then add the pineapple pieces in a single layer. Cook the pineapple for about 5 minutes, flipping the pieces once or twice, until they're tender. Remove them from the skillet and transfer them to a plate.
Add a dash more oil to the skillet if it seems dry, then add the tofu cubes in an even layer. Cook them for about 10 minutes, turning every 2 to 3 minutes, until they're golden brown. Transfer the tofu to the plate with the pineapple.
Add the garlic, peppercorns, and bay leaves to the skillet. Toast them for 1 to 2 minutes, stirring constantly, until the garlic becomes very fragrant and the bay leaves begin to darken.
Return the tofu and pineapple to the skillet, then pour the soy sauce mixture over them. Raise the heat to high and bring it to a boil, then lower the heat so the sauce is just simmering. Let the tofu and pineapple simmer in the sauce until most of it has dried up, 8 to 10 minutes, stirring occasionally.
Remove the skillet from heat. Remove and discard the bay leaves, then stir in the scallions.
Serve over rice.