Isolation method, device, terminal and storage medium for software development toolkit

By monitoring and isolating the calls of third-party software development toolkits, the problem of the inability to block malicious calls in time in existing technologies is solved, and the security protection of user privacy and property is achieved.

CN112052447BActive Publication Date: 2025-09-19BEIJING ZHI YOU WANG AN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010783225.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-06
Publication Date
2025-09-19
Estimated Expiration
2040-08-06

AI Technical Summary

Technical Problem

Existing technologies are unable to promptly prevent malicious calls to application programming interfaces by third-party software development kits, resulting in risks to user privacy and property security.

Method used

By obtaining data on system loaded classes, monitoring the calling status of preset application interfaces, obtaining calling data using callback methods, and judging the calling object based on the configuration file, malicious calls are interrupted to achieve isolation.

Benefits of technology

Timely block malicious calls to application program interfaces by third-party software development kits to effectively protect user privacy and property security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112052447B_ABST
    Figure CN112052447B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, terminal, and storage medium for isolating a software development kit (SDK). The method comprises: obtaining system-loaded class data; obtaining call data of a preset application program interface (API) based on the system-loaded class data; and interrupting the call between the preset API and the preset software development kit based on the call data of the preset API to isolate the preset API from the preset software development kit. The software development kit isolation method provided by the present invention can promptly prevent malicious calls to the API by third-party software development kits, thereby effectively protecting the privacy and property security of users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to an isolation method, device, terminal and storage medium for a software development tool kit. Background Art

[0002] When developing apps, developers frequently use third-party software development kits (SDKs) to take advantage of the convenient services and features they provide. However, some malicious SDKs pose security threats themselves. Beyond the well-known potential for collecting user privacy, such as device IDs (IMEI, IMSI, etc.) and location information, they present even more serious security issues. For example, some SDKs can actively receive server commands, collecting sensitive information such as text messages, call logs, and contacts. Furthermore, they can perform dangerous operations such as dynamically downloading code.

[0003] Because these malicious behaviors are very hidden, developers cannot discover them immediately. Even if they are discovered, the apps that have been released and run online cannot block them and reduce risks and losses.

