WO2017020459A1 - Method and apparatus for configuring plugin package for host - Google Patents

Method and apparatus for configuring plugin package for host Download PDF

Info

Publication number
WO2017020459A1
WO2017020459A1 PCT/CN2015/096380 CN2015096380W WO2017020459A1 WO 2017020459 A1 WO2017020459 A1 WO 2017020459A1 CN 2015096380 W CN2015096380 W CN 2015096380W WO 2017020459 A1 WO2017020459 A1 WO 2017020459A1
Authority
WO
WIPO (PCT)
Prior art keywords
package
identification information
plugin
plug
host
Prior art date
Application number
PCT/CN2015/096380
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 WO2017020459A1 publication Critical patent/WO2017020459A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs

Definitions

  • the present invention relates to the field of mobile internet technologies, and in particular, to a technology for configuring a plug-in package for a host.
  • a "method" in an application can be understood as a specific subroutine that implements a particular function. Taking the Android operating system as an example, when the number of methods in an application exceeds 65536, the program cannot run.
  • the prior art can solve the limitation of the number of methods in the application by integrating the plug-in into a host application.
  • the current configuration plug-in package for the host is mostly done manually by the developer. This way of manually configuring the plugin package is not only time consuming but also error prone.
  • a method for configuring a plug-in package for a host includes:
  • an apparatus for configuring a plug-in package for a host comprising:
  • the present invention can write the host-specific plug-in package identification information extracted from the plug-in package into the host's plug-in package configuration file, and configure a signature file for the plug-in package to insert the signature file into the plug-in package. , also save the plugin package that inserts the signature file to the path specified by the host.
  • the present invention automates the process of configuring a plug-in package for a host, thereby saving developers time and money and being less error prone.
  • FIG. 1 shows a flow chart of a method for configuring a plug-in package for a host, in accordance with one embodiment of the present invention
  • FIG. 2 shows a schematic diagram of an apparatus for configuring a plug-in package for a host, in accordance with one embodiment of the present invention.
  • Computer device also referred to as “computer” in the context, is meant an intelligent electronic device that can perform predetermined processing, such as numerical calculations and/or logical calculations, by running a predetermined program or instruction, which can include a processor and The memory is executed by the processor to execute a predetermined processing procedure pre-stored in the memory, or is executed by hardware such as an ASIC, an FPGA, a DSP, or the like, or a combination of the two.
  • Computer devices include, but are not limited to, servers, personal computers, notebook computers, tablets, smart phones, and the like.
  • the computer device includes, for example, a user device and a network device.
  • the user equipment includes, but is not limited to, a personal computer (PC), a notebook computer, and the like;
  • the network device includes but is not limited to a single network server, a server group composed of multiple network servers, or a cloud computing based A cloud composed of a large number of computers or network servers, where cloud computing is a kind of distributed computing, a super virtual computer composed of a group of loosely coupled computers.
  • the computer device can be operated separately to implement the present invention, and can also access the network and implement the present invention by interacting with other computer devices in the network.
  • the network in which the computer device is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a VPN network, and the like.
  • the user equipment, the network equipment, the network, and the like are merely examples, and other existing or future possible computer equipment or networks, such as those applicable to the present invention, are also included in the scope of the present invention. It is included here by reference.
  • the invention can be implemented by any computer device having the required processing capabilities.
  • the invention can be implemented by a PC.
  • the description of the present invention is exemplified by the embodiment of the present invention, and those skilled in the art should understand that the examples should not be construed as limiting the invention.
  • the PC extracts the plug-in package identification information specified by the host from the plug-in package; then, the PC writes the extracted plug-in package identification information into the host plug-in package configuration file; then, the PC configures the signature file for the plug-in package to The configured signature file is inserted into the plugin package; then, the PC saves the plugin package inserted into the signature file to the path specified by the host.
  • the solution of the present invention can be implemented by an application installed and running in a PC.
  • the application program is, for example, a java program, a script program, or the like.
  • the application can be entered by the developer in a command line dialog box. carried out. For example, a developer can enter the name of the application in a command line dialog and enter the plugin package under a path as a parameter.
  • the host path can be saved, for example, in the configuration information of the application.
  • the developer then enters the Enter command to immediately execute the application to implement the entire process of configuring the plug-in package for the host. This greatly saves the time of configuration work and solves the problem of manual configuration being error-prone.
  • the application can also have a graphical interface. Developers can execute the application by working in a graphical interface.
  • the host may be an application (which may be simply referred to as APP) installed and running in the mobile terminal, such as a mobile phone Baidu application.
  • APP application
  • the mobile terminal such as a mobile phone Baidu application.
  • the mobile terminal includes, but is not limited to, any smart operating system-based handheld electronic product, which can perform human-computer interaction with a user through an input device such as a keyboard, a virtual keyboard, a touch pad, a touch screen, and a voice control device, such as a smart phone. , tablet, etc.
  • the smart operating system includes, but is not limited to, any operating system that enriches device functions by providing various mobile applications to mobile devices, such as an Android operating system or the like.
  • the host in the present invention runs on an Android operating system.
  • a plugin means an application that is integrated into the host. Plugins such as Baidu know applications, Baidu music applications, and so on. Here, plug-ins integrated in the host can implement their own unique functions, thereby enhancing the functionality and capabilities of the host.
  • the plugin package means the installation package of the plugin.
  • the plugin package is usually a file with the apk extension.
  • a plugin package can contain one or more subfiles.
  • the host can verify that the plugin is working based on the previously configured information. For example, the host can extract the identification information of the plug-in in real time, and compare the identification information of the plug-in extracted in real time with the plug-in package identification information in the plug-in package configuration file. If the host is consistent, the host can allow the plug-in to run. For another example, the host may determine the signature information of the plug-in according to the signature file previously inserted into the plug-in package by the PC, and compare the determined signature information with the predetermined signature information. If the host is consistent, the host may allow the plug-in. run.
  • step S1 shows a method flow diagram in accordance with one embodiment of the present invention, which specifically illustrates a The process of configuring a plugin package for the host.
  • the PC extracts the plug-in package identification information specified by the host from the plug-in package; in step S2, the PC writes the extracted plug-in package identification information into the plug-in package configuration file of the host; in step S3, the PC is a plug-in.
  • the package configures the signature file to insert the configured signature file into the plug-in package; in step S4, the PC saves the plug-in package inserted into the signature file to the host-specified path.
  • steps S1 and S2 are generally performed continuously. There is no strict order relationship between step S3 and steps S1, S2.
  • the PC performs the sequence of step S3 and steps S1 and S2.
  • the PC can perform step S3 and steps S1 and S2 simultaneously.
  • the PC may also perform step S3 first, then perform step S1 and step S2, or perform step S1 and step S2 first, and then proceed to step S3.
  • step S1 the PC extracts the plug-in package identification information specified by the host from the plug-in package.
  • the plug-in package identification information includes, but is not limited to, various information for identifying a plug-in package.
  • the plug-in package identification information is, for example, an application name (such as Baidu music), a package name (such as baiduyinyue.apk), a version number, and the like.
  • the host-designated plug-in package identification information may include at least one of the foregoing plug-in package identification information.
  • the host-specified plug-in package identification information may include only the application name.
  • the host specified plug-in package identification information may include an application name, a package name, and a version number.
  • the manifest file (manifest.xml) in the plugin package contains the plugin package identification information.
  • the PC can extract the plug-in package identification information specified by the host from the manifest file.
  • the PC may extract the host-specific plug-in package identification information according to the following two sub-steps:
  • the PC can call the identification information reading tool to obtain the initial identification information of the plug-in package.
  • the identifier information reading tool refers to a tool provided by the smart operating system for reading the identification information of the plug-in package.
  • the identification information reading tool can obtain the plug-in package identification information by, for example, reading a manifest file (manifest.xml) in the plug-in package.
  • the identification information reading tool for example, an adb tool under the Android operating system (Android Debug Bridge, Jane Called adb).
  • the initial identification information of the plug-in package means the identification information of the plug-in package directly obtained by the identification information reading tool.
  • the initial identification information typically includes host-specific plug-in package identification information as well as other redundant information.
  • the PC needs to parse the initial identification information to obtain the plug-in package identification information specified by the host. Therefore, the initial identification information obtained needs to be parsable by the PC.
  • the PC may call the identification information reading tool to obtain initial identification information, which is presented in a command line dialog box.
  • the PC can save the initial identification information presented in the command line dialog in a readable file to make the initial identification information resolvable.
  • the initial identification information presented in the command line dialog box cannot be parsed by the PC (for example, a script program in the PC), and the initial identification information saved in the PC readable file can be parsed by the PC (for example, a script program in the PC). .
  • the PC can invoke the identification information reading tool to directly obtain the resolvable initial identification information.
  • the PC should be able to directly obtain resolvable initial identification information (for example, initial identification information stored in the file) by calling the identification information reading tool.
  • the PC parses the obtained initial identification information to directly obtain the plug-in package identification information specified by the host.
  • the host-specified plug-in package identification information is usually saved in the initial identification information in the form of a "name/value" pair.
  • the PC may perform a search in the initial identification information according to a preset "name” string specified by the host to obtain a "value” string corresponding to the "name” string.
  • the string representing the "value” is the plug-in package identification information specified by the host.
  • the PC can search in the initial identification information according to the "name” string specified by the host, "package name", and the "value" string corresponding to the "name” string is the plug-in package identifier specified by the host.
  • Information - package name is the "name" string specified by the host.
  • the PC can be based on the host-specified "name” string - "version” at the initial The identifier information is searched, and the "value" string corresponding to the "name” string is the plug-in package identification information specified by the host - the version number.
  • step S2 the PC writes the extracted plug-in package identification information into the host's plug-in package configuration file.
  • the host's plugin package configuration file means a file for saving plugin package identification information of the plugin package.
  • the host's plugin package configuration file can be saved on any device, such as on a PC native and/or network device.
  • the PC needs to have permission to perform write operations on the host's plug-in package configuration file.
  • the PC writes the extracted plug-in package identification information such as "application name”, "package name”, and "version number" into the host's plug-in package configuration file.
  • step S3 the PC configures a signature file for the plugin package to insert the configured signature file into the plugin package.
  • the signature file includes, but is not limited to, various files containing signature information.
  • the host can obtain the signature information according to the signature file of the plug-in, and compare the signature information with the predetermined signature information. If they are consistent, the host can allow the plugin to run. If it is inconsistent, the host does not allow the plugin to run.
  • different plugin packages can be assigned the same signature file.
  • different plugin packages can be assigned different signature files.
  • each plugin package can be assigned a signature file, such as a random code.
  • the signature file of the plugin package can also be generated based on various signature file generation algorithms.
  • the way in which the PC configures the signature file for the plugin package to insert the configured signature file into the plugin package includes but is not limited to the following three types:
  • the PC can assign or generate a signature file for the plug-in package and insert the assigned or generated signature file into the plug-in package.
  • the PC can also obtain the signature file from the first signature device for the plugin package and obtain the obtained The signed signature file is inserted into the plugin package.
  • the first signature device can be installed in any device.
  • the first signature device can be installed in a PC native or in a network device.
  • the first signature device can assign or generate a signature file for the plugin package and provide it to the PC.
  • the PC can obtain a signature file for the plug-in package from the first signature device, and insert the acquired signature file into the plug-in package.
  • the PC can obtain a unified signature file directly from the first signature device.
  • the PC may also send the plug-in package or its plug-in package identification information to the first signature device.
  • the first signature device can assign or generate a signature file based on the received plug-in package or its plug-in package identification information. Subsequently, the first signature device can return the generated signature file to the PC.
  • the PC may provide the plug-in package to the second signature device to configure the signature file for the plug-in package by the second signature device and insert the signature file into the plug-in package, and then the PC may receive the insertion signature from the second signature device.
  • the plugin package for the file may be provided.
  • the second signature device can be installed in any device.
  • the second signature device can be installed in a PC native or in a network device.
  • the second signature device can assign or generate a signature file for the plugin package and insert the assigned or generated signature file into the plugin package.
  • step S4 the PC saves the plug-in package inserted into the signature file to the path specified by the host.
  • the host-specified path is dedicated to saving the plugin package.
  • the plugin package that inserts the signature file is saved to the host-specified path to associate the plugin package with the host.
  • the step in which the PC saves the plug-in package that inserts the signature file to the host-specified path can also be referred to as "packaging the plug-in package.”
  • the PC may save the plug-in package inserted into the signature file to the path specified by the host.
  • the PC can compare the current package name of the plug-in package inserted into the signature file with the package name in the manifest file (manifest.xml) of the plug-in package. If they are consistent, the PC can directly save the plug-in package inserted into the signature file. Go to the path specified by the host.
  • the PC may also rename the current package name of the plugin package to the package name in the manifest file. Then, the PC can also save the plug-in package inserted into the signature file to the path specified by the host according to the renamed package name.
  • the current package name of the plug-in package is consistent with the package name in the manifest file of the plug-in package, which makes the plug-in run more stable and less error-prone.
  • FIG. 2 shows a schematic diagram of an apparatus in accordance with one embodiment of the present invention, which specifically illustrates an apparatus for configuring a plug-in package for a host, that is, a configuration apparatus 10.
  • the configuration device 10 is installed in a PC, and specifically includes devices 11-14.
  • the device 11 extracts the host-specific plug-in package identification information from the plug-in package (for convenience of distinction, the device 11 is hereinafter referred to as the identification information extraction device 11); the device 12 writes the extracted plug-in package identification information to the host's plug-in package configuration file.
  • the device 12 is hereinafter referred to as the identification information writing device 12
  • the device 13 configures a signature file for the plug-in package to insert the configured signature file into the plug-in package (for ease of differentiation, the device 13 is hereinafter referred to as a signature)
  • the file configuration device 13 the device 14 saves the plug-in package inserted into the signature file to the host-specified path (for convenience of distinction, the device 14 is hereinafter referred to as the plug-in package holding device 14).
  • the identification information extracting means 11 and the identification information writing means 12 are generally executed continuously.
  • the operation performed by the signature file configuring means 13 does not have a strict order relationship with the operations performed by the identification information extracting means 11 and the identification information writing means 12, respectively.
  • the signature file configuring means 13 and the identification information extracting means 11 and the identification information writing means 12 perform the operations.
  • the signature file configuring means 13 can perform an operation simultaneously with the identification information extracting means 11.
  • the signature file configuring means 13 may perform an operation first, and then perform an operation by the identification information extracting means 11 and the identification information writing means 12, or the identification information extracting means 11 and the identification information writing means 12 perform an operation first, followed by a signature.
  • the file configuration device 13 performs an operation.
  • the identification information extracting means 11 extracts the plug-in package identification information specified by the host from the plug-in package.
  • the plug-in package identification information includes, but is not limited to, various information for identifying a plug-in package.
  • the plug-in package identification information is, for example, an application name (such as Baidu music), a package name (such as baiduyinyue.apk), a version number, and the like.
  • the host-designated plug-in package identification information may include at least one of the foregoing plug-in package identification information.
  • the host-specified plug-in package identification information may include only the application name.
  • the host specified plug-in package identification information may include an application name, a package name, and a version number.
  • the manifest file (manifest.xml) in the plugin package contains the plugin package identification information.
  • the identification information extracting means 11 can extract, for example, host-specified plug-in package identification information from the manifest file.
  • the identification information extracting apparatus 11 may extract the plug-in package identification information specified by the host according to the following two sub-operations:
  • the identification information extracting means 11 can call the identification information reading means to obtain the initial identification information of the plug-in package.
  • the identifier information reading tool refers to a tool provided by the smart operating system for reading the identification information of the plug-in package.
  • the identification information reading tool can obtain the plug-in package identification information by, for example, reading a manifest file (manifest.xml) in the plug-in package.
  • the identification information reading tool is, for example, an adb tool (abbreviated as adb) under the Android operating system.
  • the initial identification information of the plug-in package means the identification information of the plug-in package directly obtained by the identification information reading tool.
  • the initial identification information typically includes host-specific plug-in package identification information as well as other redundant information.
  • the identification information extracting means 11 of the PC needs to parse the initial identification information to obtain the plug-in package identification information specified by the host. Cause Therefore, the initial identification information obtained by the identification information extraction device 11 needs to be PC-resolvable.
  • the identification information extracting means 11 may call the identification information reading means to obtain initial identification information, which is presented in a command line dialog box. Next, the identification information extracting means 11 can store the initial identification information presented in the command line dialog box in a readable file so that the initial identification information can be parsed.
  • the initial identification information presented in the command line dialog box cannot be parsed by the identification information extraction device 11 of the PC (for example, a script program in the PC), and the initial identification information saved in the PC readable file can be identified by the identification information of the PC.
  • the extraction device 11 (for example, a script program in a PC) parses.
  • the identification information extracting means 11 may call the identification information reading means to directly obtain the resolvable initial identification information.
  • the identification information extraction device 11 should directly obtain the resolvable initial identification information by calling the identification information reading tool (for example, the initial stored in the file) Identification information).
  • the identification information extracting means 11 parses the obtained initial identification information to directly obtain the plug-in package identification information specified by the host.
  • the host-specified plug-in package identification information is usually saved in the initial identification information in the form of a "name/value" pair.
  • the identification information extracting means 11 can perform a search in the initial identification information based on a "name” character string specified by the host in advance to obtain a "value” character string corresponding to the "name” character string.
  • the string representing the "value” is the plug-in package identification information specified by the host.
  • the identification information extracting device 11 can perform a search in the initial identification information according to the "name" string specified by the host, "package name", and the "value" string corresponding to the "name” string is designated by the host.
  • Plugin package identification information - package name is designated by the host.
  • the identifier information extracting device 11 can perform a search in the initial identifier information according to the "name" string specified by the host, and the "value" string corresponding to the "name” string is designated by the host.
  • Plugin package identification information - version number is designated by the host.
  • the identification information writing means 12 writes the extracted plug-in package identification information to the host's plug-in package configuration file.
  • the host's plugin package configuration file means a file for saving plugin package identification information of the plugin package.
  • the host's plugin package configuration file can be saved on any device, such as on a PC native and/or network device.
  • the identification information writing device 12 is required to have the authority to perform a write operation on the host's plug-in package configuration file.
  • the identification information writing device 12 writes the extracted plug-in package identification information such as "application name”, “package name”, “version number”, etc. into the host's plug-in package configuration file.
  • the signature file configuration means 13 configures a signature file for the plugin package to insert the configured signature file into the plugin package.
  • the signature file includes, but is not limited to, various files containing signature information.
  • the host can obtain the signature information according to the signature file of the plug-in, and compare the signature information with the predetermined signature information. If they are consistent, the host can allow the plugin to run. If it is inconsistent, the host does not allow the plugin to run.
  • different plugin packages can be assigned the same signature file.
  • different plugin packages can be assigned different signature files.
  • each plugin package can be assigned a signature file, such as a random code.
  • the signature file of the plugin package can also be generated based on various signature file generation algorithms.
  • the manner in which the signature file configuration device 13 configures the signature file for the plug-in package to insert the configured signature file into the plug-in package includes but is not limited to the following three types:
  • the signature file configuration means 13 can assign or generate a signature file for the plug-in package and insert the assigned or generated signature file into the plug-in package.
  • the signature file configuration means 13 can also obtain a signature file for the plug-in package from the first signature device and insert the acquired signature file into the plug-in package.
  • the first signature device can be installed in any device.
  • the first signature device can be installed in a PC native or in a network device.
  • the first signature device can assign or generate a signature file for the plugin package and provide it to the PC.
  • the signature text of the PC can acquire a signature file for the plug-in package from the first signature device, and insert the acquired signature file into the plug-in package.
  • the signature file configuration device 13 can obtain a unified signature file directly from the first signature device. Alternatively, the signature file configuration device 13 may also transmit the plug-in package or its plug-in package identification information to the first signature device. Accordingly, the first signature device can assign or generate a signature file based on the received plug-in package or its plug-in package identification information. Subsequently, the first signature device can return the generated signature file to the PC.
  • the signature file configuration means 13 may provide the plug-in package to the second signature device, to configure the signature file for the plug-in package by the second signature device and insert the signature file into the plug-in package, and then the signature file configuration device 13 may A plug-in package that inserts a signature file is received from the second signature device.
  • the second signature device can be installed in any device.
  • the second signature device can be installed in a PC native or in a network device.
  • the second signature device can assign or generate a signature file for the plugin package and insert the assigned or generated signature file into the plugin package.
  • the plug-in package holding means 14 saves the plug-in package inserted into the signature file to the path specified by the host.
  • the host-specified path is dedicated to saving the plugin package.
  • the plugin package that inserts the signature file is saved to the host-specified path to associate the plugin package with the host.
  • the plug-in package holding means 14 saves the plug-in package inserting the signature file to the host-specified path.
  • the operation can also be referred to as "packaging the plug-in package”.
  • the plugin package holding device 14 may save the plugin package inserted into the signature file to the path specified by the host.
  • the plug-in package holding device 14 can compare the current package name of the plug-in package inserted into the signature file with the package name in the manifest file (manifest.xml) of the plug-in package, and if they are consistent, the plug-in package holding device 14 can directly Save the plugin package that inserted the signature file to the path specified by the host.
  • the plug-in package saving device 14 may also rename the current package name of the plug-in package to the package name in the manifest file.
  • the plug-in package holding device 14 can also save the plug-in package inserted into the signature file to the path specified by the host according to the renamed package name.
  • the current package name of the plug-in package is consistent with the package name in the manifest file of the plug-in package, which makes the plug-in run more stable and less error-prone.
  • the present invention can be implemented in software and/or a combination of software and hardware.
  • the various devices of the present invention can be implemented using an application specific integrated circuit (ASIC) or any other similar hardware device.
  • the software program of the present invention may be executed by a processor to implement the steps or functions described above.
  • the software program (including related data structures) of the present invention can be stored in a computer readable recording medium such as a RAM memory, a magnetic or optical drive or a floppy disk and the like.
  • some of the steps or functions of the present invention may be implemented in hardware, for example, as a circuit that cooperates with a processor to perform various steps or functions.

