Prep: Preheat the oven to 425F and line a baking sheet with a silicone mat or parchment paper. Cut the tofu into 3/4” cubes (or tear into bite-sized pieces, if preferred)
Tofu: Add the tofu to a medium bowl and add in the oil and soy sauce. Toss with a spatula until evenly coated, then sprinkle the cornstarch on top and toss again. Transfer to a baking sheet and spread out the tofu pieces so they aren’t touching. Bake on the top rack of the oven for 30 minutes, flipping the tofu halfway through.
Sauce: Whisk the ketchup, vinegar, Shaoxing wine, sugar, water, soy sauce, and cornstarch together in a small bowl. Whisk well until the cornstarch has dissolved, then add the water and mix again. Set aside.
Stir-Fry: Warm the oil in a large wok or sauté pan over medium heat. Add the garlic and ginger and sauté for 30 to 60 seconds, until fragrant. Add the onion and bell peppers to the wok and sauté for 1 to 2 minutes. Stir the sauce again to make sure the cornstarch is dissolved, then pour it into the pan along with the pineapple. Bring to a simmer and cook for 8 to 10 minutes, stirring occasionally, until the vegetables are tender. If the sauce gets too thick you can thin it out with additional water.
Final Touches: Turn the heat to low, then stir in the baked tofu. Taste the sauce and add more soy sauce to taste, if necessary. Divide the tofu between serving bowls and serve warm over rice and with sesame seeds and green onions, or as desired. Leftovers will keep in the fridge for up to 5 days.