[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide an isolation method, device, terminal and storage medium for a software development kit in response to the above-mentioned defects of the prior art, aiming to solve the problem in the prior art that it is impossible to timely prevent malicious calls to application programming interfaces by third-party software development kits.

[0006] The technical solutions adopted by the present invention to solve the problem are as follows:

[0007] In a first aspect, an embodiment of the present invention provides a method for isolating a software development kit, wherein the method includes:

[0008] Get the data of the system loaded class;

[0009] Obtaining call data of a preset application program interface according to the data of the system loading class;

[0010] According to the calling data of the preset application program interface, the calling between the preset application program interface and the preset software development kit is interrupted to achieve isolation between the preset application program interface and the preset software development kit.

[0011] In one embodiment, obtaining the data of the system loading class includes:

[0012] Obtaining a calling method of a class loader interface, and modifying the calling method of the class loader interface according to the first callback method;

[0013] When it is detected that the data receiving state of the class loader interface is a receiving state, obtaining the calling data of the class loader interface through the first callback method;

[0014] The data of the system loading class is obtained according to the calling data of the class loader interface.

[0015] In one embodiment, obtaining calling data of a preset application program interface according to the data of the system loading class includes:

[0016] Determining the loading status of the class corresponding to the preset application program interface according to the data of the system loading class;

[0017] When the class corresponding to the preset application program interface is in a loading state, the calling data of the preset application program interface is obtained.

[0018] In one embodiment, when the class corresponding to the preset application program interface is in a loading state, obtaining the call data of the preset application program interface includes:

[0019] Obtaining a calling method for the preset application program interface;

[0020] Modify the calling method of the preset application program interface according to the second callback method;

[0021] When the class corresponding to the preset application program interface is in a loading state, the calling data of the preset application program interface is obtained according to the second callback method.

[0022] In one embodiment, when the class corresponding to the preset application program interface is in a loading state, obtaining the call data of the preset application program interface according to the second callback method includes:

[0023] When the class corresponding to the preset application program interface is in a loading state, obtaining the calling data of the second callback method through the method call stack;

[0024] The calling data of the preset application program interface is obtained according to the calling data of the second callback method.

[0025] In one embodiment, interrupting the call between the preset application program interface and the preset software development kit according to the call data of the preset application program interface to achieve isolation between the preset application program interface and the preset software development kit includes:

[0026] Obtaining a configuration file, wherein the configuration file includes the name of the preset application program interface and the name of the preset software development toolkit that prohibits calling the preset application program interface;

[0027] Determining, based on the configuration file and the calling data of the preset application program interface, whether the calling object of the preset application program interface is the preset software development kit;

[0028] When the calling object of the preset application interface is the preset software development kit, the call between the preset application interface and the preset software development kit is interrupted to achieve isolation between the preset application interface and the preset software development kit.

[0029] In one embodiment, interrupting the call between the preset application program interface and the preset software development kit according to the call data of the preset application program interface to achieve isolation between the preset application program interface and the preset software development kit further includes:

[0030] When the calling object of the preset application interface is not the preset software development kit, the calling relationship between the preset application program interface and the calling object of the preset application interface is maintained.

[0031] In a second aspect, an embodiment of the present invention provides an isolation device for a software development kit, wherein the device includes:

[0032] The first acquisition module is used to obtain the data of the system loading class;

[0033] The second acquisition module is further used to obtain call data of the preset application program interface;

[0034] The interruption module is used to isolate the preset application program interface from the preset software development kit.

[0035] In a third aspect, an embodiment of the present invention provides a terminal comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, including methods for executing any one of the above-described methods.

[0036] In a fourth aspect, an embodiment of the present invention provides a non-temporary computer-readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute any of the methods described above.

[0037] Beneficial effects of the present invention: The present invention discloses a method for isolating a software development kit, the method comprising: obtaining data of a system-loaded class, obtaining call data of a preset application program interface based on the data of the system-loaded class, and interrupting the call between the preset application program interface and the preset software development kit based on the call data of the preset application program interface, so as to isolate the preset application program interface from the preset software development kit. The method for isolating a software development kit provided by the present invention can timely prevent malicious calls to application program interfaces by third-party software development kits, thereby effectively safeguarding the privacy and property security of users. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0039] Figure 1 The figure is a flow chart of a method for isolating a software development kit provided in an embodiment of the present invention.

[0040] Figure 2 It is a flow chart of obtaining system class loading data in the isolation method for a software development kit provided by an embodiment of the present invention.

[0041] Figure 3 This is a first flow chart of obtaining calling data of a preset application program interface in the isolation method for a software development kit provided by an embodiment of the present invention.

[0042] Figure 4 This is a second flow chart of obtaining calling data of a preset application program interface in the isolation method for a software development kit provided by an embodiment of the present invention.

[0043] Figure 5 This is a third flow chart of obtaining calling data of a preset application program interface in the isolation method for a software development kit provided by an embodiment of the present invention.

[0044] Figure 6 It is a flowchart of processing the calling relationship between a preset application program interface and the preset software development kit in the isolation method for the software development kit provided by an embodiment of the present invention.

[0045] Figure 7 This is a module connection relationship diagram of an isolation device for a software development tool kit provided by an embodiment of the present invention.

[0046] Figure 8 This is a principle block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the present invention more clear and distinct, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0048] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.

[0049] With the rapid development of mobile internet technology and increasing user demand for mobile devices, the number of applications continues to grow. To improve application development efficiency and performance, developers often rely heavily on third-party software development kits (SDKs) to leverage the convenient services and features they provide. (SDKs are collections of documentation, examples, and tools that aid in application development.) However, these conveniences also come with security risks. For example, some malicious SDKs pose security threats. Beyond the well-known potential for collecting user privacy information, such as device IDs (IMEI, IMSI, etc.) and location information, they present even more serious security issues. For example, some SDKs actively receive server commands, collecting sensitive information such as text messages, call logs, and contacts. Furthermore, they can perform dangerous operations such as dynamically downloading code. Once embedded in an application, these malicious SDKs can covertly perform malicious operations while the user is running the application, potentially leading to privacy breaches or financial losses.

[0050] In order to avoid the occurrence of the above situation, the present invention provides an isolation method for software development kits, which can isolate the behavior of the third-party software development kit itself from the application program, so that the third-party software development kit can run in an isolated sandbox. At the same time, the calling and data transmission behavior of the third-party software development kit can be dynamically monitored to timely block malicious operations of the third-party software development kit.

[0051] To briefly explain the technical solution of the present invention, for system applications, their operation process requires the involvement of many classes with corresponding functions. Therefore, during the operation of the application, there must be a loading process of the corresponding classes. By monitoring the loading status of the system's classes, the operation status of the applications within the system can be known. When the system is monitored to load the classes related to the application that the user needs to monitor, it means that the application that the user needs to monitor is running. Then, by monitoring the interface of the application, it is possible to promptly discover and block the malicious behavior of calling and transmitting data of third-party software development kits.

[0052] like Figure 1 As shown, the isolation method for a software development kit provided in this embodiment includes the following steps:

[0053] Step S100: Obtain data of the system loading class.

[0054] Specifically, when the system runs an application, it must first load the application's related classes into memory before executing the application's functions. Therefore, by obtaining data on the system's loaded classes, we can determine the name of the class loaded by the system, the specific time it was loaded, and other information, thereby understanding the operating status of each application in the system.

[0055] In one implementation, Figure 2 As shown, step S100 specifically includes the following steps:

[0056] Step S110: Obtain a calling method of a class loader interface, and modify the calling method of the class loader interface according to the first callback method.

[0057] Step S120: When it is detected that the data receiving state of the class loader interface is the receiving state, the calling data of the class loader interface is obtained through the first callback method.

[0058] Step S130: Acquire system loading class data according to the calling data of the class loader interface.

[0059] In short, when the system launches an application, it first retrieves the class files associated with the application from the application's Java file. The system then uses the class loader to store the data in the class files into memory, completing the class loading process. Specifically, after retrieving the class files, the system generates a class loading request based on the data in the class files and sends it to the class loader interface. Therefore, when the class loader interface detects that it is receiving data, it indicates that the system is currently loading a class.

[0060] In order to determine which class is currently loaded by the system, it is necessary to obtain the call data of the class loader interface, determine the calling object through the call data, and thus determine which class is currently loaded by the system. In order to obtain the call data of the class loader interface, in one implementation, when it is detected that the data receiving state of the class loader interface is the receiving state, the class loader interface is hooked to obtain the call data of the class loader interface. Specifically, the calling method of the class loader interface is modified according to the preset code to obtain a first callback method. The first callback method not only implements the calling function of the class loader interface, but also directly obtains the calling object and transmitted data of the class loader interface. In other words, after the calling method of the class loader interface is modified to the first callback method, whenever the class loader interface is called, the class loader interface runs the first callback method. Since the parameters in the first callback method include the name parameter of the calling object, the class name of the calling object of the class loader interface and the transmitted data can be directly obtained through the first callback method. According to the class name and the transmitted data, the data of the class loaded by the system can be obtained, such as what class the system has loaded and the specific data transmitted to the class loader interface.

[0061] After obtaining the number of classes loaded by the system, Figure 1 As shown, the method further includes the following steps:

[0062] Step S200: Acquire calling data of a preset application program interface according to the data of the system loading class.

[0063] In short, after obtaining the data of the system-loaded class, the correspondence between the class and the application can be used to determine whether the preset application is started or running based on the data of the system-loaded class. When the preset application is started, it is necessary to promptly monitor whether the preset application interface is maliciously called to prevent third-party software development kits from maliciously stealing user privacy information or transmitting data. When the preset application is started or running, it is necessary to monitor the preset application interface and obtain the call data of the preset application interface. Through the call data of the preset application interface, the call status of the preset application interface can be analyzed, and the preset application interface can be promptly monitored to determine whether it is maliciously called to prevent third-party software development kits from maliciously stealing user privacy information or transmitting data. In actual operation, the preset application interface can be the application interface that needs to be monitored. For example, the user can choose to monitor some applications that store important personal privacy information as preset application interfaces, such as the address book interface, or set payment applications closely related to money as preset applications, such as the Alipay interface.

[0064] In one implementation, Figure 3 As shown, the step S200 specifically includes the following steps:

[0065] Step S210: Determine the loading status of the class corresponding to the preset application program interface according to the data of the system loading class.

[0066] Step S220: When the class corresponding to the preset application program interface is in a loading state, obtain the calling data of the preset application program interface.

[0067] Specifically, in order to determine whether it is necessary to perform a monitoring operation on the preset application interface, the loading status of the preset application-related classes can be judged based on whether the system-loaded class data contains the preset application-related classes, and then the running status of the preset application can be judged. When the system-loaded class data does not contain the preset application-related classes, it means that the preset application-related classes have not been loaded, and the running status of the preset application is not running; when the system-loaded class data contains the preset application-related classes, it means that the preset application-related classes are being loaded, and the running status of the preset application is running. When the running status of the preset application is running, it is necessary to monitor the preset application interface to promptly discover malicious operations of the preset application. By obtaining the call data of the preset application interface, the call status of the preset application interface can be analyzed, and malicious operations of the preset software development kit can be discovered in a timely manner.

[0068] In order to obtain the calling data of the preset application program interface, in one implementation, as Figure 4 The step S220 further includes the following steps:

[0069] Step S221: Obtain the calling method of the preset application program interface.

[0070] Step S222: Modify the calling method of the preset application program interface according to the second callback method.

[0071] Step S223: When the class corresponding to the preset application program interface is in a loading state, the calling data of the preset application program interface is obtained according to the second callback method.

[0072] In short, this embodiment utilizes a method of hooking the preset API to obtain the call data of the preset API. The hook is used to eavesdrop on information within source code. Therefore, after hooking the preset API, the transmission data of the preset API can be intercepted, thereby obtaining the call data of the preset API. Specifically, when the class corresponding to the preset API is in the loading state, the calling method of the preset API is modified according to a second callback method to achieve the hooking of the preset API. This second callback method not only implements the calling function of the preset API but also can be used to obtain the call object and transmission data of the preset API. In other words, after the calling method of the preset API is modified to the second callback method, the preset API executes the second callback method every time the preset API is called. The call object and transmission data of the preset API can be obtained according to the second callback method, thereby monitoring whether the preset API has been called maliciously.

[0073] Since the parameters of the second callback method do not include the name parameter of the calling object, in order to obtain the calling data of the preset application program interface, in one implementation, Figure 5 As shown, step S223 includes the following steps:

[0074] Step S2231: When the class corresponding to the preset application program interface is in a loading state, the calling data of the second callback method is obtained through the method call stack.

[0075] Step S2232: Obtain the calling data of the preset application program interface according to the calling data of the second callback method.

[0076] Simply put, when an application is actually running, a preset data area exists in the system memory to implement the application's method call mechanism. This preset data area is called the method call stack. Each executed method has a data area in the method call stack, which is called a stack frame. The stack frame of the method call stack stores important information about the corresponding calling method, such as the detailed calling process, the calling object, and the calling method.

[0077] Since the parameters of the second callback method do not include the name parameter of the calling object, it is necessary to obtain the call data of the preset application program interface through the method call stack. When the preset application program interface runs the second callback method, the call data of the second callback method is obtained through the method call stack. The code to implement this process is as follows:

[0078] Thread.currentThread().getStackTrace()

[0079] According to the calling data of the second callback method, the class name and calling method of the class that calls the second callback method are obtained. Since the second callback method is the calling method of the preset application interface, the calling data of the preset application interface can be indirectly obtained according to the class name and calling method of the class that calls the second callback method.

[0080] After obtaining the calling data of the preset application program interface, it is necessary to analyze the calling data of the preset application program interface. Figure 1 As shown, the method further includes the following steps:

[0081] S300: interrupting the call between the preset application program interface and the preset software development kit according to the call data of the preset application program interface, so as to isolate the preset application program interface from the preset software development kit.

[0082] Specifically, the calling object of the preset application interface can be clearly identified through the calling data of the preset application interface. When the calling object of the preset application interface is the preset software development kit, it is necessary to interrupt the call between the preset application interface and the preset software development kit in a timely manner to achieve isolation between the preset application interface and the preset software development kit.

[0083] In one implementation, Figure 6 As shown, the step S300 further includes the following steps:

[0084] Step S310: Obtain a configuration file, wherein the configuration file includes the name of the preset application program interface and the name of the preset software development kit that prohibits calling the preset application program interface.