Abstract

A method and an apparatus for configuring a plugin package for a host. The present solution comprises: extracting, from a plugin package, plugin package identification information specified by a host (S1), writing the plugin package identification information into a plugin package configuration file of the host (S2), configuring a signature file for the plugin package so as to insert the signature file into the plugin package (S3), and further saving, to a path specified by the host, the plugin package into which the signature file has been inserted (S4). The present solution can automate the process of configuring a plugin package for a host, thereby saving time costs for development personnel and avoiding errors.

Description

一种为宿主配置插件包的方法与装置Method and device for configuring plug-in package for host
相关申请的交叉引用Cross-reference to related applications
本申请请求于2015年7月31日提交的申请号为201510464145.1的中国专利申请的优先权,该中国专利申请的内容以引用方式被完整包含于此。The present application claims the priority of the Chinese Patent Application No. 201510464145.1 filed on Jul. 31, 2015, the content of which is hereby incorporated by reference.
技术领域Technical field
本发明涉及移动互联网技术领域,尤其涉及一种为宿主配置插件包的技术。The present invention relates to the field of mobile internet technologies, and in particular, to a technology for configuring a plug-in package for a host.
背景技术Background technique
随着移动互联网时代的到来,手机终端作为人们交流沟通的工具,得以被越来越广地应用。为了提供强大的功能,手机中的应用(APP)需要运行许多的程序,这导致了应用中方法的数量剧增。在此,应用中的“方法”可以被理解为实现特定功能的特定子程序。以安卓操作系统为例,当一个应用中的方法数超过了65536时,程序就不能够运行。With the advent of the mobile Internet era, mobile terminals have become more and more widely used as tools for people to communicate and communicate. In order to provide powerful features, applications (apps) in mobile phones need to run many programs, which leads to a dramatic increase in the number of methods in the application. Here, a "method" in an application can be understood as a specific subroutine that implements a particular function. Taking the Android operating system as an example, when the number of methods in an application exceeds 65536, the program cannot run.
现有技术可以通过将插件集成在宿主应用中的方案来解决应用中方法数量的限制问题。然而,目前为宿主配置插件包多通过开发人员手动进行。这种手动配置插件包的方式不仅费时费力,并且容易出错。The prior art can solve the limitation of the number of methods in the application by integrating the plug-in into a host application. However, the current configuration plug-in package for the host is mostly done manually by the developer. This way of manually configuring the plugin package is not only time consuming but also error prone.
发明内容Summary of the invention
本发明的目的是提供一种为宿主配置插件包的方法与装置。It is an object of the present invention to provide a method and apparatus for configuring a plug-in package for a host.
根据本发明的一个方面,提供了一种为宿主配置插件包的方法,其中,该方法包括:According to an aspect of the present invention, a method for configuring a plug-in package for a host is provided, wherein the method includes:
-从插件包中提取宿主指定的插件包标识信息;- extracting the plugin package identification information specified by the host from the plugin package;
-将所述插件包标识信息写入所述宿主的插件包配置文件;- writing the plugin package identification information to the host's plugin package configuration file;
-为所述插件包配置签名文件,以将所述签名文件插入所述插件包;- configuring a signature file for the plugin package to insert the signature file into the plugin package;
-将插入所述签名文件的插件包保存至所述宿主指定的路径下。 - Save the plugin package inserted into the signature file to the path specified by the host.
根据本发明的另一个方面,还提供了一种为宿主配置插件包的装置,其中,该装置包括:According to another aspect of the present invention, there is also provided an apparatus for configuring a plug-in package for a host, wherein the apparatus comprises:
-用于从插件包中提取宿主指定的插件包标识信息的装置;- means for extracting host-specific plugin package identification information from the plugin package;
-用于将所述插件包标识信息写入所述宿主的插件包配置文件的装置;Means for writing said plugin package identification information to said host's plugin package configuration file;
-用于为所述插件包配置签名文件,以将所述签名文件插入所述插件包的装置;a means for configuring a signature file for the plugin package to insert the signature file into the plugin package;
-用于将插入所述签名文件的插件包保存至所述宿主指定的路径下的装置。- means for saving the plugin package inserted into the signature file to the path specified by the host.
与现有技术相比,本发明可以将从插件包中所提取的宿主指定的插件包标识信息写入宿主的插件包配置文件,并为插件包配置签名文件以将签名文件插入所述插件包,还将插入签名文件的插件包保存至宿主指定的路径下。本发明使为宿主配置插件包的过程自动化,从而节省了开发人员的时间成本,并且不易出错。Compared with the prior art, the present invention can write the host-specific plug-in package identification information extracted from the plug-in package into the host's plug-in package configuration file, and configure a signature file for the plug-in package to insert the signature file into the plug-in package. , also save the plugin package that inserts the signature file to the path specified by the host. The present invention automates the process of configuring a plug-in package for a host, thereby saving developers time and money and being less error prone.
附图说明DRAWINGS
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本发明的其它特征、目的和优点将会变得更明显:Other features, objects, and advantages of the present invention will become more apparent from the Detailed Description of Description
图1示出根据本发明一个实施例的一种为宿主配置插件包的方法流程图;1 shows a flow chart of a method for configuring a plug-in package for a host, in accordance with one embodiment of the present invention;
图2示出根据本发明一个实施例的一种为宿主配置插件包的装置示意图。2 shows a schematic diagram of an apparatus for configuring a plug-in package for a host, in accordance with one embodiment of the present invention.
附图中相同或相似的附图标记代表相同或相似的部件。The same or similar reference numerals in the drawings denote the same or similar components.
具体实施方式detailed description
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成 时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as a process or method depicted as a flowchart. Although the flowcharts describe various operations as a sequential process, many of the operations can be implemented in parallel, concurrently or concurrently. In addition, the order of operations can be rearranged. When its operation is completed The process can be terminated while still having additional steps not included in the figures. The processing may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
在上下文中所称“计算机设备”,也称为“电脑”,是指可以通过运行预定程序或指令来执行数值计算和/或逻辑计算等预定处理过程的智能电子设备,其可以包括处理器与存储器,由处理器执行在存储器中预存的程序指令来执行预定处理过程,或是由ASIC、FPGA、DSP等硬件执行预定处理过程,或是由上述二者组合来实现。计算机设备包括但不限于服务器、个人电脑、笔记本电脑、平板电脑、智能手机等。By "computer device", also referred to as "computer" in the context, is meant an intelligent electronic device that can perform predetermined processing, such as numerical calculations and/or logical calculations, by running a predetermined program or instruction, which can include a processor and The memory is executed by the processor to execute a predetermined processing procedure pre-stored in the memory, or is executed by hardware such as an ASIC, an FPGA, a DSP, or the like, or a combination of the two. Computer devices include, but are not limited to, servers, personal computers, notebook computers, tablets, smart phones, and the like.
所述计算机设备例如包括用户设备与网络设备。其中,所述用户设备包括但不限于个人计算机(PC)、笔记本电脑等;所述网络设备包括但不限于单个网络服务器、多个网络服务器组成的服务器组或基于云计算(Cloud Computing)的由大量计算机或网络服务器构成的云,其中,云计算是分布式计算的一种,由一群松散耦合的计算机集组成的一个超级虚拟计算机。其中,所述计算机设备可单独运行来实现本发明,也可接入网络并通过与网络中的其他计算机设备的交互操作来实现本发明。其中,所述计算机设备所处的网络包括但不限于互联网、广域网、城域网、局域网、VPN网络等。The computer device includes, for example, a user device and a network device. The user equipment includes, but is not limited to, a personal computer (PC), a notebook computer, and the like; the network device includes but is not limited to a single network server, a server group composed of multiple network servers, or a cloud computing based A cloud composed of a large number of computers or network servers, where cloud computing is a kind of distributed computing, a super virtual computer composed of a group of loosely coupled computers. Wherein, the computer device can be operated separately to implement the present invention, and can also access the network and implement the present invention by interacting with other computer devices in the network. The network in which the computer device is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a VPN network, and the like.
需要说明的是,所述用户设备、网络设备和网络等仅为举例,其他现有的或今后可能出现的计算机设备或网络如可适用于本发明,也应包含在本发明保护范围以内,并以引用方式包含于此。It should be noted that the user equipment, the network equipment, the network, and the like are merely examples, and other existing or future possible computer equipment or networks, such as those applicable to the present invention, are also included in the scope of the present invention. It is included here by reference.
本文后面所讨论的方法(其中一些通过流程图示出)可以通过硬件、软件、固件、中间件、微代码、硬件描述语言或者其任意组合来实施。当用软件、固件、中间件或微代码来实施时,用以实施必要任务的程序代码或代码段可以被存储在机器或计算机可读介质(比如存储介质)中。(一个或多个)处理器可以实施必要的任务。The methods discussed later herein, some of which are illustrated by flowcharts, can be implemented in hardware, software, firmware, middleware, microcode, hardware description languages, or any combination thereof. When implemented in software, firmware, middleware or microcode, the program code or code segments to carry out the necessary tasks can be stored in a machine or computer readable medium, such as a storage medium. The processor(s) can perform the necessary tasks.
这里所公开的具体结构和功能细节仅仅是代表性的,并且是用于描述本发明的示例性实施例的目的。但是本发明可以通过许多替换形式来具体实现,并且不应当被解释成仅仅受限于这里所阐述的实施 例。The specific structural and functional details disclosed are merely representative and are for the purpose of describing exemplary embodiments of the invention. However, the invention may be embodied in many alternate forms and should not be construed as being limited only to the implementations set forth herein. example.
应当理解的是,虽然在这里可能使用了术语“第一”、“第二”等等来描述各个单元,但是这些单元不应当受这些术语限制。使用这些术语仅仅是为了将一个单元与另一个单元进行区分。举例来说,在不背离示例性实施例的范围的情况下,第一单元可以被称为第二单元,并且类似地第二单元可以被称为第一单元。这里所使用的术语“和/或”包括其中一个或更多所列出的相关联项目的任意和所有组合。It should be understood that although the terms "first," "second," etc. may be used herein to describe the various elements, these elements should not be limited by these terms. These terms are used only to distinguish one unit from another. For example, a first unit could be termed a second unit, and similarly a second unit could be termed a first unit, without departing from the scope of the exemplary embodiments. The term "and/or" used herein includes any and all combinations of one or more of the associated listed items.
这里所使用的术语仅仅是为了描述具体实施例而不意图限制示例性实施例。除非上下文明确地另有所指,否则这里所使用的单数形式“一个”、“一项”还意图包括复数。还应当理解的是,这里所使用的术语“包括”和/或“包含”规定所陈述的特征、整数、步骤、操作、单元和/或组件的存在,而不排除存在或添加一个或更多其他特征、整数、步骤、操作、单元、组件和/或其组合。The terminology used herein is for the purpose of describing the particular embodiments, The singular forms "a", "an", It is also to be understood that the terms "comprising" and """ Other features, integers, steps, operations, units, components, and/or combinations thereof.
还应当提到的是,在一些替换实现方式中,所提到的功能/动作可以按照不同于附图中标示的顺序发生。举例来说,取决于所涉及的功能/动作,相继示出的两幅图实际上可以基本上同时执行或者有时可以按照相反的顺序来执行。It should also be noted that, in some alternative implementations, the functions/acts noted may occur in a different order than that illustrated in the drawings. For example, two figures shown in succession may in fact be executed substantially concurrently or sometimes in the reverse order, depending on the function/acts involved.
下面结合附图对本发明作进一步详细描述。The invention is further described in detail below with reference to the accompanying drawings.
本发明可由任何具有所要求的处理能力的计算机设备实现。典型地,本发明可由PC实现。为便于说明起见,本说明书多以PC执行本发明的方案来进行举例说明,本领域技术人员应能理解,该等举例不应被视为对本发明的任何限制。The invention can be implemented by any computer device having the required processing capabilities. Typically, the invention can be implemented by a PC. For the sake of convenience, the description of the present invention is exemplified by the embodiment of the present invention, and those skilled in the art should understand that the examples should not be construed as limiting the invention.
具体地,PC从插件包中提取宿主指定的插件包标识信息;接着,PC将所提取的插件包标识信息写入宿主的插件包配置文件;随后,PC为插件包配置签名文件,以将所配置的签名文件插入插件包;随后,PC将插入签名文件的插件包保存至宿主指定的路径下。Specifically, the PC extracts the plug-in package identification information specified by the host from the plug-in package; then, the PC writes the extracted plug-in package identification information into the host plug-in package configuration file; then, the PC configures the signature file for the plug-in package to The configured signature file is inserted into the plugin package; then, the PC saves the plugin package inserted into the signature file to the path specified by the host.
优选地,本发明的方案可以由安装并运行于PC中的应用程序来实现。在此,所述应用程序例如java程序、脚本程序等。Preferably, the solution of the present invention can be implemented by an application installed and running in a PC. Here, the application program is, for example, a java program, a script program, or the like.
所述应用程序可以通过开发人员在命令行对话框中输入指令来 执行。例如,开发人员可以在命令行对话框中输入该应用程序的名称,并输入一路径下的插件包以作为参数。其中,宿主的路径例如可以被保存在该应用程序的配置信息内。随后,开发人员输入回车命令这一个按键即可以立即执行该应用程序以实现为宿主配置插件包的全部过程。这大幅地节省了配置工作的时间,并解决了人工配置容易出错的问题。The application can be entered by the developer in a command line dialog box. carried out. For example, a developer can enter the name of the application in a command line dialog and enter the plugin package under a path as a parameter. The host path can be saved, for example, in the configuration information of the application. The developer then enters the Enter command to immediately execute the application to implement the entire process of configuring the plug-in package for the host. This greatly saves the time of configuration work and solves the problem of manual configuration being error-prone.
或者,所述应用程序也可以具有图形化界面。开发人员可以通过在图形化界面中进行操作,来执行该应用程序。Alternatively, the application can also have a graphical interface. Developers can execute the application by working in a graphical interface.
在此,宿主可以为一种安装并运行于移动终端中的应用(可简称为APP),例如手机百度应用等。Here, the host may be an application (which may be simply referred to as APP) installed and running in the mobile terminal, such as a mobile phone Baidu application.
其中,移动终端包括但不限于任何一种基于智能操作系统的手持式电子产品,其可与用户通过键盘、虚拟键盘、触摸板、触摸屏以及声控设备等输入设备来进行人机交互,诸如智能手机、平板电脑等。其中,智能操作系统包括但不限于任何通过向移动设备提供各种移动应用来丰富设备功能的操作系统,诸如安卓(Android)操作系统等。The mobile terminal includes, but is not limited to, any smart operating system-based handheld electronic product, which can perform human-computer interaction with a user through an input device such as a keyboard, a virtual keyboard, a touch pad, a touch screen, and a voice control device, such as a smart phone. , tablet, etc. Among them, the smart operating system includes, but is not limited to, any operating system that enriches device functions by providing various mobile applications to mobile devices, such as an Android operating system or the like.
优选地,本发明中所述宿主运行于安卓操作系统。Preferably, the host in the present invention runs on an Android operating system.
插件意指,被集成在宿主中的应用。插件例如百度知道应用、百度音乐应用等。在此,集成在宿主中的插件可以实现其自身特有的功能,从而增强宿主的功能和能力。A plugin means an application that is integrated into the host. Plugins such as Baidu know applications, Baidu music applications, and so on. Here, plug-ins integrated in the host can implement their own unique functions, thereby enhancing the functionality and capabilities of the host.
插件包意指插件的安装包。在安卓操作系统下,插件包通常为以apk为后缀名的文件。插件包中可以包含一个或多个子文件。The plugin package means the installation package of the plugin. In the Android operating system, the plugin package is usually a file with the apk extension. A plugin package can contain one or more subfiles.
在插件集成在宿主中之后,当插件需要运行时,宿主可以根据之前所配置的信息验证该插件是否可以运行。例如,宿主可以实时地提取插件的标识信息,并将实时提取的插件的标识信息与插件包配置文件中的插件包标识信息进行比较,如果一致,宿主则可以允许该插件运行。又如,宿主可以将实时地根据此前被PC插入插件包中的签名文件来确定插件的签名信息,并将所确定的签名信息与预定的签名信息进行比较,如果一致,宿主则可以允许该插件运行。After the plugin is integrated into the host, when the plugin needs to run, the host can verify that the plugin is working based on the previously configured information. For example, the host can extract the identification information of the plug-in in real time, and compare the identification information of the plug-in extracted in real time with the plug-in package identification information in the plug-in package configuration file. If the host is consistent, the host can allow the plug-in to run. For another example, the host may determine the signature information of the plug-in according to the signature file previously inserted into the plug-in package by the PC, and compare the determined signature information with the predetermined signature information. If the host is consistent, the host may allow the plug-in. run.
图1示出根据本发明一个实施例的方法流程图,其具体示出一种 为宿主配置插件包的过程。在步骤S1中,PC从插件包中提取宿主指定的插件包标识信息;在步骤S2中,PC将所提取的插件包标识信息写入宿主的插件包配置文件;在步骤S3中,PC为插件包配置签名文件,以将所配置的签名文件插入插件包;在步骤S4中,PC将插入签名文件的插件包保存至宿主指定的路径下。1 shows a method flow diagram in accordance with one embodiment of the present invention, which specifically illustrates a The process of configuring a plugin package for the host. In step S1, the PC extracts the plug-in package identification information specified by the host from the plug-in package; in step S2, the PC writes the extracted plug-in package identification information into the plug-in package configuration file of the host; in step S3, the PC is a plug-in. The package configures the signature file to insert the configured signature file into the plug-in package; in step S4, the PC saves the plug-in package inserted into the signature file to the host-specified path.
本领域技术人员应能理解,步骤S1和步骤S2通常为连续进行的。步骤S3与步骤S1、S2之间并无严格的顺序关系。PC进行步骤S3与步骤S1、S2的先后顺序存在多种方式。例如,PC可以同时地进行步骤S3以及步骤S1和S2。又如,PC也可以先进行步骤S3,随后再进行步骤S1和步骤S2,或者先进行步骤S1和步骤S2,随后再进行步骤S3。Those skilled in the art will appreciate that steps S1 and S2 are generally performed continuously. There is no strict order relationship between step S3 and steps S1, S2. There are various ways in which the PC performs the sequence of step S3 and steps S1 and S2. For example, the PC can perform step S3 and steps S1 and S2 simultaneously. For another example, the PC may also perform step S3 first, then perform step S1 and step S2, or perform step S1 and step S2 first, and then proceed to step S3.
具体地,在步骤S1中,PC从插件包中提取宿主指定的插件包标识信息。Specifically, in step S1, the PC extracts the plug-in package identification information specified by the host from the plug-in package.
其中,所述插件包标识信息包括但不限于各种用于标识插件包的信息。所述插件包标识信息例如应用名称(如百度音乐)、包名(如baiduyinyue.apk)、版本号等。The plug-in package identification information includes, but is not limited to, various information for identifying a plug-in package. The plug-in package identification information is, for example, an application name (such as Baidu music), a package name (such as baiduyinyue.apk), a version number, and the like.
在此,所述宿主指定的插件包标识信息可以包括前述插件包标识信息中的至少任一项。例如,宿主指定的插件包标识信息可以仅包括应用名称。又如,宿主指定的插件包标识信息可以包括应用名称、包名、版本号这三项。Here, the host-designated plug-in package identification information may include at least one of the foregoing plug-in package identification information. For example, the host-specified plug-in package identification information may include only the application name. For another example, the host specified plug-in package identification information may include an application name, a package name, and a version number.
插件包中的清单文件(manifest.xml)中包含插件包标识信息。PC例如可以从该清单文件中提取宿主指定的插件包标识信息。The manifest file (manifest.xml) in the plugin package contains the plugin package identification information. For example, the PC can extract the plug-in package identification information specified by the host from the manifest file.
优选地,PC可以按照以下2个子步骤提取宿主指定的插件包标识信息:Preferably, the PC may extract the host-specific plug-in package identification information according to the following two sub-steps:
1)PC可以调用标识信息读取工具,以获得插件包的初始标识信息。1) The PC can call the identification information reading tool to obtain the initial identification information of the plug-in package.
其中,所述标识信息读取工具意指智能操作系统所提供的用于读取插件包的标识信息的工具。标识信息读取工具例如可以通过读取插件包中的清单文件(manifest.xml)来获取插件包标识信息。所述标识信息读取工具例如安卓操作系统下的adb工具(Android Debug Bridge,简 称为adb)。The identifier information reading tool refers to a tool provided by the smart operating system for reading the identification information of the plug-in package. The identification information reading tool can obtain the plug-in package identification information by, for example, reading a manifest file (manifest.xml) in the plug-in package. The identification information reading tool, for example, an adb tool under the Android operating system (Android Debug Bridge, Jane Called adb).
插件包的初始标识信息意指通过标识信息读取工具所直接获得的插件包的标识信息。初始标识信息通常包括宿主指定的插件包标识信息以及其他冗余信息。在随后的步骤中,PC需对初始标识信息进行解析,以获得宿主指定的插件包标识信息。因此,所获得的初始标识信息需为PC可解析的。The initial identification information of the plug-in package means the identification information of the plug-in package directly obtained by the identification information reading tool. The initial identification information typically includes host-specific plug-in package identification information as well as other redundant information. In the subsequent steps, the PC needs to parse the initial identification information to obtain the plug-in package identification information specified by the host. Therefore, the initial identification information obtained needs to be parsable by the PC.
在此,优选地,PC可以调用标识信息读取工具,以获得初始标识信息,该初始标识信息在命令行对话框中呈现。接着,PC可以将在命令行对话框中所呈现的初始标识信息保存在一可读文件中,以使得该初始标识信息可解析。Here, preferably, the PC may call the identification information reading tool to obtain initial identification information, which is presented in a command line dialog box. Next, the PC can save the initial identification information presented in the command line dialog in a readable file to make the initial identification information resolvable.
其中,呈现在命令行对话框中的初始标识信息无法被PC(例如PC中的脚本程序)解析,而保存在PC可读文件中的初始标识信息可以被PC(例如PC中的脚本程序)解析。The initial identification information presented in the command line dialog box cannot be parsed by the PC (for example, a script program in the PC), and the initial identification information saved in the PC readable file can be parsed by the PC (for example, a script program in the PC). .
可替代地,PC可以调用标识信息读取工具,以直接获得可解析的初始标识信息。Alternatively, the PC can invoke the identification information reading tool to directly obtain the resolvable initial identification information.
在此,随着智能操作系统所提供标识信息读取工具的功能升级,PC应可以通过调用标识信息读取工具直接地获得可解析的初始标识信息(例如保存在文件中的初始标识信息)。Here, as the function of the identification information reading tool provided by the smart operating system is upgraded, the PC should be able to directly obtain resolvable initial identification information (for example, initial identification information stored in the file) by calling the identification information reading tool.
2)PC解析所获得的初始标识信息,以直接获得宿主指定的插件包标识信息。2) The PC parses the obtained initial identification information to directly obtain the plug-in package identification information specified by the host.
在此,初始标识信息中通常以“名称/值”对的形式保存宿主指定的插件包标识信息。Here, the host-specified plug-in package identification information is usually saved in the initial identification information in the form of a "name/value" pair.
PC例如可以根据预先设定的宿主指定的“名称”字符串,在初始标识信息中进行查找,以获得该“名称”字符串所对应的“值”字符串。该表示“值”的字符串即为宿主指定的插件包标识信息。For example, the PC may perform a search in the initial identification information according to a preset "name" string specified by the host to obtain a "value" string corresponding to the "name" string. The string representing the "value" is the plug-in package identification information specified by the host.
例如,PC可以根据宿主指定的“名称”字符串——“package name”,在初始标识信息中进行查找,该“名称”字符串所对应的“值”字符串即为宿主指定的插件包标识信息——包名。For example, the PC can search in the initial identification information according to the "name" string specified by the host, "package name", and the "value" string corresponding to the "name" string is the plug-in package identifier specified by the host. Information - package name.
又如,PC可以根据宿主指定的“名称”字符串——“version”,在初始 标识信息中进行查找,该“名称”字符串所对应的“值”字符串即为宿主指定的插件包标识信息——版本号。As another example, the PC can be based on the host-specified "name" string - "version" at the initial The identifier information is searched, and the "value" string corresponding to the "name" string is the plug-in package identification information specified by the host - the version number.
本领域技术人员应能理解,前述提取宿主指定的插件包标识信息的方式仅为举例,而不应被视为对本发明的任何限制,任何现有其它或今后可能出现的提取宿主指定的插件包标识信息的方式如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。It should be understood by those skilled in the art that the foregoing manner of extracting the plug-in package identification information specified by the host is only an example, and should not be regarded as any limitation to the present invention, any existing plug-in specified by the extraction host specified by other or future generations. The manner in which the information is identified, as applicable to the present invention, is also intended to be included within the scope of the present invention and is hereby incorporated by reference.
在步骤S2中,PC将所提取的插件包标识信息写入宿主的插件包配置文件。In step S2, the PC writes the extracted plug-in package identification information into the host's plug-in package configuration file.
在此,宿主的插件包配置文件意指用于保存插件包的插件包标识信息的文件。宿主的插件包配置文件可以保存在任何设备中,如保存在PC本机和/或网络设备。PC需具有对宿主的插件包配置文件的执行写入操作的权限。Here, the host's plugin package configuration file means a file for saving plugin package identification information of the plugin package. The host's plugin package configuration file can be saved on any device, such as on a PC native and/or network device. The PC needs to have permission to perform write operations on the host's plug-in package configuration file.
例如,PC将所提取的“应用名称”、“包名”、“版本号”等插件包标识信息写入宿主的插件包配置文件。For example, the PC writes the extracted plug-in package identification information such as "application name", "package name", and "version number" into the host's plug-in package configuration file.
在步骤S3中,PC为插件包配置签名文件,以将所配置的签名文件插入插件包。In step S3, the PC configures a signature file for the plugin package to insert the configured signature file into the plugin package.
在此,签名文件包括但不限于各种包含签名信息的文件。Here, the signature file includes, but is not limited to, various files containing signature information.
集成在宿主中的插件需要运行时,宿主可以根据该插件的签名文件来获得签名信息,并将该签名信息与预定的签名信息相比较。如果一致,则宿主可以允许该插件运行。如果不一致,则宿主不允许该插件运行。When the plug-in integrated in the host needs to run, the host can obtain the signature information according to the signature file of the plug-in, and compare the signature information with the predetermined signature information. If they are consistent, the host can allow the plugin to run. If it is inconsistent, the host does not allow the plugin to run.
在此,不同的插件包可以被分配相同的签名文件。或者,不同的插件包也可以被分配不同的签名文件。例如,每个插件包可以被分配一个签名文件,如随机码。又如,进一步地,插件包的签名文件还可以基于各种签名文件生成算法来生成。Here, different plugin packages can be assigned the same signature file. Alternatively, different plugin packages can be assigned different signature files. For example, each plugin package can be assigned a signature file, such as a random code. As another example, the signature file of the plugin package can also be generated based on various signature file generation algorithms.
PC为插件包配置签名文件以将所配置的签名文件插入插件包的方式包括但不限于以下3种:The way in which the PC configures the signature file for the plugin package to insert the configured signature file into the plugin package includes but is not limited to the following three types:
1)PC可以自行为插件包分配或生成签名文件,并将所分配的或所生成的签名文件插入插件包。1) The PC can assign or generate a signature file for the plug-in package and insert the assigned or generated signature file into the plug-in package.
2)PC还可以从第一签名装置为插件包获取签名文件,并将所获 取的签名文件插入插件包中。2) The PC can also obtain the signature file from the first signature device for the plugin package and obtain the obtained The signed signature file is inserted into the plugin package.
其中,所述第一签名装置可以装置于任何设备中。例如,所述第一签名装置可以装置于PC本机中或网络设备中。第一签名装置可以为插件包分配或生成签名文件,并提供给PC。相应地,PC可以从第一签名装置为插件包获取签名文件,并将所获取的签名文件插入插件包中。Wherein, the first signature device can be installed in any device. For example, the first signature device can be installed in a PC native or in a network device. The first signature device can assign or generate a signature file for the plugin package and provide it to the PC. Accordingly, the PC can obtain a signature file for the plug-in package from the first signature device, and insert the acquired signature file into the plug-in package.
其中,PC可以直接从第一签名装置获得统一的签名文件。或者,PC也可以把插件包或者其插件包标识信息发送给第一签名装置。相应地,第一签名装置可以根据所接收的插件包或其插件包标识信息来分配或生成签名文件。随后,第一签名装置可以将所生成的签名文件返回给PC。Among them, the PC can obtain a unified signature file directly from the first signature device. Alternatively, the PC may also send the plug-in package or its plug-in package identification information to the first signature device. Accordingly, the first signature device can assign or generate a signature file based on the received plug-in package or its plug-in package identification information. Subsequently, the first signature device can return the generated signature file to the PC.
3)PC可以将插件包提供给第二签名装置,以由该第二签名装置为该插件包配置签名文件并将该签名文件插入插件包中,随后,PC可以从第二签名装置接收插入签名文件的插件包。3) The PC may provide the plug-in package to the second signature device to configure the signature file for the plug-in package by the second signature device and insert the signature file into the plug-in package, and then the PC may receive the insertion signature from the second signature device. The plugin package for the file.
其中,所述第二签名装置可以装置于任何设备中。例如,所述第二签名装置可以装置于PC本机中或网络设备中。第二签名装置可以为插件包分配或生成签名文件并将所分配的或所生成的签名文件插入插件包中。Wherein, the second signature device can be installed in any device. For example, the second signature device can be installed in a PC native or in a network device. The second signature device can assign or generate a signature file for the plugin package and insert the assigned or generated signature file into the plugin package.
本领域技术人员应能理解,前述为插件包配置签名文件以将所配置的签名文件插入插件包的方式仅为举例,而不应被视为对本发明的任何限制,任何现有其它或今后可能出现的为插件包配置签名文件以将所配置的签名文件插入插件包的方式如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。It should be understood by those skilled in the art that the foregoing manner of configuring a signature file for a plug-in package to insert the configured signature file into the plug-in package is merely an example, and should not be considered as any limitation on the present invention, any other existing or future possibility The manner in which the signature file is configured for the plug-in package to insert the configured signature file into the plug-in package is applicable to the present invention and is also included in the scope of the present invention and is hereby incorporated by reference.
在步骤S4中,PC将插入签名文件的插件包保存至宿主指定的路径下。In step S4, the PC saves the plug-in package inserted into the signature file to the path specified by the host.
在此,宿主指定的路径专用于保存插件包。插入签名文件的插件包被保存至宿主指定的路径下,即可使该插件包与宿主建立关联。PC将插入签名文件的插件包保存至宿主指定的路径下的步骤通常也可以被称为“对插件包进行打包处理”。 Here, the host-specified path is dedicated to saving the plugin package. The plugin package that inserts the signature file is saved to the host-specified path to associate the plugin package with the host. The step in which the PC saves the plug-in package that inserts the signature file to the host-specified path can also be referred to as "packaging the plug-in package."
优选地,如果插件包的当前包名与插件包的清单文件中的包名一致,PC可以将插入签名文件的插件包保存至宿主指定的路径下。Preferably, if the current package name of the plug-in package is consistent with the package name in the manifest file of the plug-in package, the PC may save the plug-in package inserted into the signature file to the path specified by the host.
在此,PC可以将插入签名文件的插件包当前的包名与该插件包的清单文件(manifest.xml)中的包名进行比较,如果一致,PC即可以直接将插入签名文件的插件包保存至宿主指定的路径下。Here, the PC can compare the current package name of the plug-in package inserted into the signature file with the package name in the manifest file (manifest.xml) of the plug-in package. If they are consistent, the PC can directly save the plug-in package inserted into the signature file. Go to the path specified by the host.
更优选地,如果插件包的当前包名与插件包的清单文件中的包名不一致,PC还可以将插件包的当前包名重命名为清单文件中的包名。接着,PC还可以按照重命名后的包名,将插入签名文件的插件包保存至宿主指定的路径下。More preferably, if the current package name of the plugin package does not match the package name in the manifest file of the plugin package, the PC may also rename the current package name of the plugin package to the package name in the manifest file. Then, the PC can also save the plug-in package inserted into the signature file to the path specified by the host according to the renamed package name.
在此,插件包的当前包名与插件包的清单文件中的包名保持一致,可以使插件运行得更稳定、不易出错。Here, the current package name of the plug-in package is consistent with the package name in the manifest file of the plug-in package, which makes the plug-in run more stable and less error-prone.
图2示出根据本发明一个实施例的装置示意图,其具体示出一种为宿主配置插件包的装置,也即配置装置10。如图2所示,配置装置10被装置于PC中,并具体包括装置11-14。2 shows a schematic diagram of an apparatus in accordance with one embodiment of the present invention, which specifically illustrates an apparatus for configuring a plug-in package for a host, that is, a configuration apparatus 10. As shown in FIG. 2, the configuration device 10 is installed in a PC, and specifically includes devices 11-14.
装置11从插件包中提取宿主指定的插件包标识信息(为便于区分,以下将装置11称为标识信息提取装置11);装置12将所提取的插件包标识信息写入宿主的插件包配置文件(为便于区分,以下将装置12称为标识信息写入装置12);装置13为插件包配置签名文件,以将所配置的签名文件插入插件包(为便于区分,以下将装置13称为签名文件配置装置13);装置14将插入签名文件的插件包保存至宿主指定的路径下(为便于区分,以下将装置14称为插件包保存装置14)。The device 11 extracts the host-specific plug-in package identification information from the plug-in package (for convenience of distinction, the device 11 is hereinafter referred to as the identification information extraction device 11); the device 12 writes the extracted plug-in package identification information to the host's plug-in package configuration file. (For ease of differentiation, the device 12 is hereinafter referred to as the identification information writing device 12); the device 13 configures a signature file for the plug-in package to insert the configured signature file into the plug-in package (for ease of differentiation, the device 13 is hereinafter referred to as a signature) The file configuration device 13); the device 14 saves the plug-in package inserted into the signature file to the host-specified path (for convenience of distinction, the device 14 is hereinafter referred to as the plug-in package holding device 14).
本领域技术人员应能理解,标识信息提取装置11和标识信息写入装置12通常为连续执行的。签名文件配置装置13所执行的操作与标识信息提取装置11、标识信息写入装置12所分别执行的操作之间并无严格的顺序关系。签名文件配置装置13与标识信息提取装置11、标识信息写入装置12执行操作的先后顺序存在多种方式。例如,签名文件配置装置13可以与标识信息提取装置11同时执行操作。又如, 签名文件配置装置13可以先执行操作,随后再由标识信息提取装置11、标识信息写入装置12来执行操作,或者标识信息提取装置11、标识信息写入装置12先执行操作,随后再由签名文件配置装置13来执行操作。It will be understood by those skilled in the art that the identification information extracting means 11 and the identification information writing means 12 are generally executed continuously. The operation performed by the signature file configuring means 13 does not have a strict order relationship with the operations performed by the identification information extracting means 11 and the identification information writing means 12, respectively. There are various ways in which the signature file configuring means 13 and the identification information extracting means 11 and the identification information writing means 12 perform the operations. For example, the signature file configuring means 13 can perform an operation simultaneously with the identification information extracting means 11. Another example is that The signature file configuring means 13 may perform an operation first, and then perform an operation by the identification information extracting means 11 and the identification information writing means 12, or the identification information extracting means 11 and the identification information writing means 12 perform an operation first, followed by a signature. The file configuration device 13 performs an operation.
具体地,标识信息提取装置11从插件包中提取宿主指定的插件包标识信息。Specifically, the identification information extracting means 11 extracts the plug-in package identification information specified by the host from the plug-in package.
其中,所述插件包标识信息包括但不限于各种用于标识插件包的信息。所述插件包标识信息例如应用名称(如百度音乐)、包名(如baiduyinyue.apk)、版本号等。The plug-in package identification information includes, but is not limited to, various information for identifying a plug-in package. The plug-in package identification information is, for example, an application name (such as Baidu music), a package name (such as baiduyinyue.apk), a version number, and the like.
在此,所述宿主指定的插件包标识信息可以包括前述插件包标识信息中的至少任一项。例如,宿主指定的插件包标识信息可以仅包括应用名称。又如,宿主指定的插件包标识信息可以包括应用名称、包名、版本号这三项。Here, the host-designated plug-in package identification information may include at least one of the foregoing plug-in package identification information. For example, the host-specified plug-in package identification information may include only the application name. For another example, the host specified plug-in package identification information may include an application name, a package name, and a version number.
插件包中的清单文件(manifest.xml)中包含插件包标识信息。标识信息提取装置11例如可以从该清单文件中提取宿主指定的插件包标识信息。The manifest file (manifest.xml) in the plugin package contains the plugin package identification information. The identification information extracting means 11 can extract, for example, host-specified plug-in package identification information from the manifest file.
优选地,标识信息提取装置11可以按照以下2个子操作提取宿主指定的插件包标识信息:Preferably, the identification information extracting apparatus 11 may extract the plug-in package identification information specified by the host according to the following two sub-operations:
1)标识信息提取装置11可以调用标识信息读取工具,以获得插件包的初始标识信息。1) The identification information extracting means 11 can call the identification information reading means to obtain the initial identification information of the plug-in package.
其中,所述标识信息读取工具意指智能操作系统所提供的用于读取插件包的标识信息的工具。标识信息读取工具例如可以通过读取插件包中的清单文件(manifest.xml)来获取插件包标识信息。所述标识信息读取工具例如安卓操作系统下的adb工具(Android Debug Bridge,简称为adb)。The identifier information reading tool refers to a tool provided by the smart operating system for reading the identification information of the plug-in package. The identification information reading tool can obtain the plug-in package identification information by, for example, reading a manifest file (manifest.xml) in the plug-in package. The identification information reading tool is, for example, an adb tool (abbreviated as adb) under the Android operating system.
插件包的初始标识信息意指通过标识信息读取工具所直接获得的插件包的标识信息。初始标识信息通常包括宿主指定的插件包标识信息以及其他冗余信息。在随后的操作中,PC的标识信息提取装置11需对初始标识信息进行解析,以获得宿主指定的插件包标识信息。因 此,标识信息提取装置11所获得的初始标识信息需为PC可解析的。The initial identification information of the plug-in package means the identification information of the plug-in package directly obtained by the identification information reading tool. The initial identification information typically includes host-specific plug-in package identification information as well as other redundant information. In the subsequent operation, the identification information extracting means 11 of the PC needs to parse the initial identification information to obtain the plug-in package identification information specified by the host. Cause Therefore, the initial identification information obtained by the identification information extraction device 11 needs to be PC-resolvable.
在此,优选地,标识信息提取装置11可以调用标识信息读取工具,以获得初始标识信息,该初始标识信息在命令行对话框中呈现。接着,标识信息提取装置11可以将在命令行对话框中所呈现的初始标识信息保存在一可读文件中,以使得该初始标识信息可解析。Here, preferably, the identification information extracting means 11 may call the identification information reading means to obtain initial identification information, which is presented in a command line dialog box. Next, the identification information extracting means 11 can store the initial identification information presented in the command line dialog box in a readable file so that the initial identification information can be parsed.
其中,呈现在命令行对话框中的初始标识信息无法被PC的标识信息提取装置11(例如PC中的脚本程序)解析,而保存在PC可读文件中的初始标识信息可以被PC的标识信息提取装置11(例如PC中的脚本程序)解析。The initial identification information presented in the command line dialog box cannot be parsed by the identification information extraction device 11 of the PC (for example, a script program in the PC), and the initial identification information saved in the PC readable file can be identified by the identification information of the PC. The extraction device 11 (for example, a script program in a PC) parses.
可替代地,标识信息提取装置11可以调用标识信息读取工具,以直接获得可解析的初始标识信息。Alternatively, the identification information extracting means 11 may call the identification information reading means to directly obtain the resolvable initial identification information.
在此,随着智能操作系统所提供标识信息读取工具的功能升级,标识信息提取装置11应可以通过调用标识信息读取工具直接地获得可解析的初始标识信息(例如保存在文件中的初始标识信息)。Here, with the function upgrade of the identification information reading tool provided by the smart operating system, the identification information extraction device 11 should directly obtain the resolvable initial identification information by calling the identification information reading tool (for example, the initial stored in the file) Identification information).
2)标识信息提取装置11解析所获得的初始标识信息,以直接获得宿主指定的插件包标识信息。2) The identification information extracting means 11 parses the obtained initial identification information to directly obtain the plug-in package identification information specified by the host.
在此,初始标识信息中通常以“名称/值”对的形式保存宿主指定的插件包标识信息。Here, the host-specified plug-in package identification information is usually saved in the initial identification information in the form of a "name/value" pair.
标识信息提取装置11例如可以根据预先设定的宿主指定的“名称”字符串,在初始标识信息中进行查找,以获得该“名称”字符串所对应的“值”字符串。该表示“值”的字符串即为宿主指定的插件包标识信息。The identification information extracting means 11 can perform a search in the initial identification information based on a "name" character string specified by the host in advance to obtain a "value" character string corresponding to the "name" character string. The string representing the "value" is the plug-in package identification information specified by the host.
例如,标识信息提取装置11可以根据宿主指定的“名称”字符串——“package name”,在初始标识信息中进行查找,该“名称”字符串所对应的“值”字符串即为宿主指定的插件包标识信息——包名。For example, the identification information extracting device 11 can perform a search in the initial identification information according to the "name" string specified by the host, "package name", and the "value" string corresponding to the "name" string is designated by the host. Plugin package identification information - package name.
又如,标识信息提取装置11可以根据宿主指定的“名称”字符串——“version”,在初始标识信息中进行查找,该“名称”字符串所对应的“值”字符串即为宿主指定的插件包标识信息——版本号。For another example, the identifier information extracting device 11 can perform a search in the initial identifier information according to the "name" string specified by the host, and the "value" string corresponding to the "name" string is designated by the host. Plugin package identification information - version number.
本领域技术人员应能理解,前述提取宿主指定的插件包标识信息的方式仅为举例,而不应被视为对本发明的任何限制,任何现有其它或今 后可能出现的提取宿主指定的插件包标识信息的方式如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。Those skilled in the art should understand that the foregoing manner of extracting the plug-in package identification information specified by the host is merely an example, and should not be regarded as any limitation on the present invention, any other existing or present. The manner in which the host-specific plug-in package identification information may be extracted as may be applicable to the present invention is also intended to be included within the scope of the present invention and is hereby incorporated by reference.
随后,标识信息写入装置12将所提取的插件包标识信息写入宿主的插件包配置文件。Subsequently, the identification information writing means 12 writes the extracted plug-in package identification information to the host's plug-in package configuration file.
在此,宿主的插件包配置文件意指用于保存插件包的插件包标识信息的文件。宿主的插件包配置文件可以保存在任何设备中,如保存在PC本机和/或网络设备。标识信息写入装置12需具有对宿主的插件包配置文件的执行写入操作的权限。Here, the host's plugin package configuration file means a file for saving plugin package identification information of the plugin package. The host's plugin package configuration file can be saved on any device, such as on a PC native and/or network device. The identification information writing device 12 is required to have the authority to perform a write operation on the host's plug-in package configuration file.
例如,标识信息写入装置12将所提取的“应用名称”、“包名”、“版本号”等插件包标识信息写入宿主的插件包配置文件。For example, the identification information writing device 12 writes the extracted plug-in package identification information such as "application name", "package name", "version number", etc. into the host's plug-in package configuration file.
签名文件配置装置13为插件包配置签名文件,以将所配置的签名文件插入插件包。The signature file configuration means 13 configures a signature file for the plugin package to insert the configured signature file into the plugin package.
在此,签名文件包括但不限于各种包含签名信息的文件。Here, the signature file includes, but is not limited to, various files containing signature information.
集成在宿主中的插件需要运行时,宿主可以根据该插件的签名文件来获得签名信息,并将该签名信息与预定的签名信息相比较。如果一致,则宿主可以允许该插件运行。如果不一致,则宿主不允许该插件运行。When the plug-in integrated in the host needs to run, the host can obtain the signature information according to the signature file of the plug-in, and compare the signature information with the predetermined signature information. If they are consistent, the host can allow the plugin to run. If it is inconsistent, the host does not allow the plugin to run.
在此,不同的插件包可以被分配相同的签名文件。或者,不同的插件包也可以被分配不同的签名文件。例如,每个插件包可以被分配一个签名文件,如随机码。又如,进一步地,插件包的签名文件还可以基于各种签名文件生成算法来生成。Here, different plugin packages can be assigned the same signature file. Alternatively, different plugin packages can be assigned different signature files. For example, each plugin package can be assigned a signature file, such as a random code. As another example, the signature file of the plugin package can also be generated based on various signature file generation algorithms.
签名文件配置装置13为插件包配置签名文件以将所配置的签名文件插入插件包的方式包括但不限于以下3种:The manner in which the signature file configuration device 13 configures the signature file for the plug-in package to insert the configured signature file into the plug-in package includes but is not limited to the following three types:
1)签名文件配置装置13可以自行为插件包分配或生成签名文件,并将所分配的或所生成的签名文件插入插件包。1) The signature file configuration means 13 can assign or generate a signature file for the plug-in package and insert the assigned or generated signature file into the plug-in package.
2)签名文件配置装置13还可以从第一签名装置为插件包获取签名文件,并将所获取的签名文件插入插件包中。2) The signature file configuration means 13 can also obtain a signature file for the plug-in package from the first signature device and insert the acquired signature file into the plug-in package.
其中,所述第一签名装置可以装置于任何设备中。例如,所述第一签名装置可以装置于PC本机中或网络设备中。第一签名装置可以为插件包分配或生成签名文件,并提供给PC。相应地,PC的签名文 件配置装置13可以从第一签名装置为插件包获取签名文件,并将所获取的签名文件插入插件包中。Wherein, the first signature device can be installed in any device. For example, the first signature device can be installed in a PC native or in a network device. The first signature device can assign or generate a signature file for the plugin package and provide it to the PC. Correspondingly, the signature text of the PC The piece configuration device 13 can acquire a signature file for the plug-in package from the first signature device, and insert the acquired signature file into the plug-in package.
其中,签名文件配置装置13可以直接从第一签名装置获得统一的签名文件。或者,签名文件配置装置13也可以把插件包或者其插件包标识信息发送给第一签名装置。相应地,第一签名装置可以根据所接收的插件包或其插件包标识信息来分配或生成签名文件。随后,第一签名装置可以将所生成的签名文件返回给PC。The signature file configuration device 13 can obtain a unified signature file directly from the first signature device. Alternatively, the signature file configuration device 13 may also transmit the plug-in package or its plug-in package identification information to the first signature device. Accordingly, the first signature device can assign or generate a signature file based on the received plug-in package or its plug-in package identification information. Subsequently, the first signature device can return the generated signature file to the PC.
3)签名文件配置装置13可以将插件包提供给第二签名装置,以由该第二签名装置为该插件包配置签名文件并将该签名文件插入插件包中,随后,签名文件配置装置13可以从第二签名装置接收插入签名文件的插件包。3) The signature file configuration means 13 may provide the plug-in package to the second signature device, to configure the signature file for the plug-in package by the second signature device and insert the signature file into the plug-in package, and then the signature file configuration device 13 may A plug-in package that inserts a signature file is received from the second signature device.
其中,所述第二签名装置可以装置于任何设备中。例如,所述第二签名装置可以装置于PC本机中或网络设备中。第二签名装置可以为插件包分配或生成签名文件并将所分配的或所生成的签名文件插入插件包中。Wherein, the second signature device can be installed in any device. For example, the second signature device can be installed in a PC native or in a network device. The second signature device can assign or generate a signature file for the plugin package and insert the assigned or generated signature file into the plugin package.
本领域技术人员应能理解,前述为插件包配置签名文件以将所配置的签名文件插入插件包的方式仅为举例,而不应被视为对本发明的任何限制,任何现有其它或今后可能出现的为插件包配置签名文件以将所配置的签名文件插入插件包的方式如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。It should be understood by those skilled in the art that the foregoing manner of configuring a signature file for a plug-in package to insert the configured signature file into the plug-in package is merely an example, and should not be considered as any limitation on the present invention, any other existing or future possibility The manner in which the signature file is configured for the plug-in package to insert the configured signature file into the plug-in package is applicable to the present invention and is also included in the scope of the present invention and is hereby incorporated by reference.
随后,插件包保存装置14将插入签名文件的插件包保存至宿主指定的路径下。Subsequently, the plug-in package holding means 14 saves the plug-in package inserted into the signature file to the path specified by the host.
在此,宿主指定的路径专用于保存插件包。插入签名文件的插件包被保存至宿主指定的路径下,即可使该插件包与宿主建立关联。插件包保存装置14将插入签名文件的插件包保存至宿主指定的路径下的操作通常也可以被称为“对插件包进行打包处理”。Here, the host-specified path is dedicated to saving the plugin package. The plugin package that inserts the signature file is saved to the host-specified path to associate the plugin package with the host. The plug-in package holding means 14 saves the plug-in package inserting the signature file to the host-specified path. The operation can also be referred to as "packaging the plug-in package".
优选地,如果插件包的当前包名与插件包的清单文件中的包名一致,插件包保存装置14可以将插入签名文件的插件包保存至宿主指定的路径下。 Preferably, if the current package name of the plugin package matches the package name in the manifest file of the plugin package, the plugin package holding device 14 may save the plugin package inserted into the signature file to the path specified by the host.
在此,插件包保存装置14可以将插入签名文件的插件包当前的包名与该插件包的清单文件(manifest.xml)中的包名进行比较,如果一致,插件包保存装置14即可以直接将插入签名文件的插件包保存至宿主指定的路径下。Here, the plug-in package holding device 14 can compare the current package name of the plug-in package inserted into the signature file with the package name in the manifest file (manifest.xml) of the plug-in package, and if they are consistent, the plug-in package holding device 14 can directly Save the plugin package that inserted the signature file to the path specified by the host.
更优选地,如果插件包的当前包名与插件包的清单文件中的包名不一致,插件包保存装置14还可以将插件包的当前包名重命名为清单文件中的包名。接着,插件包保存装置14还可以按照重命名后的包名,将插入签名文件的插件包保存至宿主指定的路径下。More preferably, if the current package name of the plug-in package does not match the package name in the manifest file of the plug-in package, the plug-in package saving device 14 may also rename the current package name of the plug-in package to the package name in the manifest file. Next, the plug-in package holding device 14 can also save the plug-in package inserted into the signature file to the path specified by the host according to the renamed package name.
在此,插件包的当前包名与插件包的清单文件中的包名保持一致,可以使插件运行得更稳定、不易出错。Here, the current package name of the plug-in package is consistent with the package name in the manifest file of the plug-in package, which makes the plug-in run more stable and less error-prone.
需要注意的是,本发明可在软件和/或软件与硬件的组合体中被实施,例如,本发明的各个装置可采用专用集成电路(ASIC)或任何其他类似硬件设备来实现。在一个实施例中,本发明的软件程序可以通过处理器执行以实现上文所述步骤或功能。同样地,本发明的软件程序(包括相关的数据结构)可以被存储到计算机可读记录介质中,例如,RAM存储器,磁或光驱动器或软磁盘及类似设备。另外,本发明的一些步骤或功能可采用硬件来实现,例如,作为与处理器配合从而执行各个步骤或功能的电路。It should be noted that the present invention can be implemented in software and/or a combination of software and hardware. For example, the various devices of the present invention can be implemented using an application specific integrated circuit (ASIC) or any other similar hardware device. In one embodiment, the software program of the present invention may be executed by a processor to implement the steps or functions described above. Likewise, the software program (including related data structures) of the present invention can be stored in a computer readable recording medium such as a RAM memory, a magnetic or optical drive or a floppy disk and the like. Additionally, some of the steps or functions of the present invention may be implemented in hardware, for example, as a circuit that cooperates with a processor to perform various steps or functions.
对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本发明内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。 It is apparent to those skilled in the art that the present invention is not limited to the details of the above-described exemplary embodiments, and the present invention can be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the invention is defined by the appended claims instead All changes in the meaning and scope of equivalent elements are included in the present invention. Any reference signs in the claims should not be construed as limiting the claim. In addition, it is to be understood that the word "comprising" does not exclude other elements or steps. A plurality of units or devices recited in the system claims can also be implemented by a unit or device by software or hardware. The first, second, etc. words are used to denote names and do not denote any particular order.

Claims (19)

  1. 一种为宿主配置插件包的方法,其中,该方法包括:A method for configuring a plugin package for a host, wherein the method includes:
    -从插件包中提取宿主指定的插件包标识信息;- extracting the plugin package identification information specified by the host from the plugin package;
    -将所述插件包标识信息写入所述宿主的插件包配置文件;- writing the plugin package identification information to the host's plugin package configuration file;
    -为所述插件包配置签名文件,以将所述签名文件插入所述插件包;- configuring a signature file for the plugin package to insert the signature file into the plugin package;
    -将插入所述签名文件的插件包保存至所述宿主指定的路径下。- Save the plugin package inserted into the signature file to the path specified by the host.
  2. 根据权利要求1所述的方法,其中,所述提取步骤具体包括:The method of claim 1, wherein the extracting step comprises:
    -调用标识信息读取工具,以获得初始标识信息;- calling an identification information reading tool to obtain initial identification information;
    -解析所述初始标识信息,以获得所述插件包标识信息。- Parsing the initial identification information to obtain the plugin package identification information.
  3. 根据权利要求2所述的方法,其中,所述初始标识信息的获得步骤具体包括:The method of claim 2, wherein the obtaining the initial identification information comprises:
    -调用所述标识信息读取工具,以获得所述初始标识信息,所述初始标识信息在命令行对话框中呈现;Calling the identification information reading tool to obtain the initial identification information, the initial identification information being presented in a command line dialog box;
    -将所述初始标识信息保存在一可读文件中,以使得所述初始标识信息可解析。- saving the initial identification information in a readable file such that the initial identification information is analyzable.
  4. 根据权利要求1至3中任一项所述的方法,其中,所述配置签名文件的步骤还包括:The method of any one of claims 1 to 3, wherein the step of configuring the signature file further comprises:
    -从第一签名装置为所述插件包获取所述签名文件。- obtaining the signature file for the plugin package from the first signature device.
  5. 根据权利要求1至3中任一项所述的方法,其中,所述配置签名文件的步骤具体包括:The method according to any one of claims 1 to 3, wherein the step of configuring the signature file specifically comprises:
    -将所述插件包提供给第二签名装置,以由所述第二签名装置为其配置所述签名文件并将所述签名文件插入所述插件包中;Providing the plug-in package to a second signature device for configuring the signature file for the second signature device and inserting the signature file into the plug-in package;
    -从所述第二签名装置接收插入所述签名文件的插件包。Receiving a plug-in package inserted into the signature file from the second signature device.
  6. 根据权利要求1至5中任一项所述的方法,其中,所述保存步骤具体包括:The method according to any one of claims 1 to 5, wherein the saving step specifically comprises:
    -如果所述插件包的当前包名与所述插件包的清单文件中的包名一致,将插入所述签名文件的插件包保存至所述宿主指定的路径下。 - if the current package name of the plugin package matches the package name in the manifest file of the plugin package, the plugin package inserted into the signature file is saved to the path specified by the host.
  7. 根据权利要求6所述的方法,其中,所述保存步骤还包括:The method of claim 6 wherein said saving step further comprises:
    -如果所述插件包的当前包名与所述插件包的清单文件中的包名不一致,将所述插件包的当前包名重命名为所述清单文件中的包名;- if the current package name of the plugin package does not match the package name in the manifest file of the plugin package, the current package name of the plugin package is renamed to the package name in the manifest file;
    -按照重命名后的包名,将插入所述签名文件的插件包保存至所述宿主指定的路径下。- Save the plugin package inserted into the signature file to the path specified by the host according to the renamed package name.
  8. 根据权利要求1至7中任一项所述的方法,其中,所述宿主运行于安卓操作系统。The method of any of claims 1 to 7, wherein the host runs on an Android operating system.
  9. 一种为宿主配置插件包的装置,其中,该装置包括:A device for configuring a plug-in package for a host, wherein the device comprises:
    -用于从插件包中提取宿主指定的插件包标识信息的装置;- means for extracting host-specific plugin package identification information from the plugin package;
    -用于将所述插件包标识信息写入所述宿主的插件包配置文件的装置;Means for writing said plugin package identification information to said host's plugin package configuration file;
    -用于为所述插件包配置签名文件,以将所述签名文件插入所述插件包的装置;a means for configuring a signature file for the plugin package to insert the signature file into the plugin package;
    -用于将插入所述签名文件的插件包保存至所述宿主指定的路径下的装置。- means for saving the plugin package inserted into the signature file to the path specified by the host.
  10. 根据权利要求9所述的装置,其中,所述提取插件包标识信息的装置具体用于:The apparatus according to claim 9, wherein said means for extracting plug-in package identification information is specifically used for:
    -调用标识信息读取工具,以获得初始标识信息;- calling an identification information reading tool to obtain initial identification information;
    -解析所述初始标识信息,以获得所述插件包标识信息。- Parsing the initial identification information to obtain the plugin package identification information.
  11. 根据权利要求10所述的装置,其中,获得所述初始标识信息的操作具体包括:The device of claim 10, wherein the obtaining the initial identification information comprises:
    -调用所述标识信息读取工具,以获得所述初始标识信息,所述初始标识信息在命令行对话框中呈现;Calling the identification information reading tool to obtain the initial identification information, the initial identification information being presented in a command line dialog box;
    -将所述初始标识信息保存在一可读文件中,以使得所述初始标识信息可解析。- saving the initial identification information in a readable file such that the initial identification information is analyzable.
  12. 根据权利要求9至11中任一项所述的装置,其中,所述配置签名文件的装置还用于:The apparatus according to any one of claims 9 to 11, wherein the means for configuring a signature file is further configured to:
    -从第一签名装置为所述插件包获取所述签名文件。- obtaining the signature file for the plugin package from the first signature device.
  13. 根据权利要求9至11中任一项所述的装置,其中,所述配置签 名文件的装置具体用于:Apparatus according to any one of claims 9 to 11, wherein said configuration sign The device of the name file is specifically used to:
    -将所述插件包提供给第二签名装置,以由所述第二签名装置为其配置所述签名文件并将所述签名文件插入所述插件包中;Providing the plug-in package to a second signature device for configuring the signature file for the second signature device and inserting the signature file into the plug-in package;
    -从所述第二签名装置接收插入所述签名文件的插件包。Receiving a plug-in package inserted into the signature file from the second signature device.
  14. 根据权利要求9至13中任一项所述的装置,其中,所述保存插入所述签名文件的插件包的装置具体用于:The apparatus according to any one of claims 9 to 13, wherein the means for saving a plug-in package inserted into the signature file is specifically used to:
    -如果所述插件包的当前包名与所述插件包的清单文件中的包名一致,将插入所述签名文件的插件包保存至所述宿主指定的路径下。- if the current package name of the plugin package matches the package name in the manifest file of the plugin package, the plugin package inserted into the signature file is saved to the path specified by the host.
  15. 根据权利要求14所述的装置,其中,所述保存插入所述签名文件的插件包的装置还用于:The apparatus according to claim 14, wherein said means for saving a plug-in package inserted into said signature file is further for:
    -如果所述插件包的当前包名与所述插件包的清单文件中的包名不一致,将所述插件包的当前包名重命名为所述清单文件中的包名;- if the current package name of the plugin package does not match the package name in the manifest file of the plugin package, the current package name of the plugin package is renamed to the package name in the manifest file;
    -按照重命名后的包名,将插入所述签名文件的插件包保存至所述宿主指定的路径下。- Save the plugin package inserted into the signature file to the path specified by the host according to the renamed package name.
  16. 根据权利要求9至15中任一项所述的装置,其中,所述宿主运行于安卓操作系统。The apparatus of any one of claims 9 to 15, wherein the host runs on an Android operating system.
  17. 一种计算机可读存储介质,所述计算机可读存储介质包括计算机指令,当所述计算机指令被执行时,如权利要求1至8中任一项所述的方法被执行。A computer readable storage medium comprising computer instructions, the method of any one of claims 1 to 8 being executed when the computer instructions are executed.
  18. 一种计算机程序产品,当所述计算机程序产品被执行时,如权利要求1至8中任一项所述的方法被执行。A computer program product, when the computer program product is executed, the method of any one of claims 1 to 8 being performed.
  19. 一种计算机设备,所述计算机设备包括存储器和处理器,所述存储器中存储有计算机指令,所述处理器被配置来通过执行所述计算机指令以执行如权利要求1至8中任一项所述的方法。 A computer device comprising a memory and a processor, wherein the memory stores computer instructions, the processor being configured to perform the computer instructions to perform as claimed in any one of claims 1 to 8 The method described.
PCT/CN2015/096380 2015-07-31 2015-12-04 Method and apparatus for configuring plugin package for host WO2017020459A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510464145.1A CN105138351B (en) 2015-07-31 2015-07-31 A kind of method and apparatus for host's configuration plug-in packet
CN201510464145.1 2015-07-31

Publications (1)

Publication Number Publication Date
WO2017020459A1 true WO2017020459A1 (en) 2017-02-09

Family

ID=54723709

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/096380 WO2017020459A1 (en) 2015-07-31 2015-12-04 Method and apparatus for configuring plugin package for host

Country Status (2)

Country Link
CN (1) CN105138351B (en)
WO (1) WO2017020459A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032651A (en) * 2018-08-24 2018-12-18 深圳创维-Rgb电子有限公司 Using update method, intelligent terminal and computer readable storage medium
CN109918075A (en) * 2017-12-12 2019-06-21 北京奇虎科技有限公司 Utilize the SDK packaging method, packing plug-in unit and corresponding terminal for being packaged plug-in unit
CN111176663A (en) * 2019-12-20 2020-05-19 北京字节跳动网络技术有限公司 Data processing method, device and equipment of application program and storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092494B (en) * 2016-02-18 2020-09-01 腾讯科技(深圳)有限公司 Method and device for accessing APK (android Package) resource
CN107222453B (en) * 2016-03-22 2020-01-31 阿里巴巴集团控股有限公司 file transmission method and device
CN105930183A (en) * 2016-04-13 2016-09-07 乐视控股(北京)有限公司 Method and device for updating video application programs
CN109145591B (en) * 2018-09-10 2021-11-16 上海连尚网络科技有限公司 Plug-in loading method of application program

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179378A (en) * 2006-12-21 2008-05-14 腾讯科技(深圳)有限公司 Method and system for executing plug-in unit
CN101887376A (en) * 2010-07-09 2010-11-17 中兴通讯股份有限公司 Widget engine and method for uploading scripts or plugins by using same
CN102411506A (en) * 2011-07-07 2012-04-11 杭州典能科技有限公司 Java-system business-unit plug-in type managing system and dynamic business-function changing method
WO2014183447A1 (en) * 2013-05-14 2014-11-20 Tencent Technology (Shenzhen) Company Limited Method, system and sever for downloading installation package

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880456B (en) * 2012-07-31 2016-08-31 北京奇虎科技有限公司 Plug-in loading method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179378A (en) * 2006-12-21 2008-05-14 腾讯科技(深圳)有限公司 Method and system for executing plug-in unit
CN101887376A (en) * 2010-07-09 2010-11-17 中兴通讯股份有限公司 Widget engine and method for uploading scripts or plugins by using same
CN102411506A (en) * 2011-07-07 2012-04-11 杭州典能科技有限公司 Java-system business-unit plug-in type managing system and dynamic business-function changing method
WO2014183447A1 (en) * 2013-05-14 2014-11-20 Tencent Technology (Shenzhen) Company Limited Method, system and sever for downloading installation package

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
VOICEOFNET.: "apk multi-channel automatic packaging", 17 October 2013 (2013-10-17), pages 1 and 2, Retrieved from the Internet <URL:http://blog.csdn.net/voiceofnet/article/details/12836699> *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918075A (en) * 2017-12-12 2019-06-21 北京奇虎科技有限公司 Utilize the SDK packaging method, packing plug-in unit and corresponding terminal for being packaged plug-in unit
CN109032651A (en) * 2018-08-24 2018-12-18 深圳创维-Rgb电子有限公司 Using update method, intelligent terminal and computer readable storage medium
CN109032651B (en) * 2018-08-24 2022-06-10 深圳创维-Rgb电子有限公司 Application updating method, intelligent terminal and computer readable storage medium
CN111176663A (en) * 2019-12-20 2020-05-19 北京字节跳动网络技术有限公司 Data processing method, device and equipment of application program and storage medium
CN111176663B (en) * 2019-12-20 2024-02-02 抖音视界有限公司 Data processing method, device, equipment and storage medium of application program

Also Published As

Publication number Publication date
CN105138351B (en) 2019-10-18
CN105138351A (en) 2015-12-09

Similar Documents

Publication Publication Date Title
WO2017020459A1 (en) Method and apparatus for configuring plugin package for host
US10303590B2 (en) Testing functional correctness and idempotence of software automation scripts
US11269660B2 (en) Methods and systems for integrated development environment editor support with a single code base
US10235275B2 (en) Extraction of problem diagnostic knowledge from test cases
US9053236B1 (en) Automated directory services test setup utility
CN109918055B (en) Application program generation method and device
US10936309B2 (en) Development project blueprint and package generation
WO2018036342A1 (en) Csar-based template design visualization method and device
US11593342B2 (en) Systems and methods for database orientation transformation
US9892122B2 (en) Method and apparatus for determining a range of files to be migrated
US10248409B1 (en) Limiting the effects of source code patches on corresponding native-code patches
US20170371687A1 (en) Automated globalization enablement on development operations
CN104407890A (en) Method for starting Android system from OTG (On-The-Go) equipment
WO2017020460A1 (en) Method and apparatus for integrating plugin
US10338891B2 (en) Migration between model elements of different types in a modeling environment
US10606569B2 (en) Declarative configuration elements
CN113360379B (en) Program test environment creation method and program test environment creation apparatus
US20210271458A1 (en) Managing an app method and system
CN109948251B (en) CAD-based data processing method, device, equipment and storage medium
CN109976765B (en) Application group deployment method, device, equipment and storage medium
JP6818568B2 (en) Communication device, communication specification difference extraction method and communication specification difference extraction program
CN115794125A (en) Service deployment method, device and medium
JP5363286B2 (en) Simulation program generation program and simulation program generation method
JP2015527621A (en) Correction management device, correction management method, and correction management program
CN105511898A (en) Method, device and equipment for upgrade management of cloud terminal

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: 15900228

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: 15900228

Country of ref document: EP

Kind code of ref document: A1