CN112783512A - Application package processing method, device, equipment and storage medium - Google Patents

Application package processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112783512A
CN112783512A CN202110277904.9A CN202110277904A CN112783512A CN 112783512 A CN112783512 A CN 112783512A CN 202110277904 A CN202110277904 A CN 202110277904A CN 112783512 A CN112783512 A CN 112783512A
Authority
CN
China
Prior art keywords
resource
package
application
application program
file
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.)
Granted
Application number
CN202110277904.9A
Other languages
Chinese (zh)
Other versions
CN112783512B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110277904.9A priority Critical patent/CN112783512B/en
Publication of CN112783512A publication Critical patent/CN112783512A/en
Application granted granted Critical
Publication of CN112783512B publication Critical patent/CN112783512B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • 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)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses an application package processing method, device, equipment and storage medium, and belongs to the technical field of artificial intelligence. The embodiment of the application provides a method for automatically processing an application package, and on one hand, the full flow of application package processing is realized based on an automatic script without manual participation, so that the labor cost is greatly reduced, the processing efficiency is improved, and the accuracy of a processing result can be improved. On the other hand, after the application program package is decompressed, the resource files can be automatically analyzed in batches, the whole amount of resource files are analyzed, the resource files are not manually analyzed one by means of an analysis tool, the processing efficiency is greatly improved, the analysis result can reflect the condition of the whole application program package instead of the condition of a single resource file, the requirement of a user is met better, the user does not need to analyze the resource files one by one, and the manual analysis time is saved, so that the method is high in efficiency and good in applicability.

Description

