WO2022135227A1 - Method for generating installation package of application and electronic device - Google Patents

Method for generating installation package of application and electronic device Download PDF

Info

Publication number
WO2022135227A1
WO2022135227A1 PCT/CN2021/137943 CN2021137943W WO2022135227A1 WO 2022135227 A1 WO2022135227 A1 WO 2022135227A1 CN 2021137943 W CN2021137943 W CN 2021137943W WO 2022135227 A1 WO2022135227 A1 WO 2022135227A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
app
smali
authentication
installation package
Prior art date
Application number
PCT/CN2021/137943
Other languages
French (fr)
Chinese (zh)
Inventor
万多苗
Original Assignee
花瓣云科技有限公司
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 花瓣云科技有限公司 filed Critical 花瓣云科技有限公司
Publication of WO2022135227A1 publication Critical patent/WO2022135227A1/en

Links

Images

Classifications

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

Definitions

  • the present application relates to the field of terminals, and more particularly, to a method and an electronic device for generating an installation package of an application in the field of terminals.
  • the application market APP can provide VIP (very important person, VIP) functions, such as , the application market APP can authorize some APPs as an APP combination package to VIP users.
  • VIP very important person
  • APPs For APPs that need to be downloaded or belong to VIP users, they need to have authentication capabilities, so that when the user uses this type of APP, it can be determined whether the user has paid or belongs to VIP users.
  • the software development kit (SDK) is integrated into the APP installation package, and then the APP integrated with the authentication SDK is provided to the application market APP, which is published by the application market APP.
  • the APP After the electronic device is installed, if the APP is activated, the APP will initiate an authentication process to determine whether the user has paid or is a VIP user. Only when the authentication is passed can the user use this type of APP.
  • the embodiment of the present application provides a method for generating an installation package of an application program, which can save the APP developer's effort in integrating the authentication SDK and avoid the waste of research and development resources.
  • a method for generating an installation package of an application program including: the server of the developer portal obtains the first installation package of the application program APP and the authentication software development kit SDK, and then performs the first installation package. Decompilation is performed to obtain a first set of files, and then the authentication SDK is injected into the first set of files to obtain a second set of files, and finally a second installation package of the APP is generated according to the second set of files.
  • the server of the developer portal decompiles the installation package of the APP submitted by the developer, injects the authentication SDK into the first set of files obtained after the decompilation process, and obtains the second set of files.
  • the second file set is compiled to obtain the installation package of the APP integrated with the authentication SDK, thereby saving the APP developer's effort in integrating the authentication SDK and avoiding the waste of research and development resources.
  • the first file set includes a first configuration file of an APP
  • the authentication SDK is injected into the first file set to obtain the second
  • the file set includes: declaring a startup page of the authentication SDK in the first configuration file to obtain a second configuration file, where the second file set includes the second configuration file.
  • 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.
  • the declaring the startup page of the authentication SDK in the first configuration file includes: in the first configuration file In the configuration file, the startup page of the authentication SDK is declared as the startup page of the APP.
  • 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 first performs the authentication process after startup, so as to avoid affecting the function of the APP itself.
  • the first file set includes a first static resource file
  • the authentication SDK is injected into the first file set , including: decompiling the authentication SDK to obtain a static resource file of the authentication SDK; merging the first static resource file and the static resource file of the authentication SDK to obtain a second static resource file resource files, the second file set includes the second static resource file.
  • the method further includes: creating a loading module, where the loading module is used to load the static resource file of the authentication SDK; the injecting the authentication SDK into the first file set to obtain a second file set, including: injecting the authentication SDK and the loading module into the first file set to obtain the second file set .
  • the APP can load the static resource files in the authentication SDK through the loading module when performing the authentication process.
  • the method further includes: processing the loading module to obtain a smali file of the loading module; the first file set Including a first smali file, and injecting the authentication SDK and the loading module into the first file set to obtain the second file set, including: adding the first smali file and the loading module
  • the smali files are merged to obtain a second smali file, and the second file set includes the second smali file.
  • the 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 the second smali file in the second file set, thereby injecting the loading module into the first file concentrated.
  • the method further includes: decompiling the authentication SDK to obtain a smali file of the startup page of the authentication SDK
  • the described first smali file is merged with the smali file of the loading module, and the second smali file is obtained, including: the smali file of the startup page of the authentication SDK, the first smali file and all The smali files of the loading module are merged to obtain the second smali file.
  • the method further includes: decompressing the first installation package to obtain a media resource file of the APP; the Generating a second installation package of the APP according to the second file set includes: generating a second installation package of the APP according to the media resource file and the second file set.
  • the original resource package of the APP is decompressed to obtain the media resource file of the APP, and then the media resource file of the APP is added to the APP integrated with the authentication SDK.
  • the installation package of the APP the installation package of the APP integrated with the authentication SDK can contain the media resource file of the APP, so as to avoid affecting the function of the APP itself.
  • the present application provides an apparatus, the apparatus is included in an electronic device, and the apparatus has a function of implementing the behavior of the electronic device in the above-mentioned aspect and possible implementation manners of the above-mentioned aspect.
  • the functions can be implemented by hardware, or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules or units corresponding to the above functions.
  • the present application provides an electronic device including one or more processors and one or more memories.
  • the one or more memories are coupled to the one or more processors for storing computer program code, the computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform A method for generating an installation package of an APP in any possible implementation of any one of the foregoing aspects.
  • the present application provides a computer-readable storage medium, including computer instructions, which, when the computer instructions are executed on an electronic device, enable the electronic device to perform any of the possible video playback methods in any of the foregoing aspects.
  • the present application provides a computer program product that, when the computer program product runs on an electronic device, enables the electronic device to execute any of the possible methods for generating an APP installation package in any of the foregoing aspects.
  • FIG. 1 is a schematic block diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a method for generating an installation package of an APP provided by an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a file obtained by decompiling an original installation package of an APP according to an embodiment of the present application.
  • the installation package of the APP needs to be submitted to the developer portal first, and the developer portal then submits the APP installation package to the server side of the App Market APP. Finally, the APP is released on the application market APP.
  • the app market can provide VIP functions.
  • the app market can add a certain Some APPs are authorized to be used by VIP users as an APP combination package. In other words, if the user is a VIP user of the application market APP, the APP in the APP combination package can be downloaded for free.
  • APPs that need to be downloaded or belong to VIP users they need to have authentication capabilities, so that when the user uses this type of APP, it can be determined whether the user has paid or belongs to VIP users.
  • the authorization SDK is integrated into the installation package of the APP, and then the installation package of the APP integrated with the authentication SDK is provided to the developer portal, and the developer portal then submits the installation package of the APP integrated with the authentication SDK to the application market APP service Finally, the APP integrated with the authentication SDK is released on the application market APP.
  • the APP will initiate an authentication process to determine whether the user has Users who pay or belong to VIP users can use this type of APP only after the authentication is passed.
  • the embodiment of the present application provides a method for generating an installation package of an APP.
  • the server of the developer portal injects an authentication SDK into the installation package of the APP submitted by the developer to obtain an APP integrated with the authentication SDK. This saves the APP developers' effort in integrating the authentication SDK and avoids the waste of R&D resources.
  • FIG. 1 is a schematic structural diagram of an example of an electronic device 100 provided by an embodiment of the present application.
  • the electronic device 100 may be a server of the 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.
  • the processor 101 , the memory 102 , and the communication interface 103 communicate through the bus 104 , and can also communicate through other means such as wireless transmission.
  • the memory 102 is used for storing instructions, and the processor 101 is used for executing 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 the method for generating an APP installation package shown in FIG. 2 .
  • 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.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGAs field programmable gate arrays
  • a general purpose processor may be a microprocessor or any conventional processor or the like.
  • the memory 102 may include read only memory and random access memory and provides instructions and data to the processor 101 .
  • Memory 102 may also include non-volatile random access memory.
  • the memory 102 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be random access memory (RAM), which acts as an external cache.
  • RAM random access memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • Double data rate synchronous dynamic random access memory double data date SDRAM, DDR SDRAM
  • enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM
  • synchronous link dynamic random access memory direct rambus RAM, DR RAM
  • bus 104 may also include a power bus, a control bus, a status signal bus, and the like. However, for the sake of clarity, the various buses are labeled as bus 104 in FIG. 1 .
  • FIG. 2 shows a schematic flowchart of a method 200 for generating an APP installation package, and the method is executed by the server of the developer portal.
  • Step 201 the server obtains the first installation package of the APP and the authentication SDK.
  • Step 202 the server decompiles the first installation package to obtain a first file set.
  • Step 203 the server injects the authentication SDK into the first file set to obtain the second file set.
  • Step 204 the server generates a second installation package of the APP according to the second file set.
  • the server of the developer portal can decompile the original installation package to obtain a first file set, which includes the original files from the APP.
  • a first file set which includes the original files from the APP.
  • Multiple intermediate state files between the installation package and the source code of the APP the server of the developer portal injects the authentication SDK into the first file set to obtain the second file set, and finally obtains the integration of the APP according to the second file set.
  • the installation package of the APP of the authentication SDK 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 integrated with the authentication SDK in the embodiment of the present application corresponds to the second installation package of the APP.
  • the server side of the developer portal is referred to as the server side for short.
  • the first file set obtained after the server decompiles the first installation package includes the first configuration file of the APP.
  • 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.
  • the server can specify the authentication SDK in the AndroidManifest.xml file under the premise of retaining the declaration of the APP startup page in the AndroidManifest.xml file. declaration on the startup page.
  • 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 in the AndroidManifest.xml file. It is the startup page of the APP, and retains the declaration of the original startup page of the APP in the AndroidManifest.xml file. In this case, when the APP starts, the startup page of the authentication SDK will be called first to execute the authentication process.
  • 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.
  • the server in order to inject the authentication SDK into the first file set, can decompile the authentication SDK to obtain a static resource file of the authentication SDK.
  • decompile the first installation package of the APP After processing, the obtained first file set 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 will authenticate the SDK.
  • the static resource file of the APP is merged with the static resource file of the APP to obtain the second static resource file in the second file set.
  • the static resource file of the APP corresponds to the first static resource file.
  • the server can create a loading module and inject the loading module into the first file set.
  • the static resource file of the authentication SDK is loaded.
  • the static resource file of the authentication SDK may include pictures, codes corresponding to the authentication process, and entries, etc.
  • the loading module can These static resource files are loaded.
  • the loading module created by the server may include, for example, the DexClassLoader loader of Android.
  • the DexClassLoader loader may, for example, load the code corresponding to the authentication process in the static resource file of the authentication SDK.
  • the server in order to inject the loading module into the first file set, can process the loading module after creating the loading module to obtain the smali file of the loading module.
  • the obtained first file set includes the smali file of the APP.
  • the server can add the smali file of the loaded module to the file directory where the smali file of the APP is located.
  • the server Merge the smali file of the loaded module with the smali file of the APP to obtain the second smali file in the second file set.
  • the smali file of the APP corresponds to the first smali file.
  • the server after the server decompiles the authentication SDK, it will also obtain the smali file of the startup page of the authentication SDK, and the server can add the smali file of the startup page of the authentication SDK and the smali file of the loading module.
  • 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 document.
  • intermediate state files After decompiling the original resource package of the APP, multiple intermediate state 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 state files are not listed. , but it should be understood that these files are only some of the files in the first file set, and the first file set also includes other intermediate state files besides these files. Correspondingly, the second configuration file, the second static resource file and the first file set The second smali file is only a part of the files in the second file set, and the second file set also includes other intermediate state files that are not listed.
  • the server may compile the second file set to obtain the second installation package of the APP.
  • the installation package generally contains audio files and video files.
  • resource files are generally not stored in the specified path. After the original installation package of the APP is decompiled, the server cannot obtain such resource files.
  • the server can obtain such resource files by decompressing the original installation package of the APP.
  • the server decompresses the original installation package of the APP to obtain such resources. files, and compress such resource files and copy them into the second installation package of the APP.
  • the server can sign the second installation package of the APP, and 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 The second installation package of the APP is signed by using the signature file provided by the developer of the APP.
  • the following takes a game APP as an example to describe in detail the method for generating an APP installation package provided by the embodiment of the present application.
  • the server of the developer portal first decompiles youxi.apk using apktool to process youxi.apk, and obtains the structure of the intermediate state file
  • the static resource files of the game APP are stored in the res directory
  • the smali files of the game APP are stored in the smali directory. Part of the intermediate state file obtained after compilation processing.
  • the server can modify the AndroidManifest.xml of the game APP.
  • the server can modify the startup page of the authentication SDK in the AndroidManifest.xml file on the premise of retaining the declaration of the startup page of the APP in the AndroidManifest.xml file. statement.
  • 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 of the APP in the AndroidManifest.xml file. page, and retain the declaration of the original startup page of the APP in the AndroidManifest.xml file.
  • the server when the APP starts, it will first call the startup page of the authentication SDK to execute the authentication process.
  • the name of the startup page of the authentication SDK is "com.sdk.game.shell.ShellProxyActivity”
  • the server can add the following code to the AndroidManifest.xml file:
  • the startup page of the authentication SDK is declared as the startup page of the APP.
  • the server can decompile the authentication SDK. After the decompilation process, the static resource file of the authentication SDK can be obtained, and the server can copy the static resource file of the authentication SDK. Go to the res directory in Figure 3, in other words, the server merges the static resource file of the authentication SDK with the static resource file of the game APP.
  • the server can create a loading module and inject the loading module into the intermediate state file shown in Figure 3.
  • the function of the loading module is to When the game APP executes the authentication process, the static resource file of the authentication SDK is loaded.
  • the static resource file of the authentication SDK can include pictures, codes corresponding to the authentication process, and entries.
  • the APP is executing the authentication process.
  • the load module can load these static resource files.
  • the loading module created by the server may include, for example, the DexClassLoader of Android.
  • the DexClassLoader may, for example, load the code corresponding to the authentication process in the static resource file of the authentication SDK.
  • 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 the figure 3 in the smali directory, in other words, the server merges the smali file of the loaded module with the smali file of the game APP.
  • the server After the server decompiles the authentication SDK, it will also obtain the smali file of the startup page of the authentication SDK.
  • the server can copy the smali file of the startup page of the authentication SDK and the smali file of the loading module to Figure 3. 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 game APP.
  • the server uses apktool to compile multiple intermediate state files of the game APP that has been injected into the authentication SDK, and obtains an installation package of the game APP integrated with the authentication SDK.
  • the file youxi.apk of the original installation package generally contains audio files and video files.
  • resource files are generally not stored in the specified path and cannot be obtained by decompiling the original installation package. Therefore, , the file directory shown in Figure 3 does not contain such resource files.
  • the server can obtain it by decompressing the file youxi.apk of the original installation package of the game APP, and compressing and copying this kind of resource file to the game APP integrated with the authentication SDK. in the installation package.
  • the server can sign the installation package of the game APP integrated with the authentication SDK, and the server can use the signature file provided by the developer portal to integrate the authentication SDK.
  • 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, and obtain the signed version of the game APP integrated with the authentication SDK.
  • Game APP installation package 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, and the server can use the signature file provided by the developer portal to integrate the authentication SDK.
  • 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, and obtain the signed version of the game APP integrated with the authentication SDK.
  • Game APP installation package 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, and
  • 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 named game APP integrated with the authentication SDK on the application market APP.
  • the electronic device can be divided into functional modules according to the above method examples.
  • each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module.
  • the above-mentioned integrated modules 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, and there may be other division manners in actual implementation.
  • the method for generating an APP installation package provided in the embodiments of the present application may be executed by a business process management (business flow manager, BFM) module in the electronic device.
  • BFM business flow manager
  • 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.
  • the electronic device may include a processing module, a memory module and a communication module.
  • the processing module may be used to control and manage the actions of the electronic device, for example, may be used to support the electronic device to perform the steps performed by the processing unit.
  • the storage module can be used to support the electronic device to store program codes, data, and the like.
  • the communication module can be used to support the communication between the electronic device and other devices.
  • the processing module may be a processor or a controller. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure.
  • the processor may 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, and the like.
  • the storage module may be a memory.
  • the communication module may specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, and a Wi-Fi chip.
  • the electronic device involved in this embodiment may be a device having the structure shown in FIG. 1 .
  • This embodiment also provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on the electronic device, the electronic device executes the above-mentioned related method steps to realize the above-mentioned embodiments.
  • the method of generating the installation package of the APP is also provided.
  • This embodiment also provides a computer program product, when the computer program product runs on the computer, the computer executes the above-mentioned relevant steps, so as to realize the method for generating an APP installation package in the above-mentioned embodiment.
  • the embodiments of the present application also provide an apparatus, which may specifically be a chip, a component or a module, and the apparatus may include a connected processor and a memory; wherein, the memory is used for storing computer execution instructions, and when the apparatus is running, The processor can execute the computer-executed instructions stored in the memory, so that the chip executes the method for generating an APP installation package in the foregoing method embodiments.
  • the electronic device, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference can be made to the corresponding provided above. The beneficial effects in the method will not be repeated here.
  • the disclosed apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or May be integrated into another device, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • Units described as separate components may or may not be physically separated, and components shown as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium.
  • a readable storage medium including several instructions to make a device (which may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.

Landscapes

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

Abstract

The present application provides a method for generating an installation package of an APP and an electronic device. A server of a developer portal performs decompilation processing on an installation package of an APP submitted by a developer, injects an authentication SDK into an intermediate-state file obtained after the decompilation processing, and finally compiles the intermediate-state file to obtain the installation package of the APP integrated with the authentication SDK, so that the effort put into the integration of the authentication SDK by the developer of the APP is saved, avoiding the waste of research and development resources.

Description

生成应用程序的安装包的方法与电子设备Method and electronic device for generating installation package of application
本申请要求于2020年12月24日提交国家知识产权局、申请号为202011557385.3、申请名称为“生成应用程序的安装包的方法与电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202011557385.3 and the application title "Method and Electronic Device for Generating an Installation Package of an Application", which was submitted to the State Intellectual Property Office on December 24, 2020, the entire contents of which are by reference Incorporated in this application.
技术领域technical field
本申请涉及终端领域,并且更具体地,涉及终端领域中生成应用程序的安装包的方法与电子设备。The present application relates to the field of terminals, and more particularly, to a method and an electronic device for generating an installation package of an application in the field of terminals.
背景技术Background technique
目前,大部分电子设备均支持在其上安装应用程序(application,APP),例如,用户可以通过应用市场APP下载到各种各样的APP。At present, most electronic devices support the installation of application programs (application, APP) thereon. For example, users can download various APPs through the application market APP.
对于应用市场APP发布的诸多APP中,有些对于用户而言是可以免费下载的,有些则是需要付费后才可以下载的,或者,应用市场APP可以提供贵宾(very important person,VIP)功能,例如,应用市场APP可以将某些APP作为一个APP组合包授权给VIP用户使用,换句话说,如果用户是应用市场APP的VIP用户,则可以免费下载APP组合包内的APP。Among the many APPs released by the application market APP, some are free for users to download, and some can be downloaded after payment. Alternatively, the application market APP can provide VIP (very important person, VIP) functions, such as , the application market APP can authorize some APPs as an APP combination package to VIP users. In other words, if the user is a VIP user of the application market APP, the APP in the APP combination package can be downloaded for free.
对于需要付费下载或者属于VIP用户才可以下载的APP,其需要具备鉴权能力,以便在用户使用该这类APP时确定用户是否已付费或者属于VIP用户,例如,这类APP开发者可以将鉴权软件开发工具包(software development kit,SDK)集成在APP的安装包内,再将集成有鉴权SDK的APP提供给应用市场APP,由应用市场APP进行发布,当用户将这类APP下载在电子设备上后,如果APP被启动,APP则会发起鉴权流程,以确定用户是否已付费或者属于VIP用户,在鉴权通过的情况下,用户才可以使用这类APP。For APPs that need to be downloaded or belong to VIP users, they need to have authentication capabilities, so that when the user uses this type of APP, it can be determined whether the user has paid or belongs to VIP users. The software development kit (SDK) is integrated into the APP installation package, and then the APP integrated with the authentication SDK is provided to the application market APP, which is published by the application market APP. After the electronic device is installed, if the APP is activated, the APP will initiate an authentication process to determine whether the user has paid or is a VIP user. Only when the authentication is passed can the user use this type of APP.
然而,随着这类APP不断增多,APP的开发者在集成鉴权SDK方面投入的精力必然也会加大,进而导致研发资源的浪费。However, with the increasing number of such APPs, APP developers will inevitably increase their efforts in integrating authentication SDKs, which will lead to a waste of R&D resources.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种生成应用程序的安装包的方法,能够省去APP的开发者在集成鉴权SDK方面投入的精力,避免研发资源的浪费。The embodiment of the present application provides a method for generating an installation package of an application program, which can save the APP developer's effort in integrating the authentication SDK and avoid the waste of research and development resources.
第一方面,提供了一种生成应用程序的安装包的方法,包括:开发者门户的服务端获取应用程序APP的第一安装包与鉴权软件开发工具包SDK,之后对第一安装包进行反编译处理,得到第一文件集,再将鉴权SDK注入到所述第一文件集中,得到第二文件集,最终根据第二文件集,生成APP的第二安装包。In a first aspect, a method for generating an installation package of an application program is provided, including: the server of the developer portal obtains the first installation package of the application program APP and the authentication software development kit SDK, and then performs the first installation package. Decompilation is performed to obtain a first set of files, and then the authentication SDK is injected into the first set of files to obtain a second set of files, and finally a second installation package of the APP is generated according to the second set of files.
基于上述技术方案,由开发者门户的服务端对开发者提交的APP的安装包进行反编译处理,将鉴权SDK注入反编译处理后得到的第一文件集中,得到第二文件集,最终对第二文件集进行编译,得到集成有鉴权SDK的APP的安装包,从而省去APP的开发者在集成鉴权SDK方面投入的精力,避免研发资源的浪费。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 set of files obtained after the decompilation process, and obtains the second set of files. The second file set is compiled to obtain the installation package of the APP integrated with the authentication SDK, thereby saving the APP developer's effort in integrating the authentication SDK and avoiding the waste of research and development resources.
结合第一方面,在第一方面的某些实现方式中,所述第一文件集包括APP的第一配置文件,所述将所述鉴权SDK注入到所述第一文件集中,得到第二文件集,包括:在所 述第一配置文件中对所述鉴权SDK的启动页面进行声明,得到第二配置文件,所述第二文件集包括所述第二配置文件。With reference to the first aspect, in some implementations of the first aspect, the first file set includes a first configuration file of an APP, and the authentication SDK is injected into the first file set to obtain the second The file set includes: declaring a startup page of the authentication SDK in the first configuration file to obtain a second configuration file, where the second file set includes the second configuration file.
基于上述技术方案,在APP的配置文件中对鉴权SDK的启动页面进行声明,使得APP在启动后能够调用鉴权SDK的启动页面执行鉴权流程。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.
结合第一方面及其上述实现方式,在第一方面的某些实现方式中,所述在所述第一配置文件中对所述鉴权SDK的启动页面进行声明,包括:在所述第一配置文件中将所述鉴权SDK的启动页面声明为所述APP的启动页面。With reference to the first aspect and the foregoing implementation manners thereof, in some implementation manners of the first aspect, the declaring the startup page of the authentication SDK in the first configuration file includes: in the first configuration file In the configuration file, the startup page of the authentication SDK is declared as the startup page of the APP.
基于上述技术方案,在APP的配置文件中将鉴权SDK的启动页面声明为APP的启动页面,使得APP在启动后最先执行鉴权流程,避免影响APP的自身功能。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 first performs the authentication process after startup, so as to avoid affecting the function of the APP itself.
结合第一方面及其上述实现方式,在第一方面的某些实现方式中,所述第一文件集包括第一静态资源文件,所述将所述鉴权SDK注入到所述第一文件集中,包括:对所述鉴权SDK进行反编译处理,得到所述鉴权SDK的静态资源文件;将所述第一静态资源文件与所述鉴权SDK的静态资源文件进行合并,得到第二静态资源文件,所述第二文件集包括所述第二静态资源文件。With reference to the first aspect and the foregoing implementation manners thereof, in some implementation manners of the first aspect, the first file set includes a first static resource file, and the authentication SDK is injected into the first file set , including: decompiling the authentication SDK to obtain a static resource file of the authentication SDK; merging the first static resource file and the static resource file of the authentication SDK to obtain a second static resource file resource files, the second file set includes the second static resource file.
结合第一方面及其上述实现方式,在第一方面的某些实现方式中,所述方法还包括:创建加载模块,所述加载模块用于加载所述鉴权SDK的静态资源文件;所述将所述鉴权SDK注入到所述第一文件集中,得到第二文件集,包括:将所述鉴权SDK与所述加载模块注入到所述第一文件集中,得到所述第二文件集。With reference to the first aspect and the above implementation manners thereof, in some implementation manners of the first aspect, the method further includes: creating a loading module, where the loading module is used to load the static resource file of the authentication SDK; the injecting the authentication SDK into the first file set to obtain a second file set, including: injecting the authentication SDK and the loading module into the first file set to obtain the second file set .
基于上述技术方案,通过创建加载模块,并将加载模块注入到第一文件集中,使得APP在执行鉴权流程时,能够通过加载模块对鉴权SDK中的静态资源文件进行加载。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 performing the authentication process.
结合第一方面及其上述实现方式,在第一方面的某些实现方式中,所述方法还包括:对所述加载模块进行处理,得到所述加载模块的smali文件;所述第一文件集包括第一smali文件,所述将所述鉴权SDK与所述加载模块注入到所述第一文件集中,得到所述第二文件集,包括:将所述第一smali文件与所述加载模块的smali文件进行合并,得到第二smali文件,所述第二文件集包括所述第二smali文件。With reference to the first aspect and the foregoing implementation manners thereof, in some implementation manners of the first aspect, the method further includes: processing the loading module to obtain a smali file of the loading module; the first file set Including a first smali file, and injecting the authentication SDK and the loading module into the first file set to obtain the second file set, including: adding the first smali file and the loading module The smali files are merged to obtain a second smali file, and the second file set includes the second smali file.
通过对加载模块进行处理,得到加载模块的smali文件,使得可以将加载模块的smali文件与第一smali文件进行合并,得到第二文件集中的第二smali文件,从而将加载模块注入到第一文件集中。By processing the loading module, the 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 the second smali file in the second file set, thereby injecting the loading module into the first file concentrated.
结合第一方面及其上述实现方式,在第一方面的某些实现方式中,所述方法还包括:对所述鉴权SDK进行反编译处理,得到所述鉴权SDK的启动页面的smali文件;所述将所述第一smali文件与所述加载模块的smali文件进行合并,得到第二smali文件,包括:将所述鉴权SDK的启动页面的smali文件、所述第一smali文件与所述加载模块的smali文件进行合并,得到所述第二smali文件。In combination with the first aspect and the above-mentioned implementation manners, in some implementation manners of the first aspect, the method further includes: decompiling the authentication SDK to obtain a smali file of the startup page of the authentication SDK The described first smali file is merged with the smali file of the loading module, and the second smali file is obtained, including: the smali file of the startup page of the authentication SDK, the first smali file and all The smali files of the loading module are merged to obtain the second smali file.
结合第一方面及其上述实现方式,在第一方面的某些实现方式中,所述方法还包括:对所述第一安装包进行解压缩处理,得到所述APP的媒体资源文件;所述根据所述第二文件集,生成所述APP的第二安装包,包括:根据所述媒体资源文件与所述第二文件集,生成所述APP的第二安装包。With reference to the first aspect and the foregoing implementation manners thereof, in some implementation manners of the first aspect, the method further includes: decompressing the first installation package to obtain a media resource file of the APP; the Generating a second installation package of the APP according to the second file set includes: generating a second installation package of the APP according to the media resource file and the second file set.
基于上述技术方案,通过对APP的原始资源包进行解压缩处理,以获得APP的媒体资源文件,再将APP的媒体资源文件添加在为了将APP的媒体资源文件添加在集成有鉴 权SDK的APP的安装包内,从而使得集成有鉴权SDK的APP的安装包内能够包含APP的媒体资源文件,避免对APP的自身功能造成影响。Based on the above technical solutions, the original resource package of the APP is decompressed to obtain the media resource file of the APP, and then the media resource file of the APP is added to the APP integrated with the authentication SDK. In the installation package of the APP, the installation package of the APP integrated with the authentication SDK can contain the media resource file of the APP, so as to avoid affecting the function of the APP itself.
第二方面,本申请提供了一种装置,该装置包含在电子设备中,该装置具有实现上述方面及上述方面的可能实现方式中电子设备行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。In a second aspect, the present application provides an apparatus, the apparatus is included in an electronic device, and the apparatus has a function of implementing the behavior of the electronic device in the above-mentioned aspect and possible implementation manners of the above-mentioned aspect. The functions can be implemented by hardware, or by executing corresponding software by hardware. The hardware or software includes one or more modules or units corresponding to the above functions.
第三方面,本申请提供了一种电子设备,包括一个或多个处理器和一个或多个存储器。该一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行上述任一方面任一项可能的实现中的生成APP的安装包的方法。In a third aspect, the present application provides an electronic device including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors for storing computer program code, the computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform A method for generating an installation package of an APP in any possible implementation of any one of the foregoing aspects.
第四方面,本申请提供了一种计算机可读存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述任一方面任一项可能的视频播放的方法。In a fourth aspect, the present application provides a computer-readable storage medium, including computer instructions, which, when the computer instructions are executed on an electronic device, enable the electronic device to perform any of the possible video playback methods in any of the foregoing aspects.
第五方面,本申请提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述任一方面任一项可能的生成APP的安装包的方法。In a fifth aspect, the present application provides a computer program product that, when the computer program product runs on an electronic device, enables the electronic device to execute any of the possible methods for generating an APP installation package in any of the foregoing aspects.
附图说明Description of drawings
图1是本申请实施例提供的电子设备的示意性框图;1 is a schematic block diagram of an electronic device provided by an embodiment of the present application;
图2是本申请实施例提供的生成APP的安装包的方法示意图;2 is a schematic diagram of a method for generating an installation package of an APP provided by an embodiment of the present application;
图3是本申请实施例提供的对APP的原始安装包进行反编译处理后得到的文件的结构示意图。FIG. 3 is a schematic structural diagram of a file obtained by decompiling an original installation package of an APP according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
通常情况下,对于需要在应用市场APP上发布的其他APP而言,首先需要将该APP的安装包提交至开发者门户,开发者门户再将APP的安装包提交至应用市场APP的服务端,最终在应用市场APP上对该APP上进行发布。Usually, for other APPs that need to be published on the App Market APP, the installation package of the APP needs to be submitted to the developer portal first, and the developer portal then submits the APP installation package to the server side of the App Market APP. Finally, the APP is released on the application market APP.
对于应用市场APP发布的诸多APP中,有些对于用户而言是可以免费下载的,有些则是需要付费后才可以下载的,或者,应用市场APP可以提供VIP功能,例如,应用市场APP可以将某些APP作为一个APP组合包授权给VIP用户使用,换句话说,如果用户是应用市场APP的VIP用户,则可以免费下载APP组合包内的APP。Among the many apps released by the app market, some are free for users to download, and some can be downloaded after payment. Alternatively, the app market can provide VIP functions. For example, the app market can add a certain Some APPs are authorized to be used by VIP users as an APP combination package. In other words, if the user is a VIP user of the application market APP, the APP in the APP combination package can be downloaded for free.
对于需要付费下载或者属于VIP用户才可以下载的APP,其需要具备鉴权能力,以便在用户使用该这类APP时确定用户是否已付费或者属于VIP用户,例如,这类APP开发者可以将鉴权SDK集成在APP的安装包内,再将集成有鉴权SDK的APP的安装包提供给开发者门户,开发者门户再将集成有鉴权SDK的APP的安装包提交至应用市场APP的服务端,最终在应用市场APP上对集成有鉴权SDK的APP进行发布,当用户将这类APP下载在电子设备上后,如果APP被启动,APP则会发起鉴权流程,以确定用户是否已付费或者属于VIP用户,在鉴权通过的情况下,用户才可以使用这类APP。For APPs that need to be downloaded or belong to VIP users, they need to have authentication capabilities, so that when the user uses this type of APP, it can be determined whether the user has paid or belongs to VIP users. The authorization SDK is integrated into the installation package of the APP, and then the installation package of the APP integrated with the authentication SDK is provided to the developer portal, and the developer portal then submits the installation package of the APP integrated with the authentication SDK to the application market APP service Finally, the APP integrated with the authentication SDK is released on the application market APP. When the user downloads such an APP on the electronic device, if the APP is started, the APP will initiate an authentication process to determine whether the user has Users who pay or belong to VIP users can use this type of APP only after the authentication is passed.
然而,随着这类APP不断增多,APP的开发者在集成鉴权SDK方面投入的精力必然也会加大,进而导致研发资源的浪费。However, with the increasing number of such APPs, APP developers will inevitably increase their efforts in integrating authentication SDKs, which will lead to a waste of R&D resources.
有鉴于此,本申请实施例提供了一种生成APP的安装包的方法,由开发者门户的服务端在开发者提交的APP的安装包内注入鉴权SDK,得到集成有鉴权SDK的APP的安 装包,从而省去APP的开发者在集成鉴权SDK方面投入的精力,避免研发资源的浪费。In view of this, the embodiment of the present application provides a method for generating an installation package of an APP. The server of the developer portal injects an authentication SDK into the installation package of the APP submitted by the developer to obtain an APP integrated with the authentication SDK. This saves the APP developers' effort in integrating the authentication SDK and avoids the waste of R&D resources.
示例性的,图1是本申请实施例提供的一例电子设备100的结构示意图。电子设备100可以是开发者门户的服务端,电子设备100可以包括处理器101、存储器102、通信接口103和总线104等。Exemplarily, FIG. 1 is a schematic structural diagram of an example of an electronic device 100 provided by an embodiment of the present application. The electronic device 100 may be a server of the 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.
其中,处理器101、存储器102、通信接口103通过总线104进行通信,也可以通过无线传输等其他手段实现通信。该存储器102用于存储指令,该处理器101用于执行该存储器102存储的指令。该存储器102存储程序代码1021,且处理器101可以调用存储器102中存储的程序代码1021执行图2所示的生成APP的安装包的方法。The processor 101 , the memory 102 , and the communication interface 103 communicate through the bus 104 , and can also communicate through other means such as wireless transmission. The memory 102 is used for storing instructions, and the processor 101 is used for executing 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 the method for generating an APP installation package shown in FIG. 2 .
应理解,在本申请实施例中,处理器101可以是CPU,处理器101还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。It should be understood that, in this 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. A general purpose processor may be a microprocessor or any conventional processor or the like.
该存储器102可以包括只读存储器和随机存取存储器,并向处理器101提供指令和数据。存储器102还可以包括非易失性随机存取存储器。该存储器102可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data date SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。The memory 102 may include read only memory and random access memory and provides instructions and data to the processor 101 . Memory 102 may also include non-volatile random access memory. The memory 102 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory may be random access memory (RAM), which acts as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), Double data rate synchronous dynamic random access memory (double data date SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) and direct Memory bus random access memory (direct rambus RAM, DR RAM).
该总线104除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图1中将各种总线都标为总线104。In addition to the data bus, the bus 104 may also include a power bus, a control bus, a status signal bus, and the like. However, for the sake of clarity, the various buses are labeled as bus 104 in FIG. 1 .
下面结合图2对本申请实施例提供的生成APP的安装包的方法进行介绍,图2示出了生成APP的安装包的方法200的示意性流程图,该方法由开发者门户的服务端执行。The method for generating an APP installation package provided by the embodiment of the present application will be introduced below with reference to FIG. 2 . FIG. 2 shows a schematic flowchart of a method 200 for generating an APP installation package, and the method is executed by the server of the developer portal.
步骤201,服务端获取APP的第一安装包与鉴权SDK。Step 201, the server obtains the first installation package of the APP and the authentication SDK.
步骤202,服务端对第一安装包进行反编译处理,得到第一文件集。Step 202, the server decompiles the first installation package to obtain a first file set.
步骤203,服务端将鉴权SDK注入到第一文件集中,得到第二文件集。Step 203, the server injects the authentication SDK into the first file set to obtain the second file set.
步骤204,服务端根据第二文件集,生成APP的第二安装包。Step 204, the server generates a second installation package of the APP according to the second file set.
具体的,在开发人员将APP的原始安装包提交至开发者门户后,开发者门户的服务端可以对原始安装包进行反编译处理,得到第一文件集,第一文件集中包括从APP的原始安装包到APP的源代码之间的多个中间态文件,开发者门户的服务端将鉴权SDK注入到第一文件集中后得到第二文件集,最终根据第二文件集得到APP的集成有鉴权SDK的APP的安装包。其中,本申请实施例中的APP的原始安装包与第一安装包对应,本申请实施例中的APP的集成有鉴权SDK的安装包与APP的第二安装包对应。以下为了描述方 便,将开发者门户的服务端简称为服务端。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 the original files from the APP. Multiple intermediate state files between the installation package and the source code of the APP, the server of the developer portal injects the authentication SDK into the first file set to obtain the second file set, and finally obtains the integration of the APP according to the second file set. The installation package of the APP of the authentication SDK. 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 integrated with the authentication SDK in the embodiment of the present application corresponds to the second installation package of the APP. In the following, for the convenience of description, the server side of the developer portal is referred to as the server side for short.
下面对服务端将鉴权SDK注入到第一文件集中,得到第二文件集的过程进行详细描述。The process of injecting the authentication SDK into the first file set by the server to obtain the second file set will be described in detail below.
示例性的,服务端对第一安装包反编译处理后得到的第一文件集中包括APP的第一配置文件,以安卓架构为例,APP的第一配置文件例如可以是APP的AndroidManifest.xml文件,应用的AndroidManifest.xml文件是该APP在电子设备上能够运行的必备文件。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.
为了使得APP在启动后,调用鉴权SDK的启动页面执行鉴权流程,服务端可以在保留AndroidManifest.xml文件中对APP的启动页面的声明的前提下,在AndroidManifest.xml文件中对鉴权SDK的启动页面进行声明。In order to make the APP call the startup page of the authentication SDK to execute the authentication process after the APP is started, the server can specify the authentication SDK in the AndroidManifest.xml file under the premise of retaining the declaration of the APP startup page in the AndroidManifest.xml file. declaration on the startup page.
示例性的,为了避免对APP的自身功能造成影响,可以使鉴权SDK的启动页面在APP的启动页面之前被执行,因此,服务端可以在AndroidManifest.xml文件中将鉴权SDK的启动页面声明为APP的启动页面,并且保留AndroidManifest.xml文件中对APP的原来的启动页面的声明,在这种情况下,当APP启动后,便会最先调用鉴权SDK的启动页面执行鉴权流程。在本申请实施例中,将对鉴权SDK的启动页面声明后的APP的AndroidManifest.xml文件称为第二配置文件,第二文件集包括第二配置文件。Exemplarily, in order to avoid affecting the function 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 in the AndroidManifest.xml file. It is the startup page of the APP, and retains the declaration of the original startup page of the APP in the AndroidManifest.xml file. In this case, when the APP starts, 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.
示例性的,为了将鉴权SDK注入到第一文件集中,服务端可以对鉴权SDK进行反编译处理,得到鉴权SDK的静态资源文件,此外,在对APP的第一安装包进行反编译处理后,得到的第一文件集中包括APP的静态资源文件,服务端可以将鉴权SDK的静态资源文件添加在APP的静态资源文件所在的文件目录下,换句话说,服务端将鉴权SDK的静态资源文件与APP的静态资源文件进行合并,得到第二文件集中的第二静态资源文件。其中,在本申请实施例中,APP的静态资源文件与第一静态资源文件对应。Exemplarily, in order to inject the authentication SDK into the first file set, the server can decompile the authentication SDK to obtain a static resource file of the authentication SDK. In addition, decompile the first installation package of the APP. After processing, the obtained first file set 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 will authenticate the SDK. The static resource file of the APP is merged with the static resource file of the APP to obtain the second static resource file in the second file set. Wherein, in the embodiment of the present application, the static resource file of the APP corresponds to the first static resource file.
为了使得APP在执行鉴权流程时,能够对鉴权SDK的静态资源文件进行加载,服务端可以创建加载模块,并将加载模块注入到第一文件集中,加载模块的作用是在APP在执行鉴权流程时对鉴权SDK的静态资源文件进行加载,例如,鉴权SDK的静态资源文件可以包括图片、鉴权流程对应的代码以及词条等,APP在执行鉴权流程时,加载模块可以对这些静态资源文件进行加载。In order to enable the APP to load the static resource files of the authentication SDK when the APP executes the authentication process, the server can create a loading module and inject the loading module into the first file set. During the authentication process, the static resource file of the authentication SDK is loaded. For example, the static resource file 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 These static resource files are loaded.
服务端创建的加载模块例如可以包括安卓的DexClassLoader加载器,APP在执行鉴权流程时,DexClassLoader加载器例如可以对鉴权SDK的静态资源文件中的鉴权流程对应的代码进行加载。The loading module created by the server may include, for example, the DexClassLoader loader of Android. 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.
示例性的,为了将加载模块注入到第一文件集中,服务端可以在创建加载模块后,对加载模块进行处理,得到加载模块的smali文件,此外,服务端在对APP的第一安装包进行反编译处理后,得到的第一文件集中包括APP的smali文件,在这种情况下,服务端可以将加载模块的smali文件添加在APP的smali文件所在的文件目录下,换句话说,服务端将加载模块的smali文件与APP的smali文件合并在一起,得到第二文件集中的第二smali文件。其中,在本申请实施例中,APP的smali文件与第一smali文件相对应。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. After the decompilation process, the obtained first file set includes the smali file of the APP. In this case, the server can add the smali file of the loaded module to the file directory where the smali file of the APP is located. In other words, the server Merge the smali file of the loaded module with the smali file of the APP to obtain the second smali file in the second file set. Wherein, in the embodiment of the present application, the smali file of the APP corresponds to the first smali file.
示例性的,服务端在对鉴权SDK进行反编译处理后,还会得到鉴权SDK的启动页面的smali文件,服务端可以将鉴权SDK的启动页面的smali文件与加载模块的smali文件添加在APP的smali文件所在的文件目录下,换句话说,服务端将鉴权SDK的启动页面的smali文件、加载模块的smali文件与APP的smali文件进行合并,得到第二文件集中 的第二smali文件。Exemplarily, after the server decompiles the authentication SDK, it will also obtain the smali file of the startup page of the authentication SDK, and the server can add the smali file of the startup page of the authentication SDK and the smali file of the loading module. In 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 document.
在对APP的原始资源包反编译后,会得到多个中间态文件,由于本申请实施例只涉及第一配置文件、第一静态资源文件以及第一smali文件,因此没有列举出其他中间态文件,但是应该理解的是,这些文件只是第一文件集中的部分文件,第一文件集中还包括除这些文件之外的其他中间态文件,相应地,第二配置文件、第二静态资源文件以及第二smali文件也只是第二文件集中的部分文件,第二文件集中同样包括没有列举出来的其他中间态文件。After decompiling the original resource package of the APP, multiple intermediate state 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 state files are not listed. , but it should be understood that these files are only some of the files in the first file set, and the first file set also includes other intermediate state files besides these files. Correspondingly, the second configuration file, the second static resource file and the first file set The second smali file is only a part of the files in the second file set, and the second file set also includes other intermediate state files that are not listed.
在得到第二文件集后,服务端可以对第二文件集进行编译处理,得到APP的第二安装包。After obtaining the second file set, the server may compile the second file set to obtain the second installation package of the APP.
然而,对应一些原始安装包内包含媒体资源文件的APP,例如,游戏APP,其安装包内一般会包含音频文件、视频文件,这类资源文件一般没有存储在规则的路径下,因此,在对APP的原始安装包进行反编译处理后,服务端并没能获取到这类资源文件。However, for some APPs that contain media resource files in the original installation package, such as game APPs, the installation package generally contains audio files and video files. Such resource files are generally not stored in the specified path. After the original installation package of the APP is decompiled, the server cannot obtain such resource files.
示例性的,对于这类资源文件,服务端可以通过对APP的原始安装包进行解压缩的方式来获得这类资源文件,例如,服务端对APP的原始安装包进行解压缩,获取这类资源文件,并将这类资源文件压缩处理后复制到APP的第二安装包内。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 to obtain such resources. files, and compress such resource files and copy them into the second installation package of the APP.
在得到APP的第二安装包后,服务端可以对APP的第二安装包进行签名,服务端可以使用开发者门户提供的签名文件对APP的第二安装包进行签名,或者,服务端还可以使用APP的开发者提供的签名文件对APP的第二安装包进行签名。After obtaining the second installation package of the APP, the server can sign the second installation package of the APP, and 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 The second installation package of the APP is signed by using the signature file provided by the developer of the APP.
下面以游戏APP为例,对本申请实施例提供的生成APP的安装包方法进行详细说明。The following takes a game APP as an example to describe in detail the method for generating an APP installation package provided by the embodiment of the present application.
假设开发人员向开发者门户上传了游戏APP的原始安装包的文件youxi.apk,开发者门户的服务端首先对youxi.apk使用apktool对youxi.apk进行反编译处理,得到的中间态文件的结构如图3所示,其中,res目录下存储的是游戏APP的静态资源文件,smali目录下存储的是游戏APP的smali文件,需要说明的是,图3中仅示出了对youxi.apk反编译处理后得到的部分中间态文件。Assuming that the developer uploads the file youxi.apk of the original installation package of the game APP to the developer portal, the server of the developer portal first decompiles youxi.apk using apktool to process youxi.apk, and obtains the structure of the intermediate state file As shown in Figure 3, the static resource files of the game APP are stored in the res directory, and the smali files of the game APP are stored in the smali directory. Part of the intermediate state file obtained after compilation processing.
服务端可以对游戏APP的AndroidManifest.xml进行修改,例如,服务端可以在保留AndroidManifest.xml文件中对APP的启动页面的声明的前提下,在AndroidManifest.xml文件中对鉴权SDK的启动页面进行声明。The server can modify the AndroidManifest.xml of the game APP. For example, the server can modify the startup page of the authentication SDK in the AndroidManifest.xml file on the premise of retaining the declaration of the startup page of the APP in the AndroidManifest.xml file. statement.
为了避免对APP的自身功能造成影响,可以使鉴权SDK的启动页面在APP的启动页面之前被执行,因此,服务端可以在AndroidManifest.xml文件中将鉴权SDK的启动页面声明为APP的启动页面,并且保留AndroidManifest.xml文件中对APP的原来的启动页面的声明,在这种情况下,当APP启动后,便会最先调用鉴权SDK的启动页面执行鉴权流程。例如,鉴权SDK的启动页面的名称为“com.sdk.game.shell.ShellProxyActivity”,服务端可以在AndroidManifest.xml文件中增加如下代码:In order to avoid affecting the function 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 of the APP in the AndroidManifest.xml file. page, and retain the declaration of the original startup page of the APP in the AndroidManifest.xml file. In this case, when the APP starts, it will first call the startup page of the authentication SDK 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 to the AndroidManifest.xml file:
Figure PCTCN2021137943-appb-000001
Figure PCTCN2021137943-appb-000001
Figure PCTCN2021137943-appb-000002
Figure PCTCN2021137943-appb-000002
在AndroidManifest.xml文件中增加如上代码后,鉴权SDK的启动页面被声明为APP的启动页面。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.
为了将鉴权SDK注入到第一文件集中,服务端可以对鉴权SDK进行反编译处理,反编译处理后可以得到鉴权SDK的静态资源文件,服务端可以将鉴权SDK的静态资源文件复制到图3中的res目录下,换句话说,服务端将鉴权SDK的静态资源文件与游戏APP的静态资源文件进行合并。In order to inject the authentication SDK into the first file set, the server can decompile the authentication SDK. After the decompilation process, the static resource file of the authentication SDK can be obtained, and the server can copy the static resource file of the authentication SDK. Go to the res directory in Figure 3, in other words, the server merges the static resource file of the authentication SDK with the static resource file of the game APP.
为了使得游戏APP在执行鉴权流程时能够对鉴权SDK的静态资源文件进行加载,服务端可以创建加载模块,并将加载模块注入到图3所示的中间态文件中,加载模块的作用是在游戏APP在执行鉴权流程时对鉴权SDK的静态资源文件进行加载,例如,鉴权SDK的静态资源文件可以包括图片、鉴权流程对应的代码以及词条等,APP在执行鉴权流程时,加载模块可以对这些静态资源文件进行加载。In order to enable the game APP to load the static resource file of the authentication SDK when performing the authentication process, the server can create a loading module and inject the loading module into the intermediate state file shown in Figure 3. The function of the loading module is to When the game APP executes the authentication process, the static resource file of the authentication SDK is loaded. For example, the static resource file of the authentication SDK can include pictures, codes corresponding to the authentication process, and entries. The APP is executing the authentication process. , the load module can load these static resource files.
服务端创建的加载模块例如可以包括安卓的DexClassLoader加载器,游戏APP在执行鉴权流程时,DexClassLoader加载器例如可以对鉴权SDK的静态资源文件中的鉴权流程对应的代码进行加载。The loading module created by the server may include, for example, the DexClassLoader of Android. When the game APP executes the authentication process, the DexClassLoader may, for example, load the code corresponding to the authentication process in the static resource file of the authentication SDK.
为了将加载模块注入到图3所示的中间态文件中,在创建完加载模块之后,服务端可以使用apktool对加载模块进行处理,得到加载模块的smali文件,将加载模块的smali文件复制到图3中的smali目录下,换句话说,服务端将加载模块的smali文件与游戏APP的smali文件进行合并。In order to inject the loading module into the intermediate state file shown in Figure 3, after the loading module is created, 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 the figure 3 in the smali directory, in other words, the server merges the smali file of the loaded module with the smali file of the game APP.
服务端在对鉴权SDK进行反编译处理后,还会得到鉴权SDK的启动页面的smali文件,服务端可以将鉴权SDK的启动页面的smali文件与加载模块的smali文件复制到图3中的smali目录下,换句话说,服务端将鉴权SDK的启动页面的smali文件、加载模块的smali文件与游戏APP的smali文件进行合并。After the server decompiles the authentication SDK, it will also obtain the smali file of the startup page of the authentication SDK. The server can copy the smali file of the startup page of the authentication SDK and the smali file of the loading module to Figure 3. 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 game APP.
在完成上述流程后,服务端使用apktool对已经注入鉴权SDK的游戏APP的多个中间态文件进行编译,得到集成有鉴权SDK的游戏APP的安装包。After completing the above process, the server uses apktool to compile multiple intermediate state files of the game APP that has been injected into the authentication SDK, and obtains an installation package of the game APP integrated with the authentication SDK.
对于游戏APP而言,原始安装包的文件youxi.apk内一般会包含音频文件、视频文件,这类资源文件一般没有存储在规则的路径下,不能通过对原始安装包进行反编译处理获得,因此,图3所示的文件目录下并不包含这类资源文件。For game apps, the file youxi.apk of the original installation package generally contains audio files and video files. Such resource files are generally not stored in the specified path and cannot be obtained by decompiling the original installation package. Therefore, , the file directory shown in Figure 3 does not contain such resource files.
对于这类资源文件,服务端可以通过对游戏APP的原始安装包的文件youxi.apk进行解压缩的方式来获得,并将这类资源文件压缩处理后复制到集成有鉴权SDK的游戏APP的安装包内。For this kind of resource file, the server can obtain it by decompressing the file youxi.apk of the original installation package of the game APP, and compressing and copying this kind of resource file to the game APP integrated with the authentication SDK. in the installation package.
在得到集成有鉴权SDK的游戏APP的安装包后,服务端可以对集成有鉴权SDK的游戏APP的安装包进行签名,服务端可以使用开发者门户提供的签名文件对集成有鉴权SDK的游戏APP的安装包进行签名,或者,服务端还可以使用游戏APP的开发者提供的签名文件对集成有鉴权SDK的游戏APP的安装包进行签名,得到签名后的集成有鉴权SDK的游戏APP的安装包。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, and the server can use the signature file provided by the developer portal to integrate the authentication SDK. 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, and obtain the signed version of the game APP integrated with the authentication SDK. Game APP installation package.
之后服务端可以将签名后的集成有鉴权SDK的游戏APP的安装包提供给应用市场APP的服务端最终在应用市场APP上对名后的集成有鉴权SDK的游戏APP进行发布。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 named game APP integrated with the authentication SDK on the application market APP.
本实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment, the electronic device can be divided into functional modules according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated modules 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, and there may be other division manners in actual implementation.
示例性的,本申请实施例中提供的生成APP的安装包的方法可以由电子设备内的业务流程管理(business flow manager,BFM)模块执行。Exemplarily, the method for generating an APP installation package provided in the embodiments of the present application may be executed by a business process management (business flow manager, BFM) module in the electronic device.
需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。It should be noted that, all relevant contents of the steps involved in the above method embodiments can be cited in the functional description of the corresponding functional module, which will not be repeated here.
本实施例提供的电子设备,用于执行上述生成APP的安装包的方法,因此可以达到与上述实现方法相同的效果。在采用集成的单元的情况下,电子设备可以包括处理模块、存储模块和通信模块。其中,处理模块可以用于对电子设备的动作进行控制管理,例如,可以用于支持电子设备执行处理单元执行的步骤。存储模块可以用于支持电子设备存储程序代码和数据等。通信模块,可以用于支持电子设备与其他设备的通信。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. Where an integrated unit is employed, the electronic device may include a processing module, a memory module and a communication module. The processing module may be used to control and manage the actions of the electronic device, for example, may be used to support the electronic device to perform the steps performed by the processing unit. The storage module can be used to support the electronic device to store program codes, data, and the like. The communication module can be used to support the communication between the electronic device and other devices.
其中,处理模块可以是处理器或控制器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理(digital signal processing,DSP)和微处理器的组合等等。存储模块可以是存储器。通信模块具体可以为射频电路、蓝牙芯片、Wi-Fi芯片等与其他电子设备交互的设备。The processing module may be a processor or a controller. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure. The processor may 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, and the like. The storage module may be a memory. The communication module may specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, and a Wi-Fi chip.
在一个实施例中,当处理模块为处理器,存储模块为存储器时,本实施例所涉及的电子设备可以为具有图1所示结构的设备。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 device having the structure shown in FIG. 1 .
本实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的生成APP的安装包的方法。This embodiment also provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on the electronic device, the electronic device executes the above-mentioned related method steps to realize the above-mentioned embodiments. The method of generating the installation package of the APP.
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的生成APP的安装包的方法。This embodiment also provides a computer program product, when the computer program product runs on the computer, the computer executes the above-mentioned relevant steps, so as to realize the method for generating an APP installation package in the above-mentioned embodiment.
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的生成APP的安装包的方法。In addition, the embodiments of the present application also provide an apparatus, which may specifically be a chip, a component or a module, and the apparatus may include a connected processor and a memory; wherein, the memory is used for storing computer execution instructions, and when the apparatus is running, The processor can execute the computer-executed instructions stored in the memory, so that the chip executes the method for generating an APP installation package in the foregoing method embodiments.
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the electronic device, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference can be made to the corresponding provided above. The beneficial effects in the method will not be repeated here.
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。From the description of the above embodiments, those skilled in the art can understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated by different The function module is completed, that is, the internal structure of the device is divided into different function modules, so as to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以 结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or May be integrated into another device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。Units described as separate components may or may not be physically separated, and components shown as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。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 alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (which may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above content is only a specific embodiment of the present application, but the protection scope of the present application is not limited to this. Covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (18)

  1. 一种生成应用程序的安装包的方法,其特征在于,所述方法包括:A method for generating an installation package of an application, the method comprising:
    获取应用程序APP的第一安装包与鉴权软件开发工具包SDK;Obtain the first installation package of the application APP and the authentication software development kit SDK;
    对所述第一安装包进行反编译处理,得到第一文件集;Decompiling the first installation package to obtain a first file set;
    将所述鉴权SDK注入到所述第一文件集中,得到第二文件集;injecting the authentication SDK into the first file set to obtain a second file set;
    根据所述第二文件集,生成所述APP的第二安装包。According to the second file set, a second installation package of the APP is generated.
  2. 根据权利要求1所述的方法,其特征在于,所述第一文件集包括APP的第一配置文件,所述将所述鉴权SDK注入到所述第一文件集中,得到第二文件集,包括:The method according to claim 1, wherein the first file set includes a first configuration file of an APP, and the authentication SDK is injected into the first file set to obtain a second file set, include:
    在所述第一配置文件中对所述鉴权SDK的启动页面进行声明,得到第二配置文件,所述第二文件集包括所述第二配置文件。The startup page of the authentication SDK is declared in the first configuration file to obtain a second configuration file, and the second file set includes the second configuration file.
  3. 根据权利要求2所述的方法,其特征在于,所述在所述第一配置文件中对所述鉴权SDK的启动页面进行声明,包括:The method according to claim 2, wherein the declaring the start page of the authentication SDK in the first configuration file comprises:
    在所述第一配置文件中将所述鉴权SDK的启动页面声明为所述APP的启动页面。In the first configuration file, the startup page of the authentication SDK is declared as the startup page of the APP.
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述第一文件集包括第一静态资源文件,所述将所述鉴权SDK注入到所述第一文件集中,包括:The method according to any one of claims 1 to 3, wherein the first file set includes a first static resource file, and the injecting the authentication SDK into the first file set includes :
    对所述鉴权SDK进行反编译处理,得到所述鉴权SDK的静态资源文件;Decompile the authentication SDK to obtain a static resource file of the authentication SDK;
    将所述第一静态资源文件与所述鉴权SDK的静态资源文件进行合并,得到第二静态资源文件,所述第二文件集包括所述第二静态资源文件。The first static resource file and the static resource file of the authentication SDK are combined to obtain a second static resource file, and the second file set includes the second static resource file.
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:The method according to claim 4, wherein the method further comprises:
    创建加载模块,所述加载模块用于加载所述鉴权SDK的静态资源文件;Create a loading module, the loading module is used to load the static resource file of the authentication SDK;
    所述将所述鉴权SDK注入到所述第一文件集中,得到第二文件集,包括:Said injecting the authentication SDK into the first file set to obtain a second file set, including:
    将所述鉴权SDK与所述加载模块注入到所述第一文件集中,得到所述第二文件集。The authentication SDK and the loading module are injected into the first file set to obtain the second file set.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method according to claim 5, wherein the method further comprises:
    对所述加载模块进行处理,得到所述加载模块的smali文件;The loading module is processed to obtain the smali file of the loading module;
    所述第一文件集包括第一smali文件,所述将所述鉴权SDK与所述加载模块注入到所述第一文件集中,得到所述第二文件集,包括:The first file set includes a first smali file, and the authentication SDK and the loading module are injected into the first file set to obtain the second file set, including:
    将所述第一smali文件与所述加载模块的smali文件进行合并,得到第二smali文件,所述第二文件集包括所述第二smali文件。The first smali file is merged with the smali file of the loading module to obtain a second smali file, and the second file set includes the second smali file.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method according to claim 6, wherein the method further comprises:
    对所述鉴权SDK进行反编译处理,得到所述鉴权SDK的启动页面的smali文件;Decompile the authentication SDK to obtain the smali file of the start page of the authentication SDK;
    所述将所述第一smali文件与所述加载模块的smali文件进行合并,得到第二smali文件,包括:The described first smali file is merged with the smali file of the loading module to obtain a second smali file, including:
    将所述鉴权SDK的启动页面的smali文件、所述第一smali文件与所述加载模块的smali文件进行合并,得到所述第二smali文件。The smali file of the startup page of the authentication SDK, the first smali file and the smali file of the loading module are combined to obtain the second smali file.
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 7, wherein the method further comprises:
    对所述第一安装包进行解压缩处理,得到所述APP的媒体资源文件;Decompressing the first installation package to obtain a media resource file of the APP;
    所述根据所述第二文件集,生成所述APP的第二安装包,包括:The generating the second installation package of the APP according to the second file set includes:
    根据所述媒体资源文件与所述第二文件集,生成所述APP的第二安装包。A second installation package of the APP is generated according to the media resource file and the second file set.
  9. 一种电子设备,其特征在于,包括:一个或多个处理器;存储器;以及一个或多个程序,其中所述一个或多个程序被存储在所述存储器中,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行如下步骤:An electronic device, characterized by comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory, when the one or more programs When the program is executed by the processor, the electronic device is caused to perform the following steps:
    获取应用程序APP的第一安装包与鉴权软件开发工具包SDK;Obtain the first installation package of the application APP and the authentication software development kit SDK;
    对所述第一安装包进行反编译处理,得到第一文件集;Decompiling the first installation package to obtain a first file set;
    将所述鉴权SDK注入到所述第一文件集中,得到第二文件集;injecting the authentication SDK into the first file set to obtain a second file set;
    根据所述第二文件集,生成所述APP的第二安装包。According to the second file set, a second installation package of the APP is generated.
  10. 根据权利要求9所述的电子设备,其特征在于,所述第一文件集包括APP的第一配置文件,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行如下步骤:The electronic device according to claim 9, wherein the first file set includes a first configuration file of an APP, and when the one or more programs are executed by the processor, the electronic device is caused to execute Follow the steps below:
    在所述第一配置文件中对所述鉴权SDK的启动页面进行声明,得到第二配置文件,所述第二文件集包括所述第二配置文件。The startup page of the authentication SDK is declared in the first configuration file to obtain a second configuration file, and the second file set includes the second configuration file.
  11. 根据权利要求10所述的电子设备,其特征在于,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行如下步骤:The electronic device according to claim 10, wherein when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps:
    在所述第一配置文件中将所述鉴权SDK的启动页面声明为所述APP的启动页面。In the first configuration file, the startup page of the authentication SDK is declared as the startup page of the APP.
  12. 根据权利要求9至11中任一项所述的电子设备,其特征在于,所述第一文件集包括第一静态资源文件,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行如下步骤:The electronic device according to any one of claims 9 to 11, wherein the first file set includes a first static resource file, and when the one or more programs are executed by the processor, make The electronic device performs the following steps:
    对所述鉴权SDK进行反编译处理,得到所述鉴权SDK的静态资源文件;Decompile the authentication SDK to obtain a static resource file of the authentication SDK;
    将所述第一静态资源文件与所述鉴权SDK的静态资源文件进行合并,得到第二静态资源文件,所述第二文件集包括所述第二静态资源文件。The first static resource file and the static resource file of the authentication SDK are combined to obtain a second static resource file, and the second file set includes the second static resource file.
  13. 根据权利要求12所述的电子设备,其特征在于,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行如下步骤:The electronic device according to claim 12, wherein when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps:
    创建加载模块,所述加载模块用于加载所述鉴权SDK的静态资源文件;Create a loading module, the loading module is used to load the static resource file of the authentication SDK;
    将所述鉴权SDK与所述加载模块注入到所述第一文件集中,得到所述第二文件集。The authentication SDK and the loading module are injected into the first file set to obtain the second file set.
  14. 根据权利要求13所述的电子设备,其特征在于,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行如下步骤:The electronic device according to claim 13, wherein when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps:
    对所述加载模块进行处理,得到所述加载模块的smali文件;The loading module is processed to obtain the smali file of the loading module;
    将所述第一smali文件与所述加载模块的smali文件进行合并,得到第二smali文件,所述第二文件集包括所述第二smali文件。The first smali file is merged with the smali file of the loading module to obtain a second smali file, and the second file set includes the second smali file.
  15. 根据权利要求14所述的电子设备,其特征在于,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行如下步骤:The electronic device according to claim 14, wherein when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps:
    对所述鉴权SDK进行反编译处理,得到所述鉴权SDK的启动页面的smali文件;Decompile the authentication SDK to obtain the smali file of the start page of the authentication SDK;
    将所述鉴权SDK的启动页面的smali文件、所述第一smali文件与所述加载模块的smali文件进行合并,得到所述第二smali文件。The smali file of the startup page of the authentication SDK, the first smali file and the smali file of the loading module are combined to obtain the second smali file.
  16. 根据权利要求9至15中任一项所述的电子设备,其特征在于,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行如下步骤:The electronic device according to any one of claims 9 to 15, wherein when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps:
    对所述第一安装包进行解压缩处理,得到所述APP的媒体资源文件;Decompressing the first installation package to obtain a media resource file of the APP;
    根据所述媒体资源文件与所述第二文件集,生成所述APP的第二安装包。A second installation package of the APP is generated according to the media resource file and the second file set.
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1至8中任一项所述的生成应用程序的安装包的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions that, when the computer instructions are executed on an electronic device, cause the electronic device to perform any one of claims 1 to 8. A method for generating an installation package of an application is described.
  18. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1至9中任一项所述的生成应用程序的安装包的方法。A computer program product, characterized in that, when the computer program product runs on a computer, the computer is caused to execute the method for generating an installation package of an application program according to any one of claims 1 to 9.
PCT/CN2021/137943 2020-12-24 2021-12-14 Method for generating installation package of application and electronic device WO2022135227A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011557385.3A CN114675840A (en) 2020-12-24 2020-12-24 Method and electronic equipment for generating installation package of application program
CN202011557385.3 2020-12-24

Publications (1)

Publication Number Publication Date
WO2022135227A1 true WO2022135227A1 (en) 2022-06-30

Family

ID=82071023

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/137943 WO2022135227A1 (en) 2020-12-24 2021-12-14 Method for generating installation package of application and electronic device

Country Status (2)

Country Link
CN (1) CN114675840A (en)
WO (1) WO2022135227A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155717A (en) * 2015-04-01 2016-11-23 北京蓝海讯通科技有限公司 A kind of method and apparatus that SDK is integrated into third party APK
CN106445509A (en) * 2016-09-09 2017-02-22 厦门雅基软件有限公司 SDK batch quick access tool
KR20180015535A (en) * 2016-08-03 2018-02-13 주식회사 엔에스에이치씨 Obfuscation method of android application using partial encryption of dex file in android application package
CN109614107A (en) * 2018-11-01 2019-04-12 同盾控股有限公司 A kind of integrated approach and device of Software Development Kit
CN109960509A (en) * 2019-03-06 2019-07-02 江苏通付盾信息安全技术有限公司 Using the method, apparatus of reinforcing, calculate equipment and computer storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155717A (en) * 2015-04-01 2016-11-23 北京蓝海讯通科技有限公司 A kind of method and apparatus that SDK is integrated into third party APK
KR20180015535A (en) * 2016-08-03 2018-02-13 주식회사 엔에스에이치씨 Obfuscation method of android application using partial encryption of dex file in android application package
CN106445509A (en) * 2016-09-09 2017-02-22 厦门雅基软件有限公司 SDK batch quick access tool
CN109614107A (en) * 2018-11-01 2019-04-12 同盾控股有限公司 A kind of integrated approach and device of Software Development Kit
CN109960509A (en) * 2019-03-06 2019-07-02 江苏通付盾信息安全技术有限公司 Using the method, apparatus of reinforcing, calculate equipment and computer storage medium

Also Published As

Publication number Publication date
CN114675840A (en) 2022-06-28

Similar Documents

Publication Publication Date Title
US10831460B2 (en) System and method for extending the functionality of an application
US10104123B2 (en) Fetching a policy definition library from a policy server at mobile device runtime of an application package to control access to mobile device resources
US9536080B2 (en) Method for validating dynamically loaded libraries using team identifiers
US9811393B2 (en) Consistent extension points to allow an extension to extend functionality of an application to another application
US8032764B2 (en) Electronic devices, information products, processes of manufacture and apparatus for enabling code decryption in a secure mode using decryption wrappers and key programming applications, and other structures
US9679130B2 (en) Pervasive package identifiers
TWI420879B (en) Anti-hack protection to restrict installation of operating systems and other software
WO2016078130A1 (en) Dynamic loading method for preventing reverse of apk file
US20060282899A1 (en) System and method for delivery of a modular operating system
WO2015183456A1 (en) Consistent extension points to allow an extension to extend functionality of an application to another application
US9471755B2 (en) Font protection management
CN111291371A (en) Application program security verification method and device
CN107402792B (en) Integration method, device, equipment and storage medium of application software installation package
WO2016119548A1 (en) Method for preventing software decompilation, and method and apparatus for preventing decompilation software from starting
WO2019062771A1 (en) Method for enabling multiple instances of one android application to be opened, mobile terminal, and storage medium
CN111290740B (en) Application program development method and device, computer equipment and storage medium
CN113569166A (en) Data processing method and device, electronic equipment and storage medium
CN112199208B (en) Method and terminal for providing additional function interface on android system
WO2022135227A1 (en) Method for generating installation package of application and electronic device
CN116467015B (en) Mirror image generation method, system start verification method and related equipment
CN112579138A (en) Page display method and device, electronic equipment and storage medium
Kaur et al. Implementation of Linux Optimization Technique for ARM Based System on Chip
US8448244B1 (en) Methods and systems for fused files comprising logic and content data
US20220398070A1 (en) Method and system for automatically creating instances of containerized servers
CN114168937A (en) Resource access method, computing device and readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21909223

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21909223

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 21909223

Country of ref document: EP

Kind code of ref document: A1