Contact one of the Silicon Valley law firms that's used to dealing with these things. Don't go to some cheapo ambulance chasing lawyer who doesn't know what to do. Even if you cough up $20k in fees to a law firm it's worth doing. They'll help you set up a company for your product and steer everything through that to unlock your funds. A lot of advice on here is overly negative and misinformed. As someone who has had to deal with changes of legal status, setting up companies as a foreigner, and has dealt with the hell of PayPal account freezing, I can assure you this is fixable if you work with a reputable experienced law firm.