Application signature method and system based on Android platform and electronic equipment

By introducing the collaborative work of the compilation server and the encrypted server on the Android platform, generating and using encrypted storage platform keys, the problem of platform keys being easily obtained illegally is solved, and the security of user data is improved.

CN119906545APending Publication Date: 2025-04-29FUJIAN LANDI COMMERCIAL EQUIPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411981627.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

In the existing Android platform, the platform key is placed directly in the source code, which is easily illegally obtained, resulting in threatening the security of user data.

Method used

The application signature method based on the Android platform is adopted to generate and use the platform key through the collaborative work of the compilation server and the encryptor server. The encryptor server generates and encrypts the storage platform key, and the compilation server transmits the application package to be signed to the encryptor server for signature to avoid external leakage of the platform key.

Benefits of technology

Effectively prevent platform keys from being illegally acquired, enhance user data security, and ensure the security and integrity of the application signature process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119906545A_ABST
    Figure CN119906545A_ABST
Patent Text Reader

Abstract

The invention discloses an application signature method and system based on an Android platform and electronic equipment. The method is used for an application signature system based on an Android platform, the application signature system comprises a compiling server and an encryption machine server, the compiling server is connected with the encryption machine server, and the method comprises the following steps: the encryption machine server generates a platform key; the compiling server obtains a to-be-signed application package from the to-be-compiled source code, generates a request instruction according to the to-be-signed application package, and sends the request instruction to the encryption machine server; the encryptor server obtains a target key from the platform key according to the request instruction, signs the to-be-signed application package based on the target key to obtain a signed application package, and sends the signed application package to a compiling server; and the compiling server generates a system application package according to the signature application package. The platform key can be prevented from being illegally acquired, so that the data security of a user is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of application signature, and in particular to an application signature method, system and electronic device based on an Android platform. Background Art

[0002] In the Android source code, there are many system applications signed by platformkey. These system applications have high permissions and can perform critical system-level operations.

[0003] In related technologies, the platformkey is placed directly in the Android source code. All developers who have access to the source code may leak the platformkey. If an illegal application obtains the platformkey signature and disguises itself as a system application through the platformkey signature, it may infringe on the user's data security and lead to serious consequences such as data leakage. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide an application signing method, system and electronic device based on the Android platform, which can prevent the platform key from being illegally obtained, thereby ensuring the data security of users.

[0005] In order to solve the above technical problems, a technical solution adopted by the present invention is: An application signing method based on an Android platform is used for an application signing system based on an Android platform, wherein the application signing system comprises a compiling server and an encryption machine server, wherein the compiling server is connected to the encryption machine server; the method comprises: The encryption machine server generates a platform key; The compiling server obtains the application package to be signed from the source code to be compiled, generates a request instruction according to the application package to be signed, and sends the request instruction to the encryption machine server; The encryption machine server obtains the target key from the platform key according to the request instruction, signs the application package to be signed based on the target key to obtain a signed application package, and sends the signed application package to the compilation server; The compile server generates a system application package according to the signed application package.

[0006] In order to solve the above technical problems, another technical solution adopted by the present invention is: An application signature system based on an Android platform comprises a compiling server and an encryption machine server, wherein the compiling server is connected to the encryption machine server; The compile server is used to: Obtaining an application package to be signed from the source code to be compiled, generating a request instruction according to the application package to be signed, and sending the request instruction to the encryption machine server; and Generate a system application package according to the signed application package sent by the encryption machine server; The encryption machine server is used for: Generate a platform key; and The target key is obtained from the platform key according to the request instruction, and the application package to be signed is signed based on the target key to obtain a signed application package, and the signed application package is sent to the compile server.

[0007] In order to solve the above technical problems, another technical solution adopted by the present invention is: An electronic device includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, each step in the above-mentioned application signing method based on the Android platform is implemented.

[0008] The beneficial effects of the present invention are as follows: in the compilation server, an application package to be signed is obtained from the source code to be compiled, and a request instruction is generated according to the application package to be signed. The encryption machine server obtains the corresponding target key according to the request instruction, and signs the application package to be signed based on the target key to obtain a signed application package. Finally, the compilation server generates a system application package according to the signed application package. The present application encrypts and stores the platform key in the encryption machine server, so the platform key cannot be obtained by the external environment, which can effectively prevent the platform key from being illegally obtained. At the same time, since the platform key cannot be obtained by the external environment, in order to avoid the inability to sign the system application when the source code is compiled, the compilation server interacts with the encryption machine server when compiling the source code, and the application package to be signed is placed in the encryption machine server for signature processing, so that the signing process does not need to extract the platform key from the encryption machine server, and the application signature can also be realized, effectively ensuring the user's data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 A flowchart of an application signing method based on an Android platform provided by an embodiment of the present invention; Figure 2 Another flow chart of an application signing method based on the Android platform provided by an embodiment of the present invention; Figure 3 An architecture diagram of an application signature system based on the Android platform provided by an embodiment of the present invention; Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention; Description of labels: 100. An application signature system based on the Android platform; 101. A compilation server; 102. An encryption machine server; 200. An electronic device; 201. A memory; 202. A processor. DETAILED DESCRIPTION

[0010] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. 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.

[0011] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0012] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0013] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0014] In the Android source code, there are many system applications signed by platformkey. The platformkey is placed directly in the Android source code, and all developers who can access the source code may leak the platformkey. If an illegal application obtains the platformkey signature and disguises itself as a system application through the platformkey signature, it may infringe on the user's data security and cause serious consequences such as data leakage.

[0015] In the related technology, if the platformkey is placed directly in the Android source code, the Android source code will use the build / make / target / product / security / platform key to sign the system application when compiling the image. However, the Android source code is a shared resource, and all developers who can access the source code can easily obtain the platformkey, which affects data security. However, if the platformkey is placed outside the Android source code, the Android source code will not be able to sign the system application when compiling the image, causing the system application signing to fail.

[0016] In order to solve the above problems, the present application provides an application signing method, system and electronic device based on the Android platform.

[0017] The embodiment of the present application provides an application signing method based on the Android platform, which is used for an application signing system based on the Android platform. The application signing system includes a compiling server and an encryption server, and the compiling server is connected to the encryption server. Figure 1 As shown, the method includes steps 110 to 140.

[0018] Step 110: The encryption machine server generates a platform key.

[0019] Step 120: The compilation server obtains the application package to be signed from the source code to be compiled, generates a request instruction according to the application package to be signed, and sends the request instruction to the encryption machine server.

[0020] Step 130: The encryption machine server obtains the target key from the platform key according to the request instruction, signs the application package to be signed based on the target key to obtain a signed application package, and sends the signed application package to the compilation server.

[0021] Step 140: The compiling server generates a system application package according to the signed application package.

[0022] In one embodiment of the present application, by modifying the script for implementing application signature in the source code to be compiled, the compilation server is connected to the encryption server when signing the application package to be signed, thereby signing the application based on the encryption server.

[0023] In one embodiment of the present application, the platform key generated by the encryption machine server is stored in encrypted form, that is, the platform key cannot be accessed from the external environment, thereby ensuring that the platform key is not leaked.

[0024] It can be seen from the above embodiments that in the compilation server, the application package to be signed is obtained from the source code to be compiled, and a request instruction is generated according to the application package to be signed. The encryption machine server obtains the corresponding target key according to the request instruction, and signs the application package to be signed based on the target key to obtain a signed application package. Finally, the compilation server generates a system application package based on the signed application package. The present application encrypts and stores the platform key in the encryption machine server, so the platform key cannot be obtained by the external environment, which can effectively prevent the platform key from being illegally obtained. At the same time, since the platform key cannot be obtained by the external environment, in order to avoid the inability to sign the system application when the source code is compiled, the compilation server interacts with the encryption machine server when compiling the source code, and the application package to be signed is placed in the encryption machine server for signature processing, so that the signing process does not need to extract the platform key from the encryption machine server, and the application signature can be realized, effectively ensuring the user's data security.

[0025] In one embodiment of the present application, the method in step 120 whereby the compiling server generates a request instruction according to the application package to be signed includes step 210 .

[0026] Step 210: The compile server determines the key name and file digest of the application package to be signed, and generates a request instruction according to the key name and file digest.

[0027] In one embodiment of the present application, the compilation server extracts the file digest, key name, and algorithm type of the application package to be signed from the source code to be compiled, generates a request instruction based on the extracted file digest, key name, and algorithm type, and connects to the encryption machine server while instructing the encryption machine server to sign the file digest. The file digest is a hash string. When the encryption machine server returns the signed application package, the algorithm type used for signing is synchronously returned to facilitate subsequent signature verification of the application package.

[0028] It can be seen from the above embodiment that a request instruction is generated based on the key name and file digest. The key name is used to indicate that the encryption machine server can obtain the specified platform key and sign the file digest to avoid transmitting the entire application and improve transmission efficiency.

[0029] In one embodiment of the present application, the method in step 210 in which the encryption machine server obtains the target key from the platform key according to the request instruction includes step 310.

[0030] Step 310: The encryption machine server obtains the target key from the platform key according to the key name.

[0031] It can be seen from the above embodiment that the encryption machine server obtains the specified platform key based on the key name uploaded by the compilation server. Since multiple platform keys may be stored in the encryption machine server, in order to avoid signature errors, the key name is used as the unique identifier of the platform key, thereby achieving accurate acquisition of the key.

[0032] In one embodiment of the present application, the target key includes an encrypted and stored platform private key. In step 130 , the encryption machine server signs the application package to be signed based on the target key to obtain a signed application package, and the method of sending the signed application package to the compilation server includes step 410 .

[0033] Step 410: The encryption machine server signs the file digest of the application package to be signed according to the platform private key to obtain a signature digest, and sends the signature digest to the compilation server to generate a signed application.

[0034] It can be seen from the above embodiments that the encryption machine server signs the file digest based on the encrypted and stored platform private key. While signing the application, it ensures that the platform private key will not be leaked, thereby preventing illegal applications from disguising system applications based on keys and improving security.

[0035] In one embodiment of the present application, the target key also includes a platform public key that matches the platform private key. After the encryption machine server obtains the target key from the platform key according to the request instruction in step 130, the method further includes step 510.

[0036] Step 510: The encryption machine server sends the platform public key to the compilation server.

[0037] It can be seen from the above embodiments that the platform public key is sent to the compilation server for publication, so as to be used in the signature verification process of the system application, thereby ensuring the security of the application.

[0038] In one embodiment of the present application, the method in step 140 for the compiling server to generate a system application package according to the signed application package includes step 610: Step 610: The compiling server packages and generates a system application package according to the signature digest and the platform public key.

[0039] It can be seen from the above embodiments that the system application package is generated based on the signature digest and the platform public key in the compilation server to avoid occupying the encryption machine server resources.

[0040] In one embodiment of the present application, the method in step 610 for the compiling server to generate a system application package according to the signature digest and the platform public key includes step 710: Step 710: The compiling server extracts the signature script from the source code to be compiled, and encapsulates the signature digest and the platform public key into a system application package according to the signature script.

[0041] It can be seen from the above embodiments that the signature summary and the platform public key are encapsulated by the signature script of the source code to be compiled to obtain a native system application package, thereby avoiding source code compilation failure.

[0042] In one embodiment of the present application, the method further includes step 810: Step 810: The compiling server adds the system application package to the source code to be compiled, and executes the compiling task based on the source code to be compiled including the system application package.

[0043] It can be seen from the above embodiments that by compiling the source code of the application signed by the encryption machine server, key protection can be achieved while also completing the application signature during source code compilation.

[0044] like Figure 2 As shown, in one embodiment of the present application, the above-mentioned application signing method based on the Android platform specifically includes the following steps: Step 1: The encryption machine server generates a platform key pair internally, the platform key pair includes a platform public key and a platform private key, wherein the platform private key is stored privately. This is equivalent to the above step 110.

[0045] Step 2: The compilation server extracts application information such as the file summary, algorithm type, and key name of the application package to be signed from the Android source code.

[0046] Step 3: The compile server generates a request instruction based on the file digest, algorithm type and key name to connect to the encryption server, which is equivalent to the above step 210.

[0047] Step 4: The encryption machine server receives the request instruction and obtains the specified platform key pair according to the key name in the request instruction, which is equivalent to the above step 310.

[0048] Step 5: The encryption server signs the file digest according to the acquired platform private key to obtain the signed file digest, which is equivalent to the above step 410.

[0049] Step 6: The encryption server sends the acquired platform public key, the signed file digest, and the algorithm type used for signing to the compilation server, which is equivalent to the above step 510.

[0050] Step 7: The compiling server encapsulates the signed file digest into a native application package according to the signature script in the Android source code to obtain a system application package, which is equivalent to the above step 710.

[0051] Step 8: The compiling server implements the mirror compilation of the Android source code based on the system application package, which is equivalent to the above step 810.

[0052] Please refer to Figure 3 Another embodiment of the present application provides an application signing system 100 based on the Android platform, including a compilation server 101 and an encryption machine server 102.

[0053] The compile server 101 is connected to the encryption machine server 102 .

[0054] Compile server 101 is used for: Obtain the application package to be signed from the source code to be compiled, generate a request instruction according to the application package to be signed, and send the request instruction to the encryption machine server; and generate a system application package according to the signed application package sent by the encryption machine server 102.

[0055] The encryption machine server 102 is used to: Generate a platform key; and obtain a target key from the platform key according to the request instruction, and sign the application package to be signed based on the target key to obtain a signed application package, and send the signed application package to the compilation server 101.

[0056] Among them, the compilation server and the encryption machine server respectively implement the corresponding contents in the above-mentioned application signing method based on the Android platform. The application signing method based on the Android platform has been disclosed in the above part and will not be repeated here.

[0057] Please refer to Figure 4 Another embodiment of the present application provides an electronic device 200, including a memory 201, a processor 202, and a computer program stored in the memory 201 and running on the processor 202. When the processor 202 executes the computer program, each step in the above-mentioned application signing method based on the Android platform is implemented.

[0058] In summary, the present invention provides an application signing method, system and electronic device based on the Android platform, in which the platform key is generated by the encryption machine server and encrypted and stored, so the platform key cannot be obtained by the external environment, and the platform key can be effectively prevented from being illegally obtained. At the same time, when the compilation server needs to sign the application package, the relevant data of the application package is transmitted to the encryption machine server for signing to obtain a signed application package, thereby avoiding the problem that the compilation server cannot sign the system application when the source code is compiled. The present application interacts with the encryption machine server when the compilation server compiles the source code, and places the application package to be signed in the encryption machine server for signature processing, so that the signing process does not need to extract the platform key from the encryption machine server, and the application signature can be realized, effectively ensuring the user's data security.

[0059] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An application signing method based on Android platform, characterized in that: An application signature system based on an Android platform, the application signature system comprising a compile server and an encryption machine server, the compile server being connected to the encryption machine server; the method comprising: The encryption machine server generates a platform key; The compiling server obtains the application package to be signed from the source code to be compiled, generates a request instruction according to the application package to be signed, and sends the request instruction to the encryption machine server; The encryption machine server obtains the target key from the platform key according to the request instruction, signs the application package to be signed based on the target key to obtain a signed application package, and sends the signed application package to the compilation server; The compile server generates a system application package according to the signed application package.

2. The method according to claim 1, characterized in that The compiling server generates a request instruction according to the application package to be signed, including: The compile server determines the key name and file digest of the application package to be signed, and generates a request instruction according to the key name and the file digest.

3. The method according to claim 2, characterized in that The encryption machine server obtains the target key from the platform key according to the request instruction, including: The encryption machine server obtains the target key from the platform key according to the key name.

4. The method according to claim 1, characterized in that The target key includes an encrypted and stored platform private key; The encryption machine server signs the application package to be signed based on the target key to obtain a signed application package, and sending the signed application package to the compilation server comprises: The encryption machine server signs the file digest of the application package to be signed according to the platform private key to obtain a signature digest, and sends the signature digest to the compilation server.

5. The method according to claim 4, characterized in that The target key also includes a platform public key that matches the platform private key; After the encryption machine server obtains the target key from the platform key according to the request instruction, it also includes: The encryption machine server sends the platform public key to the compilation server.

6. The method according to claim 5, characterized in that The compiling server generates a system application package according to the signed application package, comprising: The compile server generates a system application package by packaging according to the signature digest and the platform public key.

7. The method according to claim 6, characterized in that The compiling server generates a system application package according to the signature digest and the platform public key packaging, including: The compiling server extracts a signature script from the source code to be compiled, and encapsulates the signature summary and the platform public key into a system application package according to the signature script.

8. The method according to claim 1, characterized in that Also includes: The compiling server adds the system application package to the source code to be compiled, and performs a compiling task based on the source code to be compiled including the system application package.

9. An application signature system based on the Android platform, characterized in that: It includes a compiling server and an encryption machine server, wherein the compiling server is connected to the encryption machine server; The compile server is used to: Obtaining an application package to be signed from the source code to be compiled, generating a request instruction according to the application package to be signed, and sending the request instruction to the encryption machine server; as well as Generate a system application package according to the signed application package sent by the encryption machine server; The encryption machine server is used for: Generate platform key; as well as The target key is obtained from the platform key according to the request instruction, and the application package to be signed is signed based on the target key to obtain a signed application package, and the signed application package is sent to the compile server.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, each step of the application signing method based on the Android platform as described in any one of claims 1 to 8 is implemented.