Perhaps it could happen lately after the Mudan Incident.
The Qing government of China did not give up its suzerainty over the Ryukyus, and lodged a protest against Japan. In 1880, under the mediation of the former US President Ulysses S. Grant, Japan proposed that the northern part of the Ryukyu Islands belonged to Japan, while Ryukyu Hoso Island and Yaeyama Islands belonged to China.
So what if Ulysses S. Grant was a little more historically aware and knew that Ryukyu was a semi-independent kingdom until 1879 (formal abolition of the Ryukyu Kingdom).
He could decide, after reading Commodore Perry's journals, that Ryukyus could be nice spots to open Asia/China to US trade. He later contact the US Envoy Extraordinary and Minister Plenipotentiary John Bingham who telegraphs Rutherford B. Hayes. Rutherford B. Hayes, in a huge political turmoil due to the Chinese Exclusion Act in 1879, chooses to follow the proposition of Ulysses S.Grant and nominally recognizes the sovereignty of the Ryukyu King, while putting the kingdom under formal US protection (protectorate).
The United States of America, considering the signature of the "Compact between the United States and the Kingdom of Lew chew", recognizes the everlasting independance and sovereignty of the Ryukyu King over the islands. The government of the United States of America won't accept any actions by third party to break this sovereignty and hereby will ensure the protection of the Ryukyu King and his subjects according to international law.
About the compact :
https://history.state.gov/countries/lew-chew
A few hours after the proclamation, US military ships entered Naha bay and United States Civil Administration of the Ryukyu Islands began to jointly administrate and modernize the Islands, a task which included the delivrance of identity certificates to ensure the protection of the Ryukyuan citizens abroad.
In 1897, following the choice of Joseon Dynasty to proclaim itself Great Korean Empire. The Ryūkyūan King decides to proclaim himself Ryūkyūan Emperor in order to ensure the equality of Ryukyu in diplomacy. A daring diplomatic move that was worldwide mocked as ridiculous.
The United States Military Government of the Ryukyu Islands was established in 1905 after the Russo-Japanese war in order to govern the newly built US military bases of the Ryūkyūan islands and to safeguard the maritime empire from the growning geopolitical appetite of Japan.
Ryuku Islands became the headquarters of the Far East Command during WWI, a status the islands got back after WWII as a payback for the courage of the local populations who suffered from famine, forced deportations and massacres under the collaborationnist authority of the Autonomous Ryūkyūan prefecture.
Following the treason and crimes committed by members of the Ryūkyūan Imperial Family under the Japanese occupation, a popular referendum proclaimed the creation of the Three Mountains Republic in May 1952. In May 1972. the Empire of Japan and the Ryūkyūan Republic finally signed a treaty of rememberance by which the Empire of Japan formally recognized the Independance of the Ryūkyūan Republic and admitted the crimes committed during WWII.
The Three Mountains Republic is currently one of the few countries without an offensive military and even if the United States continues to own military bases on the main Islands, those military bases are mainly used for logistics and are soon to be retroceded to the Ryūkyūan authorities. The official status of the Ryūkyūan Islands as a quadriilingual republic (Ryūkyūan, Chinese, Japanese, English) continues to ensure the wealth of the republic as a bridge between Japan, China and the rest of the world.
The acceptance of Korean refugees after Korean War increased this advantage, when Korean was officially recognized as a national language and taught in obligatory schools.