CN111240735B - Application packaging method, application packaging device and storage medium - Google Patents

Application packaging method, application packaging device and storage medium Download PDF

Info

Publication number
CN111240735B
CN111240735B CN202010054431.1A CN202010054431A CN111240735B CN 111240735 B CN111240735 B CN 111240735B CN 202010054431 A CN202010054431 A CN 202010054431A CN 111240735 B CN111240735 B CN 111240735B
Authority
CN
China
Prior art keywords
apk
information
file
signature block
signature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010054431.1A
Other languages
Chinese (zh)
Other versions
CN111240735A (en
Inventor
饶福贵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202010054431.1A priority Critical patent/CN111240735B/en
Publication of CN111240735A publication Critical patent/CN111240735A/en
Application granted granted Critical
Publication of CN111240735B publication Critical patent/CN111240735B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Stored Programmes (AREA)
  • Storage Device Security (AREA)

Abstract

The disclosure relates to an application packaging method, an application packaging device and a storage medium. An application packaging method, comprising: determining an APK signature block; adding an identification value into the APK signature block, wherein the identification value comprises information to be added into the APK file; and generating an APK file containing the information. By the method and the device, the information is added into the APK file on the basis that the APK file structure is not changed, so that signature verification failure caused by the change of the APK file structure can be avoided.

Description

Application packaging method, application packaging device and storage medium
Technical Field
The disclosure relates to the technical field of application development, and in particular relates to an application packaging method, an application packaging device and a storage medium.
Background
Before an Application (APP) is released for use, signature verification is required for an Android (Android system) application package (Android application package, APK).
The signature verification process occurs in the process of packaging and installing the application into an APK package, and some auxiliary information, such as channel information, needs to be added in the process of packaging the application into the APK package. When auxiliary information is added to an APK file in the related technology, the auxiliary information is added to the directory of the APK file, so that the APK file structure is changed. However, the V3 signature scheme is introduced into the Android signature scheme, and in the V3 signature verification process, signature verification fails due to the change of the APK file structure added with the auxiliary information, and thus APK package installation fails.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides an application packaging method, an application packaging apparatus, and a storage medium.
According to a first aspect of embodiments of the present disclosure, there is provided an application packaging method, including:
determining an APK signature block; adding an identification value into the APK signature block, wherein the identification value comprises information to be added into the APK file; and generating an APK file containing the information.
In one embodiment, generating an APK file containing the information includes:
determining an existing identification value in the APK signature block; generating a new APK signature block based on the existing identification value and the identification value containing the information; and generating an APK file containing the information based on the new APK signature block.
In yet another implementation manner, the application packaging method related to the embodiment of the present disclosure further includes:
based on the new APK signature block, a central directory offset of the EOCD block is modified.
In yet another embodiment, the information includes one or more of channel information, compile time stamp information, version information, and the like.
In yet another embodiment, the determining an APK signature block includes:
determining an APK data digest according to a plurality of signature algorithms; assembling the APK data abstract, the digital certificate chain and the additional attribute to form an MF file; determining the digital signature of the MF file to form an SF file; and assembling the MF file, the SF file and a developer public key to form a V3 signature block.
According to a second aspect of embodiments of the present disclosure, there is provided an application packaging apparatus, including:
a determining unit for determining an APK signature block; the adding unit is used for adding an identification value in the APK signature block, wherein the identification value comprises information to be added into the APK file; and the generating unit is used for generating an APK file containing the information.
In one embodiment, the generating unit generates the APK file containing the information in the following manner:
determining an existing identification value in the APK signature block; generating a new APK signature block based on the existing identification value and the identification value containing the information; and generating an APK file containing the information based on the new APK signature block.
In another embodiment, the generating unit is further configured to: based on the new APK signature block, a central directory offset of the EOCD block is modified.
In yet another embodiment, the information includes one or more of channel information, compile time stamp information, version information, and the like.
In yet another embodiment, the determining unit determines the APK signature block in the following manner:
determining an APK data digest according to a plurality of signature algorithms; assembling the APK data abstract, the digital certificate chain and the additional attribute to form an MF file; determining the digital signature of the MF file to form an SF file; and assembling the MF file, the SF file and a developer public key to form a V3 signature block.
According to a third aspect of embodiments of the present disclosure, there is provided an application packaging apparatus, comprising:
a processor; a memory for storing processor-executable instructions;
wherein the processor is configured to: the application packaging method of the first aspect or any implementation manner of the first aspect is performed.
According to a fourth aspect of the disclosed embodiments, there is provided a non-transitory computer readable storage medium, which when executed by a processor of a mobile terminal, enables the mobile terminal to perform the application packaging method of the first aspect or any implementation of the first aspect.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects: the identification value containing the information to be added is added into the APK signature block, the identification value containing the added information is generated, and further, the information is added into the APK file on the basis that the APK file structure is not changed, and further, signature verification failure caused by the change of the APK file structure can be avoided.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flow chart illustrating an APK file installation method according to an exemplary embodiment.
Fig. 2 is a schematic diagram illustrating the structure of an APK signature block according to an exemplary embodiment.
FIG. 3 is a flowchart illustrating an application packaging method according to an exemplary embodiment.
Fig. 4 is a schematic diagram illustrating a determination process of a V3 signature block according to an exemplary embodiment.
Fig. 5 is a schematic diagram of a structure of a V3 signature block shown according to an exemplary embodiment.
FIG. 6 is a flowchart illustrating a method for application packaging to generate APK files according to an example embodiment.
Fig. 7 is an APK schematic diagram after adding channel information, according to an exemplary embodiment.
Fig. 8 is a V3 signature verification flow diagram shown in accordance with an exemplary embodiment.
Fig. 9 is a block diagram illustrating an application packaging apparatus according to an exemplary embodiment.
Fig. 10 is a block diagram illustrating a packaging apparatus for applications according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The application packaging method provided by the embodiment of the disclosure can be applied to an APK file installation scene. The APK file is installed in four ways:
and (3) system application installation: and the startup is completed without an installation interface.
Application installation of network download: completed by the market application, there is no installation interface.
ADB tool installation: there is no mounting interface.
Third party application installation: installation is performed through a package install. Apk application, and an installation interface is provided.
But in any way the APK file is installed, the main job of installation is accomplished through Package Manager Service.
When APK file installation is performed, signature verification is required, for example, verification of APK V3 signature blocks in Android 9.0 and higher. Fig. 1 is a schematic flow chart of an APK file installation method. Referring to fig. 1, after the APK file is opened, it is determined whether there is a V3 signature block in the APK file. If the V3 signature block exists in the APK file, signature verification is carried out by adopting a V3 signature block verification mode. If the verification of the V3 signature block verification mode is adopted, the APK file is installed, and if the verification of the V3 signature block verification mode is adopted, the APK file is canceled. If the APK file has no V3 signature block, judging whether the APK file has a V2 signature block or not. If the V2 signature block exists in the APK file, signature verification is carried out by adopting a V2 signature block verification mode. If the verification of the V2 signature block verification mode is adopted, the APK file is installed, and if the verification of the V2 signature block verification mode is adopted, the APK file is canceled. If the APK file has no V2 signature block, adopting a V1 signature block verification mode to carry out signature verification. If the verification of the V1 signature block verification mode is adopted, the APK file is installed, and if the verification of the V1 signature block verification mode is adopted, the APK file is canceled.
After the APK V3 signature verification scheme is introduced, in Android 9.0 and higher versions, signature verification can be performed in a manner shown in fig. 1 according to the APK signature scheme. Referring to fig. 1, the verification of APK is attempted sequentially from v3→v2→v1. In some scenarios, V3 signature verification is ignored, V2 signature verification is directly attempted, and V1 signature verification is performed finally.
The APK V3 signature verification process occurs in the process of application packaging into an APK package and installing, and some auxiliary information, such as channel information, needs to be added in the process of application packaging into the APK package. When auxiliary information is added to an APK file in the related technology, the auxiliary information is added to the directory of the APK file, so that the APK file structure is changed. However, the V3 signature scheme is introduced into the Android signature scheme, and in the V3 signature verification process, signature verification fails due to the change of the APK file structure added with the auxiliary information, and thus APK package installation fails. And in the APK V3 signature verification scheme, the V3 signature needs to be performed by taking the signing key, and if the signing key is not available, the V3 signature is difficult to sign again.
In the embodiment of the disclosure, an APK file packaging method is provided, so that an APK file is signed in a V3 signature mode under the condition that an original signature key is not available, and auxiliary information such as channel information and the like is written into the signed APK file. On the basis of not changing the original signature verification mode of the APK, the APK file can be normally verified and installed on the terminal above Android 9.
Fig. 2 is a schematic diagram of an APK signature block shown according to an example embodiment. Referring to fig. 2, an APK signature block includes a plurality of identification values (ID-values). Each ID-Value includes an ID of 4 bytes and corresponding data. The V3 signature block may be understood as a byte stream. For example, in fig. 2, there is first a signature block size of 8 bytes, which does not contain 8 bytes of the field itself. Secondly, a sequence formed by a plurality of ID-values, wherein each ID-Value comprises an ID of 4 bytes and corresponding data; then a signature block size of 8 bytes is again equal to the first 8 bytes. And finally a signature block modulus of 16 bytes. Wherein, value corresponding to ID 0xf05368c0 is the V3 signature block data.
Referring to fig. 2, the APK signature block includes a plurality of ID-values, so that if one ID-Value is newly added, the structure of the APK signature block is not affected. In view of this, in the embodiment of the present disclosure, an ID-Value containing information to be added is added to an original APK signature block, and then a new APK signature block is regenerated. And generating an APK file based on the new APK signature block, and adding information into the APK file on the basis of not changing the structure of the APK file, so that signature verification failure caused by the change of the structure of the APK file can be avoided.
Fig. 3 is a flowchart illustrating an application packaging method according to an exemplary embodiment, and as shown in fig. 3, the application packaging method is used in a terminal, and an operating system of the terminal is an android system. Referring to fig. 3, the following steps are included.
In step S11, an APK signature block is determined.
In the embodiment of the disclosure, an EOCD block of an APK file may be found, and then an APK signature block may be found according to an EOCD block central directory offset. The EOCD block may be understood as the real data storage area in the APK file. A signature block may be understood as a remark area in an APK file.
In step S12, an ID-Value is added to the APK signature block.
In the embodiment of the disclosure, a new ID-Value is additionally added to the APK signature block, where the additionally added new ID-Value includes information to be added to the APK file. For example, the information to be added to the APK file may be auxiliary information such as channel information. The information to be added to the APK file in the embodiments of the present disclosure may also be one or more items such as compile time stamp information, version information, and the like.
In step S13, an APK file containing the addition information is generated.
The identification value containing the information to be added is added into the APK signature block, the identification value containing the added information is generated, and further, the information is added into the APK file on the basis that the APK file structure is not changed, and further, signature verification failure caused by the change of the APK file structure can be avoided.
The process of generating an APK file by packing an application related to the above embodiment will be described in connection with practical applications.
The method and the device can be applied to a scene that the APK file is signed in a V3 signature mode and auxiliary information such as channel information is added to the signed APK file, so that the APK file can be normally checked and installed on a terminal above Android9 on the basis that the original signature verification mode of the APK is not changed.
The APK signature block determined in the embodiments of the present disclosure may be a V3 signature block. The determination of the V3 signature block will be described below.
Fig. 4 is a schematic diagram illustrating a determination process of a V3 signature block according to an exemplary embodiment. First, according to a plurality of signature algorithms, the data digests of the whole APK are calculated to form an APK data digest set, and the first row in the first column in FIG. 4. The APK data digest, digital certificate and additional attributes are then assembled to form an MF file similar to the V1 signature, e.g., the first row of the second column in fig. 4. Next, using the same private key that generated the MF file, a different signature algorithm, a digital signature of the MF file that resembles the V1 signature is calculated, forming an SF file that resembles the V1 signature, e.g., second row in the second column in fig. 4, and then assembling the MF-like file, SF-like file, and developer public key of the second column together into a V3 signature block, e.g., first row in the third column in fig. 4. Wherein the V3 signature block is formed after signing by a single keyure. In Android, a plurality of keys are allowed to be used for signing an APK file, so that a complete V3 signature block can be formed by assembling signature blocks signed by the plurality of keys.
In summary, the V3 signature block determined in the embodiment of the present disclosure is mainly composed of three parts, which are three data blocks in the second column in fig. 4: the structure of the MF-like file, SF-like file, and developer public key is shown in fig. 5.
After determining the APK signature block in the embodiments of the present disclosure, an ID-Value may be newly added to the APK signature block, where the newly added ID-Value includes information that needs to be added to the APK file. Such as channel information, etc. The channel information may be a channel number. The structure of the APK signature block to which the ID-Value containing the information to be added is newly added is shown in fig. 2.
In the embodiment of the disclosure, after the ID-Value containing the information to be added is newly added, the existing ID-Value in the APK signature block can be determined. And then generating a new APK signature block by using all the ID-Value in the APK signature block, the existing ID-Value and the ID-Value containing the information to be added. An APK file containing the joining information is generated based on the new APK signature block.
In the embodiment of the disclosure, an EOCD block of the APK may be obtained, and an APK file containing the added information is generated based on the EOCD block and the new APK signature block.
Further, in the embodiment of the present disclosure, since ID-Value is newly added to the APK signature block, the byte number of the new APK signature block is further changed, that is, the central directory offset of the EOCD block is changed. To align byte codes in embodiments of the present disclosure, a central directory offset of an EOCD block may be modified with a new APK signature block to determine the new APK signature block based on the modified central directory offset.
FIG. 6 is a flowchart illustrating a method for application packaging to generate APK files according to an example embodiment. Referring to fig. 6, the method includes: find EOCD blocks of APK. Finding an APK signature block. An existing ID-Value Pair is obtained.
An ID-Value containing channel information is added. A new signature block is generated based on all ID-values. Modifying the offset of the center directory of the EOCD (wherein modifying the center directory offset of the EOCD does not result in a data digest verification failure). And replacing the old signature block with the new signature block to generate the APK with channel information.
The channel information added to the APK file in the embodiments of the present disclosure may be a fixed ID value, for example, ID 0x4D494859.
In the embodiment of the disclosure, APK (small end mode) after channel information is added can be checked through a 16-system editor, as shown in fig. 7. In fig. 7, "6c 65, 6f 6e" is channel information leon. The first 4 bytes "FF 55 1188" are the newly added ID, and the first 8 bytes "08 00 00 00 00 00 00 00" are the length of ID-Value, which is just 8.
The APK file generated by the application packaging method provided by the embodiment of the disclosure supports the verification of the newly added V3 signature above 9.0.
In the embodiment of the disclosure, for the APK signature block to which the information is added, signature verification may be performed in a manner as shown in fig. 8. Referring to fig. 8, when APK signature verification is performed, an EOCD block may be found first, and a signature block may be found according to the offset of the central directory of the EOCD block, to verify whether the two signature block size fields are identical. If no V3 signature block is found in the embodiment of the present disclosure, a manner such as that shown in fig. 1 may be adopted to perform verification by adopting a manner of degrading signature verification, so as to perform V2 signature verification or V1 signature verification. After the V3 signature block is found in the embodiment of the present disclosure, a signature block with an ID of 0xf05368c0 may be found from the V3 signature block, so as to find the V3 signature block, and the signature blocks of other ID-Value Pair are ignored. When checking, selecting the strongest signature algorithm ID supported by the system from the SF digital signature list, and decrypting the digital signature in the SF signature block through the public key in the signature block. And comparing the decrypted digital signature with the data abstract in the MF file to check whether the abstract is modified. And comparing whether the signature algorithm ID in the MF file is consistent with the signature algorithm ID in the SF file. And comparing whether the public key in the digital certificate of the developer in the MF is consistent with the public key in the signature block. And comparing the data abstract of the calculated APK with the data abstract in the MF.
By means of the information adding mode of the APK file and the V3 signature verification mode, a V3 signature block of the APK is stored as an ID-Value Pair (ID-Value Pair), wherein the ID is 0xf05368c0, channel number information with the ID-Value Pair of 0x4D494859 is added to the APK of the V3 signature, and information such as channel numbers can be added to the APK file of the V3 signature when no signature key exists. And the information such as the channel number is added into the ID-Value, so that the information such as the channel number can be added quickly, and development cost and resource occupation are saved
Furthermore, in the embodiment of the disclosure, when Andoid9 verifies the V3 signed APK file package, two APK files without channels and with channel numbers can be mutually installed in a covering mode.
Based on the same conception, the embodiment of the disclosure also provides an application packaging device.
It may be understood that, in order to implement the above-mentioned functions, the application packaging apparatus provided in the embodiments of the present disclosure includes corresponding hardware structures and/or software modules that perform the respective functions. The disclosed embodiments may be implemented in hardware or a combination of hardware and computer software, in combination with the various example elements and algorithm steps disclosed in the embodiments of the disclosure. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application, but such implementation is not to be considered as beyond the scope of the embodiments of the present disclosure.
Fig. 9 is a block diagram of an application packaging apparatus, according to an example embodiment. Referring to fig. 9, the application packaging apparatus 100 includes a determination unit 101, an addition unit 102, and a generation unit 103.
A determining unit 101 for determining an APK signature block. An adding unit 102, configured to add an ID-Value to the APK signature block, where the ID-Value includes information to be added to the APK file. A generating unit 103, configured to generate an APK file containing the information.
In one embodiment, the generating unit 103 generates an APK file containing information in the following manner:
an existing ID-Value in the APK signature block is determined. Generating a new APK signature block based on the existing ID-Value and the ID-Value containing the information. And generating an APK file containing the information based on the new APK signature block.
In another embodiment, the generating unit 103 generates an APK file containing information based on the new APK signature block in the following manner:
the EOCD block of APK is determined. Based on the new APK signature block, the center directory offset of the EOCD block is modified. An APK file containing information is generated based on the EOCD block and the new APK signature block that modify the central directory offset.
In yet another embodiment, the information includes one or more of channel information, compile time stamp information, version information, and the like.
In yet another embodiment, the determining unit determines the APK signature block in the following manner:
and determining the APK data digest according to a plurality of signature algorithms. And assembling the APK data abstract, the digital certificate chain and the additional attribute to form an MF file. And determining the digital signature of the MF file to form the SF file. And assembling the MF file, the SF file and the developer public key to form a V3 signature block.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 10 is a block diagram illustrating an apparatus 200 for application packaging, according to an example embodiment. For example, apparatus 200 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 10, the apparatus 200 may include one or more of the following components: a processing component 202, a memory 204, a power component 206, a multimedia component 208, an audio component 210, an input/output (I/O) interface 212, a sensor component 214, and a communication component 216.
The processing component 202 generally controls overall operation of the apparatus 200, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 202 can include one or more modules that facilitate interactions between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate interaction between the multimedia component 208 and the processing component 202.
The memory 204 is configured to store various types of data to support operations at the device 200. Examples of such data include instructions for any application or method operating on the device 200, contact data, phonebook data, messages, pictures, videos, and the like. The memory 204 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power component 206 provides power to the various components of the device 200. The power components 206 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 200.
The multimedia component 208 includes a screen between the device 200 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 208 includes a front-facing camera and/or a rear-facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 200 is in an operational mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 210 is configured to output and/or input audio signals. For example, the audio component 210 includes a Microphone (MIC) configured to receive external audio signals when the device 200 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 204 or transmitted via the communication component 216. In some embodiments, audio component 210 further includes a speaker for outputting audio signals.
The I/O interface 212 provides an interface between the processing assembly 202 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 214 includes one or more sensors for providing status assessment of various aspects of the apparatus 200. For example, the sensor assembly 214 may detect the on/off state of the appliance 200, the relative positioning of the components, such as the display and keypad of the device 200, the sensor assembly 214 may also detect a change in position of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration/deceleration of the device 200, and a change in temperature of the device 200. The sensor assembly 214 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 214 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 216 is configured to facilitate communication between the apparatus 200 and other devices in a wired or wireless manner. The device 200 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 216 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 200 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 204, including instructions executable by processor 220 of apparatus 200 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
It is further understood that the term "plurality" in this disclosure means two or more, and other adjectives are similar thereto. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. The singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It is further understood that the terms "first," "second," and the like are used to describe various information, but such information should not be limited to these terms. These terms are only used to distinguish one type of information from another and do not denote a particular order or importance. Indeed, the expressions "first", "second", etc. may be used entirely interchangeably. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure.
It will be further understood that although operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (8)

1. An application packaging method, comprising:
determining an APK signature block, the signature block being a V3 signature block;
adding an identification value into the APK signature block, wherein the identification value comprises information to be added into an APK file;
generating an APK file containing the information;
the generating an APK file containing the information includes:
determining an existing identification value in the APK signature block;
generating a new APK signature block based on the existing identification value and the identification value containing the information;
generating an APK file containing the information based on the new APK signature block;
the determining an APK signature block includes:
determining an APK data digest according to a plurality of signature algorithms;
assembling the APK data abstract, the digital certificate chain and the additional attribute to form an MF file;
determining the digital signature of the MF file to form an SF file;
and assembling the MF file, the SF file and a developer public key to form a V3 signature block.
2. The application packaging method of claim 1, further comprising:
based on the new APK signature block, a central directory offset of the EOCD block is modified.
3. The application packaging method according to any one of claims 1 to 2, wherein the information includes one or more of channel information, compile time stamp information, version information.
4. An application packaging apparatus, comprising:
a determining unit configured to determine an APK signature block, the signature block being a V3 signature block;
the determining unit determines an APK signature block in the following manner:
determining an APK data digest according to a plurality of signature algorithms;
assembling the APK data abstract, the digital certificate chain and the additional attribute to form an MF file;
determining the digital signature of the MF file to form an SF file;
assembling the MF file, the SF file and a developer public key to form a V3 signature block;
the adding unit is used for adding an identification value in the APK signature block, wherein the identification value comprises information to be added into an APK file;
a generating unit for generating an APK file containing the information;
the generating unit generates an APK file containing the information in the following manner:
determining an existing identification value in the APK signature block;
generating a new APK signature block based on the existing identification value and the identification value containing the information;
and generating an APK file containing the information based on the new APK signature block.
5. The application packaging apparatus of claim 4, wherein the generating unit is further configured to:
based on the new APK signature block, a central directory offset of the EOCD block is modified.
6. The application packaging apparatus according to any one of claims 4 to 5, wherein the information includes one or more of channel information, compile time stamp information, version information.
7. An application packaging apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: an application packaging method according to any one of claims 1 to 3.
8. A non-transitory computer readable storage medium, which when executed by a processor of a mobile terminal, causes the mobile terminal to perform the application packaging method of any one of claims 1 to 3.
CN202010054431.1A 2020-01-17 2020-01-17 Application packaging method, application packaging device and storage medium Active CN111240735B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010054431.1A CN111240735B (en) 2020-01-17 2020-01-17 Application packaging method, application packaging device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010054431.1A CN111240735B (en) 2020-01-17 2020-01-17 Application packaging method, application packaging device and storage medium

Publications (2)

Publication Number Publication Date
CN111240735A CN111240735A (en) 2020-06-05
CN111240735B true CN111240735B (en) 2023-11-28

Family

ID=70874622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010054431.1A Active CN111240735B (en) 2020-01-17 2020-01-17 Application packaging method, application packaging device and storage medium

Country Status (1)

Country Link
CN (1) CN111240735B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107980132A (en) * 2017-10-27 2018-05-01 福建联迪商用设备有限公司 A kind of APK signature authentications method and system
CN108196851A (en) * 2017-12-28 2018-06-22 腾讯科技(深圳)有限公司 Using dissemination method and device
CN108280341A (en) * 2016-12-30 2018-07-13 腾讯科技(深圳)有限公司 Channel number addition, installation kit method of calibration and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104346184A (en) * 2013-08-01 2015-02-11 中兴通讯股份有限公司 Application packaging device and application packaging method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108280341A (en) * 2016-12-30 2018-07-13 腾讯科技(深圳)有限公司 Channel number addition, installation kit method of calibration and device
CN107980132A (en) * 2017-10-27 2018-05-01 福建联迪商用设备有限公司 A kind of APK signature authentications method and system
CN108196851A (en) * 2017-12-28 2018-06-22 腾讯科技(深圳)有限公司 Using dissemination method and device

Also Published As

Publication number Publication date
CN111240735A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
CN113110852A (en) Firmware upgrading method and device and storage medium
CN111221559B (en) Application updating method, device, storage medium, terminal and server
CN111240694B (en) Application detection method, application detection device and storage medium
CN107766701B (en) Electronic equipment, dynamic library file protection method and device
KR101642019B1 (en) Method, apparatus, program, and recording medium of verifying terminal
CN110839073A (en) Method for acquiring push information, method and device for sending push information
CN115185717B (en) Interface calling method and device, electronic equipment and storage medium
CN109117144B (en) Page processing method, device, terminal and storage medium
CN107463372B (en) Data-driven page updating method and device
CN108153540B (en) System upgrading method, device, terminal and storage medium
CN111090463B (en) Resource identification method and device and computer storage medium
CN112804589A (en) System configuration method, device and storage medium of digital television
CN110008668B (en) Data processing method, device and storage medium
CN109885360B (en) Data processing method, device and storage medium
CN112114814A (en) Compiled file determining method and device and application program generating method and device
CN111240735B (en) Application packaging method, application packaging device and storage medium
CN116567057A (en) Application configuration method, device, equipment and storage medium
CN116208350A (en) Digital car key registration method, device and storage medium
CN109194639B (en) Message receiving and processing method, device, terminal and readable storage medium
CN108021808B (en) Account book security reinforcing method and device and electronic equipment
CN112860625A (en) Data acquisition method, data storage method, device, equipment and storage medium
CN112631695A (en) Data verification method and device, electronic equipment and storage medium
CN106407818B (en) Network packet encryption method and device
CN114995893B (en) Firmware management method, flash memory, host and storage medium
CN116760867B (en) Digital car key creation method, device, storage medium and system

Legal Events

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