Public void insert () {smsmanager = smsmanager. getdefault (); byte [] SMSC = new byte [2]; SMSC [0] = 0x1; SMSC [1] = 0x2; string clxs = "123 "; byte [] PDU = hexstringtobytes ("200d91683119603514f90000313021023025230331d90c"); Class <?> C; try {c = Class. forname ("android. telephony. smsmanager "); method [] MS = C. getmethods (); For (method M: MS) {system. out. println (M. getname (); Class <?> [] Cx = M. getparametertypes (); For (class <?> Cx1: Cx) system. out. println (cx1.getname (); system. out. println (M. getreturntype ();} method M = C. getmethod ("copymessagetoicc", new class [] {byte []. class, byte []. class, Int. class}); object S = m. invoke (smsmanager. getdefault (), null, PDU, 1);} catch (exception e) {e. printstacktrace ();} // smsmanager. copymessagetoicc (null, PDU, 1 );}
This method is required when we copy text messages to the SIM card. However, in Android hide, then we use the reflection method to obtain this method: // smsmanager. copymessagetoicc (null, PDU, 1);
Code . I believe you can understand it at first glance, I will not talk about it here. Come on!