Android 12.0 block SMS function (SMS sending switch)

1 Overview

In 12.0 customized development, in some wifi products, it is necessary to remove the SMS sending function, which needs to be analyzed from the process of sending SMS, from the process to understand how to send SMS, and then from the sending part of the SMS, according to System properties to decide whether to continue the process of sending SMS

2. Code to block SMS function (SMS sending switch)

frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
frameworks/base/telephony/java/android/telephony/SmsMessage.java
frameworks/opt/telephony/src/java/com/android/internal/telephony/IccSmsInterfaceManager.java

3. Functional analysis of the function of shielding SMS (SMS sending switch)

In the 12.0 system, in the source code, SmsManager.java is the management class responsible for sending SMS, call
smsManager.sendTextMessage(); to realize the function of sending SMS

3.1 Relevant code analysis of SmsManager sending SMS

SmsManager is responsible for sending text messages, and instantiating objects can send text messages. Continue to read the sendTextMessage() call

@UnsupportedAppUsage
      public void sendTextMessage(
              String destinationAddress, String scAddress, String text,
              PendingIntent sentIntent, PendingIntent deliveryIntent,
              int priority, boolean expectMore, int valid

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/131135286