Method for generating installation package of application program and electronic device
By decompiling the APP installation package and injecting the authentication SDK, an installation package with integrated authentication SDK is generated, which solves the resource waste problem of APP developers in integrating authentication SDK and realizes the normal authentication process of APP Execution avoids the impact on APP functions.
Patent Information
- Application Number
- CN202011557385.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-24
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2040-12-24
AI Technical Summary
As the number of applications (APPs) increases, APP developers have invested more energy in the integrated authentication software development toolkit (SDK), resulting in wasted R&D resources.
The APP installation package is decompiled through the server side of the developer portal, injected the authentication SDK, and generated an installation package with integrated authentication SDK to avoid developers' additional investment in integrated authentication SDK.
Save APP developers’ efforts in integrating authentication SDK, avoid wasting R&D resources, and ensure that APP can perform authentication processes normally when it is started, avoid affecting the APP’s own functions.
Smart Images

Figure CN114675840B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and more specifically, to a method and an electronic device for generating an installation package of an application in the field of terminals. Background Art
[0002] Currently, most electronic devices support installation of applications (APP) thereon. For example, users can download various APPs through an application market APP.
[0003] Among the many apps released by the application market APP, some can be downloaded for free by users, while others can be downloaded after payment. Alternatively, the application market APP can provide VIP (very important person) functions. For example, the application market APP can authorize certain apps to VIP users as an APP combination package. In other words, if the user is a VIP user of the application market APP, he can download the apps in the APP combination package for free.
[0004] For apps that require payment to download or can only be downloaded by VIP users, they need to have authentication capabilities so that when the user uses the app, it can be determined whether the user has paid or is a VIP user. For example, the developer of such app can integrate an authentication software development kit (SDK) into the installation package of the app, and then provide the app with the integrated authentication SDK to the application market app, which will publish it. After the user downloads such app to an electronic device, if the app is started, the app will initiate an authentication process to determine whether the user has paid or is a VIP user. Only if the authentication is passed can the user use such app.
[0005] However, as the number of such apps continues to increase, app developers will inevitably invest more energy in integrating authentication SDKs, which will lead to a waste of R&D resources. Summary of the invention
[0006] The embodiment of the present application provides a method for generating an installation package of an application program, which can save the developer of the APP the effort of integrating the authentication SDK and avoid the waste of research and development resources.
[0007] In a first aspect, a method for generating an installation package of an application is provided, comprising: a server of a developer portal obtains a first installation package of an application APP and an authentication software development kit SDK, then decompiles the first installation package to obtain a first file set, then injects the authentication SDK into the first file set to obtain a second file set, and finally generates a second installation package of the APP based on the second file set.
[0008] Based on the above technical solution, the server of the developer portal decompiles the installation package of the APP submitted by the developer, injects the authentication SDK into the first file set obtained after the decompilation, obtains the second file set, and finally compiles the second file set to obtain the installation package of the APP integrated with the authentication SDK, thereby saving the APP developer the energy invested in integrating the authentication SDK and avoiding the waste of R&D resources.
[0009] In combination with the first aspect, in certain implementations of the first aspect, the first file set includes a first configuration file of the APP, and the authentication SDK is injected into the first file set to obtain a second file set, including: declaring the startup page of the authentication SDK in the first configuration file to obtain a second configuration file, and the second file set includes the second configuration file.
[0010] Based on the above technical solution, the startup page of the authentication SDK is declared in the configuration file of the APP, so that the APP can call the startup page of the authentication SDK to execute the authentication process after startup.
[0011] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, declaring the startup page of the authentication SDK in the first configuration file includes: declaring the startup page of the authentication SDK as the startup page of the APP in the first configuration file.
[0012] Based on the above technical solution, the startup page of the authentication SDK is declared as the startup page of the APP in the configuration file of the APP, so that the APP executes the authentication process first after startup to avoid affecting the APP's own functions.
[0013] In combination with the first aspect and its above-mentioned implementation methods, in some implementation methods of the first aspect, the first file set includes a first static resource file, and injecting the authentication SDK into the first file set includes: decompiling the authentication SDK to obtain the static resource file of the authentication SDK; merging the first static resource file with the static resource file of the authentication SDK to obtain a second static resource file, and the second file set includes the second static resource file.
[0014] In combination with the first aspect and its above-mentioned implementation methods, in some implementation methods of the first aspect, the method also includes: creating a loading module, the loading module is used to load the static resource files of the authentication SDK; injecting the authentication SDK into the first file set to obtain the second file set, including: injecting the authentication SDK and the loading module into the first file set to obtain the second file set.
[0015] Based on the above technical solution, by creating a loading module and injecting the loading module into the first file set, the APP can load the static resource files in the authentication SDK through the loading module when executing the authentication process.
[0016] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, the method also includes: processing the loading module to obtain a smali file of the loading module; the first file set includes a first smali file, and injecting the authentication SDK and the loading module into the first file set to obtain the second file set includes: merging the first smali file with the smali file of the loading module to obtain a second smali file, and the second file set includes the second smali file.
[0017] By processing the loading module, a smali file of the loading module is obtained, so that the smali file of the loading module can be merged with the first smali file to obtain a second smali file in the second file set, thereby injecting the loading module into the first file set.
[0018] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, the method also includes: decompiling the authentication SDK to obtain a smali file of the startup page of the authentication SDK; merging the first smali file with the smali file of the loading module to obtain a second smali file, including: merging the smali file of the startup page of the authentication SDK, the first smali file and the smali file of the loading module to obtain the second smali file.
[0019] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, the method also includes: decompressing the first installation package to obtain the media resource file of the APP; generating the second installation package of the APP based on the second file set includes: generating the second installation package of the APP based on the media resource file and the second file set.
[0020] Based on the above technical solution, the original resource package of the APP is decompressed to obtain the media resource files of the APP, and then the media resource files of the APP are added to the installation package of the APP integrated with the authentication SDK, so that the installation package of the APP integrated with the authentication SDK can include the media resource files of the APP, avoiding affecting the APP's own functions.
[0021] In a second aspect, the present application provides a device, which is included in an electronic device, and has the function of implementing the electronic device behavior in the above aspects and possible implementations of the above aspects. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions.
[0022] In a third aspect, the present application provides an electronic device, comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, and the computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the method of generating an installation package of an APP in any possible implementation of any of the above aspects.
[0023] In a fourth aspect, the present application provides a computer-readable storage medium, including computer instructions, which, when executed on an electronic device, enables the electronic device to execute any possible video playback method of any of the above aspects.
[0024] In a fifth aspect, the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute any possible method of generating an installation package of an APP according to any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a schematic block diagram of an electronic device provided in an embodiment of the present application;
[0026] Figure 2 It is a schematic diagram of a method for generating an installation package of an APP provided in an embodiment of the present application;
[0027] Figure 3 It is a schematic diagram of the structure of the file obtained after decompiling the original installation package of the APP provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0029] Normally, for other apps that need to be released on the application market APP, you first need to submit the installation package of the APP to the developer portal, and the developer portal will then submit the installation package of the APP to the server of the application market APP, and finally release the APP on the application market APP.
[0030] Among the many apps released by the application market APP, some can be downloaded for free by users, while others can be downloaded after payment. Alternatively, the application market APP can provide VIP functions. For example, the application market APP can authorize certain apps to VIP users as an APP combination package. In other words, if the user is a VIP user of the application market APP, he can download the apps in the APP combination package for free.
[0031] For apps that require payment to download or can only be downloaded by VIP users, they need to have authentication capabilities so that when the user uses the app, it can be determined whether the user has paid or is a VIP user. For example, the developer of such app can integrate the authentication SDK into the installation package of the app, and then provide the installation package of the app with the authentication SDK to the developer portal. The developer portal then submits the installation package of the app with the authentication SDK to the server of the application market app, and finally publishes the app with the authentication SDK on the application market app. After the user downloads such app to an electronic device, if the app is started, the app will initiate an authentication process to determine whether the user has paid or is a VIP user. Only if the authentication is passed can the user use such app.
[0032] However, as the number of such apps continues to increase, app developers will inevitably invest more energy in integrating authentication SDKs, which will lead to a waste of R&D resources.
[0033] In view of this, an embodiment of the present application provides a method for generating an installation package of an APP, where the server of the developer portal injects an authentication SDK into the installation package of the APP submitted by the developer, and obtains an installation package of the APP with integrated authentication SDK, thereby saving the APP developer the energy invested in integrating the authentication SDK and avoiding waste of R&D resources.
[0034] For example, Figure 1 1 is a schematic diagram of the structure of an example of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may be a server of a developer portal, and the electronic device 100 may include a processor 101, a memory 102, a communication interface 103, a bus 104, and the like.
[0035] The processor 101, the memory 102, and the communication interface 103 communicate via the bus 104, and may also communicate via other means such as wireless transmission. The memory 102 is used to store instructions, and the processor 101 is used to execute the instructions stored in the memory 102. The memory 102 stores program code 1021, and the processor 101 can call the program code 1021 stored in the memory 102 to execute Figure 2 The method for generating an installation package of an APP is shown.
[0036] It should be understood that in the embodiment of the present application, the processor 101 may be a CPU, and the processor 101 may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0037] The memory 102 may include a read-only memory and a random access memory, and provide instructions and data to the processor 101. The memory 102 may also include a non-volatile random access memory. The memory 102 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0038] The bus 104 may include a power bus, a control bus, a status signal bus, etc. in addition to the data bus. Figure 1 Various buses are labeled as bus 104.
[0039] Combine the following Figure 2 The method for generating an installation package of an APP provided in an embodiment of the present application is introduced. Figure 2 A schematic flow chart of a method 200 for generating an installation package of an APP is shown, and the method is executed by a server of a developer portal.
[0040] Step 201: The server obtains the first installation package and authentication SDK of the APP.
[0041] Step 202: The server performs decompile processing on the first installation package to obtain a first file set.
[0042] Step 203: The server injects the authentication SDK into the first file set to obtain a second file set.
[0043] Step 204: The server generates a second installation package of the APP based on the second file set.
[0044] Specifically, after the developer submits the original installation package of the APP to the developer portal, the server of the developer portal can decompile the original installation package to obtain a first file set, which includes multiple intermediate files from the original installation package of the APP to the source code of the APP. The server of the developer portal injects the authentication SDK into the first file set to obtain a second file set, and finally obtains the installation package of the APP with the authentication SDK integrated according to the second file set. Among them, the original installation package of the APP in the embodiment of the present application corresponds to the first installation package, and the installation package of the APP with the authentication SDK integrated in the embodiment of the present application corresponds to the second installation package of the APP. For the convenience of description below, the server of the developer portal is referred to as the server.
[0045] The following is a detailed description of the process in which the server injects the authentication SDK into the first file set to obtain the second file set.
[0046] Exemplarily, the first file set obtained after the server decompiles the first installation package includes the first configuration file of the APP. Taking the Android architecture as an example, the first configuration file of the APP can be, for example, the AndroidManifest.xml file of the APP. The AndroidManifest.xml file of the application is a necessary file for the APP to run on the electronic device.
[0047] In order to enable the APP to call the startup page of the authentication SDK to perform the authentication process after startup, the server can declare the startup page of the authentication SDK in the AndroidManifest.xml file while retaining the declaration of the startup page of the APP in the AndroidManifest.xml file.
[0048] Exemplarily, in order to avoid affecting the functions of the APP itself, the startup page of the authentication SDK can be executed before the startup page of the APP. Therefore, the server can declare the startup page of the authentication SDK as the startup page of the APP in the AndroidManifest.xml file, and retain the declaration of the original startup page of the APP in the AndroidManifest.xml file. In this case, when the APP is started, the startup page of the authentication SDK will be called first to execute the authentication process. In the embodiment of the present application, the AndroidManifest.xml file of the APP after declaring the startup page of the authentication SDK is called the second configuration file, and the second file set includes the second configuration file.
[0049] Exemplarily, in order to inject the authentication SDK into the first file set, the server can decompile the authentication SDK to obtain the static resource files of the authentication SDK. In addition, after decompiling the first installation package of the APP, the first file set obtained includes the static resource files of the APP. The server can add the static resource files of the authentication SDK to the file directory where the static resource files of the APP are located. In other words, the server merges the static resource files of the authentication SDK with the static resource files of the APP to obtain the second static resource files in the second file set. In this embodiment of the present application, the static resource files of the APP correspond to the first static resource files.
[0050] In order to enable the APP to load the static resource files of the authentication SDK when executing the authentication process, the server can create a loading module and inject the loading module into the first file set. The function of the loading module is to load the static resource files of the authentication SDK when the APP executes the authentication process. For example, the static resource files of the authentication SDK may include pictures, codes corresponding to the authentication process, and entries, etc. When the APP executes the authentication process, the loading module can load these static resource files.
[0051] The loading module created by the server may include, for example, Android's DexClassLoader loader. When the APP executes the authentication process, the DexClassLoader loader may, for example, load the code corresponding to the authentication process in the static resource file of the authentication SDK.
[0052] Exemplarily, in order to inject the loading module into the first file set, the server can process the loading module after creating the loading module to obtain the smali file of the loading module. In addition, after the server decompiles the first installation package of the APP, the first file set obtained includes the smali file of the APP. In this case, the server can add the smali file of the loading module to the file directory where the smali file of the APP is located. In other words, the server merges the smali file of the loading module with the smali file of the APP to obtain the second smali file in the second file set. In this embodiment of the present application, the smali file of the APP corresponds to the first smali file.
[0053] Exemplarily, after decompiling the authentication SDK, the server will also obtain the smali file of the startup page of the authentication SDK. The server can add the smali file of the startup page of the authentication SDK and the smali file of the loading module to the file directory where the smali file of the APP is located. In other words, the server merges the smali file of the startup page of the authentication SDK, the smali file of the loading module and the smali file of the APP to obtain the second smali file in the second file set.
[0054] After decompiling the original resource package of the APP, multiple intermediate files will be obtained. Since the embodiment of the present application only involves the first configuration file, the first static resource file and the first smali file, other intermediate files are not listed. However, it should be understood that these files are only part of the files in the first file set, and the first file set also includes other intermediate files besides these files. Correspondingly, the second configuration file, the second static resource file and the second smali file are also only part of the files in the second file set, and the second file set also includes other intermediate files that are not listed.
[0055] After obtaining the second file set, the server may compile the second file set to obtain a second installation package of the APP.
[0056] However, for some apps whose original installation packages contain media resource files, such as game apps, their installation packages generally contain audio files and video files. These resource files are generally not stored in regular paths. Therefore, after decompiling the original installation package of the app, the server was unable to obtain these resource files.
[0057] Exemplarily, for such resource files, the server can obtain such resource files by decompressing the original installation package of the APP. For example, the server decompresses the original installation package of the APP, obtains such resource files, and compresses such resource files and copies them to the second installation package of the APP.
[0058] After obtaining the second installation package of the APP, the server can sign the second installation package of the APP. The server can use the signature file provided by the developer portal to sign the second installation package of the APP, or the server can also use the signature file provided by the developer of the APP to sign the second installation package of the APP.
[0059] Taking a game APP as an example, the method for generating an installation package for an APP provided in an embodiment of the present application is described in detail below.
[0060] Assume that the developer uploads the original installation package file youxi.apk of the game APP to the developer portal. The server of the developer portal first uses apktool to decompile youxi.apk. The structure of the intermediate file is as follows: Figure 3 As shown, the res directory stores the static resource files of the game APP, and the smali directory stores the smali files of the game APP. It should be noted that Figure 3 Only some intermediate files obtained after decompiling youxi.apk are shown.
[0061] The server can modify the AndroidManifest.xml of the game APP. For example, the server can declare the startup page of the authentication SDK in the AndroidManifest.xml file while retaining the declaration of the startup page of the APP in the AndroidManifest.xml file.
[0062] In order to avoid affecting the functions of the APP itself, the startup page of the authentication SDK can be executed before the startup page of the APP. Therefore, the server can declare the startup page of the authentication SDK as the startup page of the APP in the AndroidManifest.xml file, and retain the declaration of the original startup page of the APP in the AndroidManifest.xml file. In this case, when the APP is started, the startup page of the authentication SDK will be called first to execute the authentication process. For example, the name of the startup page of the authentication SDK is "com.sdk.game.shell.ShellProxyActivity", and the server can add the following code in the AndroidManifest.xml file:
[0063]
[0064] After adding the above code to the AndroidManifest.xml file, the startup page of the authentication SDK is declared as the startup page of the APP.
[0065] In order to inject the authentication SDK into the first file set, the server can decompile the authentication SDK. After decompiling, the static resource files of the authentication SDK can be obtained. The server can copy the static resource files of the authentication SDK to Figure 3 In other words, the server merges the static resource files of the authentication SDK with the static resource files of the game APP.
[0066] In order to enable the game APP to load the static resource files of the authentication SDK when executing the authentication process, the server can create a loading module and inject the loading module into Figure 3 In the intermediate state file shown, the role of the loading module is to load the static resource files of the authentication SDK when the game APP executes the authentication process. For example, the static resource files of the authentication SDK may include pictures, codes corresponding to the authentication process, and entries, etc. When the APP executes the authentication process, the loading module can load these static resource files.
[0067] The loading module created by the server may include, for example, Android's DexClassLoader loader. When the game APP executes the authentication process, the DexClassLoader loader may, for example, load the code corresponding to the authentication process in the static resource file of the authentication SDK.
[0068] To inject the loaded module into Figure 3 In the intermediate state file shown in the figure, after creating the loading module, the server can use apktool to process the loading module, obtain the smali file of the loading module, and copy the smali file of the loading module to Figure 3 In other words, the server merges the smali file of the loading module with the smali file of the game APP.
[0069] After the server has decompiled the authentication SDK, it will also obtain the smali file of the authentication SDK startup page. The server can copy the smali file of the authentication SDK startup page and the smali file of the loading module to Figure 3In other words, the server merges the smali file of the authentication SDK startup page, the smali file of the loading module, and the smali file of the game APP.
[0070] After completing the above process, the server uses apktool to compile multiple intermediate files of the game APP that has been injected with the authentication SDK to obtain an installation package of the game APP integrated with the authentication SDK.
[0071] For game apps, the original installation package file youxi.apk generally contains audio files and video files. Such resource files are generally not stored in regular paths and cannot be obtained by decompiling the original installation package. Figure 3 The file directory shown does not contain such resource files.
[0072] For such resource files, the server can obtain them by decompressing the youxi.apk file of the original installation package of the game APP, and then compressing and copying such resource files to the installation package of the game APP integrated with the authentication SDK.
[0073] After obtaining the installation package of the game APP integrated with the authentication SDK, the server can sign the installation package of the game APP integrated with the authentication SDK. The server can use the signature file provided by the developer portal to sign the installation package of the game APP integrated with the authentication SDK, or the server can also use the signature file provided by the developer of the game APP to sign the installation package of the game APP integrated with the authentication SDK to obtain the signed installation package of the game APP integrated with the authentication SDK.
[0074] Afterwards, the server can provide the signed installation package of the game APP integrated with the authentication SDK to the server of the application market APP, and finally publish the signed game APP integrated with the authentication SDK on the application market APP.
[0075] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0076] Exemplarily, the method for generating an installation package of an APP provided in the embodiments of the present application can be executed by a business flow manager (BFM) module in an electronic device.
[0077] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0078] The electronic device provided in this embodiment is used to execute the above-mentioned method for generating an installation package of an APP, so the same effect as the above-mentioned implementation method can be achieved. In the case of an integrated unit, the electronic device may include a processing module, a storage module and a communication module. Among them, the processing module can be used to control and manage the actions of the electronic device, for example, it can be used to support the electronic device to execute the steps performed by the processing unit. The storage module can be used to support the electronic device to store program codes and data, etc. The communication module can be used to support the communication between the electronic device and other devices.
[0079] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.
[0080] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 1 Device of the structure shown.
[0081] This embodiment also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method of generating an installation package of an APP in the above-mentioned embodiment.
[0082] This embodiment also provides a computer program product. When the computer program product is run on a computer, the computer executes the above-mentioned related steps to implement the method for generating an installation package of an APP in the above-mentioned embodiment.
[0083] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor may execute the computer execution instructions stored in the memory so that the chip executes the method of generating an installation package of an APP in the above-mentioned method embodiments.
[0084] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.
[0085] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0086] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0087] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0088] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0089] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0090] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for generating an installation package of an application, characterized in that: The method comprises: Obtain the first installation package of the application APP and the authentication software development kit SDK; Decompile the first installation package to obtain a first file set, where the first file set includes a first configuration file, a first static resource file, and a first smali file of the APP; Declare the startup page of the authentication SDK as the startup page of the APP in the first configuration file to obtain a second configuration file; Decompile the authentication SDK to obtain a static resource file of the authentication SDK; Merge the first static resource file with the static resource file of the authentication SDK to obtain a second static resource file; Create a loading module and process the loading module to obtain a smali file of the loading module, wherein the loading module is used to load the static resource file of the authentication SDK; Merging the first smali file with the smali file of the loading module to obtain a second smali file, or decompiling the authentication SDK to obtain a smali file of the startup page of the authentication SDK, and merging the smali file of the startup page of the authentication SDK, the first smali file and the smali file of the loading module to obtain the second smali file; A second installation package of the APP is generated according to the second file set, where the second file set includes the second configuration file, the second static resource file and the second smali file.
2. The method according to claim 1, characterized in that The method further comprises: Decompressing the first installation package to obtain a media resource file of the APP; Generating a second installation package of the APP according to the second file set includes: Generate a second installation package of the APP based on the media resource file and the second file set.
3. An electronic device, characterized in that: include: one or more processors; Memory; and one or more programs, wherein the one or more programs are stored in the memory, and when the one or more programs are executed by the processor, the electronic device performs the following steps: Obtain the first installation package of the application APP and the authentication software development kit SDK; Decompile the first installation package to obtain a first file set, where the first file set includes a first configuration file, a first static resource file, and a first smali file of the APP; Declare the startup page of the authentication SDK as the startup page of the APP in the first configuration file to obtain a second configuration file; Decompile the authentication SDK to obtain a static resource file of the authentication SDK; Merge the first static resource file with the static resource file of the authentication SDK to obtain a second static resource file; Create a loading module and process the loading module to obtain a smali file of the loading module, wherein the loading module is used to load the static resource file of the authentication SDK; Merging the first smali file with the smali file of the loading module to obtain a second smali file, or decompiling the authentication SDK to obtain a smali file of the startup page of the authentication SDK, and merging the smali file of the startup page of the authentication SDK, the first smali file and the smali file of the loading module to obtain the second smali file; A second installation package of the APP is generated according to the second file set, where the second file set includes the second configuration file, the second static resource file and the second smali file.
4. The electronic device according to claim 3, characterized in that: When the one or more programs are executed by the processor, the electronic device performs the following steps: Decompressing the first installation package to obtain a media resource file of the APP; Generate a second installation package of the APP based on the media resource file and the second file set.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method for generating an installation package of an application according to any one of claims 1 to 2.
6. A computer program product, characterized in that When the computer program product is run on a computer, the computer is enabled to execute the method for generating an installation package of an application program according to any one of claims 1 to 2.
Citation Information
Patent Citations
Android platform software protecting system, method and equipment
CN102760219A
Android application installation package making device and method, electronic device and storage medium
CN108427552A