Adultery

Hi, i was in a relationship with a woman from lat 1.5 years.During the course of relationship , I came to know that she is married.I tried cutting off my ties with her but she said she is already living separately and is going for a divorce coz her husband ask for dowry and beat her. In the meanwhile , the husband got to know about her going out with me and other guys . He contacted me and told me that he have proves like cALL details and witnesses who has seen his wife and me together.However, he realises that I ve been fooled and has promised me that he will not file a case of adultery against me but he wants a divorce.The girl has refused to give a divorce now as she have chats of her husband with some other woman. The guy is ready for a mutual consent divorce but the girl is not. The husband is asking me to sign an affidavit stating that she was involved with me and has fooled me.He will use that affidavit with other proofs, to tke the divorce and will not file a case against me. I am lost as wot to do? As what I ve read , they cant prove adultery till they caught me in act and the girl has said that she dont care if dey file a case against me as she wont be harmed. I am only 25 and the woman is 34 and her husband 29 .I dont want a court case .Please help me how to get out of this.