Debugging system and debugging method of application program
By designing a mobile application debugging system including development end, cloud platform, application market and device end, the problem of high dependence on existing debugging methods is solved, and the device end is independently acquired and debugged applications, reducing dependence on the development end.
Patent Information
- Application Number
- CN202411439066.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-10-15
AI Technical Summary
The existing mobile application debugging methods rely heavily on the development side, and the device side needs to communicate with the development side to obtain the application signature, resulting in high dependence on the debugging process.
Design an application debugging system, including the development end, cloud platform, application market and device end. The cloud platform issues application certificates and profile authorization files, and signs the development side to generate hap packages, and reports them to the cloud platform. The device side obtains the debug version of the hap package through the cloud platform for debugging, verification and debugging.
Reduces the dependence of the application debugging process on the development side, and the device side can directly obtain the debug version of the hap package through the cloud platform for debugging, improving the independence and efficiency of debugging.
Smart Images

Figure CN119645816A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a debugging system and a debugging method for an application. Background Art
[0002] As the mobile Internet market continues to expand, a variety of mobile applications have appeared in people's daily lives. Therefore, the number of people engaged in mobile application development has gradually increased. The existing debugging method is generally that after the development of the application, the developer issues an application signature for the application and binds the device ID of the device to the application signature, and then debugs the application through the device. This means that each device needs to communicate with the developer to obtain the application signature, which makes application debugging heavily dependent on the developer.
[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 debugging system and a debugging method for an application program 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 debugging system for an application program, wherein the debugging system for the application program includes a development end, a cloud platform, an application market, and a device end;
[0006] The cloud platform is used to issue application certificates and profile authorization files for applications developed by the development end;
[0007] The development end is used to sign the application package data of the application and the profile authorization file based on the key pair stored therein and the application certificate to obtain the hap package of the application, and when the version type of the hap package is a release version, send the hap to the application market, and when the version type of the hap package is a debug version, send the hap package to the device end;
[0008] The application market is used to re-sign the hap package using the market certificate, and publish the re-signed hap package;
[0009] The device end is used to debug and verify the hap package, and debug the application program after the debugging and verification pass.
[0010] The debugging system for the application program, wherein the cloud platform is also used to issue a market certificate for the application market.
[0011] The application debugging system, wherein the specific process of the cloud platform for issuing an application certificate and a profile authorization file for an application developed by a development end includes:
[0012] Receive the application certificate generation request sent by the developer;
[0013] Respond to the application certificate generation request and issue an application certificate to the development end;
[0014] Obtaining a profile private key in a preset profile key pair, and performing a profile file signing on application information of the application based on the profile private key to obtain signed application information;
[0015] The signed application information and the preset profile signing certificate are packaged into p7b format to obtain a profile authorization file.
[0016] The debugging system of the application, wherein the generation process of the profile signature certificate specifically includes:
[0017] Generate a self-signed root certificate and issue an intermediate certificate through the root certificate;
[0018] Generate a profile key pair and use the intermediate certificate pair to issue a profile signing certificate.
[0019] The debugging system of the application, wherein the specific process of the device end for debugging and verifying the hap package includes:
[0020] Performing a first time verification on the hap packet based on the signature time of the hap packet and the current time of the first system;
[0021] If the first verification is passed, installing the application package data in the hap package to install the application program;
[0022] In response to the opening operation of the application, performing a second time check based on the second system current time at the response time and the usage limit time of the application;
[0023] If the second time verification passes, the application is started to debug the application.
[0024] The debugging system of the application program, wherein the device end is configured with a package management module, and the first time verification is performed by the package management module, and the specific process includes:
[0025] Obtain the current time of the first system that installs itself, the signing time of the application, and the authorization validity period of the authorization file;
[0026] Calculating a first time difference between the current time of the first system and the signing time;
[0027] Compare the first time difference with the first time threshold to perform signature time verification, and compare the first time difference with the authorization validity period to perform authorization validity period;
[0028] If both the signature time verification and the authorization validity period verification pass, the first time verification passes.
[0029] The debugging system of the application program, wherein the device end is configured with a package management module, and the second time verification is performed by the package management module, and the specific process includes:
[0030] For the opening operation of the application, the current time of the second system at the response time, the installation time of the application, the authorization validity period of the application, and the signing time of the application should be obtained;
[0031] If the second time difference between the current time of the second system and the installation time is less than the second time threshold, calculating the third time difference between the current time of the second system and the signing time;
[0032] When the third time difference is less than the authorization validity period, it is determined that the second time check passes.
[0033] A second aspect of the present application provides a method for debugging an application program, using the above-mentioned debugging system for the application program, wherein the method for debugging the application program specifically comprises:
[0034] The cloud platform issues application certificates and profile authorization files for applications developed by the developer.
[0035] The development end signs the application package data of the application and the profile authorization file based on the key pair stored therein and the application certificate to obtain a debugging hap package of the application;
[0036] The device performs debugging verification on the hap package, and debugs the application program after the debugging verification passes.
[0037] The debugging method of the application, wherein, after the debugging of the application is completed, the method further comprises:
[0038] The development end signs the debugged application package data and the profile authorization file based on the key pair stored therein and the application certificate to obtain a release hap package of the application;
[0039] The application market is used to re-sign the hap package with the market certificate and publish the re-signed hap package.
[0040] The debugging method for the application program, wherein the market certificate is issued by the cloud platform for the application market.
[0041] Beneficial effects: Compared with the prior art, the present application provides a debugging system and method for an application, wherein the debugging system for the application includes a development end, a cloud platform, an application market, and a device end; the cloud platform is used to issue an application certificate and a profile authorization file for the application developed by the development end; the development end is used to sign the application package data of the application and the profile authorization file based on the key pair stored therein and the application certificate to obtain the hap package of the application, and report the hap package of the application to the cloud platform; the application market is used to re-sign the hap package of the release version using the market certificate, and publish the re-signed hap package on the shelf; the device end is used to perform debugging verification on the hap package of the debug version, and debug the application after the debugging verification passes. The present application issues an application certificate for the application through the cloud platform, and the development end uploads the hap package to the cloud platform after generating the hap package, so that the device end cannot access the development end, but can obtain the hap package of the application through the cloud platform, reducing the dependence of the application debugging process on the development end. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] 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.
[0043] Figure 1 A functional block diagram of a debugging system for an application provided in an embodiment of the present application.
[0044] Figure 2 A flowchart of the working principle of the debugging system for the application provided in an embodiment of the present application.
[0045] Figure 3 Schematic diagram of the process of issuing application certificates for the cloud platform to the developer.
[0046] Figure 4 Schematic diagram of the process of verifying the application on the device side.
[0047] Figure 5 This is a flowchart of the first-time verification.
[0048] Figure 6 This is a flow chart of the second time verification. DETAILED DESCRIPTION
[0049] The embodiments of the present application provide a debugging system and a debugging method for an application. 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.
[0050] 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.
[0051] 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.
[0052] 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.
[0053] After research, it was found that as the mobile Internet market continues to expand, various mobile applications have appeared in people's daily lives. Therefore, the number of people engaged in mobile application development has gradually increased. The existing debugging method is generally that after the development of the application, the developer issues an application signature for the application and binds the device ID of the device to the application signature, and then debugs the application through the device. This means that each device needs to communicate with the developer to obtain the application signature, which makes application debugging heavily dependent on the developer.
[0054] In order to solve the above problems, a debugging system for an application is provided in an embodiment of the present application, and the debugging system for the application includes a development end, a cloud platform, an application market, and a device end; the cloud platform is used to issue an application certificate and a profile authorization file for the application developed by the development end; the development end is used to sign the application package data of the application and the profile authorization file of the application based on the key pair stored therein and the application certificate to obtain the hap package of the application, and report the hap package of the application to the cloud platform; the application market is used to re-sign the hap package of the release version using the market certificate, and publish the re-signed hap package on the shelf; the device end is used to debug and verify the hap package of the debug version, and debug the application after the debugging verification passes. The present application issues an application certificate for the application through the cloud platform, and the development end uploads the hap package to the cloud platform after generating the hap package, so that the device end cannot access the development end, but can obtain the hap package of the application through the cloud platform, reducing the dependence of the application debugging process on the development end.
[0055] The application content is further explained below through the description of embodiments in conjunction with the accompanying drawings.
[0056] This embodiment provides a debugging system for an application program, such as Figure 1 and Figure 2 As shown, the debugging system of the application includes a development end, a cloud platform, an application market and a device end, the development end communicates with the cloud platform, the cloud platform communicates with the application market and the device end, and the device end communicates with the application market. The development end is used to form the program code of the application, and send an application certificate application to the cloud platform to apply for an application certificate and a profile authorization file for the application through the application certificate application; the cloud platform is used to issue an application certificate and a profile authorization file for the application based on the application certificate application; the development end also signs the application package data of the application and the profile authorization file of the application based on the key pair stored therein and the application certificate to obtain the hap package of the application, and reports the hap package of the application to the cloud platform, so as to provide the application market with a release version of the hap package through the cloud platform, and provide the device end with a debug version of the hap package, so that the device end can directly obtain the debug version of the hap package through the cloud platform, and debug the corresponding application based on the hap package, without having to obtain the debug version of the application through the development end, thereby reducing the dependence of the application debugging process on the development end.
[0057] Furthermore, after the development end has written the application code of the application, it can apply for an application certificate and a profile authorization file for the application from the cloud platform. Specifically, the development end can send an application certificate generation request to the cloud platform, and apply for an application certificate and a profile authorization file for the application through the application certificate generation request, wherein the application certificate generation request can include configuration information of the application, and the configuration information can include a csr file, an application package name of the application, and version information, etc. The csr file is a certificate request file, which is used to request the cloud platform to issue an application certificate according to the public key in the key pair specified by the development end. The version information is used to reflect the version type of the application, wherein the version information can be a debug version or a release version, etc.
[0058] It should be noted that the application certificate generation request can be generated by the development end and sent to the cloud platform. For example, the development end first generates the application certificate generation request, and then sends the application certificate generation request to the cloud platform, so that the cloud platform issues the application certificate and profile authorization file to the development end based on the application certificate generation request; or, the cloud platform generates it itself based on the trigger operation formed by the development end. For example, the cloud platform pre-sets the issuance interface, the development end logs in to the cloud platform and uploads the locally stored configuration information through the issuance interface to trigger the cloud platform to generate the application certificate generation request by itself.
[0059] After receiving the application certificate generation request, the cloud platform will check whether the application certificate generation request carries a csr file. When the application certificate generation request carries a csr file, the application certificate is issued to the development end based on the csr file. When the application certificate generation request carries no csr file, the cloud platform generates a key pair for the application, and then uses the public key in the key pair to generate a key pair for the application. The csr file is a certificate request file, which is used to request the cloud platform to issue an application certificate according to the public key in the key pair specified by the development end. That is to say, the development end will generate a key pair and a csr file by itself before requesting the application certificate, and store the key pair and the csr file locally on the development end, so that when applying for an application certificate from the cloud platform, the csr file can be uploaded to the cloud platform. To this end, before receiving the application certificate generation request from the development end, the method may also include: when the development end forms an application, it will respond to the key generation operation performed by the developer in the die interface, generate a key pair and a csr file for the application, and store the key pair and the csr file locally on the development end.
[0060] Furthermore, when the application certificate generation request does not carry a csr file, the cloud platform is also used to generate a key pair and an application certificate for the development end. The cloud platform can randomly generate a key pair for the development end, or it can generate it based on the key information input by the development end. For example, the development end inputs the key information on the cloud platform, and then the cloud platform generates a key pair for the development end based on the key information. After the key pair is generated for the development end, the public key in the key pair will be used to issue an application certificate for the application. That is to say, generating a key pair and an application certificate for the development end specifically involves first generating a key pair for the development end, and then issuing an application certificate for the application based on the public key in the key pair generated by the development end. In addition, after the key pair is generated for the development end, a key pair storage file is generated based on the key pair, and the key pair storage file is fed back to the development end so that the development end stores the key pair, wherein the key pair storage file can be in p12 format.
[0061] In one implementation, if Figure 3 As shown, the specific process of the cloud platform for issuing application certificates and profile authorization files for applications developed by the development end includes:
[0062] H10, receiving the application certificate generation request sent by the development end;
[0063] H20, responding to the application certificate generation request, and issuing an application certificate for the development end;
[0064] H30. Obtain a profile private key in a preset profile key pair, and perform a profile file signing on the application information of the application based on the profile private key to obtain signed application information;
[0065] H40. Package the signature application information and the preset profile signature certificate into p7b format to obtain a profile authorization file.
[0066] Specifically, the application information may include the application package name and version information, etc., wherein the application information can be obtained by parsing the application certificate generation request. Of course, when the application certificate generation request does not include the application package name and version information, it can be obtained by sending an application information acquisition request to the development end. In an embodiment of the present application, the application certificate generation request includes the application package name and version information, so that when issuing an application certificate and a profile authorization file for an application based on the application certificate generation request, the application information can be obtained by directly parsing the application certificate generation request, without the need to communicate with the development end. This can reduce the time spent on communication and improve the efficiency of application signing on the one hand; on the other hand, it can also avoid signature failures or signature errors caused by communication anomalies.
[0067] When obtaining the application information of an application, the information content that needs to be included in the application information can be obtained based on the version information of the application. Specifically, when the version information of the application is a debug version, the application information includes the package name information of the application and the device information of the device end; when the version information of the application is a release version, the application information includes the package name information of the application. When the version information of the application is a debug version, the present application sets the device information of the device end in the application information so that the generated profile authorization file includes the device information of the device end. In this way, the device end that installs the signed application of the debug version can be restricted, thereby further improving the security of the signed application. Of course, it should be noted that the device information of the device end can be one or more.
[0068] Furthermore, the profile key pair and profile signing certificate are pre-generated and used to issue a profile authorization file for the application. For example, the generation process of the profile key pair and profile signing certificate can be:
[0069] Generate a self-signed root certificate and issue an intermediate certificate through the root certificate;
[0070] Generate a profile key pair and use the intermediate certificate to issue a profile signing certificate.
[0071] Specifically, the root certificate is self-signed, and the intermediate certificate is signed by the root certificate, which is used to issue a profile signing certificate for the application. The profile key pair is used as the key information of the profile authorization file to encrypt the profile authorization file. The profile key pair can be randomly generated or generated according to preset conditions, for example, the generation method of the profile key pair is given in advance, or the key information that the profile key pair needs to include is given in advance.
[0072] Further, the profile authorization file includes the signed application information and the profile signing certificate, wherein when the application is a debug version application, the profile authorization file may include the application package name, device identification, application level, signature validity period, and time limit information, etc. When the application is a debug version application, the profile authorization file may include the application package name, etc. That is to say, when the application is a debug version application, when the signed application information and the profile signing certificate are packaged into the p7b format, the application level, signature validity period, and time limit information, etc. may be obtained, and then the application information, application level, signature validity period, time limit information, and the profile signing certificate may be packaged into the p7b format. Among them, the signature validity period is used to reflect the limited period of the application certificate, and the time limit information is used to reflect the period of use of the application certificate that the device side can use, so as to verify the device side through the signature validity period and time limit information. Moreover, when the profile authorization file includes time limit information, the application information may not include the device information of the device end, so as to adopt the time limit information as the usage restriction condition of the application program. This can not only ensure that the debug version of the application program will not be used without restriction, but also avoid the need to apply for debugging permission for each device end. Even when a new device end is added, the application program needs to be re-signed, which brings convenience to users.
[0073] Further, after generating an application certificate and a profile authorization file for an application, the application certificate and the profile authorization file can be fed back to the development end in response to a download request from the development end, so that the development end can generate a hap package based on the key pair stored therein and the application package data of the application and the profile authorization file of the application by the application certificate. For example, after the cloud platform generates an application certificate and a profile authorization file for an application to be signed, the application certificate and the profile authorization file are recorded as a p7b file, wherein the p7b file can be configured with a file type, and the file type includes a debug type and a release type. The file type allows the developer to know the purpose of the p7b file, for example, when the file type is a debug type, it indicates that the p7b file is used to sign a debug version of the application, and when the file type is a release type, it indicates that the p7b file is used to sign a release version of the application.
[0074] Furthermore, when the development end signs the application package data of the application and the profile authorization file, it can configure the key pair storage file, p7b file and application certificate cer required for the signature, and then compile the application package data of the application based on the key pair storage file, p7b file and application certificate cer to generate a hap package with a signature. Specifically, when the configured p7b file is of debug type, a debug version of the hap package is generated for local installation and debugging, and the time range and validity period will be restricted based on the signature validity period and time limit information during installation; when the configured p7b file is of release type, a debug version of the hap package is generated for release.
[0075] Exemplarily, when signing the application package data of the application and the profile authorization file at the development end, a preset signing tool (e.g., hap-sign-tool.jar, etc.) may be used. Specifically, the application package data of the application, the key library file locally stored at the development end (used to store the key pair corresponding to the application certificate), the profile authorization file (which may include the original profile file, i.e., application information, etc., the profile signature and the profile signature certificate, etc.), and the application signature certificate file (which may include the root certificate, the intermediate certificate, and the application certificate) are signed by the signing tool to obtain a signed application package (i.e., the hap package).
[0076] After the development end forms the hap package of the application, the hap package is uploaded to the cloud platform, so that the hap package can be sent to the application market or downloaded by the device through the cloud platform. Specifically, for the hap package of the release version, the cloud platform will send the hap package of the release version to the application market, and for the hap package of the debug version, the cloud platform will respond to the download request of the device and send the hap package of the debug version to the device.
[0077] The application market will receive the release version of the hap package sent by the cloud platform, and use the market certificate to re-sign the release version of the hap package, and publish the re-signed hap package. The market certificate is issued by the cloud platform for the application market and is used as the source information of the application. When the application is installed on the device, it can serve as a credential of the legal source of the application, thereby improving the controllability of the application market.
[0078] The device sends a download request to the cloud platform to download the debug version of the application through the cloud platform, and after downloading the debug version of the application, the debug version of the application is debugged and verified, and the application is debugged after the verification passes. Figure 4 As shown, the specific process of the device end debugging and verifying the hap package includes:
[0079] S10, performing a first time verification on the hap packet based on the signature time of the hap packet and the current time of the first system;
[0080] S20, if the first time verification passes, installing the application package data in the hap package to install the application program;
[0081] S30, in response to the opening operation of the application, performing a second time check based on the second system current time at the response time and the usage limit time of the application;
[0082] S40: If the second time verification passes, start the application program to debug the application program.
[0083] Specifically, the first time verification is used for installation verification, and the second time verification is used for opening verification. The installation verification is used to verify the security and source of the application, and the opening verification is used to verify the debugging period. Among them, the first time verification and the second time verification are both performed through the package management module in the device end, and a signature verification module is deployed in the package management module. The RunVerify interface and the RemoveDebugData interface are newly added in the signature verification module, and the debugging range verification function is configured in the hapVerify interface in the signature verification module. In other words, the signature verification module in the package management module is configured with hapVerify interface, RunVerify interface and 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 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.
[0084] 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.
[0085] The RunVerify interface is represented as int RunVerify(const std::string bundleName);
[0086] Function parameter: application package name bundleName.
[0087] Function return value:
[0088] enumDBRunCode{
[0089] RUN_VERIFY_OK=0,
[0090] RUN_VERIFY_FIND_ERROR=-1,
[0091] RUN_VERIFY_TIME_ERROR=-2,
[0092] RUN_VERIFY_RELEASE_OK=-3,
[0093] };
[0094] 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;
[0095] RUN_VERIFY_FIND_ERROR means that the database search based on the package name fails and the application cannot be opened;
[0096] 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;
[0097] 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.
[0098] The interface logic of the RunVerify interface is:
[0099] 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.
[0100] How to use the RunVerify interface:
[0101] 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.
[0102] The RemoveDebugData interface is represented by int RemoveDebugData(const std::stringbundleName)
[0103] Function parameter: application package name
[0104] Function return value:
[0105] enum DBRemoveCode{
[0106] REMOVE_OK=0,
[0107] REMOVE_FIND_ERROR=-1,
[0108] REMOVE_DELETE_ERROR=-2,
[0109] REMOVE_RELEASE_OK=-3,
[0110] };
[0111] REMOVE_OK means the application type is debugging type and the database is deleted successfully;
[0112] REMOVE_FIND_ERROR means that the database search failed and you need to check whether the database is wrong;
[0113] REMOVE_DELETE_ERROR indicates that the application type is debugging type and the database deletion fails. You need to check whether the database is correct.
[0114] REMOVE_RELEASE_OK indicates that the application type is release type and the database does not need to be deleted;
[0115] The interface logic of the RemoveDebugData interface:
[0116] 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.
[0117] How to use the RemoveDebugData interface:
[0118] The package management module calls this interface to delete the corresponding record in the database every time the application is uninstalled.
[0119] For example, Figure 5 As shown, the verification process of the first time verification may include:
[0120] S11, obtaining the current time of the first system installing itself, the signing time of the application, and the authorization validity period of the authorization file;
[0121] S12, calculating a first time difference between the current time of the first system and the signing time;
[0122] S13, comparing the first time difference with the first time threshold to perform signature time verification, and comparing the first time difference with the authorization validity period to perform authorization validity period;
[0123] S14. If both the signature time verification and the authorization validity period verification are passed, the first time verification is passed.
[0124] Specifically, the first time threshold is used to verify the current system time. When the first time difference is less than the first time threshold, it means that the system time is correct and the application can continue to be installed. When the first time difference is greater than or equal to the first time threshold, it means that the system time is wrong, and the application is refused to be installed, that is, the application installation fails. The authorization validity period is used to verify whether the profile authorization file has expired. When the profile authorization file has expired, it means that the profile authorization file is in an unusable state and needs to be reissued for the application. The application is refused to be installed, that is, the application installation fails; when the profile authorization file has not expired, the application can continue to be installed.
[0125] The embodiment of the present application performs two checks when installing an application, namely a signature check and a debug range check. The security of the application is verified by the signature check, and the device side where the application is installed is checked by the debug range check. This ensures both the security of the application and the compliance of the device side where the application is installed.
[0126] For example, Figure 6 As shown, the verification process of the second time verification may include:
[0127] S21. For the opening operation of the application, the current time of the second system at the response time, the installation time of the application, the authorization validity period of the application, and the signing time of the application are obtained;
[0128] S22. If the second time difference between the current time of the second system and the installation time is less than the second time threshold, calculate the third time difference between the current time of the second system and the signing time;
[0129] S23: When the third time difference is less than the authorization validity period, it is determined that the second time check passes.
[0130] Specifically, the opening system time refers to the current system time when the opening operation is received, and the installation time, the authorization validity period of the application, and the signature time of the application can be obtained by reading the installation information of the application. That is, when the opening operation for the application is received, the current time of the second system is read to obtain the opening system time, and the corresponding installation information of the application is searched in the database according to the application package name to obtain the installation time of the application, the authorization validity period of the application, and the signature time of the application.
[0131] The second time difference is the installation time of the application on the device, which is used to reflect the usage time of the application on the device; the second time threshold is the limited usage time. To this end, the second time difference is compared with the second time threshold, so as to limit the usage time of the application on the device by the second time threshold, so as to avoid the debug version of the application being used by the device indefinitely, thereby limiting the device.
[0132] Furthermore, after the device uses the application program for a length of time that meets the requirements, the signature time will be verified again, that is, by verifying the third time difference between the system opening time and the signature time with the authorization validity period, thereby ensuring the validity of the digital signature and the validity of the profile authorization file, thereby further ensuring the security of the application program.
[0133] In summary, the present embodiment provides a debugging system for an application program, the debugging system for the application program comprising a development end, a cloud platform, an application market and a device end, the development end communicating with the cloud platform, the cloud platform communicating with the application market and the device end, the device end communicating with the application market, the development end being used to form a program code of an application program, and sending an application certificate application to the cloud platform to apply for an application certificate and a profile authorization file for the application program through the application certificate application; the cloud platform being used to issue an application certificate and a profile authorization file for the application program based on the application certificate application; the development end also signs the application package data of the application program and the profile authorization file based on the key pair stored therein and the application certificate to obtain a hap package of the application program, and reports the hap package of the application program to the cloud platform, so as to provide the application market with a release version of the hap package through the cloud platform, and provide the device end with a debug version of the hap package, so that the device end can directly obtain the debug version of the hap package through the cloud platform, and debug the corresponding application program based on the hap package, without having to obtain the debug version of the application program through the development end, thereby reducing the dependence of the application debugging process on the development end.
[0134] Based on the above application debugging system, the present application embodiment provides a method for debugging an application, using the above application debugging system, such as Figure 2 As shown, the debugging method of the application program specifically includes:
[0135] The cloud platform issues application certificates and profile authorization files for applications developed by the developer.
[0136] The development end signs the application package data of the application and the profile authorization file based on the key pair stored therein and the application certificate to obtain a debugging hap package of the application;
[0137] The device performs debugging verification on the hap package, and debugs the application program after the debugging verification passes.
[0138] The debugging method of the application, wherein, after the debugging of the application is completed, the method further comprises:
[0139] The development end signs the debugged application package data and the profile authorization file based on the key pair stored therein and the application certificate to obtain a release hap package of the application;
[0140] The application market is used to re-sign the hap package with the market certificate and publish the re-signed hap package.
[0141] The debugging method for the application program, wherein the market certificate is issued by the cloud platform for the application market.
[0142] 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.
[0143] 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 debugging system for an application, characterized in that: The debugging system of the application includes a development end, a cloud platform, an application market and a device end; The cloud platform is used to issue application certificates and profile authorization files for applications developed by the development end; The development end is used to sign the application package data of the application and the profile authorization file based on the key pair stored therein and the application certificate to obtain the hap package of the application, and report the hap package of the application to the cloud platform; The application market is used to re-sign the hap package of the released version using the market certificate, and publish the re-signed hap package on the shelves; The device end is used to perform debugging verification on the debug version of the hap package, and debug the application program after the debugging verification passes.
2. The application debugging system according to claim 1, characterized in that: The cloud platform is also used to issue a market certificate for the application market.
3. The application debugging system according to claim 1, characterized in that: The specific process of the cloud platform issuing application certificates and profile authorization files for applications developed by the developer includes: Receive the application certificate generation request sent by the developer; Respond to the application certificate generation request and issue an application certificate to the development end; Obtaining a profile private key in a preset profile key pair, and signing the application information of the application program with a profile file based on the profile private key to obtain signed application information; The signed application information and the preset profile signing certificate are packaged into p7b format to obtain a profile authorization file.
4. The application debugging system according to claim 3, characterized in that: The generation process of the profile signing certificate specifically includes: Generate a self-signed root certificate and issue an intermediate certificate through the root certificate; Generate a profile key pair and use the intermediate certificate pair to issue a profile signing certificate.
5. The application debugging system according to claim 1, characterized in that: The specific process of the device end for debugging and verifying the hap packet includes: Performing a first time verification on the hap packet based on the signature time of the hap packet and the current time of the first system; If the first verification is passed, installing the application package data in the hap package to install the application program; In response to the opening operation of the application, performing a second time check based on the second system current time at the response time and the usage limit time of the application; If the second time verification passes, the application is started to debug the application.
6. The application debugging system according to claim 5, characterized in that: The device end is configured with a package management module, and the first time verification is performed by the package management module, and the specific process includes: Obtain the current time of the first system that installs itself, the signing time of the application, and the authorization validity period of the authorization file; Calculating a first time difference between the current time of the first system and the signing time; Compare the first time difference with the first time threshold to perform signature time verification, and compare the first time difference with the authorization validity period to perform authorization validity period; If both the signature time verification and the authorization validity period verification pass, the first time verification passes.
7. The application debugging system according to claim 5, characterized in that: The device end is configured with a package management module, and the second time verification is performed by the package management module, and the specific process includes: For the opening operation of the application, the current time of the second system at the response time, the installation time of the application, the authorization validity period of the application, and the signing time of the application should be obtained; If the second time difference between the current time of the second system and the installation time is less than the second time threshold, calculating the third time difference between the current time of the second system and the signing time; When the third time difference is less than the authorization validity period, it is determined that the second time check passes.
8. A method for debugging an application, characterized in that: The debugging system of the application program according to any one of claims 1 to 7 is applied, wherein the debugging method of the application program specifically comprises: The cloud platform issues application certificates and profile authorization files for applications developed by the developer. The development end signs the application package data of the application and the profile authorization file based on the key pair stored therein and the application certificate to obtain a debugging hap package of the application; The device performs debugging verification on the hap package, and debugs the application program after the debugging verification passes.
9. The method for debugging an application according to claim 8, characterized in that: When the application debugging is completed, the method further includes: The development end signs the debugged application package data and the profile authorization file based on the key pair stored therein and the application certificate to obtain a release hap package of the application; The application market is used to re-sign the hap package with the market certificate and publish the re-signed hap package.
10. The method for debugging an application according to claim 8, characterized in that: The market certificate is issued by the cloud platform for the application market.
Citation Information
Patent Citations
Software package certificateprotection method and device
CN103544411A
Application signature method and device, equipment and storage medium
CN114629658A
Security system and method for applications
KR1020130093847A