After almost seven years, three US presidencies and a near-total ban, ByteDance Ltd. has secured a definitive victory in its standoff with Washington.