Prime Minister Narendra Modi has had an odd history with Beijing.

As chief minister of Gujarat, he was said to be a close friend of China's, visiting the country a couple of times and securing Chinese investment. Later, when he became prime minister, one of Modi's earliest interactions with a leader outside the neighbourhood saw him strolling along the banks of the Sabarmati with Chinese President Xi Jinping. Yet, over the course of 2016 this relationship has begun to crumble.

First India turned its bid for membership to the Nuclear Suppliers Group into a core item on is foreign policy agenda, only to be stonewalled by Beijing in June. China also was the only country in the 15-member United Nations Security Council to object twice to India's efforts at declaring terror group Jaish-e-Mohammad chief Masood Azhar a UN-designated terrorist. This weekend, at the BRICS summit, it became even clearer that Beijing will continue to shield Pakistan from New Delhi's attempts to label it a global sponsor of terrorism.

"We oppose terrorism of all forms," said China's Foreign Ministry spokesperson Hua Chunying, after Modi referred to Pakistan as the "mothership" of terrorists at the Brics summit. "[But] we are also against linking terrorism to any specific country, ethnic group or religion. Both India and Pakistan are victims of terrorism. The international community should respect the enormous efforts and sacrifices made by Pakistan in fighting terrorism."

Goan grumbles

The Brics summit – which brings together the leaders of Brazil, Russia, India, China and South Africa – was supposed to be another platform where New Delhi could build on its effort to globally isolate Pakistan after the Uri attack last month saw 19 Indian soldiers killed by cross-border militants. The summit-concluding statement, labeled the Goa Declaration, was supposed to include a strong message that could only be read as a rebuke to Pakistan.

Instead, the declaration sticks to broad platitudes about terrorism but doesn't mention the "cross-border" kind.

"We strongly condemn the recent several attacks, against some BRICS countries, including that in India. We strongly condemn terrorism in all its forms and manifestations and stressed that there can be no justification whatsoever for any acts of terrorism, whether based upon ideological, religious, political, racial, ethnic or any other reasons."

Somewhat pointedly, and despite India's efforts, the declaration includes references to Islamic State and a Syrian terror outfit, but not Jaish-e-Mohammad. “I guess it doesn’t concern all the BRICS countries,” said Amar Sinha, India's chief negotiator at the summit. "Perhaps, that’s why we couldn’t get a consensus on naming these groups."

To make things worse, Chinese Premier Xi Jinping used his time at the Brics summit to suggest that terror could be addressed through a political solution (read: Kashmir) and China's foreign ministry later reiterated its stand that both India and Pakistan are victims of terrorism. These positions diverge sharply from New Delhi's effort to single out the Pakistani establishment as a sponsor of terrorism, one that uses the Kashmir conflict as a fig leaf.

Surgical strikes

When the Indian Army said it had carried out "surgical strikes" along the Line of Control last month, delivering "significant casualties" to militants in the process, it gave the Modi administration a shot in the arm. Uri had left many feeling helpless, since it was yet another attack by cross-border militants that couldn't be responded to with military retaliation for fear of escalating conflict.

The announcement of the strikes changed all of that, giving both the government and its supporter base the feeling that India had managed to break out of a vicious cycle, even as Pakistan denied any major incident. What this means for the long-term equation at the LoC remains to be seen, but the strikes certainly addressed a feeling of despondency in the polity as well as the Bharatiya Janata Party's seemingly trigger-happy base. More than anything, ahead of important assembly elections next year, the strikes represented a major domestic victory.

Indians don't hate China nearly as much as they do Pakistan. A Pew Research survey in 2014 found that only 15% of Indians had a positive view of Pakistan, while as many as 30% viewed China favourably.

That's probably a good thing for the Indian government, because while the surgical strikes may have shored up its anti-Pakistan credentials, taking on Beijing would be much harder.

For one, India needs Chinese cash, which is why Modi has been wooing Beijing even as his nationalist base spreads messages about boycotting goods from China. Second, India is already heavily dependent on Chinese products, and attempting to pivot away from them would cause much pain to Indian industry.

Thirdly and most importantly, China and India are simply not comparable. Although they're often spoken of in the same breath as being Asia's two populous fast-growing economies, China's Gross Domestic Product is almost five times India's figure. China's sphere of influence and trade ties reach all over the globe – including India's own backyard. And the Chinese military is far larger and much more advanced than India's, despite (or actually prompting) New Delhi's status as the world's biggest arms importer.

Bhai bhai

China may not be allowing militants to use its territory, but its own Army frequently provokes India by crossing the disputed border and maintains that much of Arunachal Pradesh is "south Tibet." Despite India claiming Pakistan-occupied Kashmir as its own territory, China is building a massive economic corridor through it.

As Carnegie India Director C Raja Mohan puts it, "India must move away from from the idea of parity with China to finding ways to cope with the consequences of the growing gap in material capabilities." The government seems to recognise this. Despite what could be counted as blatant pushback from China, both at the NSG and over Masood Azhar, New Delhi has refrained from blaming Beijing or using the kind of rhetoric that appeals to nationalistic sentiments.

Yet it is not easy to ride the patriotic tiger.

The government, hoping to not unnecessarily antagonise Beijing, has stayed away from #BoycottChina but the feeling is evidently popular. And the more signs emerge of China protecting an unrepentant Pakistan, the harder New Delhi, or at least the BJP, will find it not to respond – especially ahead of Uttar Pradesh elections. Caste, religion and plenty else will take centre stage there of course, but if surgical strikes are to be the selling point, then following those up with capitulation at the hands of Islamabad's Beijing bodyguard will not assuage a charged crowd.

In a year's time, China will be the hosting the BRICS summit. How New Delhi's relationship with Beijing progresses between now and then will give us a much more definitive sense of whether Modi's bold decision to carry out, and then vocally announce the surgical strikes was part of a new pro-active neighbourhood strategy that goes beyond just pre-election chest thumping.