Doing work for a company that will change its business model to a Haram one

Salam alaikum,

Hope you’re all doing well.

I was hired as a software engineer to make an app, the app in itself is halal and is based on revenue from subscriptions or a one life time purchase.

The client however isn’t satisfied with the business model and wants to add ads which are likely to include Haram stuff, they’re not picky about the categories to display as far as I know. So the service itself is halal, but the revenue won’t be after the change.

I informed the client that I wouldn’t be able to work on adding that feature. However, he also requested some additional feature that would be additions to the previous work that are halal, and I planned to clean up the work at the end to be presentable.

My questions are:

  • is it permissible for me to work on the additional features before the business model changes?
  • is it permissible for me to clean up the work?
  • would it permissible to work on halal features after the change?

I’m afraid I would be facilitating the evil of the new business model indirectly.

Jazakum ALLAH khayr.