am broadcast -a android.provider.telephony.sms_deliver -n com.android.messaging/.receiver.smsdeliverreceiver //後面接具體引數
我這裡是先傳送廣播給smsdeliverreceiver 類,因為簡訊最先接收到廣播的就是這個類,然後才會傳送給 receiver.smsreceiver 類。引數有三個:sender、receiver、message,引數名可以自己定義,分別代表傳送人手機號,接收人手機號和簡訊內容。
xposed劫持
finalclass aclass = xposedhelpers.findclass(
"com.android.messaging.receiver.smsreceiver", lpparam.classloader);
xposedbridge.hookallmethods(aclass,"deliversmsintent",newxc_methodhook() catch(exception e)
string receiver =null;
trycatch(exception e)
string message =null;
trycatch(exception e)
pdu = smsutils.createpdusms(sender, receiver, message);//將引數轉換為pdu byte陣列
}catch(exception e)
intent intent =newintent();
intent.setaction(action);
bundle bundle =newbundle();
byte b =new byte[1][1];
b[0] = pdu;
bundle.putstring("format","3gpp");
bundle.putserializable("pdus", b);
bundle.putstring("slot","0");
bundle.putstring("phone","0");
bundle.putstring("subscription","2");
intent.putextras(bundle);
param.args[1] = intent;
}});
public static byte createpdusms(string sender,string receiver, string body) );
stringtogsm7bitpacked.setaccessible(true);
byte bodybytes = (byte) stringtogsm7bitpacked.invoke(null, body);
bo.write(0x00);// encoding: 0 for default 7bit
bo.write(datebytes);
bo.write(bodybytes);
}catch(exception e) catch(unsupportedencodingexception uex)
}pdu = bo.tobytearray();
}catch(ioexception e)
returnpdu;
}private static bytereversebyte(byteb)
private staticstring phonetpye(string phone)
returnphone.length()==11?"+86"+phone:phone;
}
private static byte encodeucs2(string message,byte header)
throwsunsupportedencodingexception
else
byte ret =new byte[userdata.length+1];
ret[0] = (byte) (userdata.length&0xff);
system.arraycopy(userdata,0, ret,1, userdata.length);
returnret;
}
Android簡訊收到,語音播報
傳送簡訊功能介面 傳送簡訊demo description author ldm date 2016 4 22 上午9 07 53 public class smsactivity extends activity implements onclicklistener 註冊簡訊監聽廣播 descri...
關於我沒有收到簡訊
在安慰自己的時候,我們應該充分發揮想象,說不定我們想的就是對的,哪怕不是對的,也能給自己乙個足以支撐到下一次機會來臨的信念。記得,那是乙個長沙陰雨綿綿,武漢陽光明媚的日子,湖大師大中南,共計11名朝氣蓬勃的年輕小子,踏上了 實習生招聘的征途.長途跋涉,共計1600 km,我們在乙個星期之內往返武漢到...
Android簡訊收到,語音播報
傳送簡訊功能介面 傳送簡訊demo description author ldm date 2016 4 22 上午9 07 53 public class smsactivity extends activity implements onclicklistener 註冊簡訊監聽廣播 descri...