An APK Installation Method and System

By launching the check and installation thread concurrently, the verification function is used to verify the APK's institutional digital certificate, solving the problem of checking and installation time in the existing technology, and achieving an improvement in installation speed.

CN113157283BActive Publication Date: 2025-07-22SHENZHEN UROVO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110371217.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-07
Publication Date
2025-07-22
Estimated Expiration
2041-04-07

AI Technical Summary

Technical Problem

During the installation process of existing APKs, the checking and installation stages take a long time, especially the slow disk writing speed, which leads to wasted CPU capabilities and the installation speed cannot be improved.

Method used

By launching the signature verification thread and installation thread concurrently, the verification function is used to verify the APK's institutional digital certificate. If successful, data writing and signature verification are carried out in parallel, using SGN certificate and hash signature, and the remaining CPU capabilities are used for the signature verification process.

Benefits of technology

The inspection and installation speed has been improved, and the installation speed has been increased by 20% to 40%, especially when large files have been saved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113157283B_ABST
    Figure CN113157283B_ABST
Patent Text Reader

Abstract

The present invention discloses an APK installation method and system. The method includes the following steps S1: At the start of installation, perform institutional verification on the institutional digital certificate of the APK through a verification function; S2: If the institutional verification is successful, concurrently start an installation thread to write the original data after decomposing the APK to the disk, and start a signature verification thread to perform signature verification on the original data signature of the APK through the verification function, thereby improving the speeds of the two stages of signature verification and installation respectively, increasing the installation speed by 20% to 40%, and the larger the APK, the more time is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of APK installation, and particularly to an APK installation method and system. Background Art

[0002] When major institutions purchase Android devices, they have many and high performance requirements for the Android system. For example, when installing an APK application, the faster the speed, the higher the score in the bidding. The existing APK application installation process is relatively complex and there are various optimization methods. Here, it is simplified into two major steps: signature verification and installation. Whether it is signature verification or installation first, the speed cannot be improved and it is time-consuming. Generally, the disk write takes longer, and the disk write speed is much slower than the CPU calculation speed, wasting the CPU's ability for a long time, which is obviously unreasonable. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide an APK installation method and system in view of the deficiencies of the prior art.

[0004] The technical solution adopted by the present invention to solve its technical problems is to construct an APK installation method, including the following steps:

[0005] S1: At the start of installation, perform institutional verification on the institutional digital certificate of the APK through a verification function;

[0006] S2: If the institutional verification is successful, concurrently start an installation thread to write the original data after decomposing the APK to the disk, and start a signature verification thread to perform signature verification on the original data signature of the APK through the verification function.

[0007] Preferably, in the APK installation method of the present invention, the institutional digital certificate is SGN; the original data signature is a hash signature.

[0008] Preferably, in the APK installation method of the present invention, step S2 includes: if the institutional verification is successful, force the verification function to output that the signature verification result is true to trigger the concurrent start of the installation thread and the signature verification thread.

[0009] Preferably, in the APK installation method of the present invention, step S2 further includes: if the institutional verification fails, start an abort installation thread to end the installation.

[0010] Preferably, in the APK installation method of the present invention, the method further includes S3: if the signature verification is successful, complete the installation.

[0011] Preferably, in the APK installation method of the present invention, the method further includes S4: if the signature verification fails, start an abort installation thread, uninstall the installed part, and end the installation.

[0012] The present invention also constructs an APK installation system, including:

[0013] An institution verification module, used to perform institution verification on the institution digital certificate of the APK through a verification function at the start of installation;

[0014] A thread concurrency module, used to concurrently start an installation thread and a signature verification thread when the institution verification is successful;

[0015] A signature verification thread, used to perform signature verification on the original data signature of the APK through the verification function;

[0016] An installation thread, used to write the original data after the APK is decomposed to the disk.

[0017] Preferably, in the APK installation system of the present invention, the institution digital certificate is SGN; the original data signature is a hash signature.

[0018] Preferably, in the APK installation system of the present invention, when the institution verification is successful, concurrently starting the installation thread and the signature verification thread includes:

[0019] When the institution verification is successful, force the verification function to output that the signature verification result is true to trigger the concurrent start of the installation thread and the signature verification thread.

[0020] Preferably, in the APK installation system of the present invention, the system further includes: an abort installation module and an abort installation thread;

[0021] The abort installation module is used to start the abort installation thread and end the installation when the institution verification fails; or to start the abort installation thread, uninstall the installed part, and end the installation when the signature verification fails.

