Shaykh M. Afifi al-Akiti (hafidhAllah) elucidates the issue of kissing one’s thumbnails and touching the eyes with them from a Shafi’i perspective:
Ma sha’ Allah, Rabbi zidni ‘ilman!
In fiqh, the discussion of taqbil al-unbulatayn wa mash al-‘aynayn is usually found at the end of Bab Adhan. Certain gestures performed during the adhan, and specifically the ‘amal of kissing the thumbs and wiping the eye, are something known to Shafi’is, and there can be no objection whatsoever by our jurists (and any jurists for that matter) to those wishing to perform this ‘amal: as far as we are concerned, it is classified under the category of the Fada’il al-A’mal [I’anat, 1:243; al-Jurdani, Fath al-‘Allam, 2:140-1].
Among its legal bases [‘ilal] is that it is a Sunna of the first Khalifa of the Messenger of Allah (may Allah’s blessings and peace be upon him!) [i.e., an Athar of the first Khalifa], and it is also based on a number of Hadiths, of which the most well known is the Hadith of Abu Bakr (may Allah be well pleased with him!):
lammA sami’a qawla l-mu’adhdhini ashhadu anna MuHammadan rasUluLlAhi qAla hAdhA wa qabbila bATina l-unmulatayni l-sabbAbatayni wa masaHa ‘aynayhi fa-qAla SallaLlAhu ‘alayhi wa sallama man fa’ala mithla khalIlI faqad Hallat ‘alayhi shafA’atI [Whenever he [Abu Bakr] heard the Mu’addhin say: “I bear witness that Muhammad is the Messenger of Allah”, he would repeat this [phrase as it is the Mandub of Adhan] and would kiss the tip of the index fingers [or thumbs] and wipe his eyes. The Prophet (may Allah’s peace and blessings be upon him!) said: whosoever does what my friend [i.e., Abu Bakr] did, my intercession will come down upon him] (Related by al-Daylami, with variants).
To read the remainder of this excellent elucidation see the full answer on the Living Islam Website.