CN107577456A - A kind of processing method and processing device of plug-in application - Google Patents

A kind of processing method and processing device of plug-in application Download PDF

Info

Publication number
CN107577456A
CN107577456A CN201710750604.1A CN201710750604A CN107577456A CN 107577456 A CN107577456 A CN 107577456A CN 201710750604 A CN201710750604 A CN 201710750604A CN 107577456 A CN107577456 A CN 107577456A
Authority
CN
China
Prior art keywords
plug
application
processing
byte code
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710750604.1A
Other languages
Chinese (zh)
Inventor
胡俊杰
王玉鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201710750604.1A priority Critical patent/CN107577456A/en
Publication of CN107577456A publication Critical patent/CN107577456A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides a kind of processing method and processing device of plug-in application.This method includes:It is compiled in the source code for the plug-in application write to programming language, after the byte code files for generating the plug-in application, the processing strategy for being carried out plug-in unit processing to the plug-in application based on the specific plug-in framework is handled the byte code files, the plug-in unit byte code files after being handled;The byte code files that plug-in unit byte code files after the processing are converted into can perform in operating system, and the executable byte code files generation plug-in unit bag of packing.The embodiment of the present invention can develop class that automatic modification is related in compilation process or method etc. in plug-in application, without developer's manual modification, improve the efficiency of exploitation.

Description

A kind of processing method and processing device of plug-in application
Technical field
The present invention relates to technical field of internet application, particularly a kind of processing method and processing device of plug-in application.
Background technology
In software development, Function Extension is carried out to software for convenience, can be developed using plug-in unit mode, will be soft Each plug-in application is finally integrated in one in software main program bag by the function package one by one to be realized of part in plug-in unit With issue.
At present, plug-in unit processing is carried out to plug-in application using some plug-in unit frameworks, can equally realizes corresponding work( Energy.When user needs to use some specific function, it can download and open corresponding plug-in unit, and can also unload at any time slotting Part.It so can not only reduce application data bag size, save flow, can also significantly reduce internal memory, storage inside occupancy, More spaces are given to the data such as photograph, the document of preciousness.
However, when carrying out plug-in unitization processing to plug-in application using plug-in unit framework, it is necessary to which developer goes to change manually Related class or method etc., development efficiency is not high.Also, manual modification can not be realized in the source code of no plug-in application.Cause This, this problem of urgent need to resolve.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on State the processing method of the plug-in application of problem and corresponding device.
One side according to embodiments of the present invention, there is provided a kind of processing method of plug-in application, suitable for using specified Plug-in unit framework carries out the situation of plug-in unit processing to plug-in application, and methods described includes:
It is compiled in the source code for the plug-in application write to programming language, generates the byte code files of the plug-in application Afterwards, the processing strategy of plug-in unit processing is carried out to the bytecode to the plug-in application based on the specific plug-in framework File is handled, the plug-in unit byte code files after being handled;
The byte code files that plug-in unit byte code files after the processing are converted into can perform in operating system, and beat Wrap the executable byte code files generation plug-in unit bag.
Alternatively, it is described that plug-in application progress plug-in unitization processing is referred to answer the plug-in unit using specific plug-in framework With the access specific plug-in framework.
Alternatively, the processing strategy for carrying out plug-in unit processing to the plug-in application based on the specific plug-in framework is right The byte code files are handled, including:
The specific plug-in framework is carried out at plug-in unit to the plug-in application using the specified interface of operating system The processing strategy of reason is injected into compiling flow;
The processing strategy is obtained from the specified interface, and the byte code files are handled.
Alternatively, the specific plug-in framework is inserted to the plug-in application using the specified interface of operating system The processing strategy of partization processing is injected into compiling flow, including:
The specific plug-in framework is split into the processing strategy of plug-in application progress plug-in unit processing multiple Injection task;
For each injecting task in the multiple injection task, corresponding injector is generated;
The multiple injector is injected separately into compiling flow.
Alternatively, the injection task includes following one of any:
The parent of Activity in the plug-in application is revised as to the spy of plugin library in the specific plug-in framework Determine parent, and super is called and changed accordingly;
It is to be inserted in the specific plug-in framework that LocalBroadcast in the plug-in application is called into code revision The calling code in part storehouse;
It is plugin library in the specific plug-in framework that Provider in the plug-in application is called into code revision Call code;
The function getIdentifier of acquisition resource in plug-in application parameter is revised as to the ginseng of dynamic adaptation Number.
Alternatively, the processing strategy is obtained from the specified interface, and the byte code files is handled, wrapped Include:
The multiple injector is obtained from the specified interface;
The byte code files are scanned, and is utilized respectively the multiple injector and the byte code files is handled.
Alternatively, the multiple injector is utilized respectively to handle the byte code files, including:
Based on Javassist class libraries instruments, it is utilized respectively the multiple injector and the byte code files is handled.
Alternatively, if the operating system is Android system, the programming language is Java language, the bytecode text Part includes Class files.
Alternatively, if the operating system is Android system, the specified interface is Transform api interfaces.
Another aspect according to embodiments of the present invention, a kind of processing unit of plug-in application is additionally provided, suitable for using Specific plug-in framework carries out the situation of plug-in unit processing to plug-in application, and described device includes:
Processing module, suitable for being compiled in the source code for the plug-in application write to programming language, generating the plug-in unit should After byte code files, the processing plan of plug-in unit processing is carried out to the plug-in application based on the specific plug-in framework Slightly the byte code files are handled, the plug-in unit byte code files after being handled;
Modular converter, suitable for the word for being converted into can perform in operating system by the plug-in unit byte code files after the processing Save code file;
Packetization module, suitable for packing, the executable byte code files generate plug-in unit bag.
Alternatively, it is described that plug-in application progress plug-in unitization processing is referred to answer the plug-in unit using specific plug-in framework With the access specific plug-in framework.
Alternatively, the processing module includes:
Injection unit, suitable for the specified interface using operating system by the specific plug-in framework to the plug-in application The processing strategy for carrying out plug-in unit processing is injected into compiling flow;
Processing unit, suitable for from the specified interface obtain it is described processing strategy, and to the byte code files at Reason.
Alternatively, the injection unit is further adapted for:
The specific plug-in framework is split into the processing strategy of plug-in application progress plug-in unit processing multiple Injection task;
For each injecting task in the multiple injection task, corresponding injector is generated;
The multiple injector is injected separately into compiling flow.
Alternatively, the injection task includes following one of any:
The parent of Activity in the plug-in application is revised as to the spy of plugin library in the specific plug-in framework Determine parent, and super is called and changed accordingly;
It is to be inserted in the specific plug-in framework that LocalBroadcast in the plug-in application is called into code revision The calling code in part storehouse;
It is plugin library in the specific plug-in framework that Provider in the plug-in application is called into code revision Call code;
The function getIdentifier of acquisition resource in plug-in application parameter is revised as to the ginseng of dynamic adaptation Number.
Alternatively, the processing unit is further adapted for:
The multiple injector is obtained from the specified interface;
The byte code files are scanned, and is utilized respectively the multiple injector and the byte code files is handled.
Alternatively, the processing unit is further adapted for:
Based on Javassist class libraries instruments, it is utilized respectively the multiple injector and the byte code files is handled.
Alternatively, if the operating system is Android system, the programming language is Java language, the bytecode text Part includes Class files.
Alternatively, if the operating system is Android system, the specified interface is Transform api interfaces.
In embodiments of the present invention, it is compiled in the source code for the plug-in application write to programming language, generates the plug-in unit After the byte code files of application, the processing strategy of plug-in unit processing is carried out to word to plug-in application based on specific plug-in framework Section code file is handled, the plug-in unit byte code files after being handled;Afterwards by the plug-in unit byte code files after processing The byte code files that can perform in operating system are converted into, and the byte code files generation plug-in unit bag for packing executable.Thus, originally Inventive embodiments can develop class that automatic modification is related in compilation process or method etc. in plug-in application, without developer's hand Dynamic modification, improve the efficiency of exploitation.Also, the source code for the plug-in application that the embodiment of the present invention can write to programming language is compiled Byte code files after translating are handled, and realize the plug-in unit of plug-in application, the source code without plug-in application, it is easy to accomplish, and It is workable.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the embodiment of the present invention.
According to the accompanying drawings will be brighter to the detailed description of the specific embodiment of the invention, those skilled in the art Above-mentioned and other purposes, the advantages and features of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this area Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows the process flow figure of plug-in application according to an embodiment of the invention;
Fig. 2 shows the process flow figure of plug-in application according to another embodiment of the present invention;
Fig. 3 shows the schematic diagram of on-the-flier compiler plug-in application;
Fig. 4 shows the structural representation of the processing unit of plug-in application according to an embodiment of the invention;
Fig. 5 shows the structural representation of the processing unit of plug-in application according to another embodiment of the present invention.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
As introduced above, at present when carrying out plug-in unitization processing to plug-in application using plug-in unit framework, it is necessary to developer The related class of modification or method etc. are gone manually, and development efficiency is not high.In order to solve this technical problem, the embodiment of the present invention provides A kind of processing method of plug-in application, the feelings suitable for carrying out plug-in unit processing to plug-in application using specific plug-in framework Condition, class that automatic modification is related in compilation process or method etc. can be developed in plug-in application, without developer's manual modification, Improve the efficiency of exploitation.
Fig. 1 shows the process flow figure of plug-in application according to an embodiment of the invention.Referring to Fig. 1, this method S102 be may comprise steps of to step S104.
Step S102, it is compiled in the source code for the plug-in application write to programming language, generates the byte of plug-in application After code file, the processing strategy for being carried out plug-in unit processing to plug-in application based on specific plug-in framework is entered to byte code files Row processing, the plug-in unit byte code files after being handled.
Step S104, the bytecode text that the plug-in unit byte code files after processing are converted into can perform in operating system Part, and the byte code files generation plug-in unit bag for packing executable.
In embodiments of the present invention, it is compiled in the source code for the plug-in application write to programming language, generates the plug-in unit After the byte code files of application, the processing strategy of plug-in unit processing is carried out to word to plug-in application based on specific plug-in framework Section code file is handled, the plug-in unit byte code files after being handled;Afterwards by the plug-in unit byte code files after processing The byte code files that can perform in operating system are converted into, and the byte code files generation plug-in unit bag for packing executable.Thus, originally Inventive embodiments can develop class that automatic modification is related in compilation process or method etc. in plug-in application, without developer's hand Dynamic modification, improve the efficiency of exploitation.Also, the source code for the plug-in application that the embodiment of the present invention can write to programming language is compiled Byte code files after translating are handled, and realize the plug-in unit of plug-in application, the source code without plug-in application, it is easy to accomplish, and It is workable.
The programming language referred in above step S102 can be Java, C++, Python etc., and it is suitable to use Programming language so that plug-in application can be run on an operating system.For example, if operating system is Android system, program Language can be Java language, so as to which the source code in the plug-in application write to Java language is compiled, the bytecode of generation File includes Class files.In addition, the byte code files of generation can also include Jar bags, Jar bags are by some Class files Obtained by packing.
In the alternative embodiment of the present invention, plug-in unitization processing is carried out to plug-in application using specific plug-in framework and is referred to Plug-in application is accessed into specific plug-in framework.Here specific plug-in framework can be RePlugin, and it is complete set , it is stable, be adapted to what is used comprehensively, account for hole class plug-in unit scheme, its main advantage has following several respects.
1) it is extremely flexible:Main program is without upgrading (without the fastener inserts in Manifest), you can supports newly-increased four Big component, or even brand-new plug-in unit.
2) it is highly stable:Hook points only have at one (Classloader).Its collapse rate is done to only " a ten thousandth ", and Perfect compatible nearly all Android ROM on the market.
3) characteristic is enriched:Support the nearly all characteristic when " single product " are developed, including static Receiver, Task- Affinity, self-defined Theme, process hole position, AppCompat etc..
4) process is any:Each component can be allowed to run in UI, reside, even " any hole position process ".
5) it is easily integrated:No matter plug-in unit or main program, only need " several rows " just can complete access.
6) freely isolate:Think isolation just isolation (plug-in unit that is such as unstable or accounting for resource, be easy to discharge), be not desired to the mould of isolation Block is just used with (such as various bases, UI plug-in units, all run in UI processes, excellent performance).
7) management is ripe:Possess mature and stable " plug-in management scheme ", support plug-in unit installation, upgrading, unloading, version pipe Reason, or even including process communication, protocol version, safety check etc..
The processing strategy for carrying out plug-in unit processing in above step S102 to plug-in application based on specific plug-in framework is right Byte code files are handled, and the embodiments of the invention provide a kind of optional scheme, in this scenario, can utilize operation system The processing strategy that the specified interface of system carries out specific plug-in framework to plug-in application plug-in unit processing is injected into compiling flow In;And then processing strategy is obtained from specified interface, and byte code files are handled.Here specified interface is operating system Allow before the byte code files (such as Class files) that compiling is completed change into executable byte code files (such as Dex files) The interface for the byte code files that operation compiling is completed.For example, when operating system is Android system, specified interface Transform Api interface.
That is, self-defined Transform links in the exploitation compilation process of plug-in application of the embodiment of the present invention, i.e., It is compiled in the source code for the plug-in application write to programming language, after the byte code files for generating the plug-in application, profit Specific plug-in framework is carried out to the processing plan of plug-in unit processing with the Transform api interfaces of operating system to plug-in application Slightly it is injected into compiling flow;And then processing strategy is obtained from specified interface, and byte code files are handled.
Further, the embodiment of the present invention should to plug-in unit by specific plug-in framework in the specified interface using operating system When being injected into the processing strategy for carrying out plug-in unit processing in compiling flow, there is provided a kind of optional scheme, in this scenario, The processing strategy that specific plug-in framework is carried out to plug-in unit processing to plug-in application splits into multiple injection tasks;Then, pin To each injecting task in multiple injection tasks, corresponding injector is generated;And then multiple injectors are injected separately into compiling In flow.Here injection task can include the parent of the Activity in plug-in application being revised as specific plug-in framework The specific parent of middle plugin library, and super is called and changed accordingly;LocalBroadcast in plug-in application is adjusted With the calling code that code revision is plugin library in specific plug-in framework;Code is called to repair the Provider in plug-in application It is changed to the calling code of plugin library in specific plug-in framework;By the function of the acquisition resource in plug-in application GetIdentifier parameter is revised as parameter of dynamic adaptation, etc., not limited to this of the embodiment of the present invention.
In actual applications, each injection task can correspond to corresponding injector, and above-mentioned injection task can be distinguished Corresponding following injector, will describe in detail respectively below.
(1) LoaderActivityInjector injectors, the injector is by the parent of the Activity in plug-in application The specific parent of plugin library in specific plug-in framework is revised as, and super is called and changed accordingly.Here, this hair The Activity for needing to replace can be stored in loaderActivityRules by bright embodiment.In addition, the embodiment of the present invention Activity that is being stated in AndroidManifest and not excluded by user configuration can be handled.After parent is changed, also Can change it is such in super call, otherwise super call can also point to modification before parent.
(2) LocalBroadcastInjector injectors, the injector is by the LocalBroadcast in plug-in application Call the calling code that code revision is plugin library in specific plug-in framework so that can be used between plug-in application and host LocalBroadcast communicates.
(3) Provider in plug-in application is called code revision by ProviderInjector injectors, the injector For the calling code of plugin library in specific plug-in framework.
(4) GetIdentifierInjector injectors, the injector is by the function of the acquisition resource in plug-in application GetIdentifier parameter is revised as the parameter of dynamic adaptation.Here, specifically by the 3rd of function getIdentifier Parameter is revised as plug-in unit bag name.
The present invention alternative embodiment in, from specified interface obtain processing strategy, and to byte code files at During reason, multiple injectors can be obtained from specified interface;Byte code files are scanned afterwards, and are utilized respectively multiple injectors to word Section code file is handled.
Further, the embodiment of the present invention can be based on Javassist class libraries instruments, be utilized respectively multiple injectors to word Section code file is handled.
A variety of implementation methods of the links of embodiment illustrated in fig. 1 are described above, a specific implementation will be passed through below Example come be discussed in detail the present invention plug-in application processing method implementation process.In this specific embodiment, with operating system Exemplified by Android system, Fig. 2 shows the process flow figure of plug-in application according to another embodiment of the present invention.Referring to figure 2, this method may comprise steps of S202 to step S208.
Step S202, the byte code files of plug-in application are obtained, the byte code files are the plug-in units write to programming language The source code of application is compiled generation.
In this step, programming language is Java language, and the source code for the plug-in application write to Java language is compiled, The byte code files of generation include Class files.In addition, the byte code files of generation can also include Jar bags, Jar bags be by What some Class files obtained by packing.
Step S204, using the byte code files of plug-in application as input, and multiple injectors are obtained from specified interface.
In this step, specified interface is the byte code files (such as Class files) that operating system allows to complete in compiling The interface for compiling the byte code files completed is operated before changing into executable byte code files (such as Dex files).For example, operation When system is Android system, specified interface is Transform api interfaces.
That is, self-defined Transform links in the exploitation compilation process of plug-in application of the embodiment of the present invention, i.e., It is compiled in the source code for the plug-in application write to programming language, after the byte code files for generating the plug-in application, profit Specific plug-in framework is carried out to the processing plan of plug-in unit processing with the Transform api interfaces of operating system to plug-in application Slightly it is injected into compiling flow, so as to obtain processing strategy from specified interface, and byte code files is handled.
In embodiments of the present invention, the processing strategy for specific plug-in framework being carried out to plug-in unit processing to plug-in application is torn open It is divided into multiple injection tasks;Then, for each injecting task in multiple injection tasks, corresponding injector is generated;And then will Multiple injectors are injected separately into compiling flow.Injector described herein can include LoaderActivityInjector Injector, LocalBroadcastInjector injectors, ProviderInjector injectors or GetIdentifierInjector injectors, etc., not limited to this of the embodiment of the present invention.
Step S206, byte code files are scanned, and be utilized respectively multiple injectors and byte code files are handled, obtained Plug-in unit byte code files after processing.
In an alternate embodiment of the invention, during byte code files modification, user configuration can be read first, such as need not The Activity of modification, it is not necessary to injector used etc..Then, ClassPool is initialized, you can to call InitClassPool () method, the class that addition refers to when compiling to ClassPool, while the record Class to be changed texts Part or Jar bags conveniently subsequently take these Class files and go to change to includeJars.Afterwards, all effective notes are traveled through Enter device, can exclude what user ignored here, and handle successively, so as to the plug-in unit byte code files after being handled.
In addition, the embodiment of the present invention can be based on Javassist class libraries instruments, multiple injectors are utilized respectively to bytecode File is handled.Java bytecode is stored in the form of binary in Class files, and each Class file includes One java class or interface, Javassist are exactly a class libraries for being used for handling Java bytecode.
Step S208, the bytecode text that the plug-in unit byte code files after processing are converted into can perform in operating system Part, and the byte code files generation plug-in unit bag for packing executable.
Above step S202 to step S208 can be inserted by the Gradle in specific plug-in framework RePlugin Part is realized, is the compiling duration in plug-in application, is injected into based on Transform API in compiling flow, then pass through Java Bytecode class libraries is modified to the Java bytecode file for compiling intermediate link, to realize that compiling duration dynamic modification plug-in unit should Purpose.
Fig. 3 shows the schematic diagram of on-the-flier compiler plug-in application, the i.e. source code in the plug-in application write to programming language It is compiled, after the byte code files (Class files) for generating plug-in application, based on specific plug-in framework to plug-in application The processing strategy for carrying out plug-in unit processing is handled byte code files, the plug-in unit byte code files after being handled (ReClass files), the plug-in unit byte code files after processing are converted into the bytecode text that can perform in operating system afterwards Part (Dex files), and the byte code files generation plug-in unit bag for packing executable.
It should be noted that in practical application, above-mentioned all optional embodiments can be any group by the way of combining Close, form the alternative embodiment of the present invention, this is no longer going to repeat them.
It is real based on same inventive concept, the present invention based on the processing method of the plug-in application that each embodiment provides above Apply example and additionally provide a kind of processing unit of plug-in application.
Fig. 4 shows the structural representation of the processing unit of plug-in application according to an embodiment of the invention.Such as Fig. 4 institutes Show, the device can at least include processing module 410, modular converter 420 and packetization module 430.
Now introduce the function and each several part of each composition or device of the processing unit of the plug-in application of the embodiment of the present invention Between annexation:
Processing module 410, suitable for being compiled in the source code for the plug-in application write to programming language, generate the plug-in unit After the byte code files of application, the processing of plug-in unit processing is carried out to the plug-in application based on the specific plug-in framework Strategy is handled the byte code files, the plug-in unit byte code files after being handled;
Modular converter 420, it is coupled with processing module 410, suitable for the plug-in unit byte code files after the processing are turned Change the byte code files that can perform in operating system into;
Packetization module 430, it is coupled with modular converter 420, suitable for packing, the executable byte code files generation is inserted Part bag.
It is described that plug-in unit processing is carried out to plug-in application using specific plug-in framework in the alternative embodiment of the present invention Refer to the plug-in application accessing the specific plug-in framework.
In the alternative embodiment of the present invention, as shown in figure 5, processing module 410 can include:
Injection unit 411, suitable for the specified interface using operating system by the specific plug-in framework to the plug-in unit It is injected into using the processing strategy for carrying out plug-in unit processing in compiling flow;
Processing unit 412, it is coupled with injection unit 411, suitable for obtaining the processing strategy from the specified interface, and The byte code files are handled.
In the alternative embodiment of the present invention, the injection unit 411 is further adapted for:
The specific plug-in framework is split into the processing strategy of plug-in application progress plug-in unit processing multiple Injection task;
For each injecting task in the multiple injection task, corresponding injector is generated;
The multiple injector is injected separately into compiling flow.
In the alternative embodiment of the present invention, the injection task includes following one of any:
The parent of Activity in the plug-in application is revised as to the spy of plugin library in the specific plug-in framework Determine parent, and super is called and changed accordingly;
It is to be inserted in the specific plug-in framework that LocalBroadcast in the plug-in application is called into code revision The calling code in part storehouse;
It is plugin library in the specific plug-in framework that Provider in the plug-in application is called into code revision Call code;
The function getIdentifier of acquisition resource in plug-in application parameter is revised as to the ginseng of dynamic adaptation Number.
In the alternative embodiment of the present invention, the processing unit 412 is further adapted for:
The multiple injector is obtained from the specified interface;
The byte code files are scanned, and is utilized respectively the multiple injector and the byte code files is handled.
In the alternative embodiment of the present invention, the processing unit 412 is further adapted for:
Based on Javassist class libraries instruments, it is utilized respectively the multiple injector and the byte code files is handled.
In the alternative embodiment of the present invention, if the operating system is Android system, the programming language is Java Language, the byte code files include Class files.
In the alternative embodiment of the present invention, if the operating system is Android system, the specified interface is Transform api interfaces.
According to the combination of any one above-mentioned alternative embodiment or multiple alternative embodiments, the embodiment of the present invention can reach Following beneficial effect:
In embodiments of the present invention, it is compiled in the source code for the plug-in application write to programming language, generates the plug-in unit After the byte code files of application, the processing strategy of plug-in unit processing is carried out to word to plug-in application based on specific plug-in framework Section code file is handled, the plug-in unit byte code files after being handled;Afterwards by the plug-in unit byte code files after processing The byte code files that can perform in operating system are converted into, and the byte code files generation plug-in unit bag for packing executable.Thus, originally Inventive embodiments can develop class that automatic modification is related in compilation process or method etc. in plug-in application, without developer's hand Dynamic modification, improve the efficiency of exploitation.Also, the source code for the plug-in application that the embodiment of the present invention can write to programming language is compiled Byte code files after translating are handled, and realize the plug-in unit of plug-in application, the source code without plug-in application, it is easy to accomplish, and It is workable.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description to the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor The application claims of shield features more more than the feature being expressly recited in each claim.It is more precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit requires, summary and accompanying drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation Replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in detail in the claims, embodiment claimed it is one of any Mode it can use in any combination.
The all parts embodiment of the present invention can be realized with hardware, or to be run on one or more processor Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that it can use in practice Microprocessor or digital signal processor (DSP) are realized in the processing unit of plug-in application according to embodiments of the present invention The some or all functions of some or all parts.The present invention is also implemented as being used to perform method as described herein Some or all equipment or program of device (for example, computer program and computer program product).Such reality The program of the existing present invention can store on a computer-readable medium, or can have the form of one or more signal. Such signal can be downloaded from internet website and obtained, and either be provided or in the form of any other on carrier signal There is provided.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of some different elements and being come by means of properly programmed computer real It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame Claim.
So far, although those skilled in the art will appreciate that detailed herein have shown and described multiple showing for the present invention Example property embodiment, still, still can be direct according to present disclosure without departing from the spirit and scope of the present invention It is determined that or derive many other variations or modifications for meeting the principle of the invention.Therefore, the scope of the present invention is understood that and recognized It is set to and covers other all these variations or modifications.
One side according to the embodiment of the present invention, there is provided a kind of processing methods of plug-in application of A1., refer to suitable for using Determine the situation that plug-in unit framework carries out plug-in unit processing to plug-in application, methods described includes:
It is compiled in the source code for the plug-in application write to programming language, generates the byte code files of the plug-in application Afterwards, the processing strategy of plug-in unit processing is carried out to the bytecode to the plug-in application based on the specific plug-in framework File is handled, the plug-in unit byte code files after being handled;
The byte code files that plug-in unit byte code files after the processing are converted into can perform in operating system, and beat Wrap the executable byte code files generation plug-in unit bag.
A2. the method according to A1, wherein, it is described that plug-in application is carried out at plug-in unit using specific plug-in framework Reason refers to the plug-in application accessing the specific plug-in framework.
A3. the method according to A1 or A2, wherein, the plug-in application is carried out based on the specific plug-in framework The processing strategy of plug-in unitization processing is handled the byte code files, including:
The specific plug-in framework is carried out at plug-in unit to the plug-in application using the specified interface of operating system The processing strategy of reason is injected into compiling flow;
The processing strategy is obtained from the specified interface, and the byte code files are handled.
A4. the method according to A3, wherein, using the specified interface of operating system by the specific plug-in framework pair The processing strategy that the plug-in application carries out plug-in unit processing is injected into compiling flow, including:
The specific plug-in framework is split into the processing strategy of plug-in application progress plug-in unit processing multiple Injection task;
For each injecting task in the multiple injection task, corresponding injector is generated;
The multiple injector is injected separately into compiling flow.
A5. the method according to A4, wherein, the injection task includes following one of any:
The parent of Activity in the plug-in application is revised as to the spy of plugin library in the specific plug-in framework Determine parent, and super is called and changed accordingly;
It is to be inserted in the specific plug-in framework that LocalBroadcast in the plug-in application is called into code revision The calling code in part storehouse;
It is plugin library in the specific plug-in framework that Provider in the plug-in application is called into code revision Call code;
The function getIdentifier of acquisition resource in plug-in application parameter is revised as to the ginseng of dynamic adaptation Number.
A6. the method according to A4 or A5, wherein, the processing strategy is obtained from the specified interface, and to described Byte code files are handled, including:
The multiple injector is obtained from the specified interface;
The byte code files are scanned, and is utilized respectively the multiple injector and the byte code files is handled.
A7. the method according to A6, wherein, be utilized respectively the multiple injector to the byte code files at Reason, including:
Based on Javassist class libraries instruments, it is utilized respectively the multiple injector and the byte code files is handled.
A8. the method according to any one of A1-A7, wherein, if the operating system is Android system, the volume Cheng Yuyan is Java language, and the byte code files include Class files.
A9. the method according to any one of A3-A7, wherein, it is described to specify if the operating system is Android system Interface is Transform api interfaces.
According to the another aspect of the embodiment of the present invention, a kind of processing units of plug-in application of B10. are additionally provided, are applied to The situation of plug-in unit processing is carried out to plug-in application using specific plug-in framework, described device includes:
Processing module, suitable for being compiled in the source code for the plug-in application write to programming language, generating the plug-in unit should After byte code files, the processing plan of plug-in unit processing is carried out to the plug-in application based on the specific plug-in framework Slightly the byte code files are handled, the plug-in unit byte code files after being handled;
Modular converter, suitable for the word for being converted into can perform in operating system by the plug-in unit byte code files after the processing Save code file;
Packetization module, suitable for packing, the executable byte code files generate plug-in unit bag.
B11. the device according to B10, wherein, it is described that plug-in unit is carried out to plug-in application using specific plug-in framework Processing refers to the plug-in application accessing the specific plug-in framework.
B12. the device according to B10 or B11, wherein, the processing module includes:
Injection unit, suitable for the specified interface using operating system by the specific plug-in framework to the plug-in application The processing strategy for carrying out plug-in unit processing is injected into compiling flow;
Processing unit, suitable for from the specified interface obtain it is described processing strategy, and to the byte code files at Reason.
B13. the device according to B12, wherein, the injection unit is further adapted for:
The specific plug-in framework is split into the processing strategy of plug-in application progress plug-in unit processing multiple Injection task;
For each injecting task in the multiple injection task, corresponding injector is generated;
The multiple injector is injected separately into compiling flow.
B14. the device according to B13, wherein, the injection task includes following one of any:
The parent of Activity in the plug-in application is revised as to the spy of plugin library in the specific plug-in framework Determine parent, and super is called and changed accordingly;
It is to be inserted in the specific plug-in framework that LocalBroadcast in the plug-in application is called into code revision The calling code in part storehouse;
It is plugin library in the specific plug-in framework that Provider in the plug-in application is called into code revision Call code;
The function getIdentifier of acquisition resource in plug-in application parameter is revised as to the ginseng of dynamic adaptation Number.
B15. the device according to B13 or B14, wherein, the processing unit is further adapted for:
The multiple injector is obtained from the specified interface;
The byte code files are scanned, and is utilized respectively the multiple injector and the byte code files is handled.
B16. the device according to B15, wherein, the processing unit is further adapted for:
Based on Javassist class libraries instruments, it is utilized respectively the multiple injector and the byte code files is handled.
B17. the device according to any one of B10-B16, wherein, if the operating system is Android system, institute It is Java language to state programming language, and the byte code files include Class files.
B18. the device according to any one of B12-B16, wherein, it is described if the operating system is Android system Specified interface is Transform api interfaces.

Claims (10)

  1. A kind of 1. processing method of plug-in application, suitable for carrying out plug-in unit processing to plug-in application using specific plug-in framework Situation, methods described includes:
    Be compiled in the source code for the plug-in application write to programming language, generate the plug-in application byte code files it Afterwards, the processing strategy of plug-in unit processing is carried out to the plug-in application based on the specific plug-in framework to bytecode text Part is handled, the plug-in unit byte code files after being handled;
    The byte code files that plug-in unit byte code files after the processing are converted into can perform in operating system, and institute of packing State executable byte code files generation plug-in unit bag.
  2. 2. the method according to claim 11, wherein, it is described that plug-in unit is carried out to plug-in application using specific plug-in framework Processing refers to the plug-in application accessing the specific plug-in framework.
  3. 3. method according to claim 1 or 2, wherein, the plug-in application is entered based on the specific plug-in framework The processing strategy of row plug-in unitization processing is handled the byte code files, including:
    The specific plug-in framework is subjected to plug-in unit processing to the plug-in application using the specified interface of operating system Processing strategy is injected into compiling flow;
    The processing strategy is obtained from the specified interface, and the byte code files are handled.
  4. 4. according to the method for claim 3, wherein, using the specified interface of operating system by the specific plug-in framework The processing strategy that plug-in unit processing is carried out to the plug-in application is injected into compiling flow, including:
    The processing strategy that the specific plug-in framework is carried out to plug-in unit processing to the plug-in application splits into multiple injections Task;
    For each injecting task in the multiple injection task, corresponding injector is generated;
    The multiple injector is injected separately into compiling flow.
  5. 5. according to the method for claim 4, wherein, the injection task includes following one of any:
    The parent of Activity in the plug-in application is revised as to the particular parent of plugin library in the specific plug-in framework Class, and super is called and changed accordingly;
    It is plugin library in the specific plug-in framework that LocalBroadcast in the plug-in application is called into code revision Calling code;
    Provider in the plug-in application is called into the calling that code revision is plugin library in the specific plug-in framework Code;
    The function getIdentifier of acquisition resource in plug-in application parameter is revised as to the parameter of dynamic adaptation.
  6. 6. the method according to claim 4 or 5, wherein, the processing strategy is obtained from the specified interface, and to described Byte code files are handled, including:
    The multiple injector is obtained from the specified interface;
    The byte code files are scanned, and is utilized respectively the multiple injector and the byte code files is handled.
  7. 7. according to the method for claim 6, wherein, it is utilized respectively the multiple injector and the byte code files is carried out Processing, including:
    Based on Javassist class libraries instruments, it is utilized respectively the multiple injector and the byte code files is handled.
  8. 8. according to the method any one of claim 1-7, wherein, it is described if the operating system is Android system Programming language is Java language, and the byte code files include Class files.
  9. 9. according to the method any one of claim 3-7, wherein, if the operating system is Android system, the finger Stationary interface is Transform api interfaces.
  10. A kind of 10. processing unit of plug-in application, suitable for being carried out using specific plug-in framework to plug-in application at plug-in unit The situation of reason, described device include:
    Processing module, suitable for being compiled in the source code for the plug-in application write to programming language, generate the plug-in application After byte code files, the processing strategy for carrying out plug-in unit processing to the plug-in application based on the specific plug-in framework is right The byte code files are handled, the plug-in unit byte code files after being handled;
    Modular converter, suitable for the bytecode for being converted into can perform in operating system by the plug-in unit byte code files after the processing File;
    Packetization module, suitable for packing, the executable byte code files generate plug-in unit bag.
CN201710750604.1A 2017-08-28 2017-08-28 A kind of processing method and processing device of plug-in application Pending CN107577456A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710750604.1A CN107577456A (en) 2017-08-28 2017-08-28 A kind of processing method and processing device of plug-in application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710750604.1A CN107577456A (en) 2017-08-28 2017-08-28 A kind of processing method and processing device of plug-in application

Publications (1)

Publication Number Publication Date
CN107577456A true CN107577456A (en) 2018-01-12

Family

ID=61029589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710750604.1A Pending CN107577456A (en) 2017-08-28 2017-08-28 A kind of processing method and processing device of plug-in application

Country Status (1)

Country Link
CN (1) CN107577456A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334784A (en) * 2018-02-02 2018-07-27 杭州迪普科技股份有限公司 A kind of vulnerability scanning method and apparatus
CN108399080A (en) * 2018-03-05 2018-08-14 深圳市华讯方舟软件信息有限公司 A kind of hot update methods of Android App
CN111176663A (en) * 2019-12-20 2020-05-19 北京字节跳动网络技术有限公司 Data processing method, device and equipment of application program and storage medium
CN111290760A (en) * 2020-03-03 2020-06-16 北京字节跳动网络技术有限公司 Application program compiling method and device, electronic equipment and storage medium
CN111427584A (en) * 2020-04-14 2020-07-17 北京达佳互联信息技术有限公司 Method, device and equipment for generating executable file
CN111435312A (en) * 2019-01-15 2020-07-21 北京嘀嘀无限科技发展有限公司 Application program management method and device and electronic equipment
CN112114810A (en) * 2020-08-13 2020-12-22 浙江大搜车融资租赁有限公司 Compiling processing method and device
CN113253999A (en) * 2021-06-24 2021-08-13 北京顶象技术有限公司 Plug-in data access method, data source management system and interface access method

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334784A (en) * 2018-02-02 2018-07-27 杭州迪普科技股份有限公司 A kind of vulnerability scanning method and apparatus
CN108399080A (en) * 2018-03-05 2018-08-14 深圳市华讯方舟软件信息有限公司 A kind of hot update methods of Android App
CN111435312A (en) * 2019-01-15 2020-07-21 北京嘀嘀无限科技发展有限公司 Application program management method and device and electronic equipment
CN111435312B (en) * 2019-01-15 2023-09-29 北京嘀嘀无限科技发展有限公司 Application program management method and device and electronic equipment
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
CN111290760A (en) * 2020-03-03 2020-06-16 北京字节跳动网络技术有限公司 Application program compiling method and device, electronic equipment and storage medium
CN111290760B (en) * 2020-03-03 2023-03-31 北京字节跳动网络技术有限公司 Application program compiling method and device, electronic equipment and storage medium
CN111427584A (en) * 2020-04-14 2020-07-17 北京达佳互联信息技术有限公司 Method, device and equipment for generating executable file
CN112114810A (en) * 2020-08-13 2020-12-22 浙江大搜车融资租赁有限公司 Compiling processing method and device
CN113253999A (en) * 2021-06-24 2021-08-13 北京顶象技术有限公司 Plug-in data access method, data source management system and interface access method
CN113253999B (en) * 2021-06-24 2021-11-05 北京顶象技术有限公司 Plug-in data access method, data source management system and interface access method

Similar Documents

Publication Publication Date Title
CN107577456A (en) A kind of processing method and processing device of plug-in application
US20210303588A1 (en) Dynamic Field Data Translation to Support High Performance Stream Data Processing
US20210073015A1 (en) Java native interface and windows universal app hooking
US11106437B2 (en) Lookup table optimization for programming languages that target synchronous digital circuits
US20080147698A1 (en) Data schemata in programming language contracts
CA2192049C (en) Process for manipulating data models used in software engineering
US8924944B2 (en) Implementation of distributed methods that support generic functions
CN103809974B (en) It is a kind of to apply the method, apparatus audited automatically and Cloud Server
CN105204916B (en) Project process operation method and device based on environmental variance
CN105022936A (en) Class file encryption and decryption method and class file encryption and decryption device
US20200225920A1 (en) Generating synchronous digital circuits from source code constructs that map to circuit implementations
US20200226228A1 (en) Language and compiler that generate synchronous digital circuits that maintain thread execution order
CN106708571A (en) Resource file loading method and device and source file reinforcing method and device
CN103678961A (en) Code dynamic generating method
CN109933350A (en) The method, apparatus and electronic equipment of embedded code in the application
CN109598107A (en) A kind of code conversion method and device based on application installation package file
CN108133126B (en) Android application reinforcing method and device
CN109614772A (en) Code conversion method and device based on application installation package file
CN105630671A (en) Code coverage rate report generation method and device
EP2626784A1 (en) Method and apparatus for automated MATLAB interfacing
KR102141749B1 (en) APP program execution method and device
Kuhn et al. FAME, a polyglot library for metamodeling at runtime
US20130111432A1 (en) Validation of a system model including an activity diagram
CN114840195B (en) Privatization method for iOS SDK static library
US20230325476A1 (en) Obfuscation device, obfuscation method, and obfuscation program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180112

RJ01 Rejection of invention patent application after publication