CN111443907A - Method and device for calling SDK function - Google Patents

Method and device for calling SDK function Download PDF

Info

Publication number
CN111443907A
CN111443907A CN202010170237.XA CN202010170237A CN111443907A CN 111443907 A CN111443907 A CN 111443907A CN 202010170237 A CN202010170237 A CN 202010170237A CN 111443907 A CN111443907 A CN 111443907A
Authority
CN
China
Prior art keywords
function
sdk
software program
target software
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010170237.XA
Other languages
Chinese (zh)
Inventor
陈世龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Wangsu Co Ltd
Original Assignee
Xiamen Wangsu Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Wangsu Co Ltd filed Critical Xiamen Wangsu Co Ltd
Priority to CN202010170237.XA priority Critical patent/CN111443907A/en
Publication of CN111443907A publication Critical patent/CN111443907A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/51Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems at application loading time, e.g. accepting, rejecting, starting or inhibiting executable software based on integrity or source reliability

Abstract

The invention discloses a method and a device for calling an SDK function, and belongs to the technical field of computers. The method comprises the following steps: after the target software program is accessed into the SDK, triggering a prompt message detection function preset in the SDK; detecting whether preset prompt information is displayed in a visual interface of the target software program or not through the prompt information detection function; if so, allowing the target software program to call the function of the SDK, otherwise refusing the target software program to call the function of the SDK. By adopting the method and the device, illegal and illegal software programs can be quickly and efficiently detected, and the software programs can be effectively ensured not to maliciously infringe the rights and interests of users under the condition that the users are unaware.

Description

