Here is some interesting information on a Gujarati-Ottoman alliance against Portugal according to "Southeast Asia as Seen from Mughal India : Tahir Muhammad's 'Immaculate Garden' (ca. 1600)" by Muzaffar Alam and Sanjay Subrahmanyam:
Recent research by Ottomanists has done much to consolidate and flesh out this picture. Important work by Giancarlo Casale thus allows us to put together a far more complete narrative of Ottoman dealings with Aceh than had hitherto been possible^12) Casale points to the crucial role of an Ottoman envoy, a certain Liitfi (formerly a sea-captain in the Sultan's muteferrika corps), who was sent out to Aceh in 1564 on a return embassy in response to an earlier Acehnese delegation that had arrived at the Sublime Porte in 1562. Liitfi appears to have returned to Istanbul in 1566 after a two-year stay in Sumatra, with plans for a massive Ottoman intervention in the affairs of the Indian Ocean, which eventually however came to naught. He also brought back a letter for the Ottoman Sultan, apparently from the Acehnese Sultan 'Ala-ud-Din Ri'ayat Syah al-Qahhar (r. 1539-71), but which - in Casale's reasoned view - appears to have been ghostwritten by Liitfi himself in impeccable Ottoman Turkish. This letter, or "report" as Casale more appositely terms it, unambiguously sets out matters in the following terms.
"We sincerely request that His Imperial Majesty should no longer consider me, your servant in this land, to be an independent ruler, but instead to accept him as a poor, humble, and downtrodden slave who lives thanks to the charity of your Imperial Majesty, Refuge of the World and Shadow of God [on Earth], in no way different from the governors of Egypt and Yemen or the beys of Jiddah and Aden (...) with God as my witness, this [city of] Aceh is one of Your Majesty's own villages, and I too am one of your servants. Your official Liitfi can personally attest to our circumstances and to our deeds, to the great endeavours we have undertaken for the sake of holy war, and to our firm and sincere longing to enter your Imperial Majesty's service, although to do so adequately would require so many words that its telling might test the limits of Your Majesty's patience ".(13)
The text set out a grandiose plan, wherein various other parts of the Indian Ocean would fall into a grand alliance around an axis that connected Aceh and the Ottomans, with Gujarat as the third point in the triangle. The rulers of diverse other lands (even those who were not Muslim), were portrayed as eagerly falling into line, and even embracing Islam in their desire to rid themselves of the Portuguese yoke. Thus, another passage of the text runs as follows.
"When the rulers of Ceylon and Calicut received news that His Majesty's servant Liitfi had arrived here [in Aceh], they sent ambassadors to us who proclaimed : 'We [too] are servants of His Imperial Majesty, Refuge of the World and Shadow of God [on Earth]' and then took an oath swearing that if His Imperial Majesty's propitious fleet were to journey to these lands, they themselves would come to the faith and profess the religion of Islam, and that likewise all of their infidel subjects would forsake the way of false belief for the straight path of the one true religion. God willing, with the illustrious assistance of His Imperial Majesty, all traces of the infidels in both the East and the West will be destroyed, and they will finally join the Islamic faith ".(14)
Such statements are of course to be taken with the proverbial pinch of salt and more. However, what is of particular significance for us, is the crucial role of Gujarat in all of these transactions. Thus, we learn that "in the year 972 H. [late 1564], His Majesty's servant Liitfi came here [to Aceh], and on his return journey he loaded sixteen kantars of pepper, silk, cinnamon, cloves, camphor, rosemary and other products from the 'Lands Below the Winds' onto a large and famous ship known as the Samadi and belonging to Chingiz Khan, one of the vezlrs of the land of Gujarat in Hindustan". O5) But equally, on the way to Aceh, former Ottoman subjects now resident in Gujarat had already come to the rescue of Liitfi, and assured his passage. Thus, another passage in the text runs :
" Karamanhoglu 'Abdur-Rahman, one of the vezirs in the land of Gujarat, is a capable and conscientious servant who is worthy of [being entrusted with] further duties [in Your Majesty's service]. While Liitfi was making his outward journey to this land from [Your Majesty's] exalted presence, he became greatly perplexed upon his arrival in Jiddah, because he was unable to find any ships there that would take him the rest of the way. [Thankfully], the above-mentioned 'Abdur-Rahman, out of respect for the illustrious orders [which Liitfi had received] from Your Imperial Majesty, sent Liitfi and all of his entourage all the way here in one of his own ships, and covered all of the expenses for the journey himself".
It is a matter of debate whether the Ottoman influence in fact was the determining factor behind the anti-Portuguese unrest in various parts of the Indian Ocean in the late 1560s and early 1570s. (16) Whether this is true or not, it is certainly true that the Ottoman empire, Gujarat and Aceh were bound in far closer ties in the 1560s than was the case by 1580. The conquest of Gujarat by the Mughals meant a sharp decline in the influence of figures such as 'Abdur-Rahman and Chingiz Khan mentioned above. Even if Aceh and the Ottomans continued to maintain relations into the seventeenth century, the "Sumatran adventure" of the Sublime Porte did not last more than a brief moment, and appears to have been more a dream of a few persons than an act of sustained policy.
Assuming the Mughals do not conquer Gujarat, we could see this Ottoman-Gujarati alliance turn into a war against Portugal, conquering many of the Portuguese factories in India as well as increasing influence in Indonesia. As the brief moment of Ottoman ascendancy over the Indian Ocean fades, these ports and influence may then fall into Gujarati control, which would be a pretty sizeable maritime empire, if a rather weak one.
More likely than not, the Mughals will come marching in and claim the various ports.