CN112052013A - Software package generation method and device, storage medium and electronic device - Google Patents

Software package generation method and device, storage medium and electronic device Download PDF

Info

Publication number
CN112052013A
CN112052013A CN202010765803.1A CN202010765803A CN112052013A CN 112052013 A CN112052013 A CN 112052013A CN 202010765803 A CN202010765803 A CN 202010765803A CN 112052013 A CN112052013 A CN 112052013A
Authority
CN
China
Prior art keywords
file
resource
apk
target
configuration information
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.)
Pending
Application number
CN202010765803.1A
Other languages
Chinese (zh)
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.)
Perfect World Beijing Software Technology Development Co Ltd
Original Assignee
Perfect World Beijing Software Technology Development 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 Perfect World Beijing Software Technology Development Co Ltd filed Critical Perfect World Beijing Software Technology Development Co Ltd
Priority to CN202010765803.1A priority Critical patent/CN112052013A/en
Publication of CN112052013A publication Critical patent/CN112052013A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/53Decompilation; Disassembly
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The invention provides a method and a device for generating a software package, a storage medium and an electronic device, wherein the method is applied to association display among historical data and comprises the following steps: acquiring a source android Application Package (APK) file of an online game and configuration information of a plurality of target release channels; performing decompiling on the source APK file to obtain an intermediate file; and respectively generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information, wherein each first target APK file corresponds to one target publishing channel. The invention solves the technical problem of low efficiency of generating the multi-channel APK file in the related technology, improves the development efficiency of the APK file and improves the channel adaptation rate of the APK file.

Description