Application package processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing an application package.
Background
The code of an application program is intended to run on a device, and usually needs to be compiled and then packaged into a file capable of being recognized and run by an operating system of the device, and the file capable of being recognized and run by the operating system is an application program package. Developers typically build code files or resource files of an application into an application package, which is distributed to other devices to enable the other devices to install the application or load resource files in the application.
At present, the application package processing method is usually implemented by a technician operating on a device to download an application package, decompress the application package, then the technician loads a single resource file in the application package by using an assettstudio tool, selects an analysis control, and analyzes the single resource file to display an analysis result in an interface. The relevant technician can perform manual analysis based on the displayed parsing result to know some conditions of the resource in the resource file. If the analysis result of the resource file is required to be recorded, manual recording is required, or export operation is manually carried out, and the analysis result of the resource file is exported to be an analysis document.
In the method, the AssetStudio tool is used for loading and analyzing a single resource file, if the comprehensive condition of a plurality of resource files in the application package needs to be obtained, related technical personnel are required to sequentially load and analyze each resource file through the AssetStudio tool, then manually record and analyze each resource file, and manually perform statistical analysis according to the records or analysis of the plurality of resource files, so that the condition of the resource files in the application package cannot be quickly known, and therefore, the method is low in processing efficiency, easy to make mistakes and poor in accuracy.
Disclosure of Invention
The embodiment of the application program package processing method, device and equipment and the storage medium can improve the processing efficiency and the accuracy of processing results. The technical scheme is as follows:
in one aspect, an application package processing method is provided, and the method includes:
acquiring an application program package based on an automation script, wherein the application program package comprises at least two resource files;
decompressing the application package based on the automation script to obtain the at least two resource files in the application package;
analyzing the header information of the at least two resource files obtained by decompression based on the automatic script, and extracting the file information of the at least two resource files from the header information, wherein the file information of one resource file is used for indicating the attribute of the resource included by the resource file;
and generating an analysis result of the application program package based on the automation script and the file information of the at least two resource files.
In some embodiments, the decompressing the application package to obtain the at least two resource files in the application package includes:
decompressing the application program package to obtain at least two encrypted resource files in the application program package;
and decrypting the at least two encrypted resource files to obtain the at least two resource files.
In one aspect, an application package processing apparatus is provided, the apparatus including:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring an application program package based on an automation script, and the application program package comprises at least two resource files;
the decompression module is used for decompressing the application program package based on the automation script to obtain the at least two resource files in the application program package;
the analysis module is used for analyzing the header information of the at least two resource files obtained by decompression based on the automatic script, and extracting the file information of the at least two resource files from the header information, wherein the file information of one resource file is used for indicating the attribute of the resource included by the resource file;
and the generation module is used for generating an analysis result of the application program package based on the automatic script and the file information of the at least two resource files.
In some embodiments, the decompression module is to:
decompressing the application program package to obtain at least two encrypted resource files in the application program package;
and decrypting the at least two encrypted resource files to obtain the at least two resource files.
In some embodiments, the file information of a resource file includes at least one of a resource name of a resource in the resource file, a type of the resource, a size of the resource, and a dependency relationship between any resource and other resources.
In some embodiments, the apparatus further comprises:
the determining module is used for determining the types of the at least two resource files according to the file names or the paths of the at least two resource files based on the automation script;
the acquisition module is further configured to acquire resource file information of the application package based on the automation script and based on the types of the at least two resource files, where the resource file information includes at least one of a proportion, a number, or a size of different types of resource files in the application package;
the generation module is used for generating an analysis result of the application package based on the file information of the at least two resource files and the resource file information.
In some embodiments, the obtaining module is to perform any one of:
responding to an application program package processing instruction triggered by the completion of the construction of any application program package, and acquiring the constructed application program package based on an automation script;
responding to an application program package processing instruction triggered by a processing operation on any application program package, and acquiring the application program package subjected to the processing operation based on an automation script;
and responding to the application program package processing instruction triggered at regular time, and acquiring the application program package constructed in the current period based on the automation script.
In some embodiments, the version of the application package is a first version; the analysis result of the application program package of the first version is a first analysis result;
the acquisition module is further used for acquiring a second analysis result of the application program package of the second version;
the device further comprises:
and the comparison module is used for comparing the first analysis result with the second analysis result to obtain difference information between the application program package of the first version and the application program package of the second version, wherein the difference information comprises at least one of differences among resource files, differences among resources or a range influenced by the resource differences.
In some embodiments, the apparatus further comprises:
and the sending module is used for responding to the analysis result indicating that the size of the application program package exceeds a first threshold value and sending early warning information.
In some embodiments, the apparatus further comprises:
and the first setting module is used for setting the downloading mode of the resource file of the first target type as a dynamic downloading mode according to the proportion of the resource files of different types in the application program package indicated by the analysis result, wherein the proportion of the resource file of the first target type is the largest in the proportion of the resource files of different types.
In some embodiments, the apparatus further comprises:
and the second setting module is used for setting the downloading mode of the resource file of the second target type as a dynamic downloading mode in response to the fact that the size of the resource file of the second target type indicated by the analysis result is larger than a second threshold value.
In one aspect, an electronic device is provided that includes one or more processors and one or more memories having stored therein at least one computer program that is loaded and executed by the one or more processors to implement various alternative implementations of the above-described application package processing method.
In one aspect, a computer-readable storage medium is provided, in which at least one computer program is stored, the at least one computer program being loaded and executed by a processor to implement various alternative implementations of the above-described application package processing method.
In one aspect, a computer program product or computer program is provided that includes one or more program codes stored in a computer-readable storage medium. The one or more processors of the electronic device can read the one or more program codes from the computer-readable storage medium, and the one or more processors execute the one or more program codes, so that the electronic device can execute the application package processing method of any one of the above-mentioned possible embodiments.
The embodiment of the application provides a method for automatically processing an application package, and on one hand, when the application package is processed, the processes of obtaining and decompressing the application package, analyzing a resource file and generating an analysis result are realized based on an automatic script, the whole process is automated, manual participation is completely not needed, the labor cost is greatly reduced, the processing efficiency is improved, and the accuracy of the processing result can be improved. On the other hand, after the application program package is decompressed, the resource files can be automatically analyzed in batches, the whole amount of resource files are analyzed, the resource files are not manually analyzed one by one through an Assetstudio tool, the processing efficiency is greatly improved, an analysis result can be generated based on the analysis results of the resource files after the analysis, the analysis result can reflect the condition of the whole application program package and does not correspond to the condition of a single resource file, the analysis result can better meet the requirement of a user, the user does not need to analyze the resource files one by one, and the manual analysis time is saved, so that the method is high in efficiency and good in applicability.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to be able to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of an implementation environment of an application package processing method according to an embodiment of the present application;
fig. 2 is a flowchart of an application package processing method according to an embodiment of the present application;
fig. 3 is a flowchart of an application package processing method according to an embodiment of the present application;
FIG. 4 is a terminal interface provided in an embodiment of the present application;
FIG. 5 is a terminal interface provided in an embodiment of the present application;
FIG. 6 is a terminal interface provided in an embodiment of the present application;
FIG. 7 is a terminal interface provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of an application package processing apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 10 is a block diagram of a terminal according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The terms "first," "second," and the like in this application are used for distinguishing between similar items and items that have substantially the same function or similar functionality, and it should be understood that "first," "second," and "nth" do not have any logical or temporal dependency or limitation on the number or order of execution. It will be further understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first image can be referred to as a second image, and similarly, a second image can be referred to as a first image without departing from the scope of various described examples. The first image and the second image can both be images, and in some cases, can be separate and distinct images.
The term "at least one" is used herein to mean one or more, and the term "plurality" is used herein to mean two or more, e.g., a plurality of packets means two or more packets.
It is to be understood that the terminology used in the description of the various described examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various described examples and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and/or" is an associative relationship that describes an associated object, meaning that three relationships can exist, e.g., a and/or B, can mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the present application generally indicates that the former and latter related objects are in an "or" relationship.
It should also be understood that, in the embodiments of the present application, the size of the serial number of each process does not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It should also be understood that determining B from a does not mean determining B from a alone, but can also determine B from a and/or other information.
It will be further understood that the terms "Comprises," "Comprising," "inCludes" and/or "inCluding," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also understood that the term "if" may be interpreted to mean "when" ("where" or "upon") or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined." or "if [ a stated condition or event ] is detected" may be interpreted to mean "upon determining.. or" in response to determining. "or" upon detecting [ a stated condition or event ] or "in response to detecting [ a stated condition or event ]" depending on the context.
The following is a description of terms involved in the present application.
Unity 3D: a cross-platform game engine used for mobile games is used for developing mobile games.
AssetsBundle: the unit runs in a resource packaging file format of an android platform, and specific resource types such as a map, a grid model, a special effect resource and the like exist in a file package.
Android (Android) system: a smart phone system in which applications can be installed.
APK (Android application package): an application program compressed file which can be installed in an Android system. For example, an APK of an electronic game application contains files such as game resources and application code.
In some embodiments, the application can employ artificial intelligence techniques to automate the processing of application packages by the device. The artificial intelligence technique is briefly described below.
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human Intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making.
The artificial intelligence technology is a comprehensive subject and relates to the field of extensive technology, namely the technology of a hardware level and the technology of a software level. The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
With the research and progress of artificial intelligence technology, the artificial intelligence technology is developed and applied in a plurality of fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, unmanned aerial vehicles, robots, smart medical care, smart customer service, and the like.
The scheme provided by the embodiment of the application relates to technologies such as artificial intelligence cloud computing and automation, and is specifically explained by the following embodiment.
The following describes an embodiment of the present application.
Fig. 1 is a schematic diagram of an implementation environment of an application package processing method according to an embodiment of the present application. The implementation environment includes a terminal 101, or the implementation environment includes a terminal 101 and an application package processing platform 102. The terminal 101 is connected to the application package processing platform 102 through a wireless network or a wired network.
The terminal 101 can be at least one of a smart phone, a game console, a desktop computer, a tablet computer, an e-book reader, an MP3(Moving Picture Experts Group Audio Layer III, motion Picture Experts compression standard Audio Layer 3) player, an MP4(Moving Picture Experts Group Audio Layer IV, motion Picture Experts compression standard Audio Layer 4) player, and a laptop computer. The terminal 101 is installed and operated with an application program supporting application package processing, which can be, for example, a system application, an instant messenger application, a news push application, a shopping application, an online video application, a social application, an electronic game application, and the like.
Illustratively, the terminal 101 is capable of performing this task independently, and also of providing data services thereto via the application package processing platform 102. The embodiments of the present application do not limit this. Illustratively, the application package processing platform 102 is configured to process an application package, and when the terminal 101 requests the application package from the application package processing platform 102, the application package processing platform 102 is capable of distributing the processed application package to the terminal 101.
The application package processing platform 102 includes at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center. The application package processing platform 102 is used to provide background services for applications that are handled by the application package. Optionally, the application package processing platform 102 undertakes primary processing, and the terminal 101 undertakes secondary processing; or, the application package processing platform 102 undertakes the secondary processing work, and the terminal 101 undertakes the primary processing work; alternatively, the application package processing platform 102 or the terminal 101 can be separately provided with processing work. Alternatively, the application package processing platform 102 and the terminal 101 perform cooperative computing by using a distributed computing architecture.
Optionally, the application package processing platform 102 includes at least one server 1021 and a database 1022, where the database 1022 is used for storing data, and in this embodiment, the database 1022 can store an application package or an analysis result of the application package (e.g., an analysis result of multiple versions of the application package), so as to provide a data service for the at least one server 1021.
The server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, big data and artificial intelligence platform. The terminal can be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like.
Those skilled in the art will appreciate that the number of the terminals 101 and the servers 1021 can be greater or smaller. For example, the number of the terminals 101 and the servers 1021 may be only one, or the number of the terminals 101 and the servers 1021 may be several tens or several hundreds, or more, and the number of the terminals or the servers and the device types are not limited in the embodiment of the present application.
Fig. 2 is a flowchart of an application package processing method provided in an embodiment of the present application, where the method is performed by an electronic device, where the electronic device is a terminal or a server, and referring to fig. 2, the method includes the following steps.
201. The electronic equipment responds to the automation script based application program package, and the application program package comprises at least two resource files.
When the resource of the application program needs to be issued to the client, the related technical personnel pack the resource into a plurality of resource files and then compress the resource files and the application program code together to obtain the application program package. Of course, when the application package only includes the resource file, the application package may be obtained by compressing a plurality of resource files. After the application package is generated, the application package can be obtained, the resource files in the application package are analyzed, the package body of the application package can be optimized according to the analysis result, or different loading modes are adopted for different types of resources according to the analysis result, so that the benefit is improved, and the like.
In an embodiment of the present application, an automated Script is provided, wherein the Script (Script) is an executable file written according to a certain format using a specific descriptive language. The automatic script is a script capable of being automatically executed, manual participation is not needed, and the automatic script can be automatically executed when the execution condition is met. The automation script includes scripts required for the entire process flow of the application package processing.
In some embodiments, the app package may be that of a Unity 3D-based cell phone game.
202. And the electronic equipment decompresses the application program package based on the automation script to obtain the at least two resource files in the application program package.
The application package is obtained by compression, and when the resource file in the application package is required to be analyzed, the electronic device can decompress the application package, restore the resource file, and after the resource file is obtained, can analyze the resource file to determine the attribute of the resource in the resource file.
203. The electronic equipment analyzes the header information of the at least two resource files obtained by decompression based on the automatic script, and extracts the file information of the at least two resource files from the header information, wherein the file information of one resource file is used for indicating the attribute of the resource included by the resource file.
The resource file includes the resources included in the resource file and various attributes of the resources in the resource file. The electronic device may parse the resource file to obtain the attributes of the resources therein.
When the resource file is analyzed, based on the automation script, the electronic device can automatically analyze the decompressed resource file, that is, after the resource file is decompressed, an analysis flow in the automation script can be triggered to analyze the decompressed resource file. The analysis process is automatically carried out, the whole resource files can be checked in batches in a batch analysis process, manual individual analysis is not needed, the analysis efficiency can be greatly improved, and the processing efficiency of the application program package is improved.
In some embodiments, the entire process flow may include multiple stages, and each stage execution completion may continue with the next flow. For example, after the flow in the decompression phase is completed, the flow in the analysis phase can be continued.
204. And the electronic equipment generates an analysis result of the application program package based on the automation script and the file information of the at least two resource files.
After the electronic equipment analyzes the file information of each resource file, the automatic script can trigger the execution of the next process, and the resource analysis result of the whole application program package is analyzed and obtained based on the file information of each resource file obtained through analysis, wherein the resource analysis result is a result obtained through full analysis. For example, the application package may include which resources, the number, the occupied proportion, or the size of the different types of resources, and the like, and may further include the dependency relationship between the different resources in the application package, and the like.
In some embodiments, the overall resource distribution of the application package and the resource details of the application package can be obtained through the analysis result, and the analysis result may require a very large amount of work and is time-consuming to be analyzed manually, and the accurate analysis result may not be obtained through manual analysis.
The foregoing steps 201 to 204 can be implemented by an automation process, where an automation script may be stored in the electronic device, and the electronic device may obtain an application package based on the automation script, decompress the application package based on the automation script to obtain the at least two resource files in the application package, analyze the at least two resource files obtained by decompression in batch based on the automation script to obtain file information of the at least two resource files, and generate an analysis result of the application package based on the file information of the at least two resource files based on the automation script.
The embodiment of the application provides a method for automatically processing an application package, and on one hand, when the application package is processed, the processes of obtaining and decompressing the application package, analyzing a resource file and generating an analysis result are realized based on an automatic script, the whole process is automated, manual participation is completely not needed, the labor cost is greatly reduced, the processing efficiency is improved, and the accuracy of the processing result can be improved. On the other hand, after the application program package is decompressed, the resource files can be automatically analyzed in batches, the whole amount of resource files are analyzed, the resource files are not manually analyzed one by one through an Assetstudio tool, the processing efficiency is greatly improved, an analysis result can be generated based on the analysis results of the resource files after the analysis, the analysis result can reflect the condition of the whole application program package and does not correspond to the condition of a single resource file, the analysis result can better meet the requirement of a user, the user does not need to analyze the resource files one by one, and the manual analysis time is saved, so that the method is high in efficiency and good in applicability.
Fig. 3 is a flowchart of an application package processing method provided in an embodiment of the present application, and referring to fig. 3, the method includes the following steps.
301. The electronic equipment obtains an application program package based on the automation script, wherein the application program package comprises at least two resource files.
In the embodiment of the application, the electronic device can process the built application package through an automatic process so as to monitor the condition of resource files or resources in the application package.
The automatic process is realized through an automatic script, the automatic script can be stored in the electronic equipment, the automatic script can be automatically executed without manual participation, and when the condition that the triggering condition is met is detected, the automatic process can be executed to process the application program package.
In some embodiments, the application package processing procedure may include a plurality of triggering manners, that is, a triggering manner may be set for the application package processing flow, and the triggering condition may be understood as a triggering condition of the automation script. The triggering method may include multiple triggering methods, and a person skilled in the relevant art may select any one of the triggering methods according to a requirement, which is not limited in the embodiment of the present application.
Three triggering modes of the application package processing procedure are provided below.
The first triggering mode is as follows: a trigger is constructed.
In the first triggering manner, the step 301 may be: the electronic equipment responds to an application program package processing instruction triggered by the completion of the construction of any application program package, and acquires the constructed application program package based on the automation script. The construction triggering means that when the construction of the application package is completed, the electronic device can be triggered to acquire the constructed application package and perform a subsequent processing procedure.
And a second triggering mode: and (4) manually triggering.
In the second triggering manner, the step 301 may be: the electronic equipment responds to an application program package processing instruction triggered by a processing operation on any application program package, and acquires the application program package subjected to the processing operation based on an automation script. The manual triggering refers to that a user operates the application package to trigger the acquisition of the application package and subsequent processing procedures. If the user wants to analyze an application package, the application package may be selected and determined to be analyzed, and the electronic device may perform the obtaining step and subsequent processing steps.
A third triggering mode: and (5) triggering at fixed time.
In the third triggering manner, the step 301 may be: and the electronic equipment responds to the application program package processing instruction triggered at regular time and acquires the application program package constructed in the current period based on the automatic script. The timing trigger means setting a period, and the electronic device periodically acquires the application package once and processes the application package.
For the acquisition process of the application package, in some embodiments, the application package is typically built by a builder. Through setting, the electronic equipment can perform information interaction with the building machine so as to acquire the application program package which is built by the electronic equipment from the building machine. Specifically, the process of obtaining the application package from the building machine may be understood as a downloading process, that is, the electronic device may download the built application package from the building machine. In other embodiments, the application package may be stored in other electronic devices after being constructed, or in a database, and accordingly, the electronic device may also obtain the application package from other electronic devices or the database.
In some embodiments, the application package may be configured to run in an android operating system, that is, the application package may be an android application package, that is, an APK. Of course, the application package is not limited to an operating system to which the application package is applied, and for example, the application package may also be used to run in an IOS operating system.
302. And the electronic equipment decompresses the application program package based on the automation script to obtain the at least two resource files in the application program package.
After the electronic equipment acquires the application program package, the automation script triggers the next process, and the subsequent processing can be automatically carried out on the next process. During processing, since the application package is a compressed package, the electronic device cannot directly parse the resource file therein, and therefore, it needs to decompress the resource file.
In some embodiments, the resource file is usually encrypted and then compressed to obtain the application package, so that when the electronic device decompresses, the electronic device may decompress the encrypted resource file first and then decrypt the encrypted resource file to restore the encrypted resource file. Specifically, the step 303 may be: the electronic device may decompress the application package based on the automation script to obtain at least two encrypted resource files in the application package. The encrypted resource file is a file obtained by encrypting the resource file. The electronic device may then decrypt the at least two encrypted resource files to obtain the at least two resource files. The decrypted resource file is an unencrypted resource file.
In some embodiments, the decryption process may be implemented by a decryption tool, and the embodiment of the present application does not limit which decryption tool is specifically used.
In some embodiments, the resource file may be packaged based on a target packaging format. For example, the target packaging format may be AssetsBundle, and the resource file may also be referred to as an AssetsBundle file. Taking the application package as an APK as an example, the step 302 is to decompress the APK to obtain an encrypted AssetsBundle file, and then decode the encrypted AssetsBundle file to obtain an unencrypted AssetsBundle file.
303. And the electronic equipment determines the types of the at least two resource files according to the file names or the paths of the at least two resource files based on the automation script.
After the electronic device decompresses the at least two resource files, it may be initially processed to obtain the statistical result of the resource files, and the initial processing process may include this step 303 and the following step 304, which may be automatically triggered by the automation script after decompression. Specifically, the electronic device may determine the type of the resource file by using a file name or a path of the resource file, where the type may be set by a related technician according to a requirement, for example, a scene resource, a scene, a character, a weapon, a stranger, and the like, and for example, an audio, a video, a picture, a special effect, a shader, and the like, which is not limited in this embodiment of the application.
304. And the electronic equipment acquires the resource file information of the application program package based on the automatic script and the types of the at least two resource files, wherein the resource file information comprises at least one of the proportion, the quantity or the size of the resource files of different types in the application program package.
After the type of each resource file is determined, the electronic equipment can count the resource files of different types based on the type to obtain the resource file information, so as to analyze at least one of the proportion, the quantity or the size of the resource files of different types in the application package.
For example, the proportion of the different types of resource files, or the number of the different types of resource files, or the sizes of the different types of resource files may be analyzed. For another example, any two items of the three information may be analyzed, for example, the proportion and the number of different types of resource files in the application package. For another example, the above three kinds of information can be analyzed: the proportion, the number and the size of the resource files of different types in the application program package.
The step 303 and the step 304 are a process of classifying the at least two decompressed resources to obtain resource file information of the at least two resource files, and through the classification, distribution of different types of resource files in the application package can be determined, and a subsequent related technician can optimize a package body of the application package according to a classification result, for example, the proportion of scene resources is large, and the proportion of scene resources in the application package needs to be reduced subsequently.
For example, a specific example is provided, for example, by classifying the AssetsBundle file in the APK of a certain electronic game, as shown in fig. 4, after decompressing the APK and classifying the resulting AssetsBundle file, the size of the resource file of the type of audio and video in the APK can be obtained, specifically, as shown in the area 401 (outline) in fig. 4:
ApkSize 677.80M (mega), i.e., APK has a Size of 677.80M (mega).
0.0kb for obbbsize, i.e., Obb (Opaque Binary Blob, android Game Universal Package) is 0.0kb (Kilobyte, kilobytes).
ScriptSize: 0.0kb, that is, the size of Script is 0.0 kb.
VideoSize: 45.64M, that is, the size of a resource file of a Video (Video) type is 45.64M.
AudioSize: 248.04M, that is, the size of an Audio (Audio) type resource file is 248.04M.
AllABSize: 1.61G, i.e., All AB (abbreviation for AssetsBundle) file, is 1.61G (abbreviated here to GB, Gigabyte).
The assetsbundlet files are classified, the types of the resource files are determined, and the resource files of the same type are classified together, for example, the content in a region 402 (assetsbundlet resource analysis) in fig. 4, 6508 scene resource files are counted in the region 402, taking scene resources as an example only, and the size of the scene resource files is 543.30M. The following statistics is performed on various resource files in the scene resource to obtain the number and size of the various scene resource files.
305. The electronic equipment analyzes the header information of the at least two resource files obtained by decompression based on the automatic script, and extracts the file information of the at least two resource files from the header information, wherein the file information of one resource file is used for indicating the attribute of the resource included by the resource file.
After the electronic device decompresses the resource file, the resource file can be analyzed, and the condition of the resource in the resource file can be further obtained. The analysis process can be automatically triggered after the decompression step, and in response to completion of decompression of any resource file, the resource file can be analyzed to obtain file information of the resource file.
The attribute of the resource included in each resource file can be stored in the header information of the resource file, and the electronic device can extract the attribute of the required resource by analyzing the header information. Specifically, the electronic device may parse the decompressed header information of the at least two resource files in batch, and extract the file information of the at least two resource files from the header information.
The process of parsing the header information may be understood as a process of reading the header information, that is, the electronic device may read the header information of the resource file to obtain metadata of the resource file, where the metadata includes the file information.
In some embodiments, the file information of one resource file may include at least one of a resource name of a resource in the resource file, a type of the resource, a size of the resource, and a dependency relationship between any resource and other resources. That is, the file information may include a resource name of a resource in the resource file, or may include a type of the resource in the resource file, or may include a size of the resource in the resource file, or may include a dependency relationship between any resource in the resource file and other resources, or may include any two or three of these attributes, or may include these attributes all together. The dependency refers to a relationship in which two resources can be referenced or referenced.
For example, resource A references resource B, and both can be considered to have a dependency relationship. Resource B, in turn, references resource A, and can also be considered to have a dependency relationship. In one particular possible embodiment, the application package may be an application package for an electronic game, which may be a cell phone game. For example, the application package is an application package of a Unity 3D-based mobile game. Taking scene resources in the electronic game as an example for illustration, tree resources and grass resources beside the tree may have a dependency relationship, and when tree resources are displayed, grass resources beside the tree are also typically displayed.
In other embodiments, the file information may further include other attributes of the resource in the resource file, for example, a location of the resource, or a priority of the resource, and a related technical person may set the attribute to be parsed as needed, which is not limited in this embodiment of the present application.
In some embodiments, in the parsing process, since the resource file is parsed based on the automated script without manually selecting the resource file to trigger the parsing step, the resource file can be parsed in batch after being decompressed, each resource file corresponds to file information, so that the batch parsing process can obtain file information of a plurality of resource files, and the result obtained by parsing can be subjected to statistical analysis to obtain some total information in the whole application package. Specifically, the electronic device may record the identification information of each resource file and the corresponding file information correspondingly, and subsequently, when summarizing the file information of a plurality of resource files, may obtain the file information of the corresponding resource file according to the recorded identification information of the resource file, and summarize the file information. The electronic device may also create a data structure for storing the analysis result, and then record the file information of any resource file in a corresponding field of the data structure when the resource file is analyzed.
306. And the electronic equipment generates an analysis result of the application program package based on the automatic script and the file information of the at least two resource files and the resource file information.
After the electronic equipment analyzes the resource file information of the resource file and the file information of the resource in the resource file, the automatic script can trigger the next process, summarize and analyze the file information of the resource file obtained by analysis, synthesize the information and generate an analysis result of the application program package.
In some embodiments, the analysis results may include a list of resource files in the application package, a list of resources in each resource file, dependencies between resources, and the like. In some embodiments, the analysis results may take the form of a data structure string, which may include the information described above. For example, the format of the data structure string may be an Object format, such as json (JS Object Notation) format. Of course, other formats are also possible, and this is not limited in the embodiments of the present application.
This step 306 is a process of generating an analysis result of the application package based on the file information of the at least two resource files based on the automation script, and the above description is given by taking an example of only classifying the resource files after the electronic device decompresses them, and then generating the analysis result, and integrating the classification result and the analysis result. In other embodiments, the electronic device may also directly parse the resource file without classifying, and then generate an analysis result based on the parsing result, which is not limited in this embodiment of the application.
In some embodiments, after the electronic device generates the analysis result, the analysis result may be further processed, or the analysis result may be sent to another device for processing. For example, the application package may be an application package of a certain version, and there may be application packages of other versions before or after the version, and the electronic device may perform version comparison on analysis results of application packages of different versions to analyze a change condition of a resource, or a change condition of different types of resource files in different versions.
In a mode of performing subsequent processing by the electronic device, the version of the application package is a first version; the analysis result of the application package of the first version is a first analysis result. The electronic device may further obtain a second analysis result of the second version of the application package, and then compare the first analysis result with the second analysis result to obtain difference information between the first version of the application package and the second version of the application package, where the difference information includes at least one of a difference between resource files, a difference between resources, or a range influenced by a resource difference.
For the range influenced by the resource difference, the range influenced by the resource difference can be analyzed by comparing the difference between the resources and then by the dependency relationship between the resources.
In a manner of performing subsequent processing by another device, the electronic device may send the first analysis result of the application package of the first version to the other device, and the other device may receive the first analysis result or the second analysis result, and then perform the result of the version comparison. For example, the version comparison may be performed by a background, and the electronic device may automatically upload the first analysis result to the cloud database through the interface, and then perform the step of the version comparison by the background.
For example, as shown in fig. 5 and fig. 6, the electronic device can analyze the results of the APK of 0.0.1000.3646 (version number) and 0.0.1000.3651 (version number) versions, and can see the comparison of the sizes of different types of resources, the comparison of the reference number of resources, and the comparison of the referenced number of resources. As shown in fig. 6, by a comparative analysis, it can be derived which resources have been changed from one version to another.
The first analysis result can also be used for APK inclusion optimization or targeted early warning.
In some embodiments, the electronic device may also send alert information in response to the analysis result indicating that the size of the application package exceeds a first threshold. For example, the first threshold is 2GB, and when the APK is found to be greater than 2GB through analysis, the APK may not be installed and operated on the mobile phone, the warning information may be sent, and a relevant technician may take measures in time to optimize the APK, thereby reducing the size of the APK.
In some embodiments, the electronic device may further set the downloading mode of the resource file of the first target type to a dynamic downloading mode according to the proportion of the resource files of different types in the application package indicated by the analysis result, where the proportion of the resource file of the first target type is the largest among the proportion of the resource files of different types. According to the analysis result, the occupation of different types of resource files in the APK can be known, and some types of resource files with larger sizes are set to be in a dynamic downloading mode, so that the resource files of the first target type do not need to be downloaded when the APK is statically downloaded, and a subsequent user can download the resource files again when needing to use the resource files of the first target type, so that the downloading flexibility is improved, and the downloading burden of the user is reduced.
In some embodiments, the electronic device may further set the downloading manner of the resource file of the second target type to the dynamic downloading manner in response to that the size of the resource file of the second target type indicated by the analysis result is greater than a second threshold. The second object type is somewhat similar to the first object type, which is determined by the proportion of the resource file, and the second object type is determined by the size of the resource file. For example, for a game, the size of the initial bag APK is 1.8GB, where scene resources occupy 400MB, game character resources occupy 200MB, audio and video resources occupy 300MB, and atlas and single map occupy 200 MB. Scene resources occupy more space, so that a dynamic downloading mode can be adopted to save the bag body, and the benefit is the maximum.
The first threshold and the second threshold may be set by a person skilled in the relevant art as needed, and the embodiment of the present application is not limited thereto.
In some embodiments, the method provided by the present application can be implemented by an automation script, and the script can be deployed to a continuous integrated automation build line, for example, the continuous integrated automation build line can be some delivery platforms, such as Jenkins platform, Jenkins is an open source software project, and is a continuous integration tool developed based on Java. And then the script can be triggered regularly, and the full process automation including APK downloading, APK file decompression and decoding, Assetsbund file analysis, data archiving and uploading, data comparison, mail early warning and the like can be completed. The continuous integration assembly line is used as a platform, and the technical modules related to the invention are connected in series, so that an automatic flow is realized, and the testing efficiency is improved.
For example, as shown in fig. 7, the PAK analysis process may include a plurality of triggering manners, and the related technical staff may perform setting therein, and may also perform setting therein for each processing step in the automated analysis process, for example, update of an automated script, setting a pull tool, setting of each step of package drop, ab (i.e., assetsbundlet file) analysis, filing component, uploading nike (a server), filing report, and the like, and in what case, the setting may be performed by an early warning, that is, a notification. The notification may be notified in a variety of ways, such as social platform, email notification, text messaging notification, and the like.
The embodiment of the application provides a method for automatically processing an application package, and on one hand, when the application package is processed, the processes of obtaining and decompressing the application package, analyzing a resource file and generating an analysis result are realized based on an automatic script, the whole process is automated, manual participation is completely not needed, the labor cost is greatly reduced, the processing efficiency is improved, and the accuracy of the processing result can be improved. On the other hand, after the application program package is decompressed, the resource files can be automatically analyzed in batches, the whole amount of resource files are analyzed, the resource files are not manually analyzed one by one through an Assetstudio tool, the processing efficiency is greatly improved, an analysis result can be generated based on the analysis results of the resource files after the analysis, the analysis result can reflect the condition of the whole application program package and does not correspond to the condition of a single resource file, the analysis result can better meet the requirement of a user, the user does not need to analyze the resource files one by one, and the manual analysis time is saved, so that the method is high in efficiency and good in applicability.
All the above optional technical solutions can be combined arbitrarily to form optional embodiments of the present application, and are not described herein again.
Fig. 8 is a schematic structural diagram of an application package processing apparatus according to an embodiment of the present application, and referring to fig. 8, the apparatus includes:
an obtaining module 801, configured to obtain an application package based on an automation script, where the application package includes at least two resource files;
a decompression module 802, configured to decompress the application package based on the automation script to obtain the at least two resource files in the application package;
an analyzing module 803, configured to analyze, based on the automation script, the header information of the at least two resource files obtained through decompression, and extract file information of the at least two resource files from the header information, where the file information of one resource file is used to indicate an attribute of a resource included in the resource file;
a generating module 804, configured to generate an analysis result of the application package based on the automation script and based on the file information of the at least two resource files.
In some embodiments, the apparatus further comprises:
the determining module is used for determining the types of the at least two resource files according to the file names or the paths of the at least two resource files;
the obtaining module 801 is further configured to obtain resource file information of the application package based on the types of the at least two resource files, where the resource file information includes at least one of a proportion, a number, or a size of resource files of different types in the application package;
the generating module 804 is configured to generate an analysis result of the application package based on the file information of the at least two resource files and the resource file information.
In some embodiments, the decompression module 802 is configured to:
decompressing the application program package to obtain at least two encrypted resource files in the application program package;
and decrypting the at least two encrypted resource files to obtain the at least two resource files.
In some embodiments, the file information of a resource file includes at least one of a resource name of a resource in the resource file, a type of the resource, a size of the resource, and a dependency relationship between any resource and other resources.
In some embodiments, the apparatus further comprises:
the determining module is used for determining the types of the at least two resource files according to the file names or the paths of the at least two resource files based on the automation script;
the obtaining module 801 is further configured to obtain resource file information of the application package based on the types of the at least two resource files based on the automation script, where the resource file information includes at least one of a proportion, a number, and a size of different types of resource files in the application package;
the generating module 804 is configured to generate an analysis result of the application package based on the file information of the at least two resource files and the resource file information.
In some embodiments, the obtaining module 801 is configured to perform any of:
responding to an application program package processing instruction triggered by the completion of the construction of any application program package, and acquiring the constructed application program package based on an automation script;
responding to an application program package processing instruction triggered by a processing operation on any application program package, and acquiring the application program package subjected to the processing operation based on an automation script;
and responding to the application program package processing instruction triggered at regular time, and acquiring the application program package constructed in the current period based on the automation script.
In some embodiments, the version of the application package is a first version; the analysis result of the application program package of the first version is a first analysis result;
the obtaining module 801 is further configured to obtain a second analysis result of the application package of the second version;
the device further comprises:
and the comparison module is used for comparing the first analysis result with the second analysis result to obtain difference information between the application program package of the first version and the application program package of the second version, wherein the difference information comprises at least one of differences among resource files, differences among resources or a range influenced by the resource differences.
In some embodiments, the apparatus further comprises:
and the sending module is used for responding to the analysis result indicating that the size of the application program package exceeds a first threshold value and sending early warning information.
In some embodiments, the apparatus further comprises:
and the first setting module is used for setting the downloading mode of the resource file of the first target type as a dynamic downloading mode according to the proportion of the resource files of different types in the application program package indicated by the analysis result, wherein the proportion of the resource file of the first target type is the largest in the proportion of the resource files of different types.
In some embodiments, the apparatus further comprises:
and the second setting module is used for setting the downloading mode of the resource file of the second target type as a dynamic downloading mode in response to the fact that the size of the resource file of the second target type indicated by the analysis result is larger than a second threshold value.
The device that this application embodiment provided can automatic processing application package, and on the one hand, when handling application package, this application package's the process of acquireing, uncompressing, resource file's analysis and generating analysis result is based on automatic script realization, and whole flow has realized the automation, need not artifical the participation completely, and the cost of labor has significantly reduced has improved the treatment effeciency, and can improve the accuracy of handling the result. On the other hand, after the application program package is decompressed, the resource files can be automatically analyzed in batches, the whole amount of resource files are analyzed, the resource files are not manually analyzed one by one through an Assetstudio tool, the processing efficiency is greatly improved, an analysis result can be generated based on the analysis results of the resource files after the analysis, the analysis result can reflect the condition of the whole application program package and does not correspond to the condition of a single resource file, the analysis result can better meet the requirement of a user, the user does not need to analyze the resource files one by one, and the manual analysis time is saved, so that the method is high in efficiency and good in applicability.
It should be noted that: in the application package processing device provided in the above embodiment, only the division of the function modules is exemplified when processing the application package, and in practical applications, the function distribution can be completed by different function modules according to needs, that is, the internal structure of the application package processing device is divided into different function modules to complete all or part of the functions described above. In addition, the application package processing apparatus and the application package processing method provided in the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments and are not described herein again.
Fig. 9 is a schematic structural diagram of an electronic device 900 according to an embodiment of the present application, where the electronic device 900 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 901 and one or more memories 902, where the memory 902 stores at least one computer program, and the at least one computer program is loaded and executed by the processors 901 to implement the application package Processing method provided by each method embodiment. The electronic device can also include other components for implementing device functions, for example, the electronic device can also have components such as a wired or wireless network interface and an input/output interface for input/output. The embodiments of the present application are not described herein in detail.
The electronic device in the above method embodiment can be implemented as a terminal. For example, fig. 10 is a block diagram of a terminal according to an embodiment of the present disclosure. The terminal 1000 can be a portable mobile terminal such as: a smart phone, a tablet computer, an MP3(Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3) player, an MP4(Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4) player, a notebook computer or a desktop computer. Terminal 1000 can also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or the like by other names.
In general, terminal 1000 can include: a processor 1001 and a memory 1002.
Processor 1001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. The processor 1001 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 1001 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also referred to as a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 1001 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, the processor 1001 may further include an AI (Artificial Intelligence) processor for processing a computing operation related to machine learning.
Memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 1002 is used to store at least one instruction for execution by the processor 1001 to implement the application package processing method provided by the method embodiments herein.
In some embodiments, terminal 1000 can also optionally include: a peripheral interface 1003 and at least one peripheral. The processor 1001, memory 1002 and peripheral interface 1003 may be connected by a bus or signal line. Various peripheral devices may be connected to peripheral interface 1003 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1004, display screen 1005, camera assembly 1006, audio circuitry 1007, positioning assembly 1008, and power supply 1009.
The peripheral interface 1003 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 1001 and the memory 1002. In some embodiments, processor 1001, memory 1002, and peripheral interface 1003 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1001, the memory 1002, and the peripheral interface 1003 may be implemented on separate chips or circuit boards, which are not limited by this embodiment.
The Radio Frequency circuit 1004 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 1004 communicates with communication networks and other communication devices via electromagnetic signals. The radio frequency circuit 1004 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1004 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuit 1004 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 1004 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 1005 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 1005 is a touch display screen, the display screen 1005 also has the ability to capture touch signals on or over the surface of the display screen 1005. The touch signal may be input to the processor 1001 as a control signal for processing. At this point, the display screen 1005 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, display screen 1005 can be one, disposed on a front panel of terminal 1000; in other embodiments, display 1005 can be at least two, respectively disposed on different surfaces of terminal 1000 or in a folded design; in other embodiments, display 1005 can be a flexible display disposed on a curved surface or a folded surface of terminal 1000. Even more, the display screen 1005 may be arranged in a non-rectangular irregular figure, i.e., a shaped screen. The Display screen 1005 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera assembly 1006 is used to capture images or video. Optionally, the camera assembly 1006 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 1006 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuit 1007 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 1001 for processing or inputting the electric signals to the radio frequency circuit 1004 for realizing voice communication. For stereo sound collection or noise reduction purposes, multiple microphones can be provided, each at a different location of terminal 1000. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 1001 or the radio frequency circuit 1004 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, the audio circuit 1007 may also include a headphone jack.
A Location component 1008 is employed to locate a current geographic Location of terminal 1000 for purposes of navigation or LBS (Location Based Service). The Positioning component 1008 can be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
Power supply 1009 is used to supply power to various components in terminal 1000. The power source 1009 may be alternating current, direct current, disposable batteries, or rechargeable batteries. When the power source 1009 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 1000 can also include one or more sensors 1010. The one or more sensors 1010 include, but are not limited to: acceleration sensor 1011, gyro sensor 1012, pressure sensor 1013, fingerprint sensor 1014, optical sensor 1015, and proximity sensor 1016.
Acceleration sensor 1011 can detect acceleration magnitudes on three coordinate axes of a coordinate system established with terminal 1000. For example, the acceleration sensor 1011 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 1001 may control the display screen 1005 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 1011. The acceleration sensor 1011 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 1012 may detect a body direction and a rotation angle of the terminal 1000, and the gyro sensor 1012 and the acceleration sensor 1011 may cooperate to acquire a 3D motion of the user on the terminal 1000. From the data collected by the gyro sensor 1012, the processor 1001 may implement the following functions: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
Pressure sensor 1013 can be disposed on a side frame of terminal 1000 and/or underneath display screen 1005. When pressure sensor 1013 is disposed on a side frame of terminal 1000, a user's grip signal on terminal 1000 can be detected, and processor 1001 performs left-right hand recognition or shortcut operation according to the grip signal collected by pressure sensor 1013. When the pressure sensor 1013 is disposed at a lower layer of the display screen 1005, the processor 1001 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 1005. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 1014 is used to collect a fingerprint of the user, and the processor 1001 identifies the user according to the fingerprint collected by the fingerprint sensor 1014, or the fingerprint sensor 1014 identifies the user according to the collected fingerprint. Upon identifying that the user's identity is a trusted identity, the processor 1001 authorizes the user to perform relevant sensitive operations including unlocking a screen, viewing encrypted information, downloading software, paying, and changing settings, etc. Fingerprint sensor 1014 may be disposed on a front, back, or side of terminal 1000. When a physical key or vendor Logo is provided on terminal 1000, fingerprint sensor 1014 can be integrated with the physical key or vendor Logo.
The optical sensor 1015 is used to collect the ambient light intensity. In one embodiment, the processor 1001 may control the display brightness of the display screen 1005 according to the ambient light intensity collected by the optical sensor 1015. Specifically, when the ambient light intensity is high, the display brightness of the display screen 1005 is increased; when the ambient light intensity is low, the display brightness of the display screen 1005 is turned down. In another embodiment, the processor 1001 may also dynamically adjust the shooting parameters of the camera assembly 1006 according to the intensity of the ambient light collected by the optical sensor 1015.
Proximity sensor 1016, also known as a distance sensor, is typically disposed on a front panel of terminal 1000. Proximity sensor 1016 is used to gather the distance between the user and the front face of terminal 1000. In one embodiment, when proximity sensor 1016 detects that the distance between the user and the front surface of terminal 1000 is gradually reduced, processor 1001 controls display screen 1005 to switch from a bright screen state to a dark screen state; when proximity sensor 1016 detects that the distance between the user and the front of terminal 1000 is gradually increased, display screen 1005 is controlled by processor 1001 to switch from a breath-screen state to a bright-screen state.
Those skilled in the art will appreciate that the configuration shown in FIG. 10 is not intended to be limiting and that terminal 1000 can include more or fewer components than shown, or some components can be combined, or a different arrangement of components can be employed.
The electronic device in the above method embodiment can be implemented as a server. For example, fig. 11 is a schematic structural diagram of a server according to an embodiment of the present application, where the server 1100 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 1101 and one or more memories 1102, where the memory 1102 stores at least one computer program, and the at least one computer program is loaded and executed by the processors 1101 to implement the application package Processing methods provided by the above-mentioned method embodiments. Certainly, the server can also have components such as a wired or wireless network interface and an input/output interface to facilitate input and output, and the server can also include other components for implementing the functions of the device, which is not described herein again.
In an exemplary embodiment, a computer-readable storage medium, such as a memory including at least one computer program, which is executable by a processor to perform the application package processing method in the above embodiments, is also provided. For example, the computer-readable storage medium can be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product or a computer program is also provided, which comprises one or more program codes stored in a computer-readable storage medium. The one or more processors of the electronic device can read the one or more program codes from the computer-readable storage medium, and the one or more processors execute the one or more program codes, so that the electronic device can perform the above-described application package processing method.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It should be understood that determining B from a does not mean determining B from a alone, but can also determine B from a and/or other information.
Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments can be implemented by hardware, or can be implemented by a program for instructing relevant hardware, and the program can be stored in a computer readable storage medium, and the above mentioned storage medium can be read only memory, magnetic or optical disk, etc.
The above description is intended only to be an alternative embodiment of the present application, and not to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. An application package processing method, the method comprising:
acquiring an application program package based on an automation script, wherein the application program package comprises at least two resource files;
decompressing the application package based on the automation script to obtain the at least two resource files in the application package;
analyzing the header information of the at least two resource files obtained by decompression based on the automatic script, and extracting the file information of the at least two resource files from the header information, wherein the file information of one resource file is used for indicating the attribute of the resource included by the resource file;
and generating an analysis result of the application program package based on the automation script and the file information of the at least two resource files.
2. The method of claim 1, wherein the file information of a resource file comprises at least one of a resource name of a resource in the resource file, a type of the resource, a size of the resource, and a dependency relationship between any resource and other resources.
3. The method of claim 1, further comprising:
determining the types of the at least two resource files according to the file names or paths of the at least two resource files based on the automation script;
based on the automation script and the types of the at least two resource files, acquiring resource file information of the application program package, wherein the resource file information comprises at least one of the proportion, the number or the size of different types of resource files in the application program package;
generating an analysis result of the application package based on the file information of the at least two resource files, including:
and generating an analysis result of the application program package based on the file information of the at least two resource files and the resource file information.
4. The method of claim 1, wherein the obtaining an application package based on the automation script comprises any one of:
responding to an application program package processing instruction triggered by the completion of the construction of any application program package, and acquiring the constructed application program package based on an automation script;
responding to an application program package processing instruction triggered by a processing operation on any application program package, and acquiring the application program package subjected to the processing operation based on an automation script;
and responding to the application program package processing instruction triggered at regular time, and acquiring the application program package constructed in the current period based on the automation script.
5. The method of claim 1, wherein the version of the application package is a first version; the analysis result of the application program package of the first version is a first analysis result;
the method further comprises the following steps:
acquiring a second analysis result of the application program package of the second version;
and comparing the first analysis result with the second analysis result to obtain difference information between the application program package of the first version and the application program package of the second version, wherein the difference information comprises at least one of differences among resource files, differences among resources or a range influenced by the resource differences.
6. The method of claim 1, further comprising any of:
sending early warning information in response to the analysis result indicating that the size of the application package exceeds a first threshold;
setting a downloading mode of a resource file of a first target type as a dynamic downloading mode according to the proportion of the resource files of different types in the application program package indicated by the analysis result, wherein the proportion of the resource file of the first target type is the largest in the proportion of the resource files of different types;
and setting the downloading mode of the resource file of the second target type as a dynamic downloading mode in response to the analysis result indicating that the size of the resource file of the second target type is larger than a second threshold value.
7. An application package processing apparatus, characterized in that the apparatus comprises:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring an application program package based on an automation script, and the application program package comprises at least two resource files;
the decompression module is used for decompressing the application program package based on the automation script to obtain the at least two resource files in the application program package;
the analysis module is used for analyzing the header information of the at least two resource files obtained by decompression based on the automatic script, and extracting the file information of the at least two resource files from the header information, wherein the file information of one resource file is used for indicating the attribute of the resource included by the resource file;
and the generation module is used for generating an analysis result of the application program package based on the automatic script and the file information of the at least two resource files.
8. The apparatus of claim 7, further comprising:
the determining module is used for determining the types of the at least two resource files according to the file names or the paths of the at least two resource files;
the obtaining module is further configured to obtain resource file information of the application package based on the types of the at least two resource files, where the resource file information includes at least one of a proportion, a number, or a size of different types of resource files in the application package;
the generation module is used for generating an analysis result of the application package based on the file information of the at least two resource files and the resource file information.
9. An electronic device, comprising one or more processors and one or more memories, in which at least one computer program is stored, the at least one computer program being loaded and executed by the one or more processors to implement the application package processing method of any one of claims 1 to 6.
10. A computer-readable storage medium, in which at least one computer program is stored, the at least one computer program being loaded and executed by a processor to implement the application package processing method according to any one of claims 1 to 6.
CN202110277904.9A 2021-03-15 2021-03-15 Application package processing method, device, equipment and storage medium Active CN112783512B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110277904.9A CN112783512B (en) 2021-03-15 2021-03-15 Application package processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110277904.9A CN112783512B (en) 2021-03-15 2021-03-15 Application package processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112783512A true CN112783512A (en) 2021-05-11
CN112783512B CN112783512B (en) 2024-05-10