Method and device for calling SDK function
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for calling an SDK function.
Background
Software developers often call SDKs (Software development kits) provided by SDKs (Software development kits) developers when developing Software programs. The SDK may be a collection of software development tools, and by accessing the SDK, the functions provided by the SDK may be configured in the developed software program.
At present, the rights and interests of software users may be violated to some extent by partial functions of the SDK, so that an SDK developer requires a software program to display prompt information to the software users in advance before calling the corresponding functions of the SDK, so as to ensure that the software users have corresponding informed rights. Therefore, the SDK developer can customize a prompt page containing prompt information in advance and provide the prompt page for the software developer so that the software developer can perform corresponding configuration on the prompt page. Subsequently, after the software program is online, the SDK developer can manually check the online software program to see whether the software program displays the pre-customized prompt page to the software user when calling the corresponding function of the SDK, so as to determine whether the software program is in compliance.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
on one hand, as more and more software programs needing to be accessed into the SDK are required, the manual auditing speed can not meet the auditing requirements of all the software programs, and when the number of the software programs reaches a certain magnitude, illegal software programs can not be found quickly in time by means of manual auditing; on the other hand, the software program types accessed to the SDK are thousands of functions, and the prompt page customized by the SDK developer in advance is difficult to adapt to all software programs, so that the SDK developer needs to spend a large amount of cost to adjust the page for different software programs.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for invoking an SDK function. The technical scheme is as follows:
in a first aspect, a method for invoking an SDK function is provided, the method comprising:
after the standard software program is accessed into the SDK, triggering a prompt message detection function preset in the SDK;
detecting whether preset prompt information is displayed in a visual interface of the target software program or not through the prompt information detection function;
if so, allowing the target software program to call the function of the SDK, otherwise refusing the target software program to call the function of the SDK.
In a second aspect, an apparatus for invoking an SDK function is provided, the apparatus comprising:
the trigger module is used for triggering a prompt message detection function preset in the SDK after the target software program is accessed into the SDK;
the detection module is used for detecting whether preset prompt information is displayed in a visual interface of the target software program or not through the prompt information detection function;
a management module, for allowing the target software program to call the function of the SDK if the SDK is the target software program, or refusing the target software program to call the function of the SDK if the SDK is the target software program
In a third aspect, there is provided a network device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by the processor to implement the method of invoking SDK functionality according to the first aspect.
In a fourth aspect, there is provided a computer readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by a processor to implement the method of invoking SDK functionality as described in the first aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, after the target software program is accessed into the SDK, a prompt message detection function preset in the SDK is triggered; detecting whether preset prompt information is displayed in a visual interface of a target software program or not through a prompt information detection function; if so, allowing the target software program to call the function of the SDK, otherwise refusing the target software program to call the function of the SDK. Therefore, by configuring the detection function in the SDK, before the software program calls the SDK function, the SDK automatically detects the display condition of the prompt message, so that illegal and illegal software programs can be quickly and efficiently detected, the user rights and interests can be effectively guaranteed that the software programs cannot be maliciously infringed under the condition that the users are unaware of the software programs, and a large amount of cost required by manual examination and verification is saved. In addition, the SDK only detects the preset prompt information, the SDK developer only needs to negotiate the information content of the prompt information with the software developer, and the display view of the prompt information can be set by the software developer, so that the adaptation degree of the display view of the prompt information and a software program can be improved, the SDK developer does not need to customize and adjust the prompt page, and the cost of page design is saved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced 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 based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for invoking an SDK function according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus for invoking an SDK function according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for invoking an SDK function according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a network device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides a method for calling an SDK function, which can be applied to a user terminal provided with a software program, is mainly executed by an SDK in the software program and is completed by the assistance of the software program. The user terminal can be any network equipment with a program running function, such as a mobile phone, a tablet, a computer and the like; the software program can be operated on the user terminal and has any program required by the SDK function call; the SDK may be a set of functions that are pre-configured in the software program for the software program to call to implement the relevant function. During the operation process of the software program, the software program can access the SDK and call the function specified in the SDK by executing a specific function call function. The SDK can verify and detect the calling of the software program to judge whether the function calling is legal or not, so that whether the corresponding function calling is allowed or not can be determined according to the judgment result. In particular, for some functions that may involve user interest, it is desirable for the software program to present a prompt to the user before invoking the function to ensure that the user is aware of the implementation of the associated function. Therefore, the SDK can detect the display condition of the prompt message to determine whether the related function can be called by the software program. In this embodiment, an SDK for acquiring user information is taken as an example, and a user terminal is taken as a mobile phone of an IOS system for description, and other cases are similar, and will be specifically described where necessary.
The process flow shown in fig. 1 will be described in detail below with reference to specific embodiments, and the contents may be as follows:
step 101, after the target software program is accessed into the SDK, triggering a prompt information detection function preset in the SDK.
In implementation, the target software program can access the SDK according to service requirements during operation to call functions provided by the SDK. And then, when the preset condition is met, the detection processing of the SDK on the display condition of the prompt information can be triggered, namely, a prompt information detection function preset in the SDK is triggered. The prompt message detection function may be pre-constructed by an SDK developer, and configured inside the SDK, for detecting the prompt message. The prompt message may be a message that is displayed to notify the software user that the user information will be acquired by the software program, and may be a text, a picture, or the like.
And 102, detecting whether preset prompt information is displayed in a visual interface of the target software program or not through a prompt information detection function.
In implementation, when a prompt information detection function preset in the SDK is triggered, the prompt information detection function may be used to detect information content in a visual interface of a target software program, that is, to detect whether preset prompt information is displayed in the visual interface. Here, the SDK developer may define information content of the hint information, such as text description content or picture detail content of the hint information, and the software developer may define a display manner of the hint information, such as defining a view background, a display position, a view frame, an information font, and the like corresponding to the hint information. Therefore, on one hand, the SDK developer defines the information content, the content of the prompt information can be ensured to be accurate, and the user can quickly and definitely know that the information is acquired by software; on the other hand, the software developer defines the display mode of the prompt information, so that the successful adaptation of the display view of the prompt information and the software program can be ensured, the harmonious matching of the style and the theme of the display view and the software program can be ensured, and the user experience of the software program is improved laterally.
And 103, if so, allowing the target software program to call the function of the SDK, otherwise, refusing the target software program to call the function of the SDK.
In implementation, if preset hint information is detected in the visual interface of the target software program through the hint information detection function, then the function of the SDK may be allowed to be called by the target software program. And if the preset prompt information is not detected in the visual interface of the target software program, the target software program can be refused to call the function of the SDK. It should be noted that the detection processing of the prompt information may occur when the target software program calls the function of the SDK, or may occur at any time after the target software accesses the SDK and before the function of the SDK is called. If the prompt information is detected, setting the current running period of the target software program or the preset time after detection, and not needing to trigger the prompt information detection function again; or the target software program is marked as a compliance software program (the duration of the marking can be set according to actual requirements, for example, the duration can be a preset duration during the current running period of the target software program or after detection), when the prompt information detection function is triggered again, the marking result can be inquired firstly, and if the prompt information detection function is the compliance software program, the detection is skipped. Therefore, the situation that the prompt information needs to be frequently displayed by the target software program due to repeated triggering of the prompt information detection function can be effectively avoided.
Further, in order to avoid the situation that the prompt information cannot be successfully detected due to delayed display of the prompt information caused by the fact that the software program is blocked, the preset duration of the detection processing of the prompt information can be set, and if the prompt information is not detected within the preset duration, the target software program is refused to call the function of the SDK. In addition, in order to avoid the situation that the display time and the detection time of the prompt information are staggered from each other, and the prompt information is not successfully detected, before the target software program is refused to call the SDK function, a prompt information display notice can be sent to the target software program, and the detection processing of the prompt information can be executed again. If the preset prompt message is not detected within the preset time length, the target software program can be refused to call the function of the SDK.
Optionally, when the software program is started, the prompt information detection function may be set as a pre-trigger function of function call of the SDK.
In implementation, the target software program may perform initialization processing on the SDK when starting, including setting the hint detection function as a function call pre-trigger function of the SDK. Here, the pre-trigger function of the function call of the SDK is: before the function call of the SDK is realized, a function to be triggered preferentially is required. Based on the above setting, the target software program triggers the prompt information detection function before calling the function of the SDK, so as to execute the detection processing of the prompt information. Therefore, the detection of the prompt message is triggered when the function of the SDK is called, and the right of the user to know the realization of the SDK function can be effectively ensured.
Optionally, the detection of the prompt information may be triggered by constructing a new function call function, and the corresponding processing may be as follows: and searching an original function calling function of the SDK, and replacing the original function calling function by a preset novel function calling function.
The novel function calling function has a trigger function of the prompt information detection function.
In implementation, an SDK developer may build a new type of function call function based on the original function call function of the SDK. The novel function calling function has all functions of the original function calling function, the implementation logic is the same as that of the original function calling function, and the difference between the two functions is that the novel function calling function also has the trigger function of the prompt message detection function. Based on the above processing, when the target software is started, the initialization processing of the SDK may be specifically as follows: the implementation address of the original function call function of the SDK can be searched by using a "class _ getInstanceMethod ()" function, and the implementation address is stored; the implementation address of the new type function call function may then be replaced with the implementation address of the original function call function using the "class _ replaymethod ()" function.
Optionally, it may be set that when human-computer interaction operation for the target software program is detected, a prompt information detection function preset in the SDK is triggered.
In implementation, in the running process of the target software program, a user can perform human-computer interaction operations such as clicking, dragging and inputting aiming at the target software program so as to control the target software program to execute a corresponding instruction. In consideration of the fact that the sight of the user generally falls within the interface of the target software program during the human-computer interaction operation, the prompt information is displayed at the moment, and the user can be effectively guaranteed to browse the content of the prompt information. Therefore, the SDK developer may require that the target software program display the prompt information in its visual interface when the human-computer interaction operation occurs, and may set a prompt information detection function preset in the SDK when the human-computer interaction operation directed to the target software program is detected.
Optionally, the processing of triggering the prompt information detection through human-computer interaction may be implemented in a function replacement manner, and the corresponding processing may be as follows: and when the target software program is started, replacing the original human-computer interaction function of the target software program by a preset novel human-computer interaction function.
The novel human-computer interaction function has a trigger function of the prompt information detection function.
In implementation, an SDK developer may construct a new human-machine interaction function based on the original human-machine interaction function of the SDK. The novel human-computer interaction function has all functions of the original human-computer interaction function, the implementation logic of the novel human-computer interaction function is the same as that of the original human-computer interaction function, and the novel human-computer interaction function and the original human-computer interaction function are different in that the novel human-computer interaction function further has a trigger function of a prompt message detection function. Based on the above processing, when the target software is started, the initialization processing of the SDK may be specifically as follows: the implementation address of the original man-machine interaction function of the SDK can be searched by using a class _ getInstanceMethod ()' function and stored; the implementation address of the new human-computer interaction function can then be replaced by the implementation address of the original human-computer interaction function by using the "class _ replayed method ()" function.
For example, the original human interaction function may be a plurality of functions of the UIResponder class:
1.touchesBegan:withEvent:;
2.touchesMoved:withEvent:;
3.touchesEnded:withEvent:;
4.touchesCancelled:withEvent:;
and multiple functions of the UIControl class:
5.beginTrackingWithTouch:withEvent:;
6.continueTrackingWithTouch:withEvent:;
7.endTrackingWithTouch:withEvent:;
8.cancelTrackingWithEvent:;
9.sendAction:to:forEvent:。
correspondingly, the constructed novel human-computer interaction function can comprise:
1.new_touchesBegan(id self,SEL_cmd,NSSet<UITouch*>*touches,UIEvent *event);
2.new_touchesMoved(id self,SEL_cmd,NSSet<UITouch*>*touches, UIEvent*event);
3.new_touchesEnded(id self,SEL_cmd,NSSet<UITouch*>*touches,UIEvent *event);
4.new_touchesCancelled(id self,SEL_cmd,NSSet<UITouch*>*touches,UIEvent*event);
5.new_beginTrackingWithTouch(id self,SEL_cmd,UITouch*touch,UIEvent *event);
6.new_continueTrackingWithTouch(id self,SEL_cmd,UITouch*touch,UIEvent*event);
7.new_endTrackingWithTouch(id self,SEL_cmd,UITouch*touch,UIEvent*event);
8.new_cancelTrackingWithEvent(id self,SEL_cmd,UIEvent*event);
9.new_sendActionto:(id self,SEL_cmd,SEL action,id target,UIEvent*event)。
thus, when a user performs touch operation on a target software program on a mobile phone screen through a finger, at least the functions in the uiresponse class and the UIControl class are triggered, the corresponding method at the beginning of the new _ is actually called, and then the prompt information detection function is triggered through the function at the beginning of the new _ in the future.
Optionally, when detecting the prompt information, the sub-view of the prompt information may be searched first, and then the visibility of the sub-view to the user is determined, and correspondingly, the processing in step 102 may be as follows: and detecting whether all the sub-views of the main window of the current target software program contain the target sub-view corresponding to the preset prompt message or not, and detecting whether the preset prompt message is visible to the user or not.
In implementation, after a prompt information detection function built in the SDK is triggered, all sub-views of a main window of a target software program may be first obtained through the prompt information detection function, and whether a target sub-view corresponding to preset prompt information is included in all sub-views may be searched, specifically, a current main window keyWindow of the target software program may be obtained through a function [ [ applicable shared application ] keyWindow ], all sub-view of the keyWindow may be obtained through the [ keyWindow ] in the keyWindow, and then all sub-views are recursively traversed to search whether a target sub-view of information content including the prompt information exists. If the target sub-view exists, whether the prompt information in the target sub-view is visible to the user can be further detected, namely whether the user can clearly and intuitively see the information content of the prompt information.
Optionally, whether the preset prompting message is visible to the user may be detected through the following aspects:
1. detecting whether the target sub-view is in a visible area of the main window;
2. detecting whether an alpha value of the target sub-view is larger than a preset threshold value or not;
3. detecting whether the width and height values of the target sub-views are larger than a preset threshold value or not;
4. detecting whether the information content in the target sub-view is clearly visible;
5. it is detected whether the target sub-view is not covered by other views.
In implementation, when determining whether the prompt information is visible to the user, the determination may be performed at least according to the display position, transparency, size, content definition, and whether the target sub-view corresponding to the prompt information is covered by the occlusion. Specifically, after the target sub-view is found, whether the target sub-view is in the visible region of the keyWindow can be judged by detecting whether the frame of the keyWindow contains the frame of the target sub-view; then, whether the alpha value of the target sub-view is larger than a preset threshold value or not can be detected; whether the width and height value (the elevation value and the width value) of the target sub-view is larger than a preset threshold value can be detected; then, whether the information content of the target sub-view is clearly visible can be detected, for example, whether the background color of the target sub-view is consistent with the character color of the prompt message, whether the character size of the prompt message is proper, and the like are judged; it may be detected subsequently whether the target sub-view is not covered by other views, wherein the determination code of the covering may be as follows:
Figure RE-GDA0002493787750000081
Figure RE-GDA0002493787750000091
Figure RE-GDA0002493787750000101
in addition, the display duration of the target sub-view can be detected, if the display duration is less than the preset duration, the target sub-view can be considered to belong to abnormal display, and then the display duration of the target sub-view can be detected to judge whether the prompt message is visible to the user.
Optionally, the SDK may support multiple functions, each function may have a corresponding prompt message, and accordingly, the processing in steps 102 and 103 may be as follows: detecting whether preset prompt information corresponding to the target function of the SDK is displayed in a visual interface of the target software program or not through a prompt information detection function; if so, allowing the target software program to call the target function, otherwise refusing the target software program to call the target function.
In implementation, the SDK may have multiple functions for the target software program to call, wherein the calling of some functions all need to display prompt information, and the displayed prompt information is different from each other. Multiple functions can share one prompt message detection function, namely, the prompt messages corresponding to different functions are detected and processed through the same prompt message detection function. Then, taking the target function as an example, in the process of detecting the prompt information, it may be detected through the prompt information detection function whether the prompt information corresponding to the target function is displayed in the visual interface of the target software program. If so, the target software program may be allowed to invoke the target function, otherwise, the target function is denied. Here, if the prompt information corresponding to the target function is detected, only the target function may be allowed to be called, and as for other functions corresponding to different prompt information, the other functions may be allowed to be called only after the prompt information is detected.
Optionally, the prompt information may be pre-configured in the SDK, so as to be called by the target software program, and the corresponding processing may be as follows: when a prompt message acquisition request of a target software program is received or an SDK function call request of the target software program is received, preset prompt messages built in the SDK are provided for the target software program.
In implementation, an SDK developer may construct an information prompt function in the SDK, so that the software program feeds back preset prompt information when calling, so as to assist the software program in acquiring and displaying the prompt information. Specifically, a privacy function and an authorized function may be constructed in the SDK, the privacy function may be used to return a term text in the prompt message, the authorized function may be used to return an authorized text in the prompt message, and the contents returned by the privacy function and the authorized function may be issued and updated by the background server of the SDK, for example, the privacy function returns "unified certification term", and the authorized "approve" and "reject" two buttons. Meanwhile, the SDK developer may notify the software developer that the software program needs to call 2 functions, namely, privacy and authorized before calling the function of the SDK, and needs to display the returned information content in the main interface of the software program.
Therefore, in one case, the target software program may actively send a prompt information acquisition request to the SDK before calling the function of the SDK, so that the SDK may be triggered to provide preset prompt information built in the SDK to the target software program; in another case, the SDK may actively provide preset prompt information built in the SDK to the target software program when receiving the SDK function call request of the target software program.
Optionally, after the target software program is rejected from calling the SDK function, the violation operation may be reported, and accordingly, after step 103, the following processing may be performed: and uploading the software identifier of the target software program to a background server of the SDK, so that the background server records the number of violation times of the target software program and manages the SDK access authority of the target software program according to the number of violation times.
In implementation, if the target software program does not display the prompt information in a compliant manner, the SDK may reject its call request for the function, and may obtain the software identifier of the target software program, and upload the software identifier to the background server of the SDK. Therefore, the background server can record the violation times of the target software program according to the software identification and then manage the SDK access authority of the target software program by utilizing the violation times. Specifically, if the total value of the number of violations is greater than a preset threshold, or the amplitude of the number of violations within a preset historical time period is greater than a preset amplitude, the access permission of the SDK of the target software program may be closed, that is, the target software program is added to the access blacklist of the SDK. Based on the above processing, it is understood that, when the SDK is initialized, the latest blacklist may be downloaded and configured from the background server, and when the software program is set to access the SDK, the blacklist is used to filter the illegal software program, and the software program in the blacklist is prohibited from accessing the SDK.
In the embodiment of the invention, after the target software program is accessed into the SDK, a prompt message detection function preset in the SDK is triggered; detecting whether preset prompt information is displayed in a visual interface of a target software program or not through a prompt information detection function; if so, allowing the target software program to call the function of the SDK, otherwise refusing the target software program to call the function of the SDK. Therefore, by configuring the detection function in the SDK, before the software program calls the SDK function, the SDK automatically detects the display condition of the prompt message, so that illegal and illegal software programs can be quickly and efficiently detected, the user rights and interests can be effectively guaranteed that the software programs cannot be maliciously infringed under the condition that the users are unaware of the software programs, and a large amount of cost required by manual examination and verification is saved. In addition, the SDK only detects the preset prompt information, the SDK developer only needs to negotiate the information content of the prompt information with the software developer, and the display view of the prompt information can be set by the software developer, so that the adaptation degree of the display view of the prompt information and a software program can be improved, the SDK developer does not need to customize and adjust the prompt page, and the cost of page design is saved.
Based on the same technical concept, an embodiment of the present invention further provides a device for invoking an SDK function, which is shown in fig. 2, and the device includes:
the trigger module 201 is configured to trigger a prompt information detection function preset in the SDK after the target software program accesses the SDK;
the detection module 202 is configured to detect whether preset prompt information is displayed in a visual interface of the target software program through the prompt information detection function;
and the management module 203 is configured to allow the target software program to call the function of the SDK if the result is positive, and reject the target software program to call the function of the SDK if the result is negative.
Optionally, as shown in fig. 3, the apparatus further includes:
a replacing module 204, configured to, when the target software program is started, search for an original function call function of the SDK, and replace the original function call function with a preset new function call function, where the new function call function has a trigger function of the prompt information detection function.
Optionally, the triggering module 201 is specifically configured to:
when human-computer interaction operation aiming at the target software program is detected, triggering a prompt message detection function preset in the SDK;
as shown in fig. 3, the apparatus further comprises:
a replacing module 204, configured to replace, when the target software program is started, an original human-machine interaction function of the target software program by a preset novel human-machine interaction function, where the novel human-machine interaction function has a trigger function of the prompt information detection function.
Optionally, the detection module 202 is specifically configured to:
and detecting whether all the sub-views of the main window of the current target software program contain the target sub-view corresponding to the preset prompt message, and detecting whether the preset prompt message is visible to a user.
Optionally, the detection module 202 is specifically configured to:
detecting whether the target sub-view is within a viewable area of the primary window; and/or the presence of a gas in the gas,
detecting whether the alpha value of the target sub-view is larger than a preset threshold value or not; and/or the presence of a gas in the gas,
detecting whether the width and height values of the target sub-views are larger than a preset threshold value or not; and/or the presence of a gas in the gas,
detecting whether the information content in the target sub-view is clearly visible; and/or the presence of a gas in the gas,
detecting whether the target sub-view is not covered by other views.
It should be noted that: in the device for invoking the SDK function according to the foregoing embodiment, when the SDK function is invoked, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for invoking the SDK function and the method for invoking the SDK function provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 4 is a schematic structural diagram of a network device according to an embodiment of the present invention. Such network devices 400 may vary widely in configuration or performance and may include one or more central processors 422 (e.g., one or more processors) and memory 432, one or more storage media 430 (e.g., one or more mass storage devices) storing applications 442 or data 444. Wherein the memory 432 and storage medium 430 may be transient or persistent storage. The program stored on the storage medium 430 may include one or more modules (not shown), each of which may include a sequence of instructions operating on the network device 400. Still further, the central processor 422 may be arranged to communicate with the storage medium 430 to execute a series of instruction operations in the storage medium 430 on the network device 400.
The network device 400 may also include one or more power supplies 429, one or more wired or wireless network interfaces 450, one or more input-output interfaces 458, one or more keyboards 456, and/or one or more operating systems 441, such as Windows Server, Mac OS X, Unix, L inux, FreeBSD, etc.
Network device 400 may include memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the above-described invoking SDK function.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (17)