[0022] By implementing the present invention, the following beneficial effects are obtained:

[0023] At the start of installation, the present invention performs institution verification on the institution digital certificate of the APK through a verification function. If the institution verification is successful, it concurrently starts an installation thread to write the original data after the APK is decomposed to the disk, and starts a signature verification thread to perform signature verification on the original data signature of the APK through the verification function, thereby improving the speed of each of the signature verification and installation phases, increasing the installation speed by 20% - 40%, and the larger the APK, the more time is saved. Description of the Drawings

[0024] The present invention will be further described below in conjunction with the accompanying drawings and embodiments. In the accompanying drawings:

[0025] Figure 1 is the flowchart of the installation thread of the present invention;

[0026] Figure 2 is the flowchart of the concurrent signature verification thread of the present invention;

[0027] Figure 3 is the flowchart of the installation thread suspension of the present invention;

[0028] Figure 4 is the module block diagram of the APK installation system of the present invention. Detailed Embodiment

[0029] For a clearer understanding of the technical features, objectives, and effects of the present invention, the detailed embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0030] It should be noted that the flowcharts shown in the accompanying drawings are only illustrative descriptions, not necessarily including all contents and operations / steps, nor necessarily executed in the described order. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined. Therefore, the actual execution order may change according to the actual situation.

[0031] The block diagrams shown in the accompanying drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0032] In the first embodiment, when installing an APK, the limit for improving the signature verification speed is the CPU, and the limit for improving the installation speed is the write speed of the disk (data partition). To avoid performance waste of the disk or CPU during the installation process, and since the disk write speed is slow and the write time is long, the installation should be carried out as early as possible without modifying the specific disk write code, allowing the signature verification process to utilize the remaining CPU capabilities of the system. Therefore, the present invention discloses an APK installation method, including the following steps:

[0033] Step S1: At the start of installation, perform institutional verification on the institutional digital certificate of the APK through a verification function. Among them, the institutional digital certificate is SGN, and the SGN file is very small, with a fast verification speed.

[0034] Step S2: If the institutional verification is successful, concurrently start the installation thread as shown in Figure 1 to write the original data after decomposing the APK to the disk, and start as shown in Figure 2The signature verification thread shown verifies the original data signature of the APK through the verification function. Among them, the original data signature is a hash signature.

[0035] In this embodiment, by concurrently starting the signature verification thread and the installation thread, the speeds of the signature verification and installation stages are improved respectively. The installation speed is increased by 20% - 40%, and the larger the APK, the more time is saved.

[0036] In this embodiment, as Figure 1 shown, when the installation starts, the CPU executes the verification function, which can verify the institutional digital certificate and the original data signature in sequence. When the institutional verification is successful, before verifying the original data signature, the verification function is forced to output that the signature verification result is true, that is, assuming the signature verification is successful. When the processor determines that the signature verification is successful, it triggers the concurrent start of the installation thread to write the original data after the APK is decomposed to the disk, and starts the signature verification thread to verify the original data signature of the APK through the verification function. It is equivalent that the started signature verification thread is transparent, and the signature verification process is carried out using the remaining CPU capacity of the system during the installation process.

[0037] In some embodiments, step S2 further includes: if the institutional verification fails, start the abort installation thread as Figure 3 shown to end the installation. Since the SGN is generally correct, the possibility of needing to abort the installation is almost zero, and the hit rate is very high. The installation process can be started in advance. In this way, the installation and signature verification can be parallel, and it does not prevent the original concurrent signature verification and concurrent installation.

[0038] In some embodiments, the method further includes:

[0039] Step S3: If the signature verification is successful, complete the installation, display that the installation is successful, and the installation ends.

[0040] Step S4: If the signature verification fails, start the abort installation thread as Figure 3 shown to abort the installation, display that the installation fails, uninstall the installed part, and end the installation.

[0041] The second embodiment, as Figure 4 shown, the present invention discloses an APK installation system, including:

[0042] An institutional verification module, used to perform institutional verification on the institutional digital certificate of the APK through the verification function at the start of the installation. Among them, the institutional digital certificate is SGN, and the SGN is very small, and the verification speed is fast.

[0043] A thread concurrency module, used to concurrently start the installation thread as Figure 1 shown and the signature verification thread as Figure 2 shown when the institutional verification is successful.

[0044] A signature verification thread for verifying the original data signature of the APK through a verification function; wherein, the original data signature is a hash signature.

