If the I-130 is sponsored by a US citizen, I-485 filing or approval will not be affected by unlawful presence (i.e. no legal status) for the US citizen's immediate relative (parents, spouse or unmarried minor child <21) as long as the relative entered US legally.
So, in above case, if the beneficiary can prove his/her immediate relative relationship with the sponsor before the deadline for him/her to file I-290B, then he/she can file I-290B; or file I-130 & I-485 concureently. Otherwise, if he/she cannot do it on time, then he/she can file I-130 and I-485 later after he/she prepare the proof document. He/she also can leave US as asoon as possible and then, apply for the immigrant visa in China.