CN111090425B - Program packaging method and device and electronic equipment - Google Patents

Program packaging method and device and electronic equipment Download PDF

Info

Publication number
CN111090425B
CN111090425B CN201911275691.5A CN201911275691A CN111090425B CN 111090425 B CN111090425 B CN 111090425B CN 201911275691 A CN201911275691 A CN 201911275691A CN 111090425 B CN111090425 B CN 111090425B
Authority
CN
China
Prior art keywords
resource
software development
file
main program
development kits
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911275691.5A
Other languages
Chinese (zh)
Other versions
CN111090425A (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.)
AlipayCom Co ltd
Original Assignee
AlipayCom 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 AlipayCom Co ltd filed Critical AlipayCom Co ltd
Priority to CN201911275691.5A priority Critical patent/CN111090425B/en
Priority to CN202310410385.8A priority patent/CN116521144A/en
Publication of CN111090425A publication Critical patent/CN111090425A/en
Application granted granted Critical
Publication of CN111090425B publication Critical patent/CN111090425B/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/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the specification discloses a program packaging method, a program packaging device and electronic equipment. The scheme comprises the following steps: acquiring a plurality of software development kits called by a main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program; compiling the main program to obtain a compiled file; when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, modifying the resource IDs in the plurality of software development kits according to the resource ID in the compiling file so that one resource file identified by the resource ID is unique; and packaging the main program and the modified plurality of software development kits.

Description

