Application signature verification method and device, equipment and storage medium
By verifying the signature information and system time when the application is opened, the problem of re-signing the application when the debugging device is replaced is solved, and debugging efficiency and device flexibility is improved.
Patent Information
- Application Number
- CN202411439063.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-03-18
AI Technical Summary
When the prior art requires multiple debugging devices to be connected during the application debugging stage, pre-binding devices cannot meet the needs, resulting in the need to re-sign the application, affecting the normal use and debugging efficiency of other devices.
When opening a debugging application, obtain the application's signature information and current system time, and verify it through the signature verification module to avoid the need to re-sign the application when adding or replacing the debugging device.
No need to re-sign the application, which improves the flexibility and efficiency of debugging equipment and meets the needs of joint debugging of multiple devices.
Smart Images

Figure CN119652542A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a verification method, device, equipment and storage medium for application signatures. Background Art
[0002] Currently, applications in the debugging stage generally bind debugging devices (for example, by binding the device identifier to the digital signature to bind the debugging device for the application in the debugging stage, etc.), and then debug the application through the bound debugging device. However, with the increase of application functions, more and more functions need to be debugged in the application, especially sometimes multiple debugging devices are needed for joint debugging. This may lead to the problem that the pre-bound device cannot meet the debugging requirements and a new debugging device is added, or a debugging device cannot meet the debugging requirements and the debugging device is replaced. At this time, the application needs to be digitally signed again, which affects the normal use of other debugging devices, and thus affects the debugging efficiency of the application.
[0003] Therefore the prior art still needs to be improved and enhanced. Summary of the invention
[0004] The technical problem to be solved by the present application is to provide a verification method, device, equipment and storage medium for application signature in view of the deficiencies in the prior art.
[0005] In order to solve the above technical problems, the first aspect of the present application provides a method for verifying an application signature, wherein the method for verifying an application signature specifically includes:
[0006] When opening a debugging type application, obtaining the application's signature information and the current system time, wherein the signature information includes the application's installation time;
[0007] Calling the signature information and the current system time to the signature verification module in the package management module;
[0008] Based on the signature information and the current system time, an opening verification is performed by a signature verification module;
[0009] When the opening verification passes, the application is opened.
[0010] The verification method for the application signature, wherein the opening verification is performed by the signature verification module based on the signature information and the current system time specifically includes:
[0011] Input the signature information and the current system time into the RunVerify interface in the signature verification module;
[0012] Calling the open verification program through the RunVerify interface, and calculating the relative time interval between the installation time and the current system time through the open verification program;
[0013] If the relative time interval is less than or equal to the application restricted usage duration, first feedback information is fed back through the RunVerify interface, wherein the first feedback information is used to reflect that the opening verification is passed;
[0014] If the relative time interval is greater than the application usage restriction duration, second feedback information is fed back through the RunVerify interface, wherein the second feedback information is used to reflect that the opening verification failed due to the failure of the application usage restriction verification.
[0015] The verification method for the application signature, wherein the signature information also includes the signature time, and the opening verification by the signature verification module based on the signature information and the current system time specifically includes:
[0016] Input the signature information and the current system time into the RunVerify interface in the signature verification module;
[0017] Calling the open verification program through the RunVerify interface, and calculating the relative time interval between the installation time and the current system time, and the absolute time interval between the signature time and the current system time through the open verification program;
[0018] If the relative time interval is less than or equal to the application usage limit duration, and the absolute time interval is less than or equal to the authorization limit period, first feedback information is fed back through the RunVerify interface, wherein the first feedback information is used to reflect that the opening verification is passed;
[0019] If the relative time interval is greater than the application usage limit duration, and the absolute time interval is less than or equal to the authorization limit period, second feedback information is fed back through the RunVerify interface, wherein the second feedback information is used to reflect that the opening verification fails due to the failure of the application usage limit verification;
[0020] If the absolute time interval is greater than the authorization validity period, and the relative time interval is less than or equal to the application usage limit duration, third feedback information is fed back through the RunVerify interface, wherein the third feedback information is used to reflect that the opening verification failed due to the failure of the authorization limited period verification;
[0021] If the relative time interval is greater than the application usage restriction duration, and the absolute time interval is greater than the authorization validity period, fourth feedback information is fed back through the RunVerify interface, wherein the fourth feedback information is used to reflect that the opening verification failed because both the application usage restriction duration and the authorization validity period failed to be verified.
[0022] The verification method of the application signature, wherein the method further comprises:
[0023] When the second feedback information is received, a prompt is provided to reinstall the application program.
[0024] The verification method of the application signature, wherein the method further comprises:
[0025] When the third feedback information or the fourth feedback information is received, a prompt is provided to re-sign the application and then re-install the application.
[0026] The verification method for the application signature, wherein the authorization validity period is greater than the application usage restriction duration.
[0027] The said application signature verification method, wherein, when the said debugging type application is opened, the signature information of the application and the current system time are obtained, the said method further comprises:
[0028] When receiving an opening operation for an application, obtaining a version type of the application;
[0029] When the version type is debug type, the operation of obtaining the signature information of the application and the current system time is performed;
[0030] When the version type is a release type, the application is launched in response to the opening operation.
[0031] A second aspect of the present application provides a verification device for an application signature, wherein the verification device for an application signature specifically includes:
[0032] The acquisition module is used to obtain the signature information of the application and the current system time when opening a debugging type application;
[0033] A calling module, used to call the signature information and the current system time to the signature verification module in the package management module, wherein the signature information includes the installation time of the application;
[0034] A verification module, used to perform an opening verification through a signature verification module based on the signature information and the current system time;
[0035] The opening module is used to open the application when the opening verification passes.
[0036] The verification device for the application signature, wherein the verification module is specifically used for:
[0037] Input the signature information and the current system time into the RunVerify interface in the signature verification module; call the open verification program through the RunVerify interface, and calculate the relative time interval between the installation time and the current system time through the open verification program; if the relative time interval is less than or equal to the application restriction usage time, feedback first feedback information through the RunVerify interface, wherein the first feedback information is used to reflect that the open verification is passed; if the relative time interval is greater than the application restriction usage time, feedback second feedback information through the RunVerify interface, wherein the second feedback information is used to reflect that the open verification fails due to the failure of the application restriction usage time verification.
[0038] The verification device for the application signature, wherein the verification module is specifically used for:
[0039] Input the signature information and the current system time into the RunVerify interface in the signature verification module; call the open verification program through the RunVerify interface, and use the open verification program to calculate the relative time interval between the installation time and the current system time, and the absolute time interval between the signature time and the current system time; if the relative time interval is less than or equal to the application restriction usage time, and the absolute time interval is less than or equal to the authorization limit period, feedback the first feedback information through the RunVerify interface, wherein the first feedback information is used to reflect that the open verification is passed; if the relative time interval is greater than the application restriction usage time, and the absolute time interval is less than or equal to the authorization limit period, feedback the second feedback information through the RunVerify interface, wherein the second feedback information is used to reflect that the open verification fails due to the failure of the application restriction usage time verification; if the absolute time interval is greater than the authorization validity period, and the relative time interval is less than or equal to the application restriction usage time, feedback the third feedback information through the RunVerify interface, wherein the third feedback information is used to reflect that the open verification fails due to the failure of the authorization validity period verification; if the relative time interval is greater than the application restriction usage time, and the absolute time interval is greater than the authorization validity period, feedback the third feedback information through the RunVerify interface, wherein the third feedback information is used to reflect that the open verification fails due to the failure of the authorization validity period verification; The ify interface feeds back fourth feedback information, wherein the fourth feedback information is used to reflect that the opening verification failed because both the application restriction usage time and the authorization validity period failed to pass the verification.
[0040] The verification device for the application signature, wherein the verification device for the application signature further comprises:
[0041] The first prompt module is used to prompt to reinstall the application program when receiving the second feedback information.
[0042] The verification device for the application signature, wherein the verification device for the application signature further comprises:
[0043] The second prompt module is used for prompting the application to be re-signed and then reinstalled when receiving the third feedback information or the fourth feedback information.
[0044] The verification device for the application signature, wherein the authorization validity period is greater than the application usage restriction duration.
[0045] The verification device for the application signature, wherein the verification device for the application signature further comprises:
[0046] A version type acquisition module, used for acquiring the version type of the application when receiving an opening operation for the application;
[0047] An execution module, used for executing an operation of obtaining the signature information of the application and the current system time when the version type is a debugging type;
[0048] A response module is used to respond to the opening operation to launch the application when the version type is a release type.
[0049] A third aspect of the present application provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in any of the above-described application signature verification methods.
[0050] A fourth aspect of the present application provides a terminal device, comprising: a processor and a memory;
[0051] The memory stores a computer-readable program executable by the processor;
[0052] When the processor executes the computer-readable program, the processor implements the steps in any of the above-mentioned application signature verification methods.
[0053] Beneficial effects: Compared with the prior art, the present application provides a method, device, equipment and storage medium for verifying application signatures, the method comprising: when opening a debugging type application, obtaining the application's signature information and current system time, wherein the signature information includes the application's installation time; calling the signature information and the current system time to a signature verification module in a package management module; performing an opening verification through the signature verification module based on the signature information and the current system time; and opening the application when the opening verification passes. When opening a debugging type application, the present application verifies the debugging device through the signature information and the current system time, so that when adding or replacing a debugging device, there is no need to digitally sign the application again, thereby better meeting debugging requirements and improving debugging efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0055] Figure 1 A flowchart of a method for verifying an application signature provided in an embodiment of the present application.
[0056] Figure 2 This is a schematic diagram of the working process of the package management module.
[0057] Figure 3 FIG. 4 is a flow chart of an implementation method of step S30 .
[0058] Figure 4 FIG. 4 is a flow chart of another implementation of step S30 .
[0059] Figure 5 A functional block diagram of an application signature verification device provided in an embodiment of the present application.
[0060] Figure 6 A functional block diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] The embodiments of the present application provide a verification method, device, equipment and storage medium for application signatures. To make the purpose, technical solution and effect of the present application clearer and more specific, the present application is further described in detail 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 application and are not used to limit the present application.
[0062] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0063] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0064] It should be understood that the sequence numbers and sizes of the steps in this embodiment do not mean the order of execution. The execution order of each process is determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0065] After research, it was found that currently, applications in the debugging stage generally bind debugging devices (for example, by binding the device identifier to the digital signature to bind the debugging device for the application in the debugging stage, etc.), and then debug the application through the bound debugging device. However, with the increase of application functions, more and more functions need to be debugged in the application, especially sometimes multiple debugging devices are needed for joint debugging. This may lead to the problem that the pre-bound device cannot meet the debugging requirements and a new debugging device is added, or a debugging device cannot meet the debugging requirements and the debugging device is replaced. At this time, the application needs to be digitally signed again, which affects the normal use of other debugging devices, and thus affects the debugging efficiency of the application.
[0066] In order to solve the above problems, in an embodiment of the present application, when a debugging type application is opened, the signature information and current system time of the application are obtained, wherein the signature information includes the installation time of the application; the signature information and the current system time are called to the signature verification module in the package management module; based on the signature information and the current system time, an opening verification is performed through the signature verification module; when the opening verification passes, the application is opened. When opening a debugging type application, the present application verifies the debugging device through the signature information and the current system time, so that when adding or replacing the debugging device, there is no need to digitally sign the application again, which can better meet the debugging needs and thus improve the debugging efficiency.
[0067] The application content is further explained below through the description of embodiments in conjunction with the accompanying drawings.
[0068] This embodiment provides a verification method for application signature, such as Figure 1 As shown, the verification method of the application signature includes:
[0069] S10. When opening a debugging type application, obtain the signature information of the application and the current system time, wherein the signature information includes the installation time of the application.
[0070] Specifically, a debugging type application refers to an application used by developers for self-testing and debugging, and the developer signs the application for debugging at the development end. That is, the electronic device is installed with the debugging type application and receives an opening operation for the debugging type application. To this end, when opening the debugging type application, before obtaining the signature information of the application and the current system time, the electronic device will first install the debugging type application, wherein the process of the electronic device first installing the debugging type application may include:
[0071] When an electronic device installs a debugging type application, a signature verification is performed on the application through a package management module; if the signature verification passes, the current system time of the electronic device on which the application is installed, the signature time of the application, and the authorization validity period of the profile authorization file of the application are obtained; a first time difference between the current system time and the signature time is calculated, and the calculated first time difference is compared with a first time threshold; when the first time difference is less than the first time threshold, whether the profile authorization file is expired is verified based on the authorization validity period; if the profile authorization file is not expired, the application is installed, and the installation time, the application package name of the application, and the authorization validity period are stored in a database as the installation information of the application, wherein the signature time and the authorization validity period are verified based on the current system time.
[0072] Furthermore, the application is a hap application formed by a debug signature. Specifically, the process of forming a hap application by a debug signature can be: compile the code into a hap package, and then debug the hap through the jar command to obtain a debug type application. Among them, when the hap is debugged and signed through the jar command, the application type will be configured for the application so that the application type of the application can be obtained when the application is installed. That is to say, when opening a debug type application, before obtaining the signature information of the application and the current system time, the method also includes:
[0073] When receiving an opening operation for an application, obtaining a version type of the application;
[0074] When the version type is debug type, the operation of obtaining the signature information of the application and the current system time is performed;
[0075] When the version type is a release type, the application is launched in response to the opening operation.
[0076] Specifically, the opening operation may be formed by clicking on the application, or by receiving an opening instruction sent by an external device, or by a calling instruction formed by other software in the electronic device, etc. The application is configured with a version type, wherein the version type is formed when the application is debugged and signed. For this reason, the application configures the version type only when it is a debug type, and when the version type of the application is obtained, if the version type is obtained, it means that the version type of the application is a debug type; if the version type is not obtained, it means that the version type of the application is a release type.
[0077] Furthermore, when the version type is a debug type, it means that the electronic device that responds to the opening operation needs to be verified to determine whether the electronic device can launch the application. When the version type is a distributed type, it means that the electronic device that uses the application does not need to be verified, and the opening operation can be directly responded to to launch the application.
[0078] S20. Call the signature information and the current system time to a signature verification module in a package management module.
[0079] Specifically, Figure 2 As shown, a signature verification module is provided in the package management module, and the signature verification module is used to verify the application, wherein a RunVerify interface and a RemoveDebugData interface are newly added in the signature verification module, and a debugging range verification function is configured in the hapVerify interface in the signature verification module, that is, the signature verification module in the package management module is configured with a hapVerify interface, a RunVerify interface and a RemoveDebugData interface; the hapVerify interface is used to verify the application when installing the application, and the verification of the application when installing the application includes signature verification and debugging range verification, and the debugging range verification is used to perform signature time verification and authorization time limit verification; the RunVerify interface is used to verify the application to be opened when opening the application; the RemoveDebugData interface is used to delete the installation information of the program to be uninstalled when uninstalling the application.
[0080] The implementation process of the hapVerify interface remains unchanged, only the interface logic of the hapVerify interface is changed. The modified interface logic can determine the application type according to the incoming application package name. If the application type is a release type, the verification passes and returns HAP_VERIFY_RELEASE_OK; if the application type is a debug type, a signature verification and a debug range verification are performed. If the verification fails, HAP_VERIFY_TIME_ERROR is returned and the application is not allowed to be opened; if the verification passes, HAP_VERIFY_OK is returned and the application is allowed to be opened. If an error occurs in searching the database, HAP_VERIFY_FIND_ERROR is returned and the application is not allowed to be opened.
[0081] The RunVerify interface is represented as int RunVerify(const std::string bundleName);
[0082] Function parameter: application package name bundleName.
[0083] Function return value:
[0084]
[0085] RUN_VERIFY_OK indicates that the application type is debug type, the usage time is limited and the verification has passed, and the application is allowed to be opened;
[0086] RUN_VERIFY_FIND_ERROR means that the database search based on the package name fails and the application cannot be opened;
[0087] RUN_VERIFY_TIME_ERROR indicates that the application type is debugging type, the validity period verification fails, and the application is not allowed to be opened;
[0088] RUN_VERIFY_RELEASE_OK indicates that the application type is a release type, there is no validity period, and the application is allowed to be opened.
[0089] The interface logic of the RunVerify interface is:
[0090] The application type is determined based on the incoming application package name. If the application type is a release type, the verification passes and RUN_VERIFY_RELEASE_OK is returned. If the application type is a debug type, the validity period verification is performed. If the verification fails, RUN_VERIFY_TIME_ERROR is returned and the application is not allowed to be opened. If the verification passes, RUN_VERIFY_OK is returned and the application is allowed to be opened. If an error occurs in searching the database, RUN_VERIFY_FIND_ERROR is returned and the application is not allowed to be opened.
[0091] How to use the RunVerify interface:
[0092] The package management module calls the RunVerify interface every time the application is opened, and adds relevant judgment logic based on the return value to control whether the opening is allowed, and if not allowed, a pop-up interface prompts that the application has exceeded the validity period.
[0093] The RemoveDebugData interface is represented by int RemoveDebugData(const std::stringbundleName)
[0094] Function parameter: application package name
[0095] Function return value:
[0096]
[0097] REMOVE_OK means the application type is debugging type and the database is deleted successfully;
[0098] REMOVE_FIND_ERROR means that the database search failed and you need to check whether the database is wrong;
[0099] REMOVE_DELETE_ERROR indicates that the application type is debugging type, and database deletion fails. You need to check whether the database is correct.
[0100] REMOVE_RELEASE_OK indicates that the application type is release type and the database does not need to be deleted;
[0101] The interface logic of the RemoveDebugData interface:
[0102] The application type is determined by searching the database based on the passed application package name. If REMOVE_FIND_ERROR is returned, it means that the database search failed. If it is a release type, REMOVE_RELEASE_OK is returned, and there is no need to delete the database. If it is a debug type, the database needs to be deleted. Returning REMOVE_OK means the deletion is successful, and returning REMOVE_DELETE_ERROR means the deletion failed.
[0103] How to use the RemoveDebugData interface:
[0104] The package management module calls this interface to delete the corresponding record in the database every time the application is uninstalled.
[0105] S30. Based on the signature information and the current system time, an opening verification is performed by a signature verification module.
[0106] Specifically, the signature information is saved in the local database of the electronic device when the application is installed, and the signature information is combined with the current system time to verify whether the electronic device meets the usage restrictions for debugging the application. In other words, the signature information and the current system time are used to verify whether the electronic device can debug the application.
[0107] In one implementation, the signature information only includes the installation time, such as Figure 3 As shown, the opening verification by the signature verification module based on the signature information and the current system time specifically includes:
[0108] S311, inputting the signature information and the current system time into the RunVerify interface in the signature verification module;
[0109] S312, calling the open verification program through the RunVerify interface, and calculating the relative time interval between the installation time and the current system time through the open verification program;
[0110] S313: If the relative time interval is less than or equal to the application usage limit duration, first feedback information is fed back through the RunVerify interface, wherein the first feedback information is used to reflect that the opening verification is passed;
[0111] S314: If the relative time interval is greater than the application usage limit duration, second feedback information is fed back through the RunVerify interface, wherein the second feedback information is used to reflect that the opening verification fails due to the failure of the application usage limit duration verification.
[0112] Specifically, the relative time interval refers to the interval between the installation time and the current system time, which is used to reflect the usage time of the electronic device using the application. The application limit usage time is pre-set, which is the usage time that the electronic device can use the application. To this end, after obtaining the relative time interval, the relative time interval is compared with the application limit usage time. If the relative time interval is less than or equal to the application limit usage time, it means that the electronic device can continue to use the application. If the relative time interval is greater than the application limit usage time, it means that the electronic device cannot continue to use the application. In this way, the usage time can be limited to restrict the electronic device, which can prevent debugging-type applications from being used indefinitely by electronic devices.
[0113] Of course, in actual applications, a whitelist of electronic devices can also be set in advance. Before performing an opening verification through the signature verification module based on the signature information and the current system time, the device identification of the electronic device can be obtained first, and then the obtained device identification input can be checked to see if it is included in the whitelist of electronic devices. If it is included in the whitelist of electronic devices, it means that the electronic device is an authorized device, and it directly responds to the opening operation to launch the application; conversely, if it is not included in the whitelist of electronic devices, it means that the electronic device is a temporary device, and an opening verification is performed on the electronic device. In this way, there is no need to re-sign the application when a new electronic device is added, and opening verification can be avoided for all electronic devices. The response efficiency of the application opening operation can be improved, which brings convenience to users.
[0114] In another implementation, the signature information may include the signing time and the installation time, such as Figure 4 As shown, the signature information also includes the signature time, and the opening verification by the signature verification module based on the signature information and the current system time specifically includes:
[0115] S321, inputting the signature information and the current system time into the RunVerify interface in the signature verification module;
[0116] S322, calling the open verification program through the RunVerify interface, and calculating the relative time interval between the installation time and the current system time, and the absolute time interval between the signature time and the current system time through the open verification program;
[0117] S323: If the relative time interval is less than or equal to the application usage limit duration, and the absolute time interval is less than or equal to the authorization limit period, feedback first feedback information through the RunVerify interface, wherein the first feedback information is used to reflect that the opening verification is passed;
[0118] S324: If the relative time interval is greater than the application usage limit duration, and the absolute time interval is less than or equal to the authorization limit period, feedback second feedback information is fed back through the RunVerify interface, wherein the second feedback information is used to reflect that the opening verification fails due to the failure of the application usage limit duration verification;
[0119] S325: If the absolute time interval is greater than the authorization validity period, and the relative time interval is less than or equal to the application usage restriction duration, feedback third feedback information is fed back through the RunVerify interface, wherein the third feedback information is used to reflect that the opening verification failed due to the failure of the authorization validity period verification;
[0120] S326. If the relative time interval is greater than the application usage restriction duration, and the absolute time interval is greater than the authorization validity period, fourth feedback information is fed back through the RunVerify interface, wherein the fourth feedback information is used to reflect that the opening verification failed because both the application usage restriction duration and the authorization validity period failed to be verified.
[0121] Specifically, the verification process of the installation time is the same as that in the above-mentioned implementation method, and will not be repeated here. Of course, before performing the opening verification, the device identification of the electronic device can also be compared with the preset electronic device whitelist, and the details are also referred to the above description. Here, only the authorization validity period verification performed after the installation time verification is passed is described. The absolute time interval is the interval time between the signature time and the current system time, which is used to verify the validity of the application's signature. In other words, by comparing the absolute time interval with the authorization validity period, it is determined whether the digital signature of the application has expired, wherein, if the absolute time interval is greater than the authorization validity period, it means that the digital signature has expired; conversely, the absolute time interval is less than or equal to the authorization validity period, indicating that the digital signature has not expired.
[0122] In addition, in actual applications, applications are generally installed only after being signed, so the signing time will be earlier than the installation time, and the usage restrictions are generally within the validity period of the signature, so in the embodiments of the present application, the authorization validity period is greater than the application limit usage time, so that the use of applications within the validity period of the signature can be restricted. Of course, in actual applications, applications that have been signed for a long time will also be installed and used by electronic devices, so the embodiments of the present application perform double verification by applying the limit usage time and the authorization validity period, which not only restricts the use of electronic devices, but also prevents the use of applications with expired signatures of electronic devices.
[0123] S40: When the opening verification passes, the application is opened.
[0124] Specifically, when the opening verification passes, it means that the electronic device can open the application, and thus will respond to the opening operation to pull up the application. When the opening verification fails, the opening operation needs to be rejected. In addition, in order to facilitate the user to know the reason for rejecting the opening operation and how to operate so that the electronic device can respond to the opening operation. When the opening verification fails, the method will form a prompt message based on the feedback information. Specifically, when the second feedback information is received, it means that the usage time of the electronic device exceeds the application limit usage time, and at this time, you can be prompted to reinstall the application. When the third feedback information or the fourth feedback information is received, it means that the validity period of the application's signature has expired, and at this time, you can be prompted to re-sign the application and reinstall the application.
[0125] In summary, this embodiment provides a method for verifying application signatures, the method comprising: when opening a debugging type application, obtaining the application's signature information and current system time, wherein the signature information includes the application's installation time; calling the signature information and the current system time to a signature verification module in a package management module; performing an opening verification through the signature verification module based on the signature information and the current system time; and opening the application when the opening verification passes. When opening a debugging type application, the present application verifies the debugging device through the signature information and the current system time, so that when adding or replacing a debugging device, there is no need to digitally sign the application again, thereby better meeting debugging requirements and improving debugging efficiency.
[0126] Based on the above-mentioned verification method for application signature, this embodiment provides a verification device for application signature, such as Figure 5 As shown, the verification device for the application signature specifically includes:
[0127] The acquisition module 100 is used to acquire the signature information of the application and the current system time when opening a debugging type application;
[0128] A calling module 200, configured to call the signature information and the current system time to a signature verification module in a package management module, wherein the signature information includes the installation time of the application;
[0129] A verification module 300, configured to perform an opening verification through a signature verification module based on the signature information and the current system time;
[0130] The opening module 400 is used to open the application when the opening verification passes.
[0131] Based on the above-mentioned application signature verification method, this embodiment provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in the application signature verification method as described in the above-mentioned embodiment.
[0132] Based on the above application signature verification method, the present application also provides a terminal device, such as Figure 6 As shown, it includes at least one processor (processor) 20; display screen 21; and memory (memory) 22, and may also include a communications interface (Communications Interface) 23 and a bus 24. Among them, the processor 20, the display screen 21, the memory 22 and the communication interface 23 can communicate with each other through the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setting mode. The communication interface 23 can transmit information. The processor 20 can call the logic instructions in the memory 22 to execute the method in the above embodiment.
[0133] In addition, the logic instructions in the memory 22 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0134] The memory 22 is a computer-readable storage medium that can be configured to store software programs, computer executable programs, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes functional applications and data processing by running the software programs, instructions or modules stored in the memory 22, that is, implementing the methods in the above embodiments.
[0135] The memory 22 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 22 may include a high-speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, may also be a transient storage medium.
[0136] In addition, the specific process of loading and executing the multiple instruction processors in the above-mentioned storage medium and the terminal device has been described in detail in the above-mentioned method, and will not be described one by one here.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for verifying an application signature, characterized in that: The verification method of the application signature specifically includes: When opening a debug version of an application, obtaining the application's signature information and the current system time, wherein the signature information includes the application's installation time; Calling the signature information and the current system time to the signature verification module in the package management module; Based on the signature information and the current system time, an opening verification is performed by a signature verification module; When the opening verification passes, the application is opened.
2. The method for verifying application signature according to claim 1, characterized in that: The performing opening verification by the signature verification module based on the signature information and the current system time specifically includes: Input the signature information and the current system time into the RunVerify interface in the signature verification module; Calling the open verification program through the RunVerify interface, and calculating the relative time interval between the installation time and the current system time through the open verification program; If the relative time interval is less than or equal to the application restricted usage duration, first feedback information is fed back through the RunVerify interface, wherein the first feedback information is used to reflect that the opening verification is passed; If the relative time interval is greater than the application usage restriction duration, second feedback information is fed back through the RunVerify interface, wherein the second feedback information is used to reflect that the opening verification failed due to the failure of the application usage restriction duration verification.
3. The method for verifying application signature according to claim 1, characterized in that: The signature information also includes the signature time. The opening verification by the signature verification module based on the signature information and the current system time specifically includes: Input the signature information and the current system time into the RunVerify interface in the signature verification module; Calling the open verification program through the RunVerify interface, and calculating the relative time interval between the installation time and the current system time, and the absolute time interval between the signature time and the current system time through the open verification program; If the relative time interval is less than or equal to the application usage limit duration, and the absolute time interval is less than or equal to the authorization limit period, first feedback information is fed back through the RunVerify interface, wherein the first feedback information is used to reflect that the opening verification is passed; If the relative time interval is greater than the application usage restriction duration, and the absolute time interval is less than or equal to the authorization period, second feedback information is fed back through the RunVerify interface, wherein the second feedback information is used to reflect that the opening verification fails due to the failure of the application usage restriction verification; If the absolute time interval is greater than the authorization validity period, and the relative time interval is less than or equal to the application usage limit duration, third feedback information is fed back through the RunVerify interface, wherein the third feedback information is used to reflect that the opening verification failed due to the failure of the authorization limited period verification; If the relative time interval is greater than the application usage restriction duration, and the absolute time interval is greater than the authorization validity period, fourth feedback information is fed back through the RunVerify interface, wherein the fourth feedback information is used to reflect that the opening verification failed because both the application usage restriction duration and the authorization validity period failed to be verified.
4. The method for verifying an application signature according to claim 2 or 3, characterized in that: The method further comprises: When the second feedback information is received, a prompt is provided to reinstall the application program.
5. The method for verifying application signature according to claim 3, characterized in that: The method further comprises: When the third feedback information or the fourth feedback information is received, a prompt is provided to re-sign the application and then re-install the application.
6. The method for verifying application signature according to claim 3, characterized in that: The authorization validity period is greater than the application usage restriction duration.
7. The method for verifying application signature according to claim 1, characterized in that: When the debug version of the application is opened, before obtaining the signature information of the application and the current system time, the method further includes: When receiving an opening operation for an application, obtaining a version type of the application; When the version type is a debug version, the operation of obtaining the signature information of the application and the current system time is performed; When the version type is a release version, the application is launched in response to the opening operation.
8. A verification device for application signature, characterized in that: The application signature verification device specifically includes: The acquisition module is used to obtain the signature information of the application and the current system time when opening the debug version of the application; A calling module, used to call the signature information and the current system time to the signature verification module in the package management module, wherein the signature information includes the installation time of the application; A verification module, used to perform an opening verification through a signature verification module based on the signature information and the current system time; The opening module is used to open the application when the opening verification passes.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the application signature verification method as described in any one of claims 1-7.
10. A terminal device, characterized in that: include: Processor and memory; The memory stores a computer-readable program executable by the processor; When the processor executes the computer-readable program, the processor implements the steps in the application signature verification method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Software package certificateprotection method and device
CN103544411A
Android system application detection method based on software signatures and installation times
CN106650444A
Application safety processing method and device
CN107086977A
Software trial authority verification method
CN108256297A