samedi 3 octobre 2015

Android Terminal: How to copy file content to clipboard\other window

Am in a need to develop script or service. As I don't have android programming knowledge, I have opted to write script for my requirement.

My Requirement: To read specific OTP from SMS\Text Message and copy to ClipBoard(seems android terminal doesn't have one). Which I need to use in any browser where my credential will be passed along with OTP.

What I have done so far: learnt few keywords to use sqlite to read OTP message and trim it to get only required characters from it. I am saving the OTP in csv file.

here it goes: with root privilages changed directory to

root@myDevice:/ cd data/data/com.android.providers.telephony/databases

where mmssms.db is present.

started sqlite3

127|root@myDevice:/data/data/com.android.providers.telephony/databases # sqlite3
SQLite version 3.8.6 2014-08-15 11:46:33

sqlite> .open mmssms.db
sqlite> .mode csv
sqlite> .output otptext.csv
sqlite> select TRIM(body, 'Your temporary security code is.') from sms where read=0;

with this my required code is created in csv file at the /data/data/com.android.providers.telephony/databases.

Now I am unable to copy the content to clipboard which I need further process.

Please help me to get this done.. Or if I can use any other approach to accomplish this..?

Thanks in advance..

Aucun commentaire:

Enregistrer un commentaire