Adviser wants to be joint first author, even though I did most of the research
You write:


  The only "effort" my adviser does is writing the actual paper


Well, in many fields, that would make them sole author. It certainly gives them a very strong claim to be first author, in fields where authorship is determined by contribution to the paper.

If you want to be first author, then write the paper yourself.

And if you can't, then don't expect first authorship, and be grateful for co-authorship (rather than an acknowledgement).

You've now added that you have done a bit of the writing, but your adviser has done most of it. So yes, they would, in many fields, still get first authorship, and you would get a co-authorship on that basis, assuming what you've written is a non-trivial proportion of the whole.