Program packaging method and device and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a program packaging method, a program packaging device, and an electronic device.
Background
In the prior art, when an APP provides a certain service to a third party application, the third party application often needs to call a plurality of software development kits (Software Development Kit, SDKs) in the APP to complete the service together, but the plurality of SDKs are often not related, so that a developer of the third party application needs to learn specific content and programming logic of each SDK, thereby bringing excessive resource consumption to the third party application and reducing access efficiency.
Thus, there is a need to provide faster or more reliable program packaging schemes.
Disclosure of Invention
In view of this, the embodiments of the present application provide a program packaging method, apparatus, and electronic device, which are used to improve the access efficiency of an application program.
In order to solve the above technical problems, the embodiments of the present specification are implemented as follows:
the program packaging method provided in the embodiment of the present specification includes:
acquiring a plurality of software development kits called by a main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program;
compiling the main program to obtain a compiled file;
when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, modifying the resource IDs in the plurality of software development kits according to the resource ID in the compiling file so that one resource file identified by the resource ID is unique;
and packaging the main program and the modified plurality of software development kits.
Another program packaging method provided in the embodiment of the present disclosure includes:
acquiring a plurality of software development kits called by a main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program;
Compiling the main program to obtain a compiled file;
when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, modifying the resource ID in the compiling file and the resource ID in the plurality of software development kits so that the resource file identified by one resource ID is unique;
and packaging the modified compiling file and the modified plurality of software development kits.
The program packaging apparatus provided in the embodiment of the present specification includes:
the system comprises a software development kit acquisition module, a main program acquisition module and a software development kit acquisition module, wherein the software development kit acquisition module is used for acquiring a plurality of software development kits called by the main program, and the plurality of software development kits are used for realizing auxiliary functions of the main program;
the main program compiling module is used for compiling the main program to obtain a compiling file;
a resource ID modifying module, configured to modify, when a resource ID in the compiled file conflicts with a resource ID in the plurality of software development kits, a resource ID in the plurality of software development kits according to the resource ID in the compiled file, so that a resource file identified by the resource ID is unique;
And the program packaging module is used for packaging the main program and the modified plurality of software development kits.
Another program packaging apparatus provided in an embodiment of the present disclosure includes:
the system comprises a software development kit acquisition module, a main program acquisition module and a software development kit acquisition module, wherein the software development kit acquisition module is used for acquiring a plurality of software development kits called by the main program, and the plurality of software development kits are used for realizing auxiliary functions of the main program;
the main program compiling module is used for compiling the main program to obtain a compiling file;
a resource ID modifying module, configured to modify, when a resource ID in the compiled file conflicts with a resource ID in the plurality of software development kits, the resource ID in the compiled file and the resource ID in the plurality of software development kits, so that a resource file identified by the resource ID is unique;
and the program packaging module is used for packaging the modified compiling file and the modified plurality of software development kits.
An electronic device provided in an embodiment of the present disclosure includes:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
Acquiring a plurality of software development kits called by a main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program;
compiling the main program to obtain a compiled file;
when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, modifying the resource IDs in the plurality of software development kits according to the resource ID in the compiling file so that one resource file identified by the resource ID is unique;
and packaging the main program and the modified plurality of software development kits.
Another electronic device provided in an embodiment of the present disclosure includes:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a plurality of software development kits called by a main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program;
compiling the main program to obtain a compiled file;
When the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, modifying the resource ID in the compiling file and the resource ID in the plurality of software development kits so that the resource file identified by one resource ID is unique;
and packaging the modified compiling file and the modified plurality of software development kits.
Embodiments of the present disclosure provide a computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to implement the above-described method.
The above-mentioned at least one technical scheme that this description embodiment adopted can reach following beneficial effect:
according to the program packaging method provided by the embodiment of the specification, the plurality of software development kits supporting the service function are combined with the main program and then output, and a developer of an access party only needs to learn the content of one combined program, so that the plurality of software development kits do not need to be respectively learned, the learning process of the access party for accessing the service is reduced, and the access efficiency of the application program is improved.
In addition, the plurality of software development kits are packaged, and the situation that one resource ID corresponds to a plurality of resource files can be possibly faced, so that the resource IDs of the plurality of software development kits and the resource files in the main program are renamed, and the problem of resource file reference conflict caused by the fact that one resource ID corresponds to a plurality of resource files is avoided.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
fig. 1 is a schematic flow chart of an embodiment one of a program packaging method provided in the embodiments of the present disclosure;
fig. 2 is a schematic flow chart of a second embodiment of a program packaging method according to the embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a program packaging apparatus corresponding to FIG. 1 according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a program packaging apparatus corresponding to FIG. 2 according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
For the purposes, technical solutions and advantages of the present application, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
When one application APP (access party) needs to access a certain service (such as a payment code service) of another application APP (output party), an SDK of the service provided by the output party needs to be called, and after a developer of the access party decompresses the SDK and learns the logic of the SDK, the function of the SDK can be realized.
However, in some cases, the development platform of the output side has a relatively large number of functions, and in order to facilitate programming of a developer, some frequently used programs for implementing the basic functions are packaged to generate the basic SDK. When developing a service, a developer only needs to call the basic SDKs to realize a function without reprogramming. Thus, some services include multiple underlying SDKs called in addition to the main program. Since the main program and the base SDK are not integrated, when they are output externally, the main program and the base SDK need to be output separately, and after receiving the main program and the base SDK, the developer of the access party needs to learn the programming language and the programming logic of the main program and the base SDK, respectively. This intangibly increases the access cost of the access party and reduces the access efficiency.
In order to improve the access efficiency, in the embodiment of the present disclosure, after the main program and the basic SDK are packaged, the main program and the basic SDK are output, and a developer of the access party only needs to learn the packaged SDKs uniformly. However, the problem of resource IDs of resource files in multiple SDKs colliding needs to be solved at the time of packaging. According to the embodiment of the specification, the resource ID of the resource file with conflict is modified, and the resource IDs in the main program and the basic SDK are unified so as to achieve that one resource ID corresponds to one resource file, so that the problem of resource ID conflict is solved.
The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
Example 1
Fig. 1 is a flowchart of an embodiment one of a program packaging method according to an embodiment of the present disclosure. From the program perspective, the execution subject of the flow may be a program or an application client that is installed on an application server.
As shown in fig. 1, the process may include the steps of:
step 102: and acquiring a plurality of software development kits called by the main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program.
A software development kit may be understood as an SDK, and when a service is implemented, multiple basic SDKs often need to be called to complete together. A base SDK may be understood as a modular package provided on a platform that can be directly invoked to implement a base function without requiring a developer to reprogram.
For example, the payment code service relies on 6 basic SDKs, namely UTDID, infinite Dart SDK, cash desk SDK, payment code SDK, login SDK and wind control SDK.
Among them, UTDID is a library for generating a universally unique identification code (Universally Unique IDentifier, UUID).
The infinite dart SDK is a set of professional complete safety solution for guaranteeing the application integrity, the application execution environment credibility and the data confidentiality of the mobile platform, and comprises four core functions of safe storage, safe encryption, safe signature and man-machine identification. The client provides a security component of the SDK type for a developer to access, and prevents the application from being attacked by a hacker or Trojan horse by realizing a multi-level security mechanism to create a security sandboxed environment.
The checkout counter SDK is also called a wireless quick payment SDK for providing a payment channel.
Payment code SDK for providing payment code service
The login SDK is used for login of the user.
The wind-controlled SDK is used for risk control of payment code services.
It should be understood that the main program is understood to be a program code that implements a service, for example, a payment code service, where the main program is a program in the payment code SDK, and the main program needs to call some basic SDKs to support the service of the payment code during execution, where the basic SDKs are UTDID, infinite dart, cash desk SDK, payment code SDK, and login SDK.
In addition, it should be noted that these basic SDKs may be stored in the same server or client as the main program, or may exist in different servers or clients.
For example, the developer a executes the step 102 on the server a, where the main program is in the form of source code, and the basic SDK may exist in a database on the server a or may exist in the server M, where the server M is used to store all the basic SDKs, and when the basic SDKs are called, the basic SDKs need to be called from the server M.
It should be noted that, the storage form of the base SDK may be a packaged state, that is, stored in the form of binary code.
Step 104: and compiling the main program to obtain a compiling file.
In this embodiment, the main program may be in the form of source code, which is written in assembly and high-level languages, such as Java, C, python, PHP, C ++, c#, javaScript, R, go, OC, swift, etc.
The source code includes a plurality of resource files, and all files capable of reading the needed resources from the source code can be called as resource files. The type of resource file may be a picture, audio, video, text resource, or other content that may be presented in a computer, etc. Is read by a special program interface and is presented to the user in the application program as required.
A program written in one programming language is translated into an equivalent program written in another language, and is called a compiler. Compilation is the process of generating a target program from a source program written in a source language by a compiler, and can understand the actions of generating the target program by the compiler.
In short, compiling is to change a high-level language which can be read and understood by human into a language which can be recognized by a computer, and a compiler is to change a familiar language into binary codes because the computer only knows 1 and 0.
Compilation can be achieved by a compiler, which divides the process of translating a source program into a target program into five phases: lexical analysis; analyzing grammar; semantic checking and intermediate code generation; code optimization; and generating an object code.
When compiling a main program, it is a process of packaging code and resource files, and besides the change from source code to target code, the process of compiling is accompanied by producing files, which can be called compiling files.
Step 106: when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, the resource IDs in the plurality of software development kits are modified according to the resource IDs in the compiling file, so that one resource file identified by the resource ID is unique.
The resource files may be packaged into APKs (res folders) during compilation or into separate resource APK packages (such as frame-res. APK). But these resource files are given unique IDs, i.e., resource indexes, to facilitate system access. The R.java file under the gen directory is automatically generated by a compiler, and a developer is not required to maintain the R.java file. The R.java automatically records all the resource files in the current application, and establishes corresponding IDs according to the resource files, including: layout resources, control resources, string resources, dragable resources, and the like. R.java can be simply understood as a resource dictionary of the current Android application.
The resource ID of the resource file can only be first in lower case letters and underlined, and then only the characters "a-z" and "0-9" can appear in the names. Such as a resource ID may be represented by "0x7f 030000".
Because each software development kit comprises an R.java file, the resource ID in the R.java file is automatically generated, and because the R.java file comprises a plurality of R.java files, the problem of resource ID conflict can be avoided in one R.java file. However, there may be one resource ID existing in a plurality of r.java files, that is, one resource ID has a corresponding resource file in different SDKs, so that call conflicts may occur when the corresponding resource file is called through the resource ID. Therefore, the resource IDs of the plurality of resource files corresponding to the resource IDs need to be modified to avoid the problem of call conflicts.
The embodiment provides a method for modifying resource IDs, which can modify resource IDs in a plurality of software development kits according to the resource IDs in a compiling file. If resource ID conflict occurs, only the resource ID in the software development kit can be modified, and the resource ID of the resource file compiled by the main program is not modified. For example, one resource ID "0x7f030000" corresponds to a plurality of resource files a, b, and c. Wherein a is located in the main program, b is located in SDK1, and c is located in SDK 2. To avoid resource file call conflicts, only the resource IDs of b and c may be modified, e.g., the resource ID of b may be modified to "0x7f030001" and the resource ID of c may be modified to "0x7f030002".
It should be noted that only the resource ID of the conflicting resource file needs to be modified here, so that the resource file identified by the resource ID is unique, and how to modify the resource ID of the conflicting resource file is not limited herein.
Step 108: and packaging the main program and the modified plurality of software development kits.
The problem of resource ID conflict is solved, and the main program and a plurality of SDKs needing to be output can be packaged and encapsulated. In the process of packaging, all programs (packages), resource files and some attribute files (such as r.java files and alives) are required to be combined respectively, and then packaged and packaged. And inputting the packed SDK to an access party, and the access party can realize access service.
In the method in fig. 1, by combining a plurality of software development kits supporting service function implementation with a main program and then outputting the combined software development kits, a developer of an access party only needs to learn the content of one combined program, and does not need to learn the plurality of software development kits respectively, so that the learning process of the access party for accessing service is reduced, and the access efficiency of an application program is improved.
In addition, when a plurality of software development kits are packaged, a situation that one resource ID corresponds to a plurality of resource files may be faced, so in this embodiment, the resource IDs of the resource files in the plurality of SDKs that collide are renamed, thereby avoiding the occurrence of resource file reference collision caused by that one resource ID corresponds to a plurality of resource files.
Based on the method of fig. 1, the examples of the present specification also provide some specific implementations of the method, as described below.
In order to improve the modification efficiency of the resource ID, the embodiment further provides a method for modifying the resource ID: the modifying the resource IDs in the plurality of software development kits according to the resource IDs in the compiled file may specifically include:
screening resource files which are the same as the resource ID in the compiling file from the resource files in the plurality of software development kits;
And carrying out resource ID naming again on the screened resource file according to the existing resource ID.
In one or more embodiments of the present disclosure, resource files having the same resource ID are first screened out. The following method can be adopted: for any resource ID, the resource ID can be searched from R.java files in all SDKs, and the resource ID appears for several times. If only one occurrence occurs, it can be stated that the resource ID corresponds to a unique resource file. If the resource ID occurs twice or more, it is indicated that the resource ID occurs in a plurality of R.java files. Therefore, the same resource ID as the r.java file in the other SDKs needs to be modified.
It should be noted that, in this embodiment, only the resource IDs of the resource files in the plurality of SDKs need to be modified, so that it is necessary to first determine the resource files in the plurality of SDKs that conflict with the resource IDs, and then rename the resource files. Renaming may set some specific rules, not specifically limited herein.
In order to accurately call the resource file, the modifying the resource IDs in the plurality of software development kits according to the resource IDs in the compiled file may further include:
Replacing the resource ID in the R.java files in the plurality of software development kits with the modified resource ID;
and replacing the resource ID in the resource file reference statement in the software development kit with the modified resource ID.
When the method is applied specifically, the corresponding relation between the resource file and the resource ID is recorded in the R.java file, the resource ID in the R.java file needs to be modified, and the modified resource ID in the R.java file is the corresponding relation between the resource file and the resource ID. Therefore, in order to accurately call the resource file, the corresponding program statement for calling the resource file in the code is also modified.
For example, a resource file is referenced in a java program, and the following references are referenced according to the grammar of java: resource_type. Resource_name, note: the resource_name does not require the suffix name of the file. If the resource ID of the resource file is modified from "0x7f030000" to "0x7f030001", then the reference statement of the resource file needs to be modified from "R.resource_type.0x7f030000" to "0x7f030001".
In addition, since the main program and the plurality of SDKs are to be combined, android components in different SDKs may run in different processes, so when implementing a service, a plurality of processes are often required to be parallel, thereby wasting system resources. In order to reduce the waste of system resources, before the packaging of the main program and the modified plurality of software development kits, the method may further include:
Decompressing the plurality of software development kits to obtain a plurality of manifest files;
modifying the process names in the plurality of manifest files and the process names in the manifest file of the main program to the same process name;
and merging the plurality of manifest files and the manifest files of the main program to generate a merged manifest file.
In the Android system, there are four major components, respectively: there is an Activity (display interface), service (Content ProvIDer (data communication), broadcastReceiver (broadcast).
Activity is a window where a user interacts with an application, one Activity corresponds to an actual web page, when one screen is opened, the previous screen is put into a pause state, and pushed onto a history stack, and the user can return to the previously opened screen by a rollback operation.
Service is a program that can run for a long time, equivalent to a Service in the background. The Service component is invisible at runtime, but it is responsible for updating the data source and visible Activity, as well as triggering notifications. When your Activity is not already active or visible, they are often used to perform some processing that needs to run continuously.
Content ProvIDer is a Content ProvIDer that provides a shared data store. The database, which can be used to manage and share applications, can be used to share its own data to external calls, interfaces to third party applications data access.
Broadcast Receiver: and receiving one or more Intents as trigger time, receiving related messages, performing some simple processing, converting the messages into a Notification, and unifying an Android event broadcasting model. By creating and registering one Broadcast Receiver, an application can listen to the Intents of the broadcast that meet certain conditions. Broadcast Receiver will automatically launch your Android application to respond to the new Intent.
The manifest file in the Android system can be understood as an application list, one must be contained in the root directory of each application, and the file names must be identical. The file contains the configuration information of the SDK, and the system needs to run the code of the SDK according to the content in the file to display the interface.
The manifest file mainly has the following roles:
1. naming the Java software package for the application. The package name serves as a unique identifier for the application. This is our apk name, which is generally similar to "com.android.gles3jni" and is similar to the Java class name, in order to determine that it is a unique value.
2. Various components of the application are described, including activities, services, broadcast receivers, and content providers that make up the application. It also names and publishes the class of each component its function, such as the Intent messages that they can handle. These statements inform the Android system about the components and the conditions under which these components can be started.
3. A process of hosting an application component is determined.
4. It is stated which rights an application must possess to access the protected part of the API and interact with other applications. Rights that other applications need to possess to interact with the application component are also declared
5. An Instrumentation class is listed that can provide analytics and other information when the application is running. These statements will only appear in the manifest when the application is in the development phase and will be removed before the application is released.
6. Minimum Android API level required for declaration applications
7. The libraries to which the application must be linked are listed.
Therefore, to modify the process name, it is necessary to obtain a manifest file for each SDK. In this embodiment, the called SDK exists in a packed form, so that the SDK needs to be decompressed first to obtain the manifest file. Then, the process names in all the manifest files are modified to the same process name, and then all the manifest files are combined. Therefore, when the packed SDK is compiled and operated, only one process is required to be established, and a plurality of processes are not required to be established, so that the waste of system resources is reduced.
For modification of the process name, the original process name may be adopted, or a new process name may be adopted.
In one or more embodiments of the present disclosure, modifying the process names in the plurality of manifest files and the process names in the manifest file of the main program to the same process name may specifically include:
acquiring a plurality of process names in a manifest file of the main program and a plurality of process names in the manifest file;
determining a main process name, wherein the main process name is one of a plurality of process names in a manifest file of the main program, or the main process name is one of a plurality of process names in the manifest file;
modifying a plurality of process names in a manifest file of the main program into the main process names;
and modifying a plurality of process names in the plurality of manifest files into the main process name.
In the above embodiment, a method for modifying a process name in a manifest file is provided, where one of a plurality of process names in a manifest file of the main program may be randomly selected, or one of a plurality of process names in a manifest file of the main program may be selected as a main process name. And then all the process names in the manifest file of the main program and the process names in the manifest file are modified to be the main process names.
It should be noted that there may be multiple process names in one manifest file, because one SDK may include multiple Android components, and different components may also run in different processes. Therefore, all of the plurality of process names in one manifest file need to be modified.
In addition to unifying the manifest file and the process names in the manifest file, the encapsulating the main program and the modified plurality of software development kits may specifically include:
merging source codes of the main program and source codes of the plurality of software development kits to generate merged source codes;
and uniformly confusing the combined source codes.
In this embodiment, the main program and the plurality of SDKs may be edited and developed in Java language. Java is a cross-platform, interpreted language, and Java source code is compiled into intermediate "bytecodes" and stored in class files. Because of the cross-platform requirement, java bytecodes contain a lot of source code information, such as variable names and method names, and variables and methods are accessed by the names, and the symbols carry a lot of semantic information and are easy to decompil into Java source code. To prevent this, java bytecodes may be obfuscated using a Java obfuscator.
Confusion is to reorganize and process the issued program, so that the processed code and the code before processing complete the same function, and the confused code is difficult to decompil, and even if decompil is successful, the real semantics of the program are difficult to obtain. The confused program code still conforms to the original file format and instruction set, the execution result is the same as before confusion, but the confusing device changes the names of all variables, functions and classes in the code into short English letter code numbers, and even if decompiled under the condition of lacking corresponding function names and program comments, the code is difficult to read. At the same time, the confusion is irreversible, and some information which does not affect normal operation is permanently lost in the confusion process, so that the program is more difficult to understand due to the loss of the information.
The function of the obfuscator is not just to protect the code, but it also has the effect of reducing the compiled program size. The volume of the jar file after compiling can be reduced by about 25% due to the shortened variable and function names and the lost part of information, which is significant for the wireless network transmission with more expensive cost.
According to the method and the device for the code confusion, after the main program and the plurality of SDKs are packaged, the code confusion of the plurality of SDKs by adopting a plurality of confusion rules is avoided, and the access efficiency is improved.
Example two
Fig. 2 is a flow chart of a second embodiment of a program packaging method according to the embodiment of the present disclosure. From the program perspective, the execution subject of the flow may be a program or an application client that is installed on an application server.
As shown in fig. 2, the process may include the steps of:
step 202: and acquiring a plurality of software development kits called by the main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program.
Step 204: and compiling the main program to obtain a compiling file.
Step 206: when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, the resource ID in the compiling file and the resource IDs in the plurality of software development kits are modified so that one resource file identified by the resource ID is unique.
Step 208: and packaging the modified compiling file and the modified plurality of software development kits.
Most of the second and first embodiments are the same, and thus, a detailed description thereof is omitted, and only the differences between the second and first embodiments are emphasized.
The difference between the second embodiment and the first embodiment is that, when modifying the resource ID, not only the resource IDs in the plurality of SDKs but also the resource IDs in the main program compilation file are modified. Therefore, it is possible to not distinguish whether the resource file in which the resource ID conflict occurs is located in the main program or in the plurality of SDKs. Whenever resource IDs collide, the resource IDs of their corresponding resource files need to be modified.
It should be noted that only the resource ID of the conflicting resource file needs to be modified here, so that the resource file identified by the resource ID is unique, and how to modify the resource ID of the conflicting resource file is not limited herein.
In the method in fig. 2, by combining a plurality of software development kits supporting service function implementation with a main program and then outputting the combined software development kits, a developer of an access party only needs to learn the content of one combined program, and does not need to learn the plurality of software development kits respectively, so that the learning process of the access party for accessing the service is reduced, and the access efficiency of the application program is improved.
In addition, when a plurality of software development kits are packaged, a situation that one resource ID corresponds to a plurality of resource files may be faced, so in this embodiment, the resource IDs of the resource files in the plurality of software development kits and the main program are renamed, thereby avoiding the occurrence of resource file reference conflict caused by that one resource ID corresponds to a plurality of resource files.
Based on the method of fig. 2, the present description examples also provide some specific implementations of the method, as described below.
In order to improve the modification efficiency of the resource ID, the embodiment further provides a method for modifying the resource ID: the modifying the resource ID in the compiled file and the resource IDs in the plurality of software development kits may specifically include:
Screening a plurality of resource files with the same resource ID from the resource files in the plurality of software development kits and the resource files in the main program;
and carrying out resource ID naming again on the plurality of screened resource files.
In one or more embodiments of the present disclosure, resource files having the same resource ID are first screened out. The following method can be adopted: for any resource ID, the resource ID can be searched from R.java files in all SDKs, and the resource ID appears several times together. If it occurs only once, it can be stated that there is no conflict with the resource ID, and therefore the resource ID corresponds to a unique resource file. If the number of occurrences of the resource ID is two or more, it is indicated that the resource ID is present in a plurality of r.java files, and thus the resource IDs of all the resource files corresponding to the resource ID need to be modified.
For example, one resource ID "0x7f050000" corresponds to a plurality of resource files a, b, and c. Wherein a is located in the main program, b is located in SDK1, and c is located in SDK 2. To avoid resource file call conflicts, the resource IDs of a, b, and c need to be modified, the resource ID of a may be modified to "0x7f050001" b, the resource ID of c may be modified to "0x7f050002".
It should be noted that, the present application does not need to determine where the resource file that conflicts exist, and only needs to determine whether the resource ID of the resource file corresponding to the resource ID should be reserved or not if the resource ID conflict occurs, so that the efficiency of modifying the resource ID is improved.
In addition, this embodiment only needs to rename the resource ID of the resource file that has collided. Renaming may set some specific rules, not specifically limited herein.
In order to accurately call the resource file, the modifying the resource ID in the compiled file and the resource IDs in the plurality of software development kits may further include:
replacing the resource ID in the R.Java file of the main program and the resource IDs in the R.Java files in the plurality of software development kits with modified resource IDs;
and replacing the resource IDs in the resource file reference statement in the main program and the software development kit with the modified resource ID.
When the method is applied specifically, the corresponding relation between the resource file and the resource ID is recorded in the R.java file, the resource ID in the R.java file needs to be modified, and the modified resource ID in the R.java file is the corresponding relation between the resource file and the resource ID. Therefore, in order to accurately call the resource file, the corresponding program statement for calling the resource file in the code is also modified.
Since the present embodiment modifies the resource IDs of the resource files in the main program and the plurality of SDKs, all the reference sentences of the resource files in the main program and the plurality of SDKs that have called the resource IDs need to be modified.
Optionally, before the packaging of the modified compiled file and the modified plurality of software development kits, the method may further include:
decompressing the plurality of software development kits to obtain a plurality of manifest files;
modifying the process names in the plurality of manifest files and the process names in the manifest file of the main program to the same process name;
and merging the plurality of manifest files and the manifest files of the main program to generate a merged manifest file.
Optionally, modifying the process names in the plurality of manifest files and the process names in the manifest file of the main program to the same process name may specifically include:
acquiring a plurality of process names in a manifest file of the main program and a plurality of process names in the manifest file;
determining a main process name, wherein the main process name is one of a plurality of process names in a manifest file of the main program, or the main process name is one of a plurality of process names in the manifest file;
Modifying a plurality of process names in a manifest file of the main program into the main process names;
and modifying a plurality of process names in the plurality of manifest files into the main process name.
Optionally, the encapsulating the main program and the plurality of software development kits may specifically include:
merging source codes of the main program and source codes of the plurality of software development kits to generate merged source codes;
and uniformly confusing the combined source codes.
Based on the same thought, the embodiment of the specification also provides a device corresponding to the method. Fig. 3 is a schematic structural diagram of a program packaging apparatus corresponding to fig. 1 according to an embodiment of the present disclosure. As shown in fig. 3, the apparatus may include:
a software development kit acquisition module 301, configured to acquire a plurality of software development kits invoked by a main program, where the plurality of software development kits are used to implement auxiliary functions of the main program;
a main program compiling module 302, configured to compile the main program to obtain a compiled file;
a resource ID modifying module 303, configured to modify, when a resource ID in the compiled file conflicts with a resource ID in the plurality of software development kits, a resource ID in the plurality of software development kits according to the resource ID in the compiled file, so that a resource file identified by the resource ID is unique;
Program encapsulation module 304 is configured to encapsulate the main program and the modified plurality of software development kits.
In the device in fig. 3, by combining a plurality of software development kits supporting service function implementation with a main program and then outputting the combined software development kits, a developer of an access party only needs to learn the content of one combined program, and does not need to learn the plurality of software development kits respectively, so that the learning process of the access party for accessing service is reduced, and the access efficiency of an application program is improved.
In addition, when a plurality of software development kits are packaged, a situation that one resource ID corresponds to a plurality of resource files may be faced, so that the resource IDs of the resource files in the plurality of software development kits that collide are renamed in this embodiment, thereby avoiding the occurrence of resource file reference collision caused by that one resource ID corresponds to a plurality of resource files.
Optionally, the resource ID modification module 303 may specifically include:
a screening unit, configured to screen, from among the resource files in the plurality of software development kits, a resource file that is the same as the resource ID in the compiled file;
and the first modification unit is used for carrying out resource ID naming on the screened resource file again according to the existing resource ID.
Optionally, the resource ID modification module 303 may further include:
a second unit, configured to replace a resource ID in the r.java file in the plurality of software development kits with a modified resource ID;
and a third unit, configured to replace the resource ID in the resource file reference statement in the software development kit with the modified resource ID.
Optionally, the apparatus may further include:
the decompression module is used for decompressing the plurality of software development kits to obtain a plurality of manifest files;
the process name modification module is used for modifying the process names in the plurality of the manifest files and the process names in the manifest files of the main program into the same process names;
and the merging module is used for merging the plurality of the manifest files and the manifest files of the main program to generate merged manifest files.
Optionally, the process name modification module may specifically include:
a process name acquisition unit configured to acquire a plurality of process names in a manifest file of the main program and a plurality of process names in the manifest file;
a main process name determining unit configured to determine a main process name, where the main process name is one of a plurality of process names in a manifest file of the main program, or the main process name is one of a plurality of process names in the manifest file;
A first process name modifying unit, configured to modify a plurality of process names in a manifest file of the main program into the main process name;
and the second process name modification unit is used for modifying the process names in the plurality of manifest files into the main process name.
Optionally, the program packaging module 304 may specifically include:
the merging unit is used for merging the source codes of the main program and the source codes of the plurality of software development kits and generating merged source codes;
and the confusion unit is used for carrying out unified confusion on the combined source codes.
Based on the same thought, the embodiment of the specification also provides a device corresponding to the method. Fig. 4 is a schematic structural diagram of a program packaging apparatus corresponding to fig. 2 according to an embodiment of the present disclosure. As shown in fig. 4, the apparatus may include:
a software development kit acquisition module 401, configured to acquire a plurality of software development kits invoked by a main program, where the plurality of software development kits are used to implement auxiliary functions of the main program;
a main program compiling module 402, configured to compile the main program to obtain a compiled file;
a resource ID modifying module 403, configured to modify, when a resource ID in the compiled file conflicts with a resource ID in the plurality of software development kits, the resource ID in the compiled file and the resource ID in the plurality of software development kits, so that a resource file identified by the resource ID is unique;
Program encapsulation module 404, configured to encapsulate the modified compiled file and the modified plurality of software development kits.
In the device in fig. 4, by combining a plurality of software development kits supporting service function implementation with a main program and then outputting the combined software development kits, a developer of an access party only needs to learn the content of one combined program, and does not need to learn the plurality of software development kits respectively, so that the learning process of the access party for accessing service is reduced, and the access efficiency of an application program is improved.
In addition, when a plurality of software development kits are packaged, a situation that one resource ID corresponds to a plurality of resource files may be faced, so in this embodiment, the resource IDs of the resource files in the plurality of software development kits and the main program are renamed, thereby avoiding the occurrence of resource file reference conflict caused by that one resource ID corresponds to a plurality of resource files.
Optionally, the resource ID modification module 303 may specifically include:
a screening unit, configured to screen a plurality of resource files having the same resource ID from the resource files in the plurality of software development kits and the resource files in the main program;
And the first modification unit is used for carrying out resource ID naming on the screened plurality of resource files again.
Optionally, the resource ID modification module 303 may further include:
the second modification unit is used for replacing the resource ID in the R.java file of the main program and the resource ID in the R.java files in the plurality of software development kits with the modified resource ID;
and a third modification unit, configured to replace resource IDs in resource file reference sentences in the main program and the software development kit with modified resource IDs.
Optionally, the apparatus may further include:
the decompression module is used for decompressing the plurality of software development kits to obtain a plurality of manifest files;
the process name modification module is used for modifying the process names in the plurality of the manifest files and the process names in the manifest files of the main program into the same process names;
and the merging module is used for merging the plurality of the manifest files and the manifest files of the main program to generate merged manifest files.
Optionally, the process name modification module may specifically include:
a process name acquisition unit configured to acquire a plurality of process names in a manifest file of the main program and a plurality of process names in the manifest file;
A main process name determining unit configured to determine a main process name, where the main process name is one of a plurality of process names in a manifest file of the main program, or the main process name is one of a plurality of process names in the manifest file;
a first process name modifying unit, configured to modify a plurality of process names in a manifest file of the main program into the main process name;
and the second process name modification unit is used for modifying the process names in the plurality of manifest files into the main process name.
Optionally, the program packaging module 404 may specifically include:
the merging unit is used for merging the source codes of the main program and the source codes of the plurality of software development kits and generating merged source codes;
and the confusion unit is used for carrying out unified confusion on the combined source codes.
Based on the same thought, the embodiment of the specification also provides equipment corresponding to the method.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 5, the apparatus 500 may include:
at least one processor 510; the method comprises the steps of,
a memory 530 communicatively coupled to the at least one processor; wherein,,
The memory 530 stores instructions 520 executable by the at least one processor 510, the instructions being executable by the at least one processor 510 to enable the at least one processor 510 to:
acquiring a plurality of software development kits called by a main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program;
compiling the main program to obtain a compiled file;
when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, modifying the resource IDs in the plurality of software development kits according to the resource ID in the compiling file so that one resource file identified by the resource ID is unique;
and packaging the main program and the modified plurality of software development kits.
Alternatively, to enable the at least one processor 510 to:
acquiring a plurality of software development kits called by a main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program;
compiling the main program to obtain a compiled file;
when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, modifying the resource ID in the compiling file and the resource ID in the plurality of software development kits so that the resource file identified by one resource ID is unique;
And packaging the modified compiling file and the modified plurality of software development kits.
Embodiments of the present disclosure provide a computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to implement the above-described method.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmelAT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present application.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (16)

1. A program packaging method, comprising:
acquiring a plurality of software development kits called by a main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program;
compiling the main program to obtain a compiled file;
when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, modifying the resource IDs in the plurality of software development kits according to the resource ID in the compiling file so that one resource file identified by the resource ID is unique; the resource ID is expressed as the resource ID of the conflict resource file;
The conflict between the resource ID in the compiling file and the resource IDs in the plurality of software development kits specifically comprises:
acquiring the number of times that the resource ID appears in the software development kit;
judging whether the resource ID is the resource ID with conflict according to the times;
when the number of times is greater than or equal to two, the resource ID is the resource ID with conflict;
and packaging the main program and the modified plurality of software development kits.
2. The method according to claim 1, wherein said modifying the resource IDs in the plurality of software development kits according to the resource IDs in the compiled file, specifically comprises:
screening resource files which are the same as the resource ID in the compiling file from the resource files in the plurality of software development kits;
and (3) re-naming the resource ID of the screened resource file according to the existing resource ID.
3. The method of claim 2, the modifying the resource IDs in the plurality of software development kits according to the resource IDs in the compiled file, further comprising:
replacing the resource ID in the R.java files in the plurality of software development kits with the modified resource ID;
And replacing the resource ID in the resource file reference statement in the software development kit with the modified resource ID.
4. The method of claim 1, prior to said encapsulating said main program and modified said plurality of software development kits, said method further comprising:
decompressing the plurality of software development kits to obtain a plurality of manifest files;
modifying the process names in the plurality of manifest files and the process names in the manifest file of the main program to the same process name;
and merging the plurality of manifest files and the manifest files of the main program to generate a merged manifest file.
5. The method of claim 4, wherein modifying the process names in the plurality of manifest files and the process names in the manifest file of the main program to the same process name specifically comprises:
acquiring a plurality of process names in a manifest file of the main program and a plurality of process names in the manifest file;
determining a main process name, wherein the main process name is one of a plurality of process names in a manifest file of the main program, or the main process name is one of a plurality of process names in the manifest file;
Modifying a plurality of process names in a manifest file of the main program into the main process names;
and modifying a plurality of process names in the plurality of manifest files into the main process name.
6. The method of claim 1, wherein the encapsulating the main program and the modified plurality of software development kits specifically comprises:
merging source codes of the main program and source codes of the plurality of software development kits to generate merged source codes;
and uniformly confusing the combined source codes.
7. A program packaging method, comprising:
acquiring a plurality of software development kits called by a main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program;
compiling the main program to obtain a compiled file;
when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, modifying the resource ID in the compiling file and the resource ID in the plurality of software development kits so that the resource file identified by one resource ID is unique; the resource ID is expressed as the resource ID of the conflict resource file;
the conflict between the resource ID in the compiling file and the resource IDs in the plurality of software development kits specifically comprises:
Acquiring the number of times that the resource ID appears in the software development kit;
judging whether the resource ID is the resource ID with conflict according to the times;
when the number of times is greater than or equal to two, the resource ID is the resource ID with conflict;
and packaging the modified compiling file and the modified plurality of software development kits.
8. The method of claim 7, wherein said modifying the resource ID in the compiled file and the resource IDs in the plurality of software development kits comprises:
screening a plurality of resource files with the same resource ID from the resource files in the plurality of software development kits and the resource files in the main program;
and carrying out resource ID naming again on the plurality of screened resource files.
9. The method of claim 7, the modifying the resource ID in the compiled file and the resource IDs in the plurality of software development kits, further comprising:
replacing the resource ID in the R.Java file of the main program and the resource IDs in the R.Java files in the plurality of software development kits with modified resource IDs;
and replacing the resource IDs in the resource file reference statement in the main program and the software development kit with the modified resource ID.
10. The method of claim 7, prior to said encapsulating the modified compiled file and modified plurality of software development kits, the method further comprising:
decompressing the plurality of software development kits to obtain a plurality of manifest files;
modifying the process names in the plurality of manifest files and the process names in the manifest file of the main program to the same process name;
and merging the plurality of manifest files and the manifest files of the main program to generate a merged manifest file.
11. The method of claim 7, wherein said encapsulating the modified compiled file and the modified plurality of software development kits specifically comprises:
merging source codes of the main program and source codes of the plurality of software development kits to generate merged source codes;
and uniformly confusing the combined source codes.
12. A program packaging apparatus comprising:
the system comprises a software development kit acquisition module, a main program acquisition module and a software development kit acquisition module, wherein the software development kit acquisition module is used for acquiring a plurality of software development kits called by the main program, and the plurality of software development kits are used for realizing auxiliary functions of the main program;
the main program compiling module is used for compiling the main program to obtain a compiling file;
A resource ID modifying module, configured to modify, when a resource ID in the compiled file conflicts with a resource ID in the plurality of software development kits, a resource ID in the plurality of software development kits according to the resource ID in the compiled file, so that a resource file identified by the resource ID is unique; the resource ID is expressed as the resource ID of the conflict resource file; the resource ID modification module is further used for obtaining the frequency of occurrence of the resource ID in the software development kit; judging whether the resource ID is the resource ID with conflict according to the times; when the number of times is greater than or equal to two, the resource ID is the resource ID with conflict;
and the program packaging module is used for packaging the main program and the modified plurality of software development kits.
13. A program packaging apparatus comprising:
the system comprises a software development kit acquisition module, a main program acquisition module and a software development kit acquisition module, wherein the software development kit acquisition module is used for acquiring a plurality of software development kits called by the main program, and the plurality of software development kits are used for realizing auxiliary functions of the main program;
the main program compiling module is used for compiling the main program to obtain a compiling file;
a resource ID modifying module, configured to modify, when a resource ID in the compiled file conflicts with a resource ID in the plurality of software development kits, the resource ID in the compiled file and the resource ID in the plurality of software development kits, so that a resource file identified by the resource ID is unique; the resource ID is expressed as the resource ID of the conflict resource file; the resource ID modification module is further used for obtaining the frequency of occurrence of the resource ID in the software development kit; judging whether the resource ID is the resource ID with conflict according to the times; when the number of times is greater than or equal to two, the resource ID is the resource ID with conflict;
And the program packaging module is used for packaging the modified compiling file and the modified plurality of software development kits.
14. An electronic device, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a plurality of software development kits called by a main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program;
compiling the main program to obtain a compiled file;
when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, modifying the resource IDs in the plurality of software development kits according to the resource ID in the compiling file so that one resource file identified by the resource ID is unique; the resource ID is expressed as the resource ID of the conflict resource file; the conflict between the resource ID in the compiling file and the resource IDs in the plurality of software development kits specifically comprises:
Acquiring the number of times that the resource ID appears in the software development kit;
judging whether the resource ID is the resource ID with conflict according to the times;
when the number of times is greater than or equal to two, the resource ID is the resource ID with conflict;
and packaging the main program and the modified plurality of software development kits.
15. An electronic device, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a plurality of software development kits called by a main program, wherein the plurality of software development kits are used for realizing auxiliary functions of the main program;
compiling the main program to obtain a compiled file;
when the resource ID in the compiling file conflicts with the resource IDs in the plurality of software development kits, modifying the resource ID in the compiling file and the resource ID in the plurality of software development kits so that the resource file identified by one resource ID is unique; the resource ID is expressed as the resource ID of the conflict resource file; the conflict between the resource ID in the compiling file and the resource IDs in the plurality of software development kits specifically comprises:
Acquiring the number of times that the resource ID appears in the software development kit;
judging whether the resource ID is the resource ID with conflict according to the times;
when the number of times is greater than or equal to two, the resource ID is the resource ID with conflict;
and packaging the modified compiling file and the modified plurality of software development kits.
16. A computer readable medium having stored thereon computer readable instructions executable by a processor to implement the program packaging method of any of claims 1 to 11.
CN201911275691.5A 2019-12-12 2019-12-12 Program packaging method and device and electronic equipment Active CN111090425B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911275691.5A CN111090425B (en) 2019-12-12 2019-12-12 Program packaging method and device and electronic equipment
CN202310410385.8A CN116521144A (en) 2019-12-12 2019-12-12 Program packaging method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911275691.5A CN111090425B (en) 2019-12-12 2019-12-12 Program packaging method and device and electronic equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202310410385.8A Division CN116521144A (en) 2019-12-12 2019-12-12 Program packaging method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111090425A CN111090425A (en) 2020-05-01
CN111090425B true CN111090425B (en) 2023-05-05

Family

ID=70396345

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202310410385.8A Pending CN116521144A (en) 2019-12-12 2019-12-12 Program packaging method and device and electronic equipment
CN201911275691.5A Active CN111090425B (en) 2019-12-12 2019-12-12 Program packaging method and device and electronic equipment

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202310410385.8A Pending CN116521144A (en) 2019-12-12 2019-12-12 Program packaging method and device and electronic equipment

Country Status (1)

Country Link
CN (2) CN116521144A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778451B (en) * 2020-11-17 2024-06-18 北京沃东天骏信息技术有限公司 File loading method, file loading device, computer system and computer readable storage medium
CN113934460A (en) * 2021-10-12 2022-01-14 郑州阿帕斯数云信息科技有限公司 Resource providing method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9632770B2 (en) * 2015-04-28 2017-04-25 Google Inc. Infrastructure for hosting and publishing software packages
CN109542445A (en) * 2017-08-01 2019-03-29 北京京东尚科信息技术有限公司 A kind of method and apparatus that Android plug-in unit melts hair
CN107844301A (en) * 2017-12-12 2018-03-27 苏州蜗牛数字科技股份有限公司 A kind of Android application channel closes bag method and device
CN110457045B (en) * 2019-08-16 2023-05-16 百度在线网络技术(北京)有限公司 Component combining and compiling method, device, equipment and storage medium
CN110502239A (en) * 2019-08-19 2019-11-26 武汉蓝星科技股份有限公司 A kind of method for developing and producing and device of onboard system SDK

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
薛显亮.解析Google Android SDK:智能手机开发范例手册.《解析Google Android SDK:智能手机开发范例手册》.中国铁道出版社,2012,1-6. *

Also Published As

Publication number Publication date
CN111090425A (en) 2020-05-01
CN116521144A (en) 2023-08-01

Similar Documents

Publication Publication Date Title
CN110502222B (en) AAR method, apparatus, medium, and device for outbound dependency on internal base repository
CN107092475B (en) Calling method and device of interactive control
CN110007920B (en) Method and device for acquiring code dependency relationship and electronic equipment
CN107045438B (en) Application top view processing method, device and component
CN111240684B (en) Cutting method and device of JS codes, medium and electronic equipment
CN110059456B (en) Code protection method, code protection device, storage medium and electronic equipment
CN107786630B (en) Web application package processing method, device and equipment
CN110263546B (en) Method, device and equipment for carrying out security check on container mirror image
CN109947643B (en) A/B test-based experimental scheme configuration method, device and equipment
CN111400681B (en) Data authority processing method, device and equipment
CN108647032B (en) Application loading method and device, computer device and computer readable storage medium
CN107133502B (en) A kind of processing method and processing device of application program
CN111090425B (en) Program packaging method and device and electronic equipment
CN107479868B (en) Interface loading method, device and equipment
CN108279941A (en) A kind of compression method and device of application program
CN114547024A (en) SQL statement risk detection method, device, equipment and medium
CN110941443B (en) Method and device for modifying file name in SDK (software development kit) and electronic equipment
CN111190692A (en) Monitoring method and system based on Roc processor and readable medium
US20170168789A1 (en) Optimized compiling of a template function
CN111443944B (en) Program construction method, device and equipment
CN111797387B (en) Method and device for intercepting plug-in
CN109409037B (en) Method, device and equipment for generating data confusion rule
CN112114810A (en) Compiling processing method and device
CN110874322B (en) Test method and test server for application program
CN113835748B (en) Packaging method, system and readable medium for application program based on HTML5

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
TA01 Transfer of patent application right

Effective date of registration: 20230111

Address after: 200120 Floor 15, No. 447, Nanquan North Road, China (Shanghai) Pilot Free Trade Zone, Pudong New Area, Shanghai

Applicant after: Alipay.com Co.,Ltd.

Address before: 310000 801-11 section B, 8th floor, 556 Xixi Road, Xihu District, Hangzhou City, Zhejiang Province

Applicant before: Alipay (Hangzhou) Information Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant