Security deposit for rental property

I am tenant staying in rental apartment in Mumbai. I have been staying in this apartment for 3+ years and have registered rental agreement. I am now vacating the flat and moving to another place. I have below questions wrt same. 1. I am required to provide 30 days notice to landlord as per agreement which I did but through WhatsApp and call. Unfortunately my email did not go through. Is WhatsApp acceptable as proof for written notice sent. 2. I suspect that landlord will ask for painting charges which I am not ready to bear as most of paint damage has been caused by water leakage and cracks in the wall. How should I challenge the same? 3. Can I hold the keys of the apartment till landlord settles my security deposit or do I need to handover the keys on last day and the wait for him to return deposit amount? 4. Within how many days after keys are handed over does landlord needs to return the deposit amount. 5. In case of dispute regarding deposit, what is preferred approach. Should I go to police or send a legal notice.