Family

ID=75762632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110277904.9A Active CN112783512B (en) 2021-03-15 2021-03-15 Application package processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112783512B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016000102A1 (en) * 2014-06-12 2016-01-07 华为技术有限公司 Application transferring method, terminal and application server
CN108415708A (en) * 2018-01-19 2018-08-17 五八有限公司 Processing method, device, equipment and the storage medium of application program installation kit size
CN108897546A (en) * 2018-07-03 2018-11-27 北京五八信息技术有限公司 Monitor method, apparatus, equipment and the readable storage medium storing program for executing of APK size
US10169035B1 (en) * 2017-09-06 2019-01-01 International Business Machines Corporation Customized static source code analysis
CN109799970A (en) * 2018-12-06 2019-05-24 珠海西山居移动游戏科技有限公司 A kind of quoting resource relationship generation method and system
CN109828777A (en) * 2018-12-06 2019-05-31 珠海西山居互动娱乐科技有限公司 A kind of hand trip installation kit optimization method and system
CN110069264A (en) * 2019-03-21 2019-07-30 平安普惠企业管理有限公司 Construct method, apparatus, computer equipment and the storage medium of resource packet
CN110232026A (en) * 2019-06-12 2019-09-13 苏州亿歌网络科技有限公司 AssetBundle resource detection method and system
CN111538502A (en) * 2020-03-27 2020-08-14 北京达佳互联信息技术有限公司 Installation package processing method and device, electronic equipment and storage medium
CN111666206A (en) * 2020-04-30 2020-09-15 北京百度网讯科技有限公司 Method, device, equipment and storage medium for acquiring influence range of change code
CN111679835A (en) * 2020-04-26 2020-09-18 五八有限公司 Application processing method, device, terminal and storage medium
CN112052036A (en) * 2020-09-07 2020-12-08 网易(杭州)网络有限公司 Application program management method and device, storage medium and computer equipment
CN112379888A (en) * 2020-12-02 2021-02-19 北京皮尔布莱尼软件有限公司 Code change analysis method
CN112486563A (en) * 2020-12-02 2021-03-12 车智互联(北京)科技有限公司 Code management method, system, computing device and readable storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016000102A1 (en) * 2014-06-12 2016-01-07 华为技术有限公司 Application transferring method, terminal and application server
US10169035B1 (en) * 2017-09-06 2019-01-01 International Business Machines Corporation Customized static source code analysis
CN108415708A (en) * 2018-01-19 2018-08-17 五八有限公司 Processing method, device, equipment and the storage medium of application program installation kit size
CN108897546A (en) * 2018-07-03 2018-11-27 北京五八信息技术有限公司 Monitor method, apparatus, equipment and the readable storage medium storing program for executing of APK size
CN109799970A (en) * 2018-12-06 2019-05-24 珠海西山居移动游戏科技有限公司 A kind of quoting resource relationship generation method and system
CN109828777A (en) * 2018-12-06 2019-05-31 珠海西山居互动娱乐科技有限公司 A kind of hand trip installation kit optimization method and system
CN110069264A (en) * 2019-03-21 2019-07-30 平安普惠企业管理有限公司 Construct method, apparatus, computer equipment and the storage medium of resource packet
CN110232026A (en) * 2019-06-12 2019-09-13 苏州亿歌网络科技有限公司 AssetBundle resource detection method and system
CN111538502A (en) * 2020-03-27 2020-08-14 北京达佳互联信息技术有限公司 Installation package processing method and device, electronic equipment and storage medium
CN111679835A (en) * 2020-04-26 2020-09-18 五八有限公司 Application processing method, device, terminal and storage medium
CN111666206A (en) * 2020-04-30 2020-09-15 北京百度网讯科技有限公司 Method, device, equipment and storage medium for acquiring influence range of change code
CN112052036A (en) * 2020-09-07 2020-12-08 网易(杭州)网络有限公司 Application program management method and device, storage medium and computer equipment
CN112379888A (en) * 2020-12-02 2021-02-19 北京皮尔布莱尼软件有限公司 Code change analysis method
CN112486563A (en) * 2020-12-02 2021-03-12 车智互联(北京)科技有限公司 Code management method, system, computing device and readable storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
XINXI: "移动性能测试 Android 包大小检查测试方案", 《HTTPS://TESTERHOME.COM/TOPICS/17629》, pages 1 *
中公教育优就业研究院: "《数字视觉与虚拟交互自学指南》", 陕西科学技术出版社, pages: 352 *
小文字 吃饭,睡觉,遛狗头: "安装包大小分析", 《HTTPS://BLOG.HACKTONS.CN/2018/04/22/CLI-APK-ANALYZE/》, pages 352 *
爱奇艺: "爱奇艺安卓app瘦身经验", 《HTTPS://WWW.IQIYI.COM/COMMON/20170920/3FBBD64D0EBB69CE.HTML》, pages 3 *

