该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
下面的代码在5.0一下版本能够直接发送,但5.0以上就会跳转到系统的短信发送界面,应该怎么修改呢?(我有看到过一个叫“招商致远手机证券”的app在5.0以上版本也能直接发短信,但反编译未能成功,smali文件是出来了,但再转成java文件就会出错,smali文件代码我又看不懂……)
if (TelephonyManager.SIM_STATE_READY == Tools.getSimStatus(WoDeDianZiBaoKaActivity.this)) {
SmsManager smsManager = SmsManager.getDefault();
Intent sendIntent = new Intent(Constants.SEND_ACTION);
PendingIntent sendPendingIntent = PendingIntent.getBroadcast(WoDeDianZiBaoKaActivity.this,0, sendIntent, 0);
Intent deliverIntent = new Intent(Constants.DELIVER_ACTION);
PendingIntent deliverPendingIntent = PendingIntent.getBroadcast(WoDeDianZiBaoKaActivity.this,0, deliverIntent, 0);
String msg = Tools.getSmsContent(WoDeDianZiBaoKaActivity.this,Constants.ZHU_DONG_SMS_FLAG,null);
// 拆分短信内容(手机短信长度限制)
List divideContents = smsManager.divideMessage(msg);
for (String text : divideContents) {
smsManager.sendTextMessage(
JniConstants.getJniCAT_POOL_NUMBER(),null, text,sendPendingIntent,
deliverPendingIntent);
}
// 添加短信发送过渡效果
LoadDialog = new Loading_Dialog(
WoDeDianZiBaoKaActivity.this);
LoadDialog.Loading_SetMsgSendingText();
LoadDialog.Loading_ZhuanDong();
dialogUtil.dismiss();
} else {
ToastMsg("SIM卡未就绪");
}