1. A method of invoking SDK functionality, the method comprising:
after the target software program is accessed into the SDK, triggering a prompt message detection function preset in the SDK;
detecting whether preset prompt information is displayed in a visual interface of the target software program or not through the prompt information detection function;
if so, allowing the target software program to call the function of the SDK, otherwise refusing the target software program to call the function of the SDK.
2. The method of claim 1, further comprising:
and when the target software program is started, setting the prompt information detection function as a pre-trigger function of the function call of the SDK.
3. The method of claim 2, wherein setting the hint information detection function as a pre-trigger function of a function call of the SDK comprises:
and searching an original function calling function of the SDK, and replacing the original function calling function by a preset novel function calling function, wherein the novel function calling function has a triggering function of the prompt information detection function.
4. The method of claim 1, wherein triggering a prompt detection function preset in the SDK comprises:
and when the man-machine interaction operation aiming at the target software program is detected, triggering a prompt message detection function preset in the SDK.
5. The method of claim 4, further comprising:
and when the target software program is started, replacing an original human-computer interaction function of the target software program by a preset novel human-computer interaction function, wherein the novel human-computer interaction function has a trigger function of the prompt information detection function.
6. The method according to claim 1, wherein the detecting whether a preset prompt message is displayed in the visual interface of the target software program comprises:
and detecting whether all the sub-views of the main window of the current target software program contain the target sub-view corresponding to the preset prompt message, and detecting whether the preset prompt message is visible to a user.
7. The method of claim 6, wherein the detecting whether the preset prompting message is visible to a user comprises:
detecting whether the target sub-view is within a viewable area of the primary window; and/or the presence of a gas in the gas,
detecting whether the alpha value of the target sub-view is larger than a preset threshold value or not; and/or the presence of a gas in the gas,
detecting whether the width and height values of the target sub-views are larger than a preset threshold value or not; and/or the presence of a gas in the gas,
detecting whether the information content in the target sub-view is clearly visible; and/or the presence of a gas in the gas,
detecting whether the target sub-view is not covered by other views.
8. The method according to claim 1, wherein the detecting whether a preset prompt message is displayed in the visual interface of the target software program through the prompt message detection function includes:
detecting whether preset prompt information corresponding to the target function of the SDK is displayed in a visual interface of the target software program or not through the prompt information detection function;
if so, allowing the target software program to call the function of the SDK, otherwise refusing the target software program to call the function of the SDK, and comprising the following steps:
if so, allowing the target software program to call the target function, otherwise refusing the target software program to call the target function.
9. The method of claim 1, further comprising:
and when a prompt message acquisition request of the target software program is received or an SDK function call request of the target software program is received, providing preset prompt messages built in the SDK for the target software program.
10. The method of claim 1, wherein after denying the target software program to invoke the function of the SDK, further comprising:
and uploading the software identifier of the target software program to a background server of the SDK, so that the background server records the violation times of the target software program and manages the SDK access authority of the target software program according to the violation times.
11. An apparatus for invoking SDK functionality, the apparatus comprising:
the trigger module is used for triggering a prompt message detection function preset in the SDK after the target software program is accessed into the SDK;
the detection module is used for detecting whether preset prompt information is displayed in a visual interface of the target software program or not through the prompt information detection function;
and the management module is used for allowing the target software program to call the function of the SDK if the SDK is the target software program, and refusing the target software program to call the function of the SDK if the SDK is not the target software program.
12. The apparatus of claim 11, further comprising:
and the replacing module is used for searching an original function calling function of the SDK when the target software program is started, and replacing the original function calling function by a preset novel function calling function, wherein the novel function calling function has a triggering function of the prompt information detection function.
13. The apparatus of claim 11, wherein the triggering module is specifically configured to:
when human-computer interaction operation aiming at the target software program is detected, triggering a prompt message detection function preset in the SDK;
the device further comprises:
and the replacing module is used for replacing an original human-computer interaction function of the target software program by a preset novel human-computer interaction function when the target software program is started, wherein the novel human-computer interaction function has the triggering function of the prompt information detection function.
14. The apparatus according to claim 11, wherein the detection module is specifically configured to:
and detecting whether all the sub-views of the main window of the current target software program contain the target sub-view corresponding to the preset prompt message, and detecting whether the preset prompt message is visible to a user.
15. The apparatus according to claim 14, wherein the detection module is specifically configured to:
detecting whether the target sub-view is within a viewable area of the primary window; and/or the presence of a gas in the gas,
detecting whether the alpha value of the target sub-view is larger than a preset threshold value or not; and/or the presence of a gas in the gas,
detecting whether the width and height values of the target sub-views are larger than a preset threshold value or not; and/or the presence of a gas in the gas,
detecting whether the information content in the target sub-view is clearly visible; and/or the presence of a gas in the gas,
detecting whether the target sub-view is not covered by other views.
16. A network device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by the processor to implement a method of invoking an SDK function according to any one of claims 1 to 10.
17. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement a method of invoking an SDK function according to any one of claims 1 to 10.
CN202010170237.XA 2020-03-12 2020-03-12 Method and device for calling SDK function Pending CN111443907A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010170237.XA CN111443907A (en) 2020-03-12 2020-03-12 Method and device for calling SDK function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010170237.XA CN111443907A (en) 2020-03-12 2020-03-12 Method and device for calling SDK function