[0085] Step S320: Determine whether the calling object of the preset application program interface is the preset software development kit according to the configuration file and the calling data of the preset application program interface.

[0086] Step S330: When the calling object of the preset application interface is the preset software development kit, interrupt the call between the preset application interface and the preset software development kit to achieve isolation between the preset application interface and the preset software development kit.

[0087] In short, the isolation method for a software development kit provided in this embodiment requires the user to input configuration information when used for the first time. The configuration information may include but is not limited to the name of the preset application interface and the name of the preset software development kit that is prohibited from calling the preset application interface. After the system obtains the configuration information, it generates a configuration file based on the configuration information and stores it. During actual operation, the system can determine which application interface needs to be monitored and whether the application interface is called in violation of regulations based on the configuration file. Among them, the preset application interface can be the interface name of the application that the user needs to monitor, and the preset software development kit can be an untrusted third-party software development kit, and the calling rule between the preset application interface and the preset software development kit is set to non-callable, so as to isolate the behavior of the preset software development kit itself from the preset application, so that the preset software development kit runs in an isolated sandbox.

[0088] Therefore, after obtaining the call data of the preset application program interface, the calling object of the preset application program interface can be determined. By matching the name of the calling object of the preset application program interface with the name of the preset software development kit in the configuration file, it can be determined whether the calling object of the preset application program interface is the preset software development kit. If the calling object of the preset application program interface is the preset software development kit, it means that the preset software development kit is calling the preset application program interface in violation of the regulations. Therefore, the call between the preset application program interface and the preset software development kit is interrupted to achieve isolation between the preset application program interface and the preset software development kit.

[0089] In one implementation, Figure 6 As shown, the step S300 further includes a step S340, when the calling object of the preset application interface is not the preset software development kit, maintaining the calling relationship between the preset application interface and the calling object of the preset application interface.

[0090] Specifically, when the calling object of the preset application interface is not the preset software development kit, it means that the calling behavior of the calling object of the preset application interface is a regular call and there is no security threat. Therefore, the calling relationship between the preset application interface and the calling object of the preset application interface is maintained.

[0091] Based on the above embodiments, the present invention also provides an isolation device for a software development kit, such as Figure 7 As shown, the device includes: a first acquisition module 1, used to obtain data of the system loading class; a second acquisition module 2, used to obtain call data of the preset application interface; an interrupt module 3, used to isolate the preset application interface from the preset software development kit; the first acquisition module, the second acquisition module, and the interrupt module are all connected to the processor.

[0092] Based on the above embodiments, the present invention further provides a non-transitory computer-readable storage medium, on which a data storage program is stored. When the data storage program is executed by a processor, the various steps of the isolation method for the software development kit described above are implemented. It should be noted that the non-transitory computer-readable storage medium can be set in a data storage device. The specific implementation method of the non-transitory computer-readable storage medium of the present invention is basically the same as the various embodiments of the isolation method for the software development kit described above, and will not be repeated here.

[0093] Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include nonvolatile and / or volatile memory. Nonvolatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).

[0094] Based on the above embodiments, the present invention further provides a terminal, which includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, including a method for isolating a software development kit as described in any one of the above. The principle block diagram of the terminal can be as follows: Figure 8 As shown. The terminal includes a processor, memory, and a network interface connected via a system bus. The processor of the terminal is used to provide computing and control capabilities. The memory of the terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the terminal is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements an isolation method for a software development kit.

[0095] Those skilled in the art will understand that Figure 8 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the intelligent terminal to which the solution of the present invention is applied. The specific intelligent terminal may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement. In addition, the isolation method for the software development kit described in any of the above can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the process of the embodiments of the above methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0096] In summary, the present invention discloses a method for isolating a software development kit (SDK), comprising: obtaining data of a system-loaded class; obtaining call data of a preset application program interface (API) based on the data of the system-loaded class; and interrupting the call between the preset application program interface and the preset software development kit based on the call data of the preset application program interface, thereby isolating the preset application program interface from the preset software development kit. The method for isolating a software development kit provided by the present invention can timely prevent malicious calls to the API by third-party software development kits, thereby effectively safeguarding the privacy and property security of users.

Claims

