I don't even think James II has to be as quiet as Charles II when it comes to his Catholicism to keep his throne. He needs to be a different person and he really needs to stop obviously telegraphing his plans to all and sundry.
Step 1 After Parliament (called the Loyal Parliament because it was so supportive) votes him some pretty significant revenues he dismisses it when he loses a by one vote on repealing the Test Acts. He looks ungrateful, anti-Parliamentary and pro-Catholic but it's not that bad.
Step 2 he issues the Declaration of Indulgence which we may approve of now because of freedom of religion but as he'd just lost a Parliamentary vote on the issue it's not exactly popular.
Step 3 Using his large resources James II maintains a larger standing army than his brother had. Not popular but not a massive deal, he had the money and wasn't imposing any new taxes so there wasn't much anyone could really say.
Step 4 James II ostentatiously appoints Catholic officers without independent wealth or strong ties to anyone important including Irishmen. This is unpopular. Not only does James II now have a big army it's an army officered by men loyal to him and him alone and includes Catholic Irishmen in positions of authority. Which goes down about as well as black guy at a Klu Klux Klan rally.
Step 5 James II refuses to dismiss said officers because he doesn't trust Parliament and anyway it's none of Parliaments business what he does with his army. That's about as popular as Malcolm X at a Klu Klux Klan rally.
I mean short of openly stating he wanted to use military force to enforce a Catholic Absolute Monarchy there wasn't much more he could do to piss everyone off and confirm all the worst fears and suspicions raised during the Exclusion Crisis, where Parliament tried to stop him ascending to the throne because of precisely this kind of thing. Pretty much his entire reign was rushing headlong towards the Glorious Revolution or the Second English Civil War.
Yep. And again, despite what people seem to imagine the big problem wasn't people saying 'James is taking orders from the Pope'--actually, the Pope in 1688, Innocent XI, was surprisingly popular in many Protestant circles. The big problem was people saying 'James is taking orders from King Louis', and in all honesty, he pretty much was.
People saw James as working to make an English Court of Versailles, and they saw correctly. There was no way that people were going to stand for that, as they'd taken down his father for much less--indeed, it's worth noting that James' support among the native English Catholics was surprisingly poor, same as it was for the Dissenters, and for the same reason. No one wanted to trade political freedoms for religious freedom, especially when the model for James' version of religious toleration was demonstrating how quickly it could turn. When all you had to do was look across the Channel at the Dragonnade to see how Absolutist backed toleration could go...
Well, it was a powerful incentive to stick with what they had, awful as it could be at times.