Method and system for distinguishing authorization takeover by short message application

文档序号:1966230 发布日期:2021-12-14 浏览:12次 中文

阅读说明:本技术 一种短信应用区别授权接管的方法及系统 (Method and system for distinguishing authorization takeover by short message application ) 是由 马钰璐 蒋欧阳 邓勇 于 2021-09-08 设计创作,主要内容包括:本发明涉及一种短信应用区别授权接管的方法及系统,涉及手机终端技术领域。本发明判断当前短信应用的包名是否与第三方短信应用的包名匹配,得到第一判断结果;当第一判断结果为当前短信应用的包名与第三方短信应用的包名不匹配时,启动系统短信应用;当第一判断结果为所述当前短信应用的包名与第三方短信应用的包名匹配时,提取所述当前短信的报文头,并根据报文头确定所述当前短信的类别;当所述当前短信的类别为所述普通短信时,启动所述第三方短信应用;当所述当前短信的类别为所述特殊短信时,启动所述系统短信应用。本发明既能让第三方短信应用正常使用,满足智能终端生态的发展要求,又能使特殊类型的短信能正常的被终端接收和展示。(The invention relates to a method and a system for distinguishing authorized takeover by short message application, and relates to the technical field of mobile phone terminals. The method comprises the steps of judging whether the packet name of the current short message application is matched with the packet name of the third-party short message application or not to obtain a first judgment result; when the first judgment result is that the packet name of the current short message application is not matched with the packet name of the third-party short message application, starting the system short message application; when the first judgment result is that the packet name of the current short message application is matched with the packet name of the third-party short message application, extracting the message header of the current short message, and determining the category of the current short message according to the message header; when the type of the current short message is the common short message, starting the third-party short message application; and when the type of the current short message is the special short message, starting the system short message application. The invention can not only enable the short message application of a third party to be normally used, meet the ecological development requirement of the intelligent terminal, but also enable the short messages of special types to be normally received and displayed by the terminal.)

1. A method for distinguishing authorization takeover by a short message application is characterized by comprising the following steps:

acquiring a packet name of a current short message application; the current short message application is a short message application currently holding ROLE _ SMS;

judging whether the packet name of the current short message application is matched with the packet name of the third-party short message application or not to obtain a first judgment result;

when the first judgment result is that the packet name of the current short message application is not matched with the packet name of the third-party short message application, starting a system short message application;

when the first judgment result is that the packet name of the current short message application is matched with the packet name of the third-party short message application, extracting the message header of the current short message, and determining the category of the current short message according to the message header; the types of the current short messages comprise common short messages and special short messages;

when the type of the current short message is the common short message, starting the third-party short message application;

and when the type of the current short message is the special short message, starting the system short message application.

2. The method of claim 1, wherein the obtaining of the packet name of the current sms application specifically comprises:

and calling an API (application program interface) of the android phone frame module to acquire the packet name of the current short message application.

3. The method of claim 1, wherein the special short messages include Class0 Class short messages, PDU short messages, cell alarm short messages, and RCS message short messages.

4. The method of claim 1, wherein the method for differentiated authorization and takeover of the short message application further comprises:

popping up a short message application list when the third-party short message application is started for the first time and requests to take over the short message, so that a user can select the short message taken over by the third-party short message application; the short message application list is an application list of short messages holding ROLE _ SMS.

5. The method of claim 1, wherein when the first determination result indicates that the packet name of the current short message application is not matched with the packet name of a third-party short message application, starting a system short message application specifically comprises:

and when the first judgment result shows that the packet name of the current short message application is not matched with the packet name of the third-party short message application, establishing Intent pointing to the system short message application to start the system short message application.

6. The method of claim 1, wherein the starting the third-party short message application when the type of the current short message is the common short message specifically comprises:

and when the current short message is the common short message, establishing Intent pointing to a third-party short message application so as to start the third-party short message application.

7. A system for distinguishing authorization takeover by a short message application is characterized in that the system for distinguishing authorization takeover by the short message application comprises:

the packet name acquisition module is used for acquiring the packet name of the current short message application; the current short message application is a short message application currently holding ROLE _ SMS;

the first judgment module is used for judging whether the packet name of the current short message application is matched with the packet name of the third-party short message application or not to obtain a first judgment result;

the system short message first take-over module is used for starting the system short message application when the first judgment result is that the packet name of the current short message application is not matched with the packet name of the third-party short message application;