Software package generation method and device, storage medium and electronic device
Technical Field
The invention relates to the field of computers, in particular to a software package generation method and device, a storage medium and an electronic device.
Background
In the related art, the internet has been rapidly developed in recent years, and smart phones have become indispensable components in human life. The smart phone is used as a support, the mobile terminal game is rapidly developed, and online popularization of the mobile terminal network game is supported by various channel distribution platforms, such as application treasure, pea pod, Huashi, charm, association, VIVO, OPPO application stores and the like. The issuing platform of each channel can promote games in various ways, provide downloading, logging and payment services for users, and issue the games issued to the issuing platform to access the SDK (software Development kit) provided by the corresponding platform, and use the user system and the payment system provided by the issuing platform. Therefore, game developers need to access the SDKs of all the issuing platforms one by one, and aiming at various SDKs and access documents of a plurality of issuing platforms, if the game developers need to normally complete the access of the SDKs of the platforms, the workload is large, and errors are easy to occur in the process.
In the related technology, a game uses a third-party multi-channel access platform, and login data and payment data of a user use functions provided by the third-party platform, so that huge potential safety hazards exist for companies and users, some application stores cannot allow the APK package to be online, in order to avoid the potential safety hazards, login configuration information, payment configuration information and the like of channels are selected to be packaged into the APK package, in order to adapt to a plurality of third access channels, when APK files are packaged, a software package needs to be made for different channels, and software development efficiency is low.
In view of the above problems in the related art, no effective solution has been found at present.
Disclosure of Invention
The embodiment of the invention provides a software package generation method and device, a storage medium and an electronic device.
According to an embodiment of the present invention, there is provided a software package generation method including: acquiring an APK file of a source android application package of an online game and configuration information of a plurality of target release channels; performing decompiling on the source APK file to obtain an intermediate file; and respectively generating a plurality of first target APK files according to the intermediate file and the configuration information, wherein each first target APK file corresponds to one target publishing channel.
Optionally, after generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information, the method further includes: reading a configuration parameter template, wherein the configuration parameter template comprises a plurality of demand parameters respectively corresponding to target release channels, and the demand parameters comprise the configuration information and expansion parameters; and respectively generating a plurality of second target APK files according to the intermediate file and the configuration parameter template.
Optionally, after obtaining the source APK file of the online game and the configuration information of the plurality of target distribution channels, the method further includes: determining attribute information of the target publishing channel, wherein the attribute information is used for representing whether the APK file to be published through the target publishing channel is allowed to be compressed or not; and if the attribute information represents that the APK file is not allowed to be compressed, packaging the configuration information to generate a compressed file, and adding the compressed file to the source APK file to obtain a third target APK file.
Optionally, respectively generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information includes: acquiring a first resource and a second resource in the intermediate file, wherein the first resource and the second resource are respectively adapted to an aapt compiling tool and an aapt2 compiling tool; and covering the first resource by using the second resource, and compiling the second resource and the plurality of configuration information by using an aapt2 compiling tool to respectively generate a plurality of first target APK files.
Optionally, the covering the first resource with the second resource includes: and performing deduplication, compiling and decompiling on the first resource to obtain a corresponding second resource.
Optionally, performing decompiling on the source APK file to obtain an intermediate file, including: decompiling the source APK file by adopting an APKTOOL component to obtain a first smali file, a first resource file and a resource description file, wherein the first resource file comprises: picture resources, layout resources, character string resources; compiling and linking the first resource file and the resource description file again by adopting aapt and appt2 to generate a new resource file, a new resource description file and a new R.java file; respectively processing the R.java file by adopting a java.exe component, a jar.exe component, a dx.jar component and a bakmali.jar component to correspondingly generate a class file, a jar file, a dex file and a second smali file, and merging the class file, the jar file, the dex file and the second smali file with the first smali file.
Optionally, respectively generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information includes: generating a second resource file and an android interface definition language AIDL file according to the intermediate file, wherein the second resource file comprises a resource identifier and a resource index in the source APK file; compiling the second resource file and the AIDL file into a first JAR package; compiling the first JAR package and a second JAR package into a Dex file, wherein the configuration information comprises the second JAR package; packing the Dex file and a third resource file to obtain an APK file, wherein the configuration information comprises the third resource file, and the third resource file comprises a resource identifier and a resource index in the configuration information; and signing the APK file, and performing memory alignment processing on the APK file through a memory mapping mechanism to obtain the first target APK file.
According to another embodiment of the present invention, there is provided a software package generation apparatus including: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a source android Application Package (APK) file of an online game and configuration information of a plurality of target issuing channels; the processing module is used for performing decompiling on the source APK file to obtain an intermediate file; and the first generation module is used for respectively generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information, wherein each first target APK file corresponds to one target distribution channel.
Optionally, the apparatus further comprises: the reading module is used for reading a configuration parameter template after the first generating module respectively generates a plurality of first target APK files according to the intermediate file and the plurality of configuration information, wherein the configuration parameter template comprises a plurality of demand parameters respectively corresponding to target publishing channels, and the demand parameters comprise the configuration information and expansion parameters; and the second generation module is used for respectively generating a plurality of second target APK files according to the intermediate file and the configuration parameter template.
Optionally, the apparatus further comprises: the reading module is used for determining the attribute information of a target issuing channel after the acquisition module acquires a source APK file of the online game and configuration information of a plurality of target issuing channels, wherein the attribute information is used for representing whether the APK file to be issued through the target issuing channel is allowed to be compressed or not; and the third generation module is used for packaging the configuration information to generate a compressed file if the attribute information represents that the APK file is not allowed to be compressed, and adding the compressed file to the source APK file to obtain a third target APK file.
Optionally, the first generating module includes: an obtaining unit, configured to obtain a first resource and a second resource in the intermediate file, where the first resource and the second resource are respectively adapted to an aapt compiling tool and an aapt2 compiling tool; and the first generating unit is used for covering the first resource with the second resource, compiling the second resource and the plurality of configuration information by using an aapt2 compiling tool, and respectively generating a plurality of first target APK files.
Optionally, the generating unit includes: and the processing subunit is used for performing duplicate removal, compiling and decompiling on the first resource to obtain a corresponding second resource.
Optionally, the processing module includes: a decompiling unit, configured to decompile the source APK file by using an APKTOOL component to obtain a first smal file, a first resource file, and a resource description file, where the first resource file includes: picture resources, layout resources, character string resources; a generating unit, configured to compile the first resource file and the resource description file again by using aapt and appt2, and link the first resource file and the resource description file to generate a new resource file, a new resource description file, and a new r.java file; and the processing unit is used for respectively processing the R.java file by adopting a java.exe component, a jar.exe component, a dx.jar component and a bakmali.jar component, correspondingly generating a class file, a jar file, a dex file and a second smali file, and merging the class file, the jar file, the dex file and the second smali file with the first smali file.
Optionally, the first generating module includes: a second generating unit, configured to generate a second resource file and an android interface definition language aid l file according to the intermediate file, where the second resource file includes a resource identifier and a resource index in the source APK file; a first compiling unit, configured to compile the second resource file and the aid dl file into a first JAR package; a second compiling unit, configured to compile the first JAR package and a second JAR package into a Dex file, where the configuration information includes the second JAR package; a packing unit, configured to pack the Dex file and a third resource file to obtain an APK file, where the configuration information includes the third resource file, and the third resource file includes a resource identifier and a resource index in the configuration information; and the processing unit is used for signing the APK file and carrying out memory alignment processing on the APK file through a memory mapping mechanism to obtain the first target APK file.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory and a processor, the memory having a computer program stored therein, the processor being configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, the APK file of the source android application package of the online game and the configuration information of the plurality of target publishing channels are obtained, then the source APK file is decompiled to obtain the intermediate file, finally the plurality of first target APK files are respectively generated according to the intermediate file and the plurality of configuration information, the source APK file is decompiled through the reverse function, and the repacking is carried out by combining the configuration information of each publishing channel, so that the plurality of channel packages can be packed and generated simultaneously, the technical problem of low efficiency of generating the multi-channel APK file in the related technology is solved, the development efficiency of the APK file is improved, and the channel adaptation rate of the APK file is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention to a lesser extent. In the drawings:
FIG. 1 is a block diagram of a hardware configuration of a software package generation computer according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of generating a software package according to an embodiment of the invention;
FIG. 3 is a block diagram of the front and rear end of the multi-channel packaging tool according to an embodiment of the present invention;
fig. 4 is a block diagram of a software package generation apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art without any inventive work based on the embodiments in the present application shall fall within the scope of protection of the present application. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
The method provided by the first embodiment of the present application may be executed in a mobile phone, a tablet, a server, a computer, or a similar electronic terminal. Taking the example of running on a computer, fig. 1 is a hardware structure block diagram of a software package generating computer according to an embodiment of the present invention. As shown in fig. 1, computer 10 may include one or more (only one shown in fig. 1) processors 102 (processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally, a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those of ordinary skill in the art that the configuration shown in FIG. 1 is illustrative only and is not intended to limit the configuration of the computer described above. For example, computer 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 can be used for storing computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a method for generating a software package in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from processor 102, which may be connected to computer 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communications provider of the computer 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a method for generating a software package is provided, and fig. 2 is a flowchart of a method for generating a software package according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes:
step S202, obtaining a source android Application Package (APK) file of the online game and configuration information of a plurality of target release channels;
the source APK file of this embodiment is a software package of an online game made by a developer, and includes a code file corresponding to a game background policy and a resource file of a game front end, where the resource file includes information such as pictures, layouts, and characters.
The configuration information comprises a channel resource package, a channel configuration file, an SDKCore frame package, a public resource file and the like, and different configuration information can be adapted to login interfaces, payment interfaces, download links, installation tools and the like in different release channels.
Step S204, performing decompiling on the source APK file to obtain an intermediate file;
by inversely compiling the APK file into the intermediate file, the sub-files, resources and configuration tables included in the source APK file can be packaged and packaged for the second time by combining with the configuration information of the target distribution channel, so that the software package can be uploaded to different application stores and downloaded and used by users from different channels.
Step S206, respectively generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information, wherein each first target APK file corresponds to one target publishing channel;
the target APK file is also called a channel package, and can be published to a corresponding application store according to the channel identification after being generated.
Through the steps, the source android application package APK file of the online game and the configuration information of a plurality of target publishing channels are obtained, then the source APK file is decompiled to obtain an intermediate file, finally a plurality of first target APK files are respectively generated according to the intermediate file and the configuration information, the source APK file is decompiled through a reverse function, and repacking is carried out by combining the configuration information of each publishing channel, a plurality of channel packages can be packed and generated simultaneously, the technical problem that the efficiency of generating the multi-channel APK file is low in the related technology is solved, the development efficiency of the APK file is improved, and the channel adaptation rate of the APK file is improved.
In this embodiment, after generating the plurality of first target APK files according to the intermediate file and the plurality of configuration information, the method further includes: reading a configuration parameter template, wherein the configuration parameter template comprises a plurality of demand parameters respectively corresponding to the target release channels, and the demand parameters comprise configuration information and expansion parameters; and respectively generating a plurality of second target APK files according to the intermediate file and the configuration parameter template.
In one example, the first target APK file is a formal version, the second target APK file is a test version or a beta version, and the second target APK file modifies some configurations according to the needs of operation or products, so that multiple versions of the same online game are released for users to select in diversity, and the functions of differentiation among the versions include sharing, pushing, thermal repairing and the like.
In some scenes, the business operation of the electronic game releases multiple versions for the same game according to the existing business requirements and considering the subsequent business expansion, and the difference of secondary distribution mainly depends on different configuration files and parameters, so that the expansion when different parameters and configurations are added in the future is mainly considered according to the important consideration. In this case, the generated and published channel package (the first target APK file) needs to be distributed for the second time, and corresponding parameters such as the original sharing need to be adjusted and modified. In the past, the work needs to be carried out one by one, and the workload is very huge for generating hundreds of sub-channels at a time. In the embodiment, a configuration parameter template is designed for the scene, so that different types of parameters can be dynamically added for different channels, all different secondary sub-packages can be generated at one time, the channel package and all the secondary sub-packages can be generated at one time, and the time for developing the package by the game can be greatly reduced.
In an implementation manner of this embodiment, after obtaining the source APK file of the online game and the configuration information of the multiple target distribution channels, the method further includes: determining attribute information of a target distribution channel, wherein the attribute information is used for representing whether an APK file to be distributed through the target distribution channel is allowed to be compressed or not; and if the attribute information represents that the APK file is not allowed to be compressed, packaging the configuration information to generate a compressed file, and adding the compressed file into the source APK file to obtain a third target APK file.
In some scenarios, some games have special requirements on the compression mode of resources when generating APKs, such as being incapable of compression and having no uniform suffix name constraint. This can result in the use of existing tools that do not meet the need for rapid game loading when repackaging. In the embodiment, by using a substitution means, a non-compression mode is reused, resources in the configuration information are added again in a mode of adding compressed files, and the files are added again in a compressed file form without compression by bypassing a used packaging mode, so that the problem is solved, and the problem that a game developer modifies codes again is avoided.
In this embodiment, generating the plurality of first target APK files according to the intermediate file and the plurality of configuration information respectively includes:
s11, acquiring a first resource and a second resource in the intermediate file, wherein the first resource and the second resource are respectively adapted to an aapt (android Packaging tool) compiling tool and an aapt2 compiling tool;
in this embodiment, aapt and aapt2 are both tools for compiling and packaging resources, and aapt2 is optimized on aapt, and can compile and package different types of resources, respectively. In the packaging process, aapt is automatically called, and the resource file is compiled into a binary file. Taking aapt2 as an example, the original resource compiling and packaging process is split into two parts, namely compiling and linking, compiling: compiling the resource file into a binary format file, and linking: and merging all the compiled files and packaging into a single file. The method can well improve the compiling performance of the resources, for example, when only one resource file sends a change, only the changed file needs to be recompiled and then linked with other unchanged resources. And aapt is to merge all resources, and compile all resources after merge to generate a resource ap file, which is a compressed package, so that the result is to compile the whole amount of resources even if only one resource file is changed.
S12, covering the first resource with the second resource, compiling the second resource and the plurality of configuration information by using an aapt2 compiling tool, and respectively generating a plurality of first target APK files.
Optionally, the covering the first resource with the second resource includes: and performing duplicate removal, compiling and decompiling on the first resource to obtain a corresponding second resource.
Since the aapt and aapt2 have obvious difference in compiling manner of resources, it may face that the channel package is not compatible with the resources used by the game mother package. The present embodiment introduces a resource compiling approach of aapt 2. The problem that the game development tool version must be required to be packaged before is solved. At present, the number of games developed by aapt2 is increasing, and the problem of conflict between games and channel resources is more prominent in the past. After the covering options of the resources are provided, particularly the introduction of aapt2 changes the compiling mode of the resources, so that the condition is greatly improved, and the adaptive capacity is improved.
In an embodiment of this embodiment, decompiling the source APK file to obtain an intermediate file includes: decompiling the source APK file by adopting an APKTOOL component to obtain a first smali file, a first resource file and a resource description file, wherein the first resource file comprises: picture resources, layout resources, character string resources; compiling and linking the first resource file and the resource description file again by adopting aapt and appt2 to generate a new resource file, a new resource description file and a new R.java file; respectively processing the R.java file by adopting a java.exe component, a jar.exe component, a dx.jar component and a bakmali.jar component to correspondingly generate a class file, a jar file, a dex file and a second smali file, and merging the class file, the jar file, the dex file and the second smali file with the first smali file.
In the embodiment, the APKTOOL component is adopted to decompile the source APK file to obtain a smali file, a resource file and a resource description file. And compiling the resource file and the resource description file again by adopting aapt and appt2, and linking to generate a new resource, a resource description file and an R.java file. Processing the R.java file by adopting Java.exe, jar.exe, dx.jar and bakmali.jar components to sequentially generate class, jar, dex and smali files. And merging with the above-mentioned decompiled smali file. And finally, adopting an APKTOOL component to forward compile new resources, new resource description files and combined smali files, and regenerating APK files.
In this embodiment, the APK file is decompiled by using the resource APKTOOL tool to obtain the resource file, and a series of resources such as 9-patch pictures, layouts, character strings and the like in the source APK file can be restored.
In an embodiment of this embodiment, generating the plurality of first target APK files according to the intermediate file and the plurality of configuration information respectively includes: generating a second resource file and an android interface definition language AIDL file according to the intermediate file, wherein the second resource file comprises a resource identifier and a resource index in a source APK file; compiling the second resource file and the AIDL file into a first JAR package; compiling the first JAR package and the second JAR package into a Dex file, wherein the configuration information comprises the second JAR package; packing the Dex file and the third resource file to obtain an APK file, wherein the configuration information comprises the third resource file, and the third resource file comprises a resource identifier and a resource index in the configuration information; and signing the APK file, and performing memory alignment processing on the APK file through a memory mapping mechanism to obtain a first target APK file.
After the APK file is reversed, the APK file is usually required to be repackaged into an APK file, the packaging process is as follows, and tools such as APKTOOL are required in the operation process. The packaging process comprises the following three steps:
the first step is to generate resource files such as R.java and resources.arsc files and files corresponding to AIDL, wherein the generated R.java and resources.arsc files are mainly used by an AAPT tool, and the generated files corresponding to AIDL are mainly used by an AIDL tool:
secondly, compiling the resource file and the code into an APK, firstly, putting the files corresponding to the R.java and aidl generated in the first step and the Java code together, compiling the Java code into a Class file by using a JAVAC tool in the JDK and printing the Class file into a JAR package; then putting the obtained JAR package and a JAR package of a third party together, and compiling into a Dex file by using a DX tool; then putting the obtained Dex file and other resources together, and generating an APK file through an APKBUILDER tool, wherein the APK file obtained in the step is not signed;
thirdly, signing the unsigned APK, wherein a JARSIGNER tool is mainly used for signing the APK; and performing memory alignment optimization processing on the APK after signature by using a ZIPALIGN tool, and greatly improving the access speed of the APK processed by the ZIPALIGN tool through a memory mapping mechanism.
Fig. 3 is an overall architecture diagram of the front end and the back end of the multi-channel packaging tool according to the embodiment of the present invention, including a game server, a game access end, a server including a channel access end, a packaging tool, and a channel server. The SDK server (server) and the SDK client (packaging tool) are added to serve as a transfer layer, the SDK server and the SDKCore framework are in charge of butt joint of all channels of the distribution platform, the channels are not directly contacted by games, and the packaging tool is added for automation realization, and aims to integrate the game client, the SDKCore framework and the channels SDK together to complete channels.
The game access end of the packaging process puts the game related resources into a packaging tool, the packaging tool downloads the channel resource package, the SDKCore frame package and the channel configuration file in the required channel access end through the packaging tool service end, and finally a plurality of channel game packages are formed through a series of operations on the packaging tool by a user.
For a game access end, firstly, an external SDK access package (also called an SDKCore frame package) matched with a packaging tool is accessed with a corresponding document, the package provides a uniform access interface for a game, the interface provides an abstract protocol of used issuing platform services for the game, the main purpose is uniform access to the game, an interface arranged in the frame is used for dotting and monitoring, the interface is checked and consulted conveniently at the later stage, the game is accessed into the SDKCore frame package to form a master package APK, the master package APK is placed into the packaging tool, and a needed channel is selected for one-key packaging. The frame provides the standard of the realization flow of the template specified channel module package, and the channel package downloaded by the packaging tool and the game package are completely fused by utilizing the dynamic loading technology, and finally the code interface is completed to call the complete flow.
For the channel access end, access documents of the SDK (also called channel SDK) provided by each issuing platform are firstly used. Channel SDK related functions are accessed under template flow control of the SDKCore framework package. And generating the accessed codes into a channel resource package with a specified custom format through a custom channel packaging script, uploading the channel resource package to a packaging tool server, and downloading the corresponding channel resource package and the game master package APK for packaging operation by the packaging tool according to the corresponding channel selected by the user.
Aiming at the channel configuration file, firstly, the channel configuration file is operated and configured to a designated position of a server according to the channel configuration parameters applied by each issuing platform for a designated game. The packaging tool downloads the corresponding channel configuration file according to the channel selected by the user, and the SDKCore frame package reads the channel configuration parameter file to obtain the configuration parameters of the appointed game channel. For the SDKCore frame package, a uniform interface is provided for the game, an access channel SDK template is provided for an internal supply channel access end, and uniform login, payment flow control and related dotting work are completed by the SDKCore frame package.
The multi-channel packaging tool is divided from the module perspective and comprises an interface configuration module, a resource downloading module, a multi-channel packaging module, a log management module and other modules. Firstly, according to the game provided master package APK, the user uses the packaging tool to select the relevant configuration, the game master package APK, the channel resource package, the SDKCore frame package and the channel resource file are packaged together, the packaging operation is completed, and the relevant function required by the issuing platform is realized.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a device for generating a software package is further provided, which is used to implement the foregoing embodiments and preferred embodiments, and the description of the software package that has been already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware or a combination of software and hardware is also possible and contemplated.
The embodiment provides a software package generation device, which is applied to the association display between historical data, and the device is used for: inputting two historical data nodes needing to be inquired, and displaying the associated nodes between the two historical data nodes by path connection through searching.
Fig. 4 is a block diagram of a software package generation apparatus according to an embodiment of the present invention, applied to a client, and as shown in fig. 4, the apparatus includes: an acquisition module 40, a processing module 42, a first generation module 44, wherein,
the acquisition module 40 is configured to acquire an APK file of a source android application package of the online game and configuration information of a plurality of target publishing channels;
the processing module 42 is configured to perform decompiling on the source APK file to obtain an intermediate file;
and the first generating module 44 is configured to generate a plurality of first target APK files according to the intermediate file and the plurality of configuration information, where each first target APK file corresponds to one target publishing channel.
Optionally, the apparatus further comprises: the reading module is used for reading a configuration parameter template after the first generating module respectively generates a plurality of first target APK files according to the intermediate file and the plurality of configuration information, wherein the configuration parameter template comprises a plurality of demand parameters respectively corresponding to target publishing channels, and the demand parameters comprise the configuration information and expansion parameters; and the second generation module is used for respectively generating a plurality of second target APK files according to the intermediate file and the configuration parameter template.
Optionally, the apparatus further comprises: the reading module is used for determining the attribute information of a target issuing channel after the acquisition module acquires a source APK file of the online game and configuration information of a plurality of target issuing channels, wherein the attribute information is used for representing whether the APK file to be issued through the target issuing channel is allowed to be compressed or not; and the third generation module is used for packaging the configuration information to generate a compressed file if the attribute information represents that the APK file is not allowed to be compressed, and adding the compressed file to the source APK file to obtain a third target APK file.
Optionally, the first generating module includes: an obtaining unit, configured to obtain a first resource and a second resource in the intermediate file, where the first resource and the second resource are respectively adapted to an aapt compiling tool and an aapt2 compiling tool; and the first generating unit is used for covering the first resource with the second resource, compiling the second resource and the plurality of configuration information by using an aapt2 compiling tool, and respectively generating a plurality of first target APK files.
Optionally, the generating unit includes: and the processing subunit is used for performing duplicate removal, compiling and decompiling on the first resource to obtain a corresponding second resource.
Optionally, the processing module includes: a decompiling unit, configured to decompile the source APK file by using an APKTOOL component to obtain a first smal file, a first resource file, and a resource description file, where the first resource file includes: picture resources, layout resources, character string resources; a generating unit, configured to compile the first resource file and the resource description file again by using aapt and appt2, and link the first resource file and the resource description file to generate a new resource file, a new resource description file, and a new r.java file; and the processing unit is used for respectively processing the R.java file by adopting a java.exe component, a jar.exe component, a dx.jar component and a bakmali.jar component, correspondingly generating a class file, a jar file, a dex file and a second smali file, and merging the class file, the jar file, the dex file and the second smali file with the first smali file.
Optionally, the first generating module includes: a second generating unit, configured to generate a second resource file and an android interface definition language aid l file according to the intermediate file, where the second resource file includes a resource identifier and a resource index in the source APK file; a first compiling unit, configured to compile the second resource file and the aid dl file into a first JAR package; a second compiling unit, configured to compile the first JAR package and a second JAR package into a Dex file, where the configuration information includes the second JAR package; a packing unit, configured to pack the Dex file and a third resource file to obtain an APK file, where the configuration information includes the third resource file, and the third resource file includes a resource identifier and a resource index in the configuration information; and the processing unit is used for signing the APK file and carrying out memory alignment processing on the APK file through a memory mapping mechanism to obtain the first target APK file.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but is not limited to this: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
Embodiments of the present invention also provide a storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, obtaining a source android Application Package (APK) file of the online game and configuration information of a plurality of target release channels;
s2, performing decompiling on the source APK file to obtain an intermediate file;
and S3, respectively generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information, wherein each first target APK file corresponds to one target publishing channel.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, obtaining a source android Application Package (APK) file of the online game and configuration information of a plurality of target release channels;
s2, performing decompiling on the source APK file to obtain an intermediate file;
and S3, respectively generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information, wherein each first target APK file corresponds to one target publishing channel.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a hardware form, and can also be realized in a software functional unit form.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that, for a person skilled in the art, several modifications and improvements can be made without departing from the principle of the present application, and these modifications and improvements should also be considered as the protection scope of the present application.

Claims (10)

1. A method for generating a software package, comprising:
acquiring a source android Application Package (APK) file of an online game and configuration information of a plurality of target release channels;
performing decompiling on the source APK file to obtain an intermediate file;
and respectively generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information, wherein each first target APK file corresponds to one target publishing channel.
2. The method of claim 1, wherein after generating a plurality of first target APK files from the intermediate file and a plurality of the configuration information, respectively, the method further comprises:
reading a configuration parameter template, wherein the configuration parameter template comprises a plurality of demand parameters respectively corresponding to target release channels, and the demand parameters comprise the configuration information and expansion parameters;
and respectively generating a plurality of second target APK files according to the intermediate file and the configuration parameter template.
3. The method of claim 1, wherein after obtaining a source APK file of an online game and configuration information of a plurality of target distribution channels, the method further comprises:
determining attribute information of the target publishing channel, wherein the attribute information is used for representing whether the APK file to be published through the target publishing channel is allowed to be compressed or not;
and if the attribute information represents that the APK file is not allowed to be compressed, packaging the configuration information to generate a compressed file, and adding the compressed file to the source APK file to obtain a third target APK file.
4. The method of claim 1, wherein generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information respectively comprises:
acquiring a first resource and a second resource in the intermediate file, wherein the first resource and the second resource are respectively adapted to an aapt compiling tool and an aapt2 compiling tool;
and covering the first resource with the second resource, and compiling the second resource and the plurality of configuration information by using an aapt2 compiling tool to respectively generate a plurality of first target APK files.
5. The method of claim 4, wherein overriding the first resource with the second resource comprises:
and performing duplicate removal, compiling and decompiling on the first resource to obtain a corresponding second resource.
6. The method of claim 1, wherein decompiling the source APK file to obtain an intermediate file comprises:
decompiling the source APK file by adopting an APKTOOL component to obtain a first smali file, a first resource file and a resource description file, wherein the first resource file comprises: picture resources, layout resources, character string resources;
compiling and linking the first resource file and the resource description file again by adopting aapt and appt2 to generate a new resource file, a new resource description file and a new R.java file;
respectively processing the R.java file by adopting a java.exe component, a jar.exe component, a dx.jar component and a bakmali.jar component to correspondingly generate a class file, a jar file, a dex file and a second smali file, and merging the class file, the jar file, the dex file and the second smali file with the first smali file.
7. The method of claim 1, wherein generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information respectively comprises:
generating a second resource file and an android interface definition language AIDL file according to the intermediate file, wherein the second resource file comprises a resource identifier and a resource index in the source APK file;
compiling the second resource file and the AIDL file into a first JAR package;
compiling the first JAR package and a second JAR package into a Dex file, wherein the configuration information comprises the second JAR package;
packing the Dex file and a third resource file to obtain an APK file, wherein the configuration information comprises the third resource file, and the third resource file comprises a resource identifier and a resource index in the configuration information;
and signing the APK file, and performing memory alignment processing on the APK file through a memory mapping mechanism to obtain the first target APK file.
8. An apparatus for generating a software package, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a source android Application Package (APK) file of an online game and configuration information of a plurality of target publishing channels;
the processing module is used for performing decompiling on the source APK file to obtain an intermediate file;
and the first generation module is used for respectively generating a plurality of first target APK files according to the intermediate file and the plurality of configuration information, wherein each first target APK file corresponds to one target publishing channel.
9. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 7.
CN202010765803.1A 2020-08-03 2020-08-03 Software package generation method and device, storage medium and electronic device Pending CN112052013A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010765803.1A CN112052013A (en) 2020-08-03 2020-08-03 Software package generation method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010765803.1A CN112052013A (en) 2020-08-03 2020-08-03 Software package generation method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN112052013A true CN112052013A (en) 2020-12-08

Family

ID=73602227

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010765803.1A Pending CN112052013A (en) 2020-08-03 2020-08-03 Software package generation method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112052013A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112905170A (en) * 2021-03-09 2021-06-04 百果园技术(新加坡)有限公司 Channel package generation method, device, equipment and storage medium
CN112905194A (en) * 2021-03-18 2021-06-04 北京字节跳动网络技术有限公司 Installation package generation method and device
CN113076147A (en) * 2021-03-09 2021-07-06 北京一亩田新农网络科技有限公司 Resource loading method, device, system and medium for dynamic APK
CN113094121A (en) * 2021-04-30 2021-07-09 腾讯科技(成都)有限公司 Data processing method, data processing equipment and computer readable storage medium
CN116755713A (en) * 2023-08-16 2023-09-15 深圳传趣网络技术有限公司 Application program generation method, device, equipment and storage medium
CN116974586A (en) * 2023-09-22 2023-10-31 深圳传趣网络技术有限公司 Multi-channel application packaging method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017084266A1 (en) * 2015-11-16 2017-05-26 乐视控股(北京)有限公司 Method and device for customizing multi-channel installation package
CN107844301A (en) * 2017-12-12 2018-03-27 苏州蜗牛数字科技股份有限公司 A kind of Android application channel closes bag method and device
CN108829405A (en) * 2018-06-04 2018-11-16 网易(杭州)网络有限公司 The generation method and device of channel packet, storage medium, electronic device
CN111209001A (en) * 2019-12-19 2020-05-29 福建升腾资讯有限公司 Method, system, equipment and medium for batch generation of APKs of android channels
CN111443918A (en) * 2018-12-29 2020-07-24 北京奇虎科技有限公司 Channel access method and device for business object installation package

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017084266A1 (en) * 2015-11-16 2017-05-26 乐视控股(北京)有限公司 Method and device for customizing multi-channel installation package
CN107844301A (en) * 2017-12-12 2018-03-27 苏州蜗牛数字科技股份有限公司 A kind of Android application channel closes bag method and device
CN108829405A (en) * 2018-06-04 2018-11-16 网易(杭州)网络有限公司 The generation method and device of channel packet, storage medium, electronic device
CN111443918A (en) * 2018-12-29 2020-07-24 北京奇虎科技有限公司 Channel access method and device for business object installation package
CN111209001A (en) * 2019-12-19 2020-05-29 福建升腾资讯有限公司 Method, system, equipment and medium for batch generation of APKs of android channels

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112905170A (en) * 2021-03-09 2021-06-04 百果园技术(新加坡)有限公司 Channel package generation method, device, equipment and storage medium
CN113076147A (en) * 2021-03-09 2021-07-06 北京一亩田新农网络科技有限公司 Resource loading method, device, system and medium for dynamic APK
CN113076147B (en) * 2021-03-09 2024-02-02 北京一亩田新农网络科技有限公司 Dynamic APK resource loading method, device, system and medium
CN112905170B (en) * 2021-03-09 2024-04-19 百果园技术(新加坡)有限公司 Channel package generation method, device, equipment and storage medium
CN112905194A (en) * 2021-03-18 2021-06-04 北京字节跳动网络技术有限公司 Installation package generation method and device
CN113094121A (en) * 2021-04-30 2021-07-09 腾讯科技(成都)有限公司 Data processing method, data processing equipment and computer readable storage medium
CN113094121B (en) * 2021-04-30 2023-03-10 腾讯科技(成都)有限公司 Data processing method, data processing equipment and computer readable storage medium
CN116755713A (en) * 2023-08-16 2023-09-15 深圳传趣网络技术有限公司 Application program generation method, device, equipment and storage medium
CN116974586A (en) * 2023-09-22 2023-10-31 深圳传趣网络技术有限公司 Multi-channel application packaging method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112052013A (en) Software package generation method and device, storage medium and electronic device
CN104346184A (en) Application packaging device and application packaging method
CN108279902B (en) Lua script technology based multi-terminal sharing bottom layer framework generation and application method
CN103123588A (en) Method and system for obtaining difference upgrade patch
CN110032392A (en) Service administering method and device, storage medium and electronic equipment
CN107632827B (en) Method and device for generating installation package of application
CN109542459A (en) Application program packaging method and device, computer installation and computer storage medium
CN106339237A (en) Plug-in loading frame for WEB application in field of JavaEE and method
CN112769706B (en) Componentized routing method and system
CN112615759B (en) Full link voltage measurement assembly, full link voltage measurement method and device
CN113312083B (en) Application generation method, device and equipment
CN112631622A (en) Application installation method and device, server and computer readable medium
CN112486518A (en) Consensus algorithm assembling method and device
CN112181366B (en) Mobile application development framework based on cross-platform interaction
CN112988409A (en) Interface calling method and device, computer equipment and storage medium
CN111338666A (en) Method, device, medium and electronic equipment for realizing application program upgrading
CN107678755B (en) Installation package packaging method and device, electronic equipment and computer readable medium
CN105389180A (en) Android platform-based USB (Universal Serial Bus) port configurable method
CN110221855B (en) Method for app and server collaborative updating and offline running
CN109857374B (en) Development method and device of mobile application
CN110908652A (en) Method and device for creating active page and compiling active page
CN115840598A (en) Micro front-end architecture system, development method, device and medium based on application market
CN111694807B (en) Processing method, system, equipment and storage medium of nonvolatile storage file
CN112988176A (en) Channel package generation method and device, storage medium and electronic equipment
CN105204937B (en) Kernel function call method, apparatus and operating system

Legal Events

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