[0045] An installation thread for writing the original data after the APK is decomposed to the disk; wherein, during the APK installation process, when the signature verification of the signature verification thread is successful, the installation is completed, and the installation success is displayed, and the installation ends.

[0046] In this embodiment, by concurrently starting the signature verification thread and the installation thread, the speeds of the two stages of signature verification and installation are respectively improved, the installation speed is increased by 20% - 40%, and the larger the APK is, the more time is saved.

[0047] In this embodiment, as Figure 1 shown, the installation starts, and the CPU executes the verification function, which can sequentially verify the institutional digital certificate and the original data signature. When the institutional verification is successful, before verifying the original data signature, the verification function is forced to output the signature verification result as true, that is, assuming the signature verification is successful. When the processor determines that the signature verification is successful, it triggers the concurrent start of the installation thread to write the original data after the APK is decomposed to the disk, and starts the signature verification thread to verify the original data signature of the APK through the verification function. It is equivalent that the started signature verification thread is transparent, and the signature verification process is carried out by using the remaining CPU capabilities of the system during the installation process.

[0048] In some embodiments, the system further includes: an abort installation module and an abort installation thread. The abort installation module is used to start the abort installation thread as Figure 3 shown when the institutional verification fails to end the installation; or, when the signature verification fails, it starts the abort installation thread as Figure 3 shown to abort the installation, display the installation failure, uninstall the installed part, and end the installation.

[0049] Since the SGN is generally correct, the possibility of needing to abort the installation is almost zero, and the hit rate is very high. The installation process can be started in advance. In this way, the installation and signature verification can be parallel, and it does not interfere with the original concurrent signature verification and concurrent installation.

[0050] By implementing the present invention, the following beneficial effects are obtained:

[0051] At the beginning of the installation, the present invention conducts institutional verification on the institutional digital certificate of the APK through a verification function. If the institutional verification is successful, installation threads are concurrently started to write the original data after the APK is decomposed to the disk, and a signature verification thread is started to conduct signature verification on the original data signature of the APK through the verification function, thereby improving the speeds of the signature verification and installation phases respectively, increasing the installation speed by 20% to 40%, and the larger the APK, the more time is saved.

[0052] It can be understood that the above embodiments only represent the preferred implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be construed as a limitation on the scope of the patent of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, the above technical features can be freely combined, and several modifications and improvements can also be made, all of which fall within the protection scope of the present invention. Therefore, all equivalent transformations and modifications made to the scope of the claims of the present invention shall fall within the scope covered by the claims of the present invention.

Claims

1. An APK installation method, characterized in that, Including the following steps: S1: At the start of installation, perform institutional verification on the institutional digital certificate of the APK through a verification function; S2: If the institutional verification is successful, force the verification function to output that the signature verification result is true, so as to trigger the concurrent start of the installation thread to write the original data after the APK is decomposed to the disk, and start the signature verification thread to perform signature verification on the original data signature of the APK through the verification function; S4: If the signature verification fails, start the installation abort thread, uninstall the installed part, and end the installation.

2. The APK installation method according to claim 1, characterized in that, The institutional digital certificate is SGN; the original data signature is a hash signature.

3. The APK installation method according to claim 1, wherein Step S2 further includes: If the institutional verification fails, start the installation abort thread and end the installation.

4. The APK installation method according to claim 1, characterized in that, The method further includes S3: If the signature verification is successful, complete the installation.

5. An APK installation system, characterized in that, Including: An institutional verification module, used to perform institutional verification on the institutional digital certificate of the APK through a verification function at the start of installation; A thread concurrency module, used when the institutional verification is successful, to force the verification function to output that the signature verification result is true, so as to trigger the concurrent start of the installation thread and the signature verification thread; A signature verification thread, used to perform signature verification on the original data signature of the APK through the verification function; An installation thread, used to write the original data after the APK is decomposed to the disk; An installation abort module and an installation abort thread, the installation abort module is used when the signature verification fails, to start the installation abort thread, uninstall the installed part, and end the installation.

6. The APK installation system according to claim 5, wherein, The institutional digital certificate is SGN; the original data signature is a hash signature.

7. The APK installation system according to claim 5, wherein The installation abort module is also used when the institutional verification fails, to start the installation abort thread and end the installation.

Citation Information

Patent Citations

  • Method, device and system for downloading and installation of installation package

    CN108108203A

  • APK (Android Package) security management and control method for Android intelligent equipment

    CN110851821A