Publications (1)

Publication Number Publication Date
CN111443907A true CN111443907A (en) 2020-07-24

Family

ID=71627412

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010170237.XA Pending CN111443907A (en) 2020-03-12 2020-03-12 Method and device for calling SDK function

Country Status (1)

Country Link
CN (1) CN111443907A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112230945A (en) * 2020-11-16 2021-01-15 厦门亿联网络技术股份有限公司 Method and device for improving equipment compatibility, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704334A (en) * 2017-10-13 2018-02-16 维沃移动通信有限公司 A kind of SDK processing method and mobile terminal
US20180365004A1 (en) * 2017-06-14 2018-12-20 Beijing Xiaomi Mobile Software Co., Ltd. Method and device for calling software development kit
CN110163664A (en) * 2019-04-29 2019-08-23 成都品果科技有限公司 A kind of advertising display feedback method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180365004A1 (en) * 2017-06-14 2018-12-20 Beijing Xiaomi Mobile Software Co., Ltd. Method and device for calling software development kit
CN107704334A (en) * 2017-10-13 2018-02-16 维沃移动通信有限公司 A kind of SDK processing method and mobile terminal
CN110163664A (en) * 2019-04-29 2019-08-23 成都品果科技有限公司 A kind of advertising display feedback method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112230945A (en) * 2020-11-16 2021-01-15 厦门亿联网络技术股份有限公司 Method and device for improving equipment compatibility, electronic equipment and storage medium
CN112230945B (en) * 2020-11-16 2022-06-28 厦门亿联网络技术股份有限公司 Method and device for improving equipment compatibility, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
USRE49459E1 (en) Apparatus and method for configuring password and for releasing lock
JP6100898B2 (en) Method and device for processing messages
EP3454248A1 (en) Application decryption method, terminal and non-transitory computer-readable storage medium
CN106951335B (en) Process daemon method and mobile terminal
CN107193666B (en) Control method and device for calling between application programs
CN111767554B (en) Screen sharing method and device, storage medium and electronic equipment
CN106557669A (en) A kind of authority control method and device of application program installation process
CN109814801A (en) Using login method, device, terminal and storage medium
WO2015200618A1 (en) Light dismiss manager
US20160179296A1 (en) Method and device for video rendering
CN108460259B (en) Information processing method and device and terminal
EP3021250B1 (en) Electronic device and method for suggesting response manual in occurrence of denial
CN106789973B (en) Page security detection method and terminal equipment
CN111443907A (en) Method and device for calling SDK function
CN112016080A (en) Application authority management method and device and electronic equipment
CN113076529B (en) Access control method, device, computer readable storage medium and equipment
CN106708558B (en) Method and device for closing application program
CN106933666B (en) Method for calling information input program and electronic equipment
CN115220859A (en) Data input mode monitoring method and device, electronic equipment and storage medium
CN111752398A (en) Verification code input method and device, electronic equipment and readable storage medium
CN106156586B (en) Control method and electronic equipment
WO2015179608A1 (en) Protecting user privacy from intrusive mobile applications
CN112416500B (en) Information processing method and electronic equipment
CN113486331A (en) API call request processing method and device, electronic equipment and readable storage medium
CN106325844B (en) Information processing method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination