Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Embodiment 1
With reference to figure 1, Fig. 1 is the process flow diagram of the embodiment of the method for a kind of Function Extension of providing of the embodiment of the invention 1; The execution subject of the present embodiment can be portable terminal, is specifically as follows mobile phone or panel computer, but is not limited to this.Preferably, the portable terminal in the present embodiment adopts the Android system, but is not limited to this.
The method of described Function Extension comprises:
S101: download default plug-in unit, the file layout of wherein said default plug-in unit comprises Android installation kit APK form;
S102: when starting default application program, load described default plug-in unit, described default plug-in unit is verified;
S103: if described default plug-in unit calls logical program corresponding to described default plug-in unit by checking, realize the Function Extension of described default application program.
Optionally, the described default plug-in unit of described loading, described default plug-in unit verified comprise:
Obtain the attribute information of described default plug-in unit, load described attribute information, described attribute information is carried out signature verification;
If described attribute information by checking, loads the logical program corresponding to execute file of described default plug-in unit, according to default interface specification described logical program is verified;
Accordingly, if described default plug-in unit calls logical program corresponding to described default plug-in unit and is specially by checking:
If the logical program that the execute file of described default plug-in unit is corresponding passes through checking, call logical program corresponding to described default plug-in unit.
Optionally, after the default plug-in unit of described download, described method further comprises:
Described default plug-in unit is decompressed, obtain the execute file of described default plug-in unit, described execute file is kept in the add-on file folder;
Accordingly, the attribute information that obtains described default plug-in unit comprises:
Search the execute file in the described add-on file folder, obtain the attribute information of default plug-in unit corresponding to described execute file.
Optionally, described attribute information is one or more in the following information: name information, volume information, icon information and descriptor.
Optionally, described calling before logical program corresponding to described default plug-in unit, described method further comprises:
The functional entrance that shows described default plug-in unit;
Accordingly, described logical program corresponding to described default plug-in unit that call is specially:
When the user clicks application A PP icon corresponding to described functional entrance, call logical program corresponding to described default plug-in unit.
In the present embodiment, by downloading default plug-in unit, when starting default application program, load described default plug-in unit, if described default plug-in unit is by checking, then call logical program corresponding to described default plug-in unit, thereby realize the Function Extension of described default application program, the existing more highest version of again downloading and installing this default application program of comparing, the present embodiment only need to be downloaded the default plug-in unit corresponding to function of expansion, and do not need to reinstall just and can expand by practical function, reduced the consumption of system resource.
Embodiment 2
With reference to figure 2, Fig. 2 is the process flow diagram of the embodiment of the method for a kind of Function Extension of providing of the embodiment of the invention 2; The execution subject of the present embodiment can be portable terminal, specifically can be mobile phone or panel computer, but is not limited to this.The present embodiment is described in detail as an example of portable terminal employing Android system example.
S201: download default plug-in unit, the file layout of wherein said default plug-in unit comprises Android installation kit APK form.
The plug-in unit that relates in the present embodiment is also referred to as expansion, is a kind of program that certain application programming interfaces standard is write of following; This plug-in unit is mainly used in expanding software function, need not to install to use.
In the Android system, the installation kit that the software after the successful installation is corresponding, namely APK (AndroidPackage, Android installation kit) file can be kept at the ad-hoc location of system, generally is/data/app; The APK file is the zip form in fact, but its suffix name is modified to apk, by obtaining the execute file in the installation kit, i.e. dex file after the APK file is decompressed; After dex is optimized, obtain the odex file, described odex file is kept at/the data/cache path under; When operation during this software, system finds corresponding odex file first from/data/cache, then with the execution that makes an explanation in the JAVA virtual machine of described odex file load on the Android system.
Can find out from top description, the Android system starts application by the odex file that loads in the APK file, and this process is the same with the process of plug-in architecture, so the APK file is for the Android system, also a kind of plug-in unit at last.
The embodiment of the invention is utilized this principle exactly, and the application program that the expanded function of software is corresponding can be write by the APK mode, and follows default interface specification, obtains default plug-in unit; The file layout of wherein said default plug-in unit is the APK form, and namely the file suffixes of described default plug-in unit is called apk, and the default plug-in unit of writing like this goes for the Android system.For other system, also can adopt this principle that application program corresponding to the expanded function of software carried out corresponding writing, generate the default plug-in unit that is applicable to this system, the expansion of practical function is given unnecessary details no longer one by one at this.
Described default interface specification is specially the restricting condition for use of described default plug-in unit, comprise: the date storage method of the during Destruction of the building process of regulation plug-in unit, regulation plug-in unit, UI (User Interface, the user interface) exhibition method of regulation plug-in unit and regulation plug-in unit etc.
In this step, can be with described default plug-in download in the storage card of portable terminal, for example: SD (Secure Digital memory card, safe digital card).
S202: described default plug-in unit is decompressed, obtain the execute file of described default plug-in unit, described execute file is kept in the add-on file folder.
The file layout of described default plug-in unit is the APK form, can decompress to file corresponding to described default plug-in unit and obtain wherein execute file, and namely the dex file is kept at described dex file in the add-on file folder.
S203: when starting default application program, obtain the attribute information of described default plug-in unit.
In this step, when default application program launching, search the execute file in the described add-on file folder, obtain the attribute information of default plug-in unit corresponding to described execute file, wherein said attribute information comprises one or more in the following information: name information, volume information, icon information and descriptor.
S204: load described attribute information, described attribute information is carried out signature verification, whether judge described attribute information by checking, if so, execution S206 if not, carries out S205.
In this step, after described default application program is obtained described attribute information, load described attribute information, described attribute information is carried out signature verification, specifically according to the unique signing certificate that has of developer described attribute information is carried out signature verification, then judge that whether described attribute information passes through checking, carries out follow-up flow process according to judged result.
S205: finish to load.
S206: load the logical program corresponding to execute file of described default plug-in unit, according to default interface specification described logical program is verified.
In this step, when described attribute information passes through checking, reload the logical program corresponding to execute file of described default plug-in unit, judge whether described logical program satisfies the requirement of described default interface specification, if satisfy, then described logical program is carried out follow-up flow process by checking; If do not satisfy, then described logical program finishes to load not by checking.
S207: if logical program corresponding to the execute file of described default plug-in unit passes through checking, show the functional entrance of described default plug-in unit; When the user clicks application A PP icon corresponding to described functional entrance, call logical program corresponding to described default plug-in unit.
In this step, if described logical program is by checking, then described default application program is finished the loading procedure of described default plug-in unit, the functional entrance that shows described default plug-in unit to the user, this functional entrance can be with IOS (Internetwork Operation System, the form of APP network operating system) (Application Program, application program) icon is presented in the display interface of described default application program.
When the user clicked APP icon corresponding to described functional entrance, logical program corresponding to the described default plug-in unit of described default application call realized function corresponding to described default plug-in unit, thereby expanded the expansion of described default application program.
A default plug-in unit in the present embodiment can realize stating the expansion of a function presetting application program, when needs are expanded a plurality of function of described default application program, can adopt a plurality of default plug-in units to realize respectively corresponding Function Extension, do not repeat them here, specifically can be with reference to the description of above-described embodiment.
In the present embodiment, by downloading default plug-in unit, when starting default application program, load described default plug-in unit, if described default plug-in unit is by checking, then call logical program corresponding to described default plug-in unit, thereby realize the Function Extension of described default application program, the existing more highest version of again downloading and installing this default application program of comparing, the present embodiment only need to be downloaded the default plug-in unit corresponding to function of expansion, and do not need to reinstall just and can expand by practical function, reduced the consumption of system resource, and can conveniently repair the functional defect of this default application program.
In addition, when the default plug-in unit existing problems of certain money, can directly replace this plug-in unit and repair, convenient and swift, improved the user experience of user when using software.
Embodiment 3
With reference to figure 3, Fig. 3 is the first structural representation of the device embodiment of a kind of Function Extension of providing of the embodiment of the invention 3; The device of described Function Extension can be portable terminal, specifically can be mobile phone or panel computer, but is not limited to this.Preferably, the device of the Function Extension in the present embodiment adopts the Android system.
The device of described Function Extension comprises:
Download module 301 is used for downloading default plug-in unit, and the file layout of wherein said default plug-in unit comprises Android installation kit APK form.
Load authentication module 302, be used for when starting default application program, loading described default plug-in unit, described default plug-in unit is verified.
Callingmodule 303 if be used for described default plug-in unit by checking, calls logical program corresponding to described default plug-in unit, realizes the Function Extension of described default application program.
In a kind of embodiment, described loading authentication module 302 comprises: first loads authentication unit 3021 and second loads authentication unit 3022, and as shown in Figure 4, Fig. 4 is the second structural representation of the device embodiment of a kind of Function Extension of providing of the embodiment of the invention 3;
Described first loads authentication unit 3021, is used for obtaining the attribute information of described default plug-in unit, loads described attribute information, and described attribute information is carried out signature verification.
Described second loads authentication unit 3022, if be used for described attribute information by checking, loads the logical program corresponding to execute file of described default plug-in unit, according to default interface specification described logical program is verified.
Accordingly, described callingmodule 303 specifically is used for, if logical program corresponding to the execute file of described default plug-in unit passes through checking, calls logical program corresponding to described default plug-in unit.
In another embodiment, described device also comprises: preserve module 304, corresponding, described first loads authentication unit 3021 comprises searching and obtains subelement 30211, as shown in Figure 5, Fig. 5 is the 3rd structural representation of the device embodiment of a kind of Function Extension of providing of the embodiment of the invention 3;
Described preservation module 304 is used for after the default plug-in unit of described download described default plug-in unit being decompressed, and obtains the execute file of described default plug-in unit, and described execute file is kept in the add-on file folder.
Described searching obtained subelement 30211, is used for searching the execute file of described add-on file folder, obtains the attribute information of default plug-in unit corresponding to described execute file.
On the basis of above-mentioned embodiment, described device also comprises:
Display module, be used for described call logical program corresponding to described default plug-in unit before, show the functional entrance of described default plug-in unit;
Accordingly, described callingmodule 303 specifically is used for, and when the user clicks application A PP icon corresponding to described functional entrance, calls logical program corresponding to described default plug-in unit.
In the present embodiment, by downloading default plug-in unit, when starting default application program, load described default plug-in unit, if described default plug-in unit is by checking, then call logical program corresponding to described default plug-in unit, thereby realize the Function Extension of described default application program, the existing more highest version of again downloading and installing this default application program of comparing, the present embodiment only need to be downloaded the default plug-in unit corresponding to function of expansion, and do not need to reinstall just and can expand by practical function, reduced the consumption of system resource, and can conveniently repair the functional defect of this default application program.
In addition, when the default plug-in unit existing problems of certain money, can directly replace this plug-in unit and repair, convenient and swift, improved the user experience of user when using software.
Need to prove, each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For device class embodiment because itself and embodiment of the method basic simlarity, so describe fairly simple, relevant part gets final product referring to the part explanation of embodiment of the method.
Need to prove, in this article, relational terms such as the first and second grades only is used for an entity or operation are separated with another entity or operational zone, and not necessarily requires or hint and have the relation of any this reality or sequentially between these entities or the operation.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby not only comprise those key elements so that comprise process, method, article or the equipment of a series of key elements, but also comprise other key elements of clearly not listing, or also be included as the intrinsic key element of this process, method, article or equipment.In the situation that not more restrictions, the key element that is limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
The all or part of step that one of ordinary skill in the art will appreciate that realization above-described embodiment can be finished by hardware, also can come the relevant hardware of instruction to finish by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
The above only is preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.