Working the ball had always been legal, but using foreign objects to do so is not. Pre-covid saliva was the most commonly used, as was sweat. Saliva has since been banned internationally, although IPL has allowed it again.
In general improving the condition of the ball has been largely accepted (within legal bounds) but damaging it is heavily frowned upon. So rubbing the ball on your upper leg to "polish" it is totally fine. Rubbing it across the pocket zipper to rough it up is a no-no (ask Faf).
Edit: in the days when spit was commonplace players would suck on certain sweets in the belief that those sweets produced more (or "better") saliva.