the current short message type judging module is used for extracting the message header of the current short message and determining the type of the current short message according to the message header when the first judging result is that the packet name of the current short message application is matched with the packet name of the third-party short message application; the types of the current short messages comprise common short messages and special short messages;

the third-party short message taking-over module is used for starting the third-party short message application when the type of the current short message is the common short message;

and the system short message second takeover module is used for starting the system short message application when the type of the current short message is the special short message.

8. The system for differentiated authorization and takeover of short message application according to claim 7, wherein the package name acquisition module specifically comprises:

and calling an API (application program interface) of the android phone frame module to acquire the packet name of the current short message application.

9. The system of claim 7, wherein the special short messages include Class0 Class short messages, PDU short messages, cell alarm short messages, and RCS message short messages.

10. The system of claim 7, wherein the system for differentiated authorization and takeover of the short message application further comprises:

the preset module is used for popping up a short message application list when the third-party short message application is started for the first time and requests to take over the short message, so that a user can select the short message taken over by the third-party short message application; the short message application list is an application list of short messages holding ROLE _ SMS.

Technical Field

The invention relates to the technical field of smart phone terminals, in particular to a method and a system for taking over a short message application with differentiated authorization.

Background

Taking over of system applications on android-compatible mobile phones is a very commonly applied technology, for example, a short message-like application developed by a third-party developer replaces an android-equipped system short message app. In practical application, the current technical implementation mode has a serious problem that the system short message APP must implement a complete SMS short message protocol stack (related to the terminal network access requirement), including a common short message, a Class0 short message, a PDU short message, and the like.

The third party APP only implements a general short message function, and implements a distinctive function on the basis. Many third party developers do not have a full implementation protocol stack because of the high development and testing thresholds that are required. Therefore, after the third party application takes over the system short message APP, when the mobile phone receives the Class0 short message, the third party application usually does not process the short message or processes the short message in an error manner, and the Class0 short message is usually sent to the operator by a government agency for emergency notification, safety reminding and other purposes, and cannot be processed by neglect.

Therefore, there is a need for a method and system for differentiated authorization and takeover of short message applications, which not only enables the short message applications of third parties to be normally used, but also enables special types of short messages to be normally received.

Disclosure of Invention

The invention aims to provide a method and a system for distinguishing authorization takeover of short message application, which can ensure that the short message application of a third party can be normally used, meet the ecological development requirement of an intelligent terminal and ensure that special types of short messages can be normally received and displayed by the terminal.

In order to achieve the purpose, the invention provides the following scheme:

a method for distinguishing authorization takeover by short message application comprises the following steps:

acquiring a packet name of a current short message application; the current short message application is a short message application currently holding ROLE _ SMS;

judging whether the packet name of the current short message application is matched with the packet name of the third-party short message application or not to obtain a first judgment result;

when the first judgment result is that the packet name of the current short message application is not matched with the packet name of the third-party short message application, starting a system short message application;

when the first judgment result is that the packet name of the current short message application is matched with the packet name of the third-party short message application, extracting the message header of the current short message, and determining the category of the current short message according to the message header; the types of the current short messages comprise common short messages and special short messages;

when the type of the current short message is the common short message, starting the third-party short message application;

and when the type of the current short message is the special short message, starting the system short message application.

Optionally, the obtaining of the packet name of the current short message application specifically includes:

and calling an API (application program interface) of the android phone frame module to acquire the packet name of the current short message application.

Optionally, the special short messages include Class0 level short messages, PDU short messages, cell alarm short messages, and RCS message short messages.

Optionally, the method for differentiated authorization takeover by the short message application further includes:

popping up a short message application list when the third-party short message application is started for the first time and requests to take over the short message, so that a user can select the short message taken over by the third-party short message application; the short message application list is an application list of short messages holding ROLE _ SMS.

Optionally, when the first determination result indicates that the packet name of the current short message application is not matched with the packet name of the third-party short message application, starting the system short message application specifically includes:

and when the first judgment result shows that the packet name of the current short message application is not matched with the packet name of the third-party short message application, establishing Intent pointing to the system short message application to start the system short message application.

Optionally, when the type of the current short message is the common short message, starting the third-party short message application specifically includes:

and when the current short message is the common short message, establishing Intent pointing to a third-party short message application so as to start the third-party short message application.

In order to achieve the purpose, the invention also provides the following technical scheme:

a system for discriminating authorized takeover by short message application comprises:

the packet name acquisition module is used for acquiring the packet name of the current short message application; the current short message application is a short message application currently holding ROLE _ SMS;

the first judgment module is used for judging whether the packet name of the current short message application is matched with the packet name of the third-party short message application or not to obtain a first judgment result;

the system short message first take-over module is used for starting the system short message application when the first judgment result is that the packet name of the current short message application is not matched with the packet name of the third-party short message application;

the current short message type judging module is used for extracting the message header of the current short message and determining the type of the current short message according to the message header when the first judging result is that the packet name of the current short message application is matched with the packet name of the third-party short message application; the types of the current short messages comprise common short messages and special short messages;

the third-party short message taking-over module is used for starting the third-party short message application when the type of the current short message is the common short message;

and the system short message second takeover module is used for starting the system short message application when the type of the current short message is the special short message.

Optionally, the package name obtaining module specifically includes:

and calling an API (application program interface) of the android phone frame module to acquire the packet name of the current short message application.

Optionally, the special short messages include Class0 level short messages, PDU short messages, cell alarm short messages, and RCS message short messages.

Optionally, the system for differentiated authorization and takeover by the short message application further includes:

the preset module is used for popping up a short message application list when the third-party short message application is started for the first time and requests to take over the short message, so that a user can select the short message taken over by the third-party short message application; the short message application list is an application list of short messages holding ROLE _ SMS.

According to the specific embodiment provided by the invention, the invention discloses the following technical effects:

firstly, acquiring a packet name of a short message application currently holding ROLE _ SMS, and judging whether the packet name of the short message application currently holding ROLE _ SMS is matched with a packet name of a third-party short message application; if the packet name of the short message application currently holding ROLE _ SMS is not matched with the packet name of the third-party short message application, starting the system short message application to take over the short message; if the packet name of the short message application currently holding ROLE _ SMS is matched with the packet name of the third-party short message application, extracting the message header of the current short message, and determining the category of the current short message according to the message header; if the type of the current short message is a common short message, a third-party short message application is started to take over the short message, and if the type of the current short message is a special short message, a system short message application is started to take over the short message. The invention can not only realize the normal use of the third-party short message application, but also ensure that the short messages of special types can be normally received and displayed by the system short message application of the terminal.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.

FIG. 1 is a schematic flow chart of a method for distinguishing authorized takeover by short message application according to the present invention;

fig. 2 is a schematic structural diagram of a system for discriminating an authorization takeover by short message application according to the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The invention aims to provide a method and a system for distinguishing authorization takeover of short message application, which can ensure that the short message application of a third party can be normally used, meet the ecological development requirement of an intelligent terminal and ensure that special types of short messages can be normally received and displayed by the terminal.

In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.

Example one

As shown in fig. 1, the present embodiment provides a method for differentiated authorization takeover of short message application, including:

step 100, acquiring a packet name of a current short message application; the current short message application is a short message application currently holding ROLE _ SMS. Specifically, an android phone framework module API is called to obtain a packet name of the current short message application.

Step 101, judging whether the packet name of the current short message application is matched with the packet name of the third-party short message application, and obtaining a first judgment result.

In the android-compatible mobile phone operating system, each application has an independent package name, for example, the package name of a native short message application of the system is com. The ROLE _ SMS variable of the android frame is stored in which short message application currently, and then the short message application is responsible for responding and processing the short message event.

And judging whether the packet name of the current short message application is matched with the packet name of the third-party short message application, namely judging whether the short message application currently holding the ROLE _ SMS is the third-party short message application.

And step 102, starting the system short message application when the first judgment result shows that the packet name of the current short message application is not matched with the packet name of the third-party short message application. Specifically, when the first determination result is that the packet name of the current short message application is not matched with the packet name of the third-party short message application, that is, when the character string of the packet name of the current short message application is not consistent with the character string of the packet name of the third-party short message application, it is indicated that the system short message application is not taken over by the third-party short message application, the system communication application continues to be responsible for processing the received short message, at this time, an Intent pointing to the system short message application is created, and short message data is filled to start the system short message application.