Also Published As

Publication number Publication date
CN112783512B (en) 2024-05-10

Similar Documents

Publication Publication Date Title
CN108536463B (en) Method, device and equipment for acquiring resource package and computer readable storage medium
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN111262887B (en) Network risk detection method, device, equipment and medium based on object characteristics
CN108595226B (en) Dynamic loading method and device and computer readable storage medium
CN110210219B (en) Virus file identification method, device, equipment and storage medium
CN111338910B (en) Log data processing method, log data display method, log data processing device, log data display device, log data processing equipment and log data storage medium
CN108132790B (en) Method, apparatus and computer storage medium for detecting a garbage code
CN110569220B (en) Game resource file display method and device, terminal and storage medium
WO2020048392A1 (en) Application virus detection method, apparatus, computer device, and storage medium
CN111275122A (en) Label labeling method, device, equipment and readable storage medium
CN111078521A (en) Abnormal event analysis method, device, equipment, system and storage medium
CN111949680A (en) Data processing method and device, computer equipment and storage medium
CN111338933A (en) Buried point verification method, device, equipment and storage medium
CN113138771A (en) Data processing method, device, equipment and storage medium
CN110768843B (en) Network problem analysis method, device, terminal and storage medium
CN110650210B (en) Image data acquisition method, device and storage medium
CN112148499A (en) Data reporting method and device, computer equipment and medium
CN112181442A (en) Unloaded page display method, device, terminal, server and storage medium
CN112560612B (en) System, method, computer device and storage medium for determining business algorithm
CN112783512A (en) Application package processing method, device, equipment and storage medium
CN113268234A (en) Page generation method, device, terminal and storage medium
CN112905328A (en) Task processing method and device and computer readable storage medium
CN112988177A (en) Application installation package issuing method, application program running method, server and terminal
CN113076452A (en) Application classification method, device, equipment and computer readable storage medium
CN113312249A (en) Log data generation method, log data display method and device

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40043478

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant