>>998562>>998564if you get a wilderness permit and camp at least at least 4 miles from a trailhead you'll be gravy.
>https://www.nps.gov/yose/planyourvisit/wildpermits.htmor you could try the shitshow that is camp 4 (first come, first served, i hope you like standing in line for 4 hours starting at 4 am)
stealth camping inside the park is difficult because lots of people try to do it and the rangers are very good at and very aggressive about catching people doing it.
yosemite is surrounded by miles of usfs land where dispersed camping is allowed, but leaving your car parked overnight on any of the highways coming in will probably get you ticketed, and most of the convenient secondary roads are lined with private property. you'd have to go an hour or so out of the park and of your way to get someplace you'll be sure no one will hassle you.