103, when the first judgment result is that the packet name of the current short message application is matched with the packet name of the third-party short message application, extracting the message header of the current short message, and determining the category of the current short message according to the message header; the types of the current short messages comprise common short messages and special short messages. The special short messages comprise Class0 level short messages, PDU short messages, cell alarm short messages and RCS message short messages. Specifically, when the first judgment result is that the packet name of the current short message application is matched with the packet name of the third-party short message application, that is, the character string of the packet name of the current short message application is consistent with the character string of the packet name of the third-party short message application, it is indicated that the system short message application has been taken over by the third-party short message application.

And 104, starting the third-party short message application when the type of the current short message is the common short message. Specifically, when the current short message is the common short message, an Intent pointing to a third-party short message application is created, and short message data is filled in to start the third-party short message application to process the short message data.

And 105, starting the system short message application when the type of the current short message is the special short message. Specifically, when the current short message is the special short message, an Intent pointing to a third-party short message application is created, and short message data is filled in, so that the system short message application is started to process the short message data, and the data of the special short message is prevented from being lost or ignored.

In a specific embodiment of the present invention, the method for differentiated authorization and takeover by a short message application further includes:

popping up a short message application list when the third-party short message application is started for the first time and requests to take over the short message, so that a user can select the short message taken over by the third-party short message application; the short message application list is an application list of short messages holding ROLE _ SMS.

Example two

As shown in fig. 2, the present embodiment provides a system for differentiating authorization takeover by a short message application, where the system for differentiating authorization takeover by a short message application is disposed in a short message function portion of an android mobile phone framework layer. When the system for the short message application to distinguish the authorized takeover processes the short message received from the outside, the system starts the related short message application according to a plurality of conditions and transmits the content of the short message.

The first condition is that the application of ROLE _ SMS is held currently, namely the application of taking over the system short message is taken over currently, if the system short message application takes over the short message application holding ROLE _ SMS at the moment, the system short message application continues to process the short message application; if the third-party short message application takes over the short message application of ROLE _ SMS, adopting a second condition to continue judging. The second condition is the type of the current short message, if the short message is a common short message, the third-party short message application continues to process the short message, and if the short message is a special short message such as a Class0 short message, a PDU short message and the like, the short message is delivered to the system short message application to process the short message.

The system for taking over the short message application by distinguishing authorization comprises the following steps:

a packet name obtaining module 200, configured to obtain a packet name of a current short message application; the current short message application is a short message application currently holding ROLE _ SMS. The package name acquisition module specifically comprises: and calling an API (application program interface) of the android phone frame module to acquire the packet name of the current short message application.

The first determining module 201 is configured to determine whether the packet name of the current short message application matches the packet name of the third-party short message application, so as to obtain a first determining result.

A system short message first takeover module 202, configured to start the system short message application when the first determination result indicates that the packet name of the current short message application is not matched with the packet name of the third-party short message application. Specifically, when the first judgment result indicates that the packet name of the current short message application is not matched with the packet name of the third-party short message application, the system short message application is not taken over by the third-party short message application, the system communication application is responsible for processing the received short message, and at this time, the system short message first taking over module creates an Intent pointing to the system short message application and fills short message data to start the system short message application.

A current short message type judgment module 203, configured to extract a packet header of a current short message and determine a type of the current short message according to the packet header when the first judgment result is that the packet name of the current short message application matches the packet name of a third-party short message application; the types of the current short messages comprise common short messages and special short messages; the special short messages comprise Class0 level short messages, PDU short messages, cell alarm short messages and RCS message short messages.

A third party short message taking-over module 204, configured to start the third party short message application when the type of the current short message is the common short message. Specifically, when the current short message is the common short message, the third-party short message taking-over module creates an Intent pointing to a third-party short message application, and fills short message data to start the third-party short message application.

A system short message second taking over module 205, configured to start the system short message application when the category of the current short message is the special short message. Specifically, when the current short message is the common short message, the system short message second takeover module creates an Intent pointing to a third-party short message application, and fills short message data to start the third-party short message application.

In a specific embodiment of the present invention, the system for differentiated authorization and takeover by short message application further includes:

the preset module is used for popping up a short message application list when the third-party short message application is started for the first time and requests to take over the short message, so that a user can select the short message taken over by the third-party short message application; the short message application list is an application list of short messages holding ROLE _ SMS.

Compared with the prior art, the invention also has the following advantages:

the invention meets the requirements of ecological prosperity and development of the intelligent terminal, and ensures that special types of short messages such as Class0 short messages and PDU short messages can be normally received and displayed by the terminal.

The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.

The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于SPI进行系统短信发送的方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类