Detailed Description
The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It will be appreciated that such embodiments are provided to make the principles and spirit of the application clear and thorough, and enabling those skilled in the art to better understand and practice the principles and spirit of the application. The exemplary embodiments provided herein are merely some, but not all embodiments of the application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the embodiments herein, are within the scope of the present application.
Embodiments of the present application relate to a terminal device and/or a server. Those skilled in the art will appreciate that embodiments of the application may be implemented as a system, apparatus, device, method, computer readable storage medium, or computer program product. Accordingly, the present disclosure may be embodied in at least one of complete hardware, complete software, or a combination of hardware and software. According to an embodiment of the application, the application claims a security processing method, a device, an electronic device, a computer readable storage medium and a computer program product for application program app exception flashing. Fig. 1 shows a schematic diagram of a system architecture according to an embodiment of the application. As shown in fig. 1, the system includes a terminal device 102 and a server 104. The terminal device 102 may include at least one of a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart television, various wearable devices, an augmented reality AR device, a virtual reality VR device, and the like. The terminal device 102 may be provided with a terminal, for example, a terminal that specifically performs a specific function (such as an app), or a terminal embedded with a plurality of applets (different functions), or a terminal that logs in through a browser. The user may operate on the terminal device 102, for example, the user may open a terminal installed on the terminal device 102 and input an instruction through a terminal operation, or the user may open a browser installed on the terminal device 102 and input an instruction through a browser operation. After the terminal device 102 receives the instruction input by the user, request information including the instruction is transmitted to the server 104. The server 104 performs a corresponding process after receiving the request information, and then returns the process result information to the terminal device 102. User instructions are completed through a series of data processing and information interaction.
In this document, terms such as first, second, third, etc. are used solely to distinguish one entity (or action) from another entity (or action) without necessarily requiring or implying any order or relationship between such entities (or actions).
Fig. 2 is a flowchart of a secure processing method for application app exception flash back according to an embodiment of the present application. The method for safely processing the abnormal flashing back of the application program app, which is provided by the embodiment of the application, is applied to a terminal, a self-defined app safety processing module is preset in a terminal system program of the app, and the app safety processing module is used for enabling the app to enter a safety operation mode and safely processing the abnormal occurrence when various abnormalities occur in the app operation process, and the method for safely processing the abnormal flashing back of the app comprises the following steps:
S101, when an abnormality related to app flashing back occurs in the app running process, capturing related information of the abnormality by an app security processing module, and switching the app into a security running mode, in the security running mode, starting a dynamic container page by the app security processing module to replace an abnormal interface of the app, and sending a security policy request message to a server, wherein the security policy request message carries abnormal call stack information so as to enable the server to issue a security processing policy corresponding to the abnormality;
S102, after the security processing strategy issued by the server is received, executing the security processing strategy to enable the app to exclude the abnormality, loading security information corresponding to the security processing strategy in the dynamic container page, and returning to a normal operation interface of the app after the abnormality is excluded.
In the embodiment of the application, a self-defined app security processing module is preset in the application program app, and the self-defined app security processing module can enable the app to enter a security operation mode and process the occurrence of the abnormality safely when the app operates abnormally. In some embodiments of the present application, optionally, the app security processing module is a custom exception handler, which is different from the default exception handling of the system, and when an exception occurs in the app, the system will execute the custom exception handler, but not execute the default exception handler (the default exception handler of the system kills the application and causes flashing back). Regarding the setting process of the custom exception handler, taking an Android system as an example, when an application program app is started (in an application. OnCreate lifecycle method), a thread. SetDefaultUncautExceptionHandler method of java is called, an instance of the exception handler is introduced, and custom exception handling logic (message loop of reporting exception, starting a security mode page, restarting a main thread) is written in a uncaughtException method of the instance, so that the custom exception handler can be realized. Wherein restarting a message cycle of a main thread allows applications in secure mode to receive, distribute and process various messages.
In this way, when the application program app has an abnormal problem, the app security processing module can report abnormal call stack information to the server according to the set abnormal processing logic, and simultaneously start a page in a security mode, wherein the page in the security mode is essentially a container page (dynamic container page), and specific information displayed by the page can be issued by the server, so that the effect of flexibly displaying dynamic content can be achieved. Fig. 3 is a schematic diagram of an Android dynamic container page according to an embodiment of the present application. As shown in fig. 3, the page of the Android system uses Activity as a carrier and WebView as a dynamic page container. In other embodiments of the present application, RN or the like may alternatively be used instead of WebView as the dynamic page container.
Further, in the embodiment of the application, when an abnormality occurs in an application program, a self-defined app security processing module captures the abnormality and opens a dynamic container page in a security mode to replace an abnormal interface of the app, and at the same time, the app security processing module sends a security policy request message carrying abnormal call stack information to a server to request the server to issue a security processing policy corresponding to the abnormal call stack information. Fig. 4 is a schematic diagram of interaction between a terminal and a server according to an embodiment of the present application. As shown in fig. 4, the terminal sends a security policy request to the server, the server issues a corresponding security processing policy according to the abnormal call stack information, and issues different security information for different security processing policy servers, wherein the security information contained in the page issued by the server is displayed to the dynamic container, and the security processing policy is sent to the client for execution.
The following is an example json of a client requesting a server security policy. The json comprises three fields, the from-domain field indicates which client the exception information originates from, the app-version field indicates the application version of the client, the stack-info field indicates the detailed information of the exception call stack, and the server returns a specific security policy according to the three fields.
{
“from-domain”:“XXX-Android”,
"App-version"
Detailed information of stack-info exception call stack
}
In some embodiments of the present application, if the abnormal call stack information has occurred before and the server side stores the corresponding patch file, the security processing policy at this time may be that the patch file is downloaded according to the download address returned to the client patch file by the server side, the dynamic container page displays the download progress of the patch file, and the application is restarted, and the patch program is installed through the thermal repair framework to solve the program bug. In this way, the terminal eliminates the abnormal problem of the app according to the security processing policy issued by the server, and loads corresponding security information (for example, the downloading progress of the patch file) in the dynamic container page. After the exception is removed, the normal running interface of the app may be returned.
By adopting the embodiment of the application, the usability of the application program can be ensured to the greatest extent by switching the application program to the safe operation mode when the application program is abnormal, thereby improving the retention of a user and improving the experience of the user. In addition, in the embodiment of the application, the server can issue the security processing strategy according to the abnormal call stack information, so that the method has great flexibility and pertinence, and the efficiency of exception processing can be obviously improved.
In some embodiments of the present application, optionally, the secure processing method of the present application further comprises the app secure processing module intercepting the app killing behavior of the exception handler when the default exception handler of the system initiates the app killing behavior due to an exception associated with app flashing back during app running.
When an application program is abnormal, the self-defined app security processing module can capture the abnormality, intercept the default behavior of the system for killing the application process, prevent the application from flashing back, replace an app abnormal interface by a dynamic container page, and issue a page displayed in the dynamic container page by a server according to a security policy, so that the method has higher flexibility. In addition, because the application does not flash back when abnormal occurs, compared with the traditional case that the flash back or the page is not opened (in the background patch manufacturing process), the user experience can be improved.
In some embodiments of the application, optionally, the secure processing policy includes at least one of:
1) The first security processing strategy is to download the patch file according to the address of the patch file issued by the server and install the patch file to the terminal;
2) A second security processing strategy, namely clearing a cache and restarting or running a switch configuration file issued by a server, wherein the switch configuration file is used for closing an abnormal function of the terminal running;
3) And a third security processing strategy, namely utilizing the dynamic container page to display the substitute content issued by the server and informing the background system of the server of the app to process the exception, wherein the substitute content is the same as part of the content displayed by the page when the app normally operates.
The first security processing policy may also be referred to as a thermal repair policy, for which, the terminal may download the patch according to the download address of the patch file issued by the server, and may display the download speed of the patch file through the dynamic container page, and after the download is completed, may restart the application, and solve the program bug by installing the patch degree through the thermal repair framework. The security processing strategy has a higher speed of processing the abnormality of the application program, and can remind the user that the problem is solved by displaying the downloading speed of the patch file, so that the experience of the user when facing the abnormality of the program can be improved.
For the first security policy, the following is a json instance where the server returns the first security processing policy. The app-version field represents an application version number of the client, the safe-mode field represents a security policy to be executed by the client, the safe-page-url field represents an h5 page address to be displayed by the dynamic container page, and a page for displaying the progress of downloading the thermal repair patch can be configured under the thermal repair policy. The mode-info contains an information field related to the security policy, which is the download address of the patch package under the hot repair policy.
{
"app-version":"13.5.0"
"safe-mode":"hotfix".
"Safe-page-ur" ≡: "h 5 page address to be presented by dynamic container page".
"mode-info":{
"Patch-url" download Address of patch package "
}
}
Fig. 5 is a schematic diagram of a thermal repair frame using tinker according to an embodiment of the present application. As shown in fig. 5, the Android end may use tinker a thermal repair framework to make a patch program for repairing an abnormality on a line, and after the end downloads the patch package, the application may be restarted, and after the application is restarted, the patch package may be installed using tinker framework to take effect.
The second type of security processing policy, which may also be referred to as a pre-configured instruction policy, is typically used in cases where an exception problem of an application may be resolved by a particular instruction. The pre-configuration instruction here may be to clear the cache, restart, modify the switch configuration file of the mobile terminal, etc. The problem of flashing back caused by the cache can be usually solved by clearing the cache, some exceptions which do not affect the main business logic can be ignored or secondary exceptions can not occur, the safe mode page can be immediately exited, the user can continue to use the application or restart the application, and some flashing back can be solved by modifying the function switch configuration file of the client. For example, a function that is abnormal in operation for some applications may be disabled by modifying its switch profile. The type of strategy can be matched with some prompt document information to be displayed on a dynamic container page, so that user experience is improved. For example, "is an abnormality in an application resolved by restarting an application.
The following is an example of a json where the server returns to the second security processing policy. The return field is substantially the same as the first secure processing policy, except that the value of the safe-mode field and the instruction field in the mode-info are an array representing a set of instructions that are executed sequentially, in this example, the client needs to perform both the clean-up cache and the restart sequentially.
{
"app-version":"13.5.0"
"safe-mode":"predefine-instruction"
"Safe-page-url": "h 5 Page Address to be displayed by dynamic Container Page"
"mode-info":{
"instruction":[
"clear-cache"
"restart"
]
}
}
The third security processing strategy is mainly used for the situation that some abnormal information never occurs or cannot be repaired in a short time, at this time, the server side can issue dynamic content to the dynamic container page of the terminal for display, and at the same time, the dynamic container page can display some alternative content, such as some interactive function information or some activity information related to the main business of the application program, and even advertisement information. Meanwhile, new abnormal information appearing at this time should trigger an alarm, inform engineers to analyze the abnormal information, select an abnormal processing strategy and update the configuration information of the server.
The following is an example of a json where the server returns a third security processing policy. The third security processing strategy is used as a spam scheme, and only dynamic pages need to be displayed. The dynamic content can be configured with pages related to application services, such as a filling page of a resume, a browsing page of a job list, or even an active page of three or four of gold, three or four of silver, which can be configured by a forward careless 51job application, so that the dynamic content has high flexibility, and a certain basic function can be used by a user under the condition that a native App is abnormal, and better use experience is provided.
{
"app-version":"13.5.0"
"'safe-mode":"business"
"Safe-page-url": "h 5 Page Address to be displayed by dynamic Container Page"
}
By adopting the safety processing method provided by the embodiment of the application, even when the abnormality which is difficult to process is faced, the user can be ensured to use the application to the greatest extent by loading the dynamic container page, and the user experience is improved. In addition, the embodiment of the application has a plurality of different security processing strategies, and can process different abnormal problems, so that the problem processing flexibility and the processing efficiency are higher.
In some embodiments of the present application, optionally, after receiving the security policy request message, the server determines whether the exception occurs for the first time according to the call stack information, if so, issues a third security processing policy to the terminal, and if not, and the server stores a patch file corresponding to the exception, issues the first security processing policy to the terminal.
In the embodiment of the application, the server judges whether the abnormality occurs for the first time according to the call stack information of the abnormality, and issues a corresponding security processing strategy according to the judgment result, wherein if the abnormality occurs for the first time, a third security processing strategy is issued to the terminal, and if the abnormality does not occur for the first time and the server stores a patch file corresponding to the abnormality, the first security processing strategy is issued to the terminal.
In some embodiments of the present application, optionally, if the server does not store the patch file corresponding to the exception, it is determined whether the exception can be resolved by the second security processing policy, if so, the second security policy is issued to the terminal, and if not, the third security policy is issued to the terminal.
In some embodiments of the present application, optionally, the security information corresponding to the first security processing policy includes a download progress of the patch, and/or the security information corresponding to the second security processing policy includes prompt content for guiding the user to operate in cooperation with the second security policy.
In the embodiment of the application, the security information displayed in the dynamic container page is issued by the server according to different security processing strategies, wherein the security information corresponding to the first security processing strategy can be the downloading progress of the patch, and the security information corresponding to the second security processing strategy can be prompt content for guiding the user to operate in cooperation with the second security strategy. Because the third security processing policy mainly displays the substitute content issued by the server in the dynamic container page, the security information corresponding to the third security processing policy is the substitute content issued by the server.
The foregoing describes implementations and advantages of embodiments of the application in terms of a number of embodiments. The following describes in detail the specific processing procedure of the embodiment of the present application in conjunction with specific examples.
Fig. 6 is a flowchart of a security processing method according to an embodiment of the present application, taking an application app vulnerability generation as an example. Referring to fig. 6, a security processing method for application app exception flash back according to an embodiment of the present application includes the following processes:
s601, APP triggers program loopholes and throws out anomalies;
s602, capturing an abnormality, intercepting system behaviors (flashing back), and entering a security mode page;
S603, uploading abnormal code call stack information, and requesting a server security policy;
s604, receiving the uploading abnormal information of the mobile terminal and issuing a security policy according to a code call stack;
S605, if the code call stack has patch program, executing step S606, if yes, executing step S607;
s606, downloading a patch program and restarting the application;
S607, whether a pre-configuration instruction is configured for the code call stack, if so, executing a step S608, and if not, executing a step S609;
s608, executing a server side issuing instruction;
S609, whether a dynamic page is configured for the code call stack, if yes, executing step S610, and if not, executing step S611;
S610, configuring a dynamic page by a dynamic container display server;
S611, new abnormal calling station information, and using the dynamic page with the spam. Triggering an alarm, analyzing call stack information, and updating security configuration.
Correspondingly to the method embodiment of the present application, the present application further provides a secure processing device for application program app exception flashing, as shown in fig. 7, where the secure processing device 100 for application program app exception flashing is applied to a terminal, and a self-defined app secure processing module is preset in a terminal system program of the app, where the app secure processing module is configured to enable the app to enter a secure operation mode and perform secure processing on the occurred exception when multiple exceptions occur in an app operation process, and the secure processing device for app exception flashing includes:
A capturing module 110, configured to capture, when an abnormality related to app flashing occurs during app running, related information of the abnormality by the app security processing module;
The switching module 120 is configured to switch the app to a secure operation mode, in the secure operation mode, the app security processing module starts a dynamic container page to replace an abnormal interface of the app, and sends a security policy request message to a server, where the security policy request message carries the abnormal call stack information, so that the server issues a security processing policy corresponding to the abnormality;
And the execution module 130 is configured to execute the security processing policy after receiving the security processing policy issued by the server, so that the app eliminates the exception, load security information corresponding to the security processing policy in the dynamic container page, and return to the normal running interface of the app after the exception is eliminated.
The electronic device in the embodiment of the application can be user terminal equipment, a server, other computing devices and a cloud server. Fig. 8 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application, where the electronic device may include a processor 801 and a memory 802 storing computer program instructions, where the processor 801 implements the flow or functions of any of the methods of the embodiments described above when executing the computer program instructions.
In particular, the processor 801 may include a Central Processing Unit (CPU), or an Application SPECIFIC INTEGRATED Circuit (ASIC), or may be configured as one or more integrated circuits that implement embodiments of the present application. Memory 802 may include mass storage for data or instructions. For example, the memory 802 may be at least one of a hard disk drive (HARD DISK DRIVE, HDD), read-only memory (ROM), random Access Memory (RAM), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, universal serial bus (Universal Serial Bus, USB) drive, or other physical/tangible memory storage device. As another example, memory 802 may include removable or non-removable (or fixed) media. For another example, memory 802 may be internal or external to the integrated gateway disaster recovery device. Memory 802 may be a non-volatile solid state memory. In other words, memory 802 typically includes a tangible (non-transitory) computer-readable storage medium (e.g., a memory device) encoded with computer-executable instructions and, when the software is executed (e.g., by one or more processors), may perform the operations described by the methods of embodiments of the application. The processor 801 implements the flow or functions of any of the methods of the above embodiments by reading and executing computer program instructions stored in the memory 802.
In one example, the electronic device shown in fig. 8 may also include a communication interface 803 and a bus 810. The processor 801, the memory 802, and the communication interface 803 are connected to each other via a bus 810 and perform communication with each other. The communication interface 803 is primarily used to implement communication between modules, devices, units and/or apparatuses in an embodiment of the application. Bus 810 includes hardware, software, or both, that may couple components of the online data flow billing device to each other. For example, the buses may include at least one of an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards Association local (VLB) bus, or other suitable bus. Bus 810 may include one or more buses. Although embodiments of the application describe or illustrate a particular bus, embodiments of the application contemplate any suitable bus or interconnection.
In connection with the methods of the above embodiments, embodiments of the present application also provide a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the flow or function of any of the methods of the above embodiments.
In addition, the embodiment of the present application further provides a computer program product, where the computer program product stores computer program instructions, and the computer program instructions implement the flow or the function of any one of the methods in the above embodiments when the computer program instructions are executed by a processor.
The foregoing exemplarily describes the flow diagrams and/or block diagrams of methods, apparatus, systems, and computer program products according to embodiments of the present application, and describes various aspects related thereto. It will be understood that each block of the flowchart illustrations and/or block diagrams, or combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions, special purpose hardware which perform the specified functions or acts, and combinations of special purpose hardware and computer instructions. For example, these computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the present application, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit.
Functional blocks shown in the block diagrams of the embodiments of the present application can be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, etc., or a program or code segment when implemented in software, that is used to perform the required tasks. The program or code segments can be stored in a memory or transmitted over transmission media or communication links through data signals carried in carrier waves. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should be noted that the present application is not limited to the specific configurations and processes described above or shown in the drawings. The foregoing is merely specific embodiments of the present application, and it will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working processes of the described system, apparatus, module or unit may refer to corresponding processes in the method embodiments, and need not be repeated. It should be understood that the scope of the present application is not limited thereto, and any person skilled in the art may conceive various equivalent modifications or substitutions within the technical scope of the present application, which are intended to be included in the scope of the present application.