I'm thinking of ending a friendship over someone refusing to tell me his phone unlock code
Don't you think it is an invasion of privacy?
Shut up, I have to unlock his phone. He's lying!!
That does not give you the right to want his phone unlock code. If he does not want to give it to you, then leave it alone.
I have the right to know what the fuck he's up to.
You don't have the right unless your friend tells you himself. You cannot expect your friends to do things for you if they don't want to.