1. A method for isolating a software development kit, characterized in that: The method comprises: Obtaining data of system loaded classes, including: obtaining a calling method of a class loader interface, and modifying the calling method of the class loader interface according to a first callback method; the parameters in the first callback method include a name parameter of the calling object, and the class name of the calling object of the class loader interface and the transmitted data can be directly obtained through the first callback method; when it is detected that the data receiving state of the class loader interface is a receiving state, obtaining the calling data of the class loader interface through the first callback method; obtaining data of the system loaded classes according to the calling data of the class loader interface; According to the data of the system loaded class, the calling data of the preset application program interface is obtained, including: obtaining the calling method of the class loader interface, and modifying the calling method of the class loader interface according to the first callback method; the parameters in the first callback method include the name parameter of the calling object, and the class name of the calling object of the class loader interface and the transmitted data can be directly obtained through the first callback method; when it is detected that the data receiving state of the class loader interface is the receiving state, the calling data of the class loader interface is obtained through the first callback method; and the data of the system loaded class is obtained according to the calling data of the class loader interface; Interrupting a call between the preset application program interface and a preset software development kit based on the call data of the preset application program interface to isolate the preset application program interface from the preset software development kit, including: obtaining a configuration file, the configuration file including the name of the preset application program interface and the name of the preset software development kit that is prohibited from calling the preset application program interface; determining whether the calling object of the preset application program interface is the preset software development kit based on the configuration file and the call data of the preset application program interface; and interrupting the call between the preset application program interface and the preset software development kit when the calling object of the preset application program interface is the preset software development kit.

2. The isolation method for a software development kit according to claim 1, characterized in that: Interrupting the call between the preset application program interface and the preset software development kit according to the call data of the preset application program interface to achieve isolation between the preset application program interface and the preset software development kit further includes: When the calling object of the preset application program interface is not the preset software development kit, the calling relationship between the preset application program interface and the calling object of the preset application program interface is maintained.

3. An isolation device for a software development toolkit, characterized in that: The device comprises: A first acquisition module is configured to acquire data of system-loaded classes, including: acquiring a calling method of a class loader interface, and modifying the calling method of the class loader interface according to a first callback method; the parameters in the first callback method include a name parameter of a calling object, and the class name of the calling object of the class loader interface and the transmitted data can be directly acquired through the first callback method; when it is detected that the data receiving state of the class loader interface is a receiving state, acquiring the calling data of the class loader interface through the first callback method; and acquiring data of the system-loaded classes according to the calling data of the class loader interface; The second acquisition module is further configured to acquire call data of a preset application program interface, including: determining the loading status of a class corresponding to the preset application program interface based on the data of the system loaded class; when the class corresponding to the preset application program interface is in the loading status, it indicates that the class related to the preset application program is being loaded, and the running status of the preset application program is running; acquiring the call data of the preset application program interface, monitoring the preset application program interface, and promptly detecting malicious operations of the preset application program; wherein acquiring the call data of the preset application program interface includes: acquiring a calling method of the preset application program interface; modifying the calling method of the preset application program interface according to a second callback method; when the class corresponding to the preset application program interface is in the loading status, acquiring the call data of the preset application program interface according to the second callback method; wherein the parameters of the second callback method do not include a name parameter of the calling object; in order to acquire the call data of the preset application program interface, when the class corresponding to the preset application program interface is in the loading status, acquiring the call data of the second callback method through a method call stack; wherein the method call stack is a preset data area in the system memory used to implement the method call mechanism of the application program; wherein the first callback method and the second callback method are both methods for hooking the interface, and hooking is used to hook information between source codes; an interruption module, configured to isolate the preset application program interface from the preset software development kit to achieve isolation between the preset application program interface and the preset software development kit, comprising: obtaining a configuration file, the configuration file including the name of the preset application program interface and the name of the preset software development kit that is prohibited from calling the preset application program interface; determining, based on the configuration file and the calling data of the preset application program interface, whether the calling object of the preset application program interface is the preset software development kit; and interrupting the call between the preset application program interface and the preset software development kit when the calling object of the preset application program interface is the preset software development kit.

4. A terminal, characterized in that: The terminal includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to execute the one or more programs including the method according to any one of claims 1-2.

5. A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the method according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Method and device for monitoring third-party SDK (Software Development Kit) in application and device for reinforcing installation package

    CN106557691A