CN106095502A - Hot restorative procedure, device, server and the system of a kind of Android application - Google Patents

Hot restorative procedure, device, server and the system of a kind of Android application Download PDF

Info

Publication number
CN106095502A
CN106095502A CN201610411014.1A CN201610411014A CN106095502A CN 106095502 A CN106095502 A CN 106095502A CN 201610411014 A CN201610411014 A CN 201610411014A CN 106095502 A CN106095502 A CN 106095502A
Authority
CN
China
Prior art keywords
android
class file
application
service packs
appointment
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
CN201610411014.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
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201610411014.1A priority Critical patent/CN106095502A/en
Publication of CN106095502A publication Critical patent/CN106095502A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • 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
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

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

Abstract

The invention discloses hot restorative procedure, device, server and the system of a kind of Android application.The method includes: obtain the service packs specifying Android application, and described service packs includes the class file specified after specifying the reparation in Android application;When specifying Android application to start, load described service packs;When specifying Android application to need to call the class file specified, from described service packs, call the class file specified after reparation to perform corresponding function.Understand, this programme is compared with prior art, this repair process without experience publisher repack appointment Android application, test, change bag to each application market and channel, prompting customer upgrade, prompting user download, utilize newly installed cladding lid to install the appointment series of steps such as Android application, on the basis of not changing the application of former Android, utilize a service packs can realize the hot repair of Android application again, significantly reduce the rehabilitation cost of Android application.

Description

Hot restorative procedure, device, server and the system of a kind of Android application
Technical field
The present invention relates to Internet technical field, be specifically related to the hot restorative procedure of a kind of Android application, device, server And system.
Background technology
In prior art, when an Android is applied after issuing, catch sight of in the application of this Android and serious problems occur Needing to carry out emergency repair, at this time exploitation side will hurry badly battered: needs to repair the application of this Android, will repair After Android application entirety be packaged into Android application installation kit, Android application installation kit is tested, test by backward respectively Individual application market and channel change bag, point out customer upgrade, and prompting user downloads the Android application installation kit after reparation, to this reparation After Android application installation kit carry out installing covering the application of preprosthetic Android;Sometimes it is only used to revise a line generation Code, also to pay huge cost and carry out changing bag and again issuing;And for a user, the liter repeatedly of a Android application Level, the process re-downloading installation also will be substantially reduced the experience of user.
Summary of the invention
In view of the above problems, it is proposed that the present invention in case provide one overcome the problems referred to above or at least in part solve on State hot restorative procedure, device, server and the system of the Android application of problem.
According to one aspect of the present invention, it is provided that the hot restorative procedure of a kind of Android application, the method includes:
Obtaining the service packs specifying Android application, described service packs includes: specify the finger after the reparation in Android application Fixed class file;
When specifying Android application to start, load described service packs;
When specifying Android application to need to call the class file specified, from described service packs, call specifying after reparation Class file is to perform corresponding function.
Alternatively, load described service packs to include:
According to the file directory at described service packs place, construct Classloader, load described patch by this Classloader Bag.
Alternatively, the described service packs of described loading also includes:
Obtaining the first loading set that the process that loads described service packs is corresponding, described service packs is that this first adds Carry the only element in set;
Obtain the second loading set corresponding to the process specifying each execution file in Android application to load, it is intended that Each file that performs in Android application is the element in this second loading set;
Load set by first and the second loading set is merged into one and loaded set so that described service packs adds as this Carry first element in set.
Alternatively, described when specifying Android application to need to call the class file specified, call from described service packs and repair The class file specified after Fu includes to perform corresponding function:
When specify Android application need to call a class file time, according to described load set order of elements, successively from The class file called required for searching in each element;
If finding the class file needing to call, stopping searching, directly invoking this class file and performing corresponding function;
If not finding the class file needing to call, jumping to next element and searching the class file needing to call, directly To finding.
Alternatively, the method farther includes:
Before specifying Android application to start, obtain a third party and perform file, this third party is performed file and puts into Specify in the specified file catalogue of Android application;In each Miscellaneous Documents performed in file specifying Android application, injection refers to Show that this class file performs, to described third party, the code that file is quoted;
When specifying Android application to start, first load described third party's file, reload and specify respectively holding in Android application Style of writing part.
Alternatively, described in each Miscellaneous Documents performed in file specifying Android application, inject and indicate this class file Described third party performs the code that file quotes include:
One Exclude Lists is set;
Obtain each class file specified in Android application, it is judged that whether this class file hits described Exclude Lists, if No, inject in this class file and indicate this class file that described third party is performed the code that file is quoted;If it is, do not exist Injecting codes in this class file.
Alternatively, described Exclude Lists includes:
The offspring class file of the Application class file in specifying Android to apply.
Alternatively, the class file specified after the reparation in described service packs does not include the class literary composition in described Exclude Lists Part.
Alternatively, the class file specified after each reparation in described service packs includes: specifying after this reparation The identification information of class file;
Before then the class file specified after calling reparation from described service packs performs corresponding function, the method enters one Step includes: whether judge the identification information of the identification information of the class file specified after this reparation and the corresponding class file specified Identical, it is to call the class file specified after this reparation, otherwise stop the class file specifying after calling this reparation.
Alternatively, the class file specified after each reparation in described service packs includes: specifying after this reparation The description information that class file is applied about Android;
Before then the class file specified after calling reparation from described service packs performs corresponding function, the method enters one Step includes: judge the description information that the class file specified after specifying Android application whether to meet this reparation is applied about Android, It is to call the class file specified after this reparation, otherwise stop the class file specifying after calling this reparation.
Alternatively, described service packs generates and is issued to this locality at server.
Alternatively, the method farther includes:
If collapsed in specifying Android application Preset Time upon actuation, unload described service packs.
According to another aspect of the present invention, it is provided that the hot restorative procedure of a kind of Android application, the method includes:
Generate the appointment Android application after repairing, obtain the Miscellaneous Documents in the appointment Android application after repairing;
Retain the application of preprosthetic appointment Android, obtain the Miscellaneous Documents in the application of preprosthetic appointment Android;
The Miscellaneous Documents in the application of appointment Android after repairing and the Miscellaneous Documents in the application of preprosthetic appointment Android Compare;
For each class file, if the content of this class file changes before and after repairing, then this class file is for specifying Class file;
Each repaired class file specified is put in patch file, generates service packs;
Described service packs is issued to client, client loads described service packs with to specifying Android application to repair Multiple.
Alternatively, if the class file in the application of preprosthetic appointment Android is obscured, then the method is wrapped further Include: retain the class file in the application of preprosthetic appointment Android obscures mapping relations;
Described will repair after the application of appointments Android in the application of Miscellaneous Documents and preprosthetic appointment Android in all kinds of File compares and includes:
For each class file in the appointment Android application after repairing, obscure mapping relations according to described, determine correspondence The application of preprosthetic appointment Android in class file, compare whether the content of class file changes before and after repairing.
Alternatively, if the content of each class file in the application of preprosthetic appointment Android represents with MD5 value, the method Farther include: the MD5 value of the content of each class file in the application of appointment Android after calculating reparation;
The most described will repair after the application of appointments Android in the application of Miscellaneous Documents and preprosthetic appointment Android in each Class file compares and includes: for each class file in the appointments Android application after repairing, by the MD5 value of this class file and The MD5 value of the class file in the application of corresponding preprosthetic appointment Android compares.
According to having it is still another aspect of the present invention to provide the hot repair apparatus for coating that a kind of Android is applied, this device includes:
Acquiring unit, is suitable to obtain the service packs specifying Android application, and described service packs includes: specify in Android application Reparation after the class file specified;
Loading unit, is suitable to, when specifying Android application to start, load described service packs;
Call unit, is suitable to, when specifying Android application to need to call the class file specified, call from described service packs The class file specified after reparation is to perform corresponding function.
Alternatively, described loading unit, be suitable to the file directory according to described service packs place, construct Classloader, logical Cross this Classloader and load described service packs.
Alternatively, described loading unit, it is further adapted for obtaining corresponding first the adding of process that described service packs is loaded Carrying set, described service packs is the only element in this first loading set;Obtain to specify Android application in respectively perform literary composition Part carries out the second loading set that the process that loads is corresponding, it is intended that it is that this second loads set that each in Android application performs file In element;Load set by first and the second loading set is merged into one and loaded set so that described service packs is as this Load first element in set.
Alternatively, described call unit, be suitable to, when specifying Android application to need to call a class file, add according to described Carry the order of elements of set, the class file called required for lookup from each element successively;If finding what needs called Class file, stops searching, and directly invokes this class file and performs corresponding function;If not finding the class file needing to call, jump Forward next element to and search the class file needing to call, till finding.
Alternatively, this device farther includes: pretreatment unit;
Pretreatment unit, is suitable to, before specifying Android application to start, obtain a third party and perform file, by the 3rd Fang Zhihang file is put in the specified file catalogue specifying Android application;Specify Android application each perform in file all kinds of In file, inject and indicate this class file that described third party is performed the code that file is quoted;
Described loading unit, is further adapted for, when specifying Android application to start, first loading described third party's file, then adding Carry specify Android application in respectively perform file.
Alternatively, described pretreatment unit, be suitable to arrange an Exclude Lists;Obtain each class specified in Android application File, it is judged that whether this class file hits described Exclude Lists, indicates this class file to institute if it does not, inject in this class file State third party and perform the code that file carries out quoting;If it is, not injecting codes in this class file.
Alternatively, described Exclude Lists includes:
The offspring class file of the Application class file in specifying Android to apply.
Alternatively, the class file specified after the reparation in described service packs does not include the class literary composition in described Exclude Lists Part.
Alternatively, the class file specified after each reparation in described service packs includes: specifying after this reparation The identification information of class file;
The most described call unit, is further adapted for the class file specified after calling reparation from described service packs and performs Before corresponding function, it is judged that the identification information of the class file specified after this reparation is believed with the mark of the corresponding class file specified Cease the most identical, be, call the class file specified after this reparation, otherwise stop the class file specifying after calling this reparation.
Alternatively, the class file specified after each reparation in described service packs includes: specifying after this reparation The description information that class file is applied about Android;
The most described call unit, is further adapted for the class file specified after calling reparation from described service packs and performs Before corresponding function, it is judged that the description that the class file specified after specifying Android application whether to meet this reparation is applied about Android Information, is to call the class file specified after this reparation, otherwise stop the class file specifying after calling this reparation.
Alternatively, described service packs generates and is issued to this locality at server.
Alternatively, this device farther includes:
Unloading unit, is suitable to, when there is collapse in specifying Android application Preset Time upon actuation, unload described benefit Fourth bag.
According to another aspect of the invention, it is provided that the hot remediation server of a kind of Android application, this server includes:
Repair process unit, is suitable to the appointment Android application generated after repairing, obtains in the appointment Android application after repairing Miscellaneous Documents;And be suitable to retain the application of preprosthetic appointment Android, obtain in the application of preprosthetic appointment Android is all kinds of File;
Service packs signal generating unit, the Miscellaneous Documents be suitable in the appointment Android application after repairing specifies peace with preprosthetic Miscellaneous Documents in Zhuo Yingyong compares;For each class file, if the content of this class file becomes before and after repairing Change, then this class file is the class file specified;Each repaired class file specified is put in patch file, generates patch Bag;
Service packs issues unit, is suitable to described service packs is issued to client, by client load described service packs with Repair specifying Android application.
Alternatively, described repair process unit, the class file being further adapted in preprosthetic appointment Android is applied enters Having gone when obscuring, retain the class file in the application of preprosthetic appointment Android obscures mapping relations;
Described service packs signal generating unit, is suitable to for each class file in the appointment Android application after repairing, according to institute Stating and obscure mapping relations, determine the class file in the preprosthetic appointment Android application of correspondence, the content comparing class file is being repaiied Whether change before and after Fu.
Alternatively, described repair process unit, each class literary composition being further adapted in preprosthetic appointment Android is applied When the content of part represents with MD5 value, the MD5 value of the content of each class file in the application of appointment Android after calculating reparation;
Described service packs signal generating unit, is suitable to for each class file in the appointment Android application after repairing, by such The MD5 value of file compares with the MD5 value of the class file in the application of corresponding preprosthetic appointment Android.
According to another aspect of the invention, it is provided that the hot repair complex system of a kind of Android application, this system includes: as above Device described in any one, and, the as above server described in any one.
As shown in the above, when specifying the class file specified in Android application to go wrong to need to be repaired, foundation The technical scheme that the present invention provides, directly obtains the patch of the class file specified after comprising the reparation specified in Android application Bag, when Android application needs to call the class file specified, calls the class the specified literary composition after corresponding reparation from this service packs Part, it is achieved that it is properly functioning that Android is applied.Compared with prior art, this repair process repacks finger without experiencing publisher The application of Dingan County Zhuo, test, change to each application market and channel bag, prompting customer upgrade, prompting user's download, utilize newly installed Cladding lid installs series of steps such as specifying Android application, on the basis of not changing the application of former Android, utilizes a service packs The hot repair that can realize Android application is multiple, significantly reduces the rehabilitation cost of Android application, and repair process user's unaware, Both meet exploitation demand, also comply with user's request.
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 description, and in order to allow above and other objects of the present invention, the feature and advantage can Become apparent, below especially exemplified by the detailed description of the invention of the present invention.
Accompanying drawing explanation
By reading the detailed description of hereafter preferred implementation, various other advantage and benefit common for this area Technical staff will be clear from understanding.Accompanying drawing is only used for illustrating the purpose of preferred implementation, and is not considered as the present invention Restriction.And in whole accompanying drawing, it is denoted by the same reference numerals identical parts.In the accompanying drawings:
Fig. 1 shows the flow chart of the hot restorative procedure that a kind of Android applies;
Fig. 2 shows the flow chart of the hot restorative procedure that a kind of Android applies;
Fig. 3 shows the schematic diagram of the hot repair apparatus for coating that a kind of Android applies;
Fig. 4 shows the schematic diagram of the hot repair apparatus for coating that a kind of Android applies
Fig. 5 shows the schematic diagram of the hot remediation server that a kind of Android applies
Fig. 6 shows the schematic diagram of the hot repair complex system that a kind of Android applies.
Detailed description of the invention
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although accompanying drawing shows the disclosure Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure and should be by embodiments set forth here Limited.On the contrary, it is provided that these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure Complete conveys to those skilled in the art.
Fig. 1 shows the flow chart of the hot restorative procedure that a kind of Android applies, from visitor Side, family illustrates the implementation process of this programme.As it is shown in figure 1, the method includes:
Step S110, obtains the service packs specifying Android application, and described service packs includes: specify repairing in Android application The class file specified after Fu.
Step S120, when specifying Android application to start, loads described service packs.
Step S130, when specifying Android application to need to call the class file specified, calls reparation from described service packs After the class file specified to perform corresponding function.
Visible, when specifying the class file specified in Android application to go wrong to need to be repaired, according to the side shown in Fig. 1 Method, directly obtains the service packs of the class file specified after comprising the reparation specified in Android application, when Android application needs to adjust During with the class file specified, from this service packs, call the class file specified after corresponding reparation, it is achieved that Android application Properly functioning.Compared with prior art, this repair process without experience publisher repack appointment Android application, test, to Each application market and channel change bag, prompting customer upgrade, prompting user download, utilize newly installed cladding lid install specify Android The series of steps such as application, on the basis of not changing the application of former Android, in the way of patch, the application of dynamic restoring Android is tight Anxious problem, significantly reduces the rehabilitation cost of Android application.
In one embodiment of the invention, step S120 loads described service packs to include: according to described service packs institute File directory, construct Classloader, by this Classloader load described service packs.Such as, it is intended that in Android application There is leak in certain class file a.class specified performed in file, for repairing this leak, obtains the benefit specifying Android application Fourth bag patch.dex, this patch.dex include repaired after the class file a.class specified, construct Classloader ClassLoader, by DexClassLoader object, loads by service packs patch.dex.
After service packs is loaded, in order to allow this service packs play the function of dynamic restoring, this programme to be specified When Android application needs to call the class file specified, it is ensured that specify Android application call is the class the specified literary composition in service packs Part, and never call the class file specified specified in Android application in original execution file.For realizing this purpose, need reason The operation principle of solution Android system:
In Android system, Classloader can load multiple execution file, the added multiple execution carried of this Classloader File arrangements becomes an orderly loading set, and the added each execution file carried of this Classloader is the equal of this loading set In an element, when different during this loads set perform the class file having repetition in file, when needs call this During class file, the class file that system meeting prioritizing selection loads in the order preceding execution file in set calls.Foundation This principle, so that the class file specified in service packs is preferred and calls, the service packs after loading should occupy phase The preceding element position of sequence loaded in set answered.
Therefore, on the basis of above-described embodiment, further, step S120 loads described service packs also to include: obtain Taking the first loading set that the process loading described service packs is corresponding, described service packs is in this first loading set Only element;Obtain the second loading set corresponding to the process specifying each execution file in Android application to load, refer to Each file that performs in Dingan County's Zhuo application is the element in this second loading set;Load set and second by first and load set Merge into one and load set so that described service packs is as first element in this loading set.Such as, to service packs The first loading collection that patch.dex carries out the process that loads corresponding is combined into subordinate ordered array dexElements1:{patch.dex}, Service packs patch.dex comprises the a.class after reparation, adds specifying each original execution file in Android application Second loading collection corresponding to the process that carries is combined into subordinate ordered array dexElements2:{classes1.dex, classes2.dex, Classes3.dex ... }, classes2.dex wherein comprises original a.class not repaired, subordinate ordered array DexElements2 has i.e. loaded specifying Android application to start when;Getting service packs patch.dex and carrying out After loading, subordinate ordered array dexElements1 and subordinate ordered array dexElements2 are merged into one and load set so that First element that service packs patch.dex gathers as this loading, i.e. loads collection and is combined into: patch.dex, Classes1.dex, classes2.dex, classes3.dex ... }, Android system can call by prioritizing selection the most when needed A.class in patch.dex replaces calling the a.class in classes2.dex.Wherein, specifically, can be in order to By calling DexUtils.injectDexAtFirst () method, service packs is inserted into loading with the reflex mechanism of Android system The foremost of set dexElements.
Then step S130 of method shown in Fig. 1 is when specifying Android application to need to call the class file specified, from described benefit Fourth bag calls the class file specified after reparation and includes to perform corresponding function: need to call a class when specifying Android application During file, according to the described order of elements loading set, the class file called required for lookup from each element successively;If Find the class file needing to call, stop searching, directly invoke this class file and perform corresponding function;If not finding needs The class file called, jumps to next element and searches the class file needing to call, till finding.Such as, in utilization Literary composition example in build loading set patch.dex, classes1.dex, classes2.dex, classes3.dex ... }, Specify Android to apply in running, when needs call a class file, the order of elements gathered according to this loading, first from Patch.dex searches the class file needing to call, does not finds, then from classes1.dex, search the class needing to call File, by that analogy, until finding, stops searching;When specifying Android application to need to call a.class, add with current Carry the order of set, after all first begin look for a.class from patch.dex, it is ensured that the class file quilt after the reparation in service packs Call.
According to above-mentioned embodiment, this programme is bundled to a dex by specifying the class file gone wrong in Android application In file, obtain a service packs patch.dex, by loading, reflecting, this patch.dex is inserted into ClassLoader pair The foremost loading set answered.In a specific embodiment, when class a.class specified called in service packs time Wait, it is intended that the operation of Android application goes wrong, and reason is: specify Android application call original execution file B.class in classes2.dex, owing to b.class refer to a.class, then specifies Android application to need to call further A.class, is now positioned at before loading set due to service packs, then directly invoke in service packs patch.dex is repaired After a.class, wherein, b.class refer to a.class, b.class in classes2.dex, and a.class exists In patch.dex, it is intended that the execution file at two class file places with adduction relationship of Android application call differs, peace Tall and erect system reports an error, malloc failure malloc.For solving this problem, this programme have extensively studied the operating mechanism of Android system, finds: Android Applying when calling class file, Android system is to the execution file at the invoked class file place with adduction relationship whether phase With the premise carrying out checking it is: if person who quote (b.class in example the most above) this class has been labeled with CLASS_ ISPREVERIFIED identifies, then whether the class file that this class file is cited with it will be held by Android system same Style of writing part checks.
But this CLASS_ISPREVERIFIED mark is when specifying Android application to start, Android system is to specifying peace Class file in tall and erect system is the most all quoted and is stamped after the class file in same execution file verifies, the most not Yes meets this verification condition for the class file with adduction relationship in the Android application of variation, the most all will be labeled with CLASS_ISPREVERIFIED identifies.Then in order to avoid reporting an error when specifying the class file in Android application call service packs, In one embodiment of the present of invention, when will prevent specifying Android application to start, Miscellaneous Documents is labeled with CLASS_ ISPREVERIFIED identifies, and the method shown in Fig. 1 farther includes:
Before specifying Android application to start, obtain a third party and perform file, this third party is performed file and puts into Specify in the specified file catalogue of Android application;In each Miscellaneous Documents performed in file specifying Android application, injection refers to Show that this class file performs, to described third party, the code that file is quoted;When specifying Android application to start, first load described Third party's file, reload specify Android application in respectively perform file.Such as, obtain a third party and perform file Hack.dex, it can be empty realization that this third party performs file, and this hack.dex puts into the specified file specifying Android application In catalogue, inside the constructed fuction of all class files specifying Android application, all inject one section of code, this section of code instruction class Hack.dex is quoted by file, when specifying Android application to start, first passes through and calls loadPatch method by hack.dex Dynamic load is come in, reload specify Android application respectively perform file, so, when Android system carries out starting verification, often Individual class file has adduction relationship to hack.dex, hack.dex but with Miscellaneous Documents not in same execution file, therefore, all kinds of File does not meets verification condition, will not be labeled with CLASS_ISPREVERIFIED mark, so, apply in follow-up appointment Android Would not occur when calling the class file in service packs reporting an error.
In said process, in each Miscellaneous Documents performed in file specifying Android application, inject and indicate this class file Described third party performs the code that file quotes include: arrange an Exclude Lists;Obtain and specify in Android application Each class file, it is judged that whether this class file hits described Exclude Lists, if it does not, inject such literary composition of instruction in this class file Part performs, to described third party, the code that file is quoted;If it is, not injecting codes in this class file.
Wherein, the entrance that Application applies as Android, loading third-party perform file hack.dex be Perform in onCreate in Application, i.e. Application is before loading third-party performs file hack.dex It is loaded, has quoted third party perform the generation of file if injecting instruction in the offspring class file of Application class file Code, can cause third party to perform file and be marked as not existing, even if subsequent load hack.dex, can not change it and not deposit Labelling, it is thus impossible to inject described code in the offspring class file of Application class, in the most described Exclude Lists wrap Include: the offspring class file of the Application class file in specifying Android to apply.
The most in one embodiment of the invention, third party is quoted due to instruction unimplanted in the class file in Exclude Lists Performing the code of file, this class file is necessarily labeled with CLASS_ISPREVERIFIED when Android system carries out and opens verification Mark, it is impossible to this class file is repaired, in the most described service packs by calling the respective class file in service packs again The class file specified after reparation does not include the class file in described Exclude Lists.
In one embodiment of the invention, the class file specified after each reparation in described service packs includes: The identification information of the class file specified after this reparation;Then the class file specified after calling reparation from described service packs is held Before row corresponding function, the method shown in Fig. 1 farther includes: judge the identification information of the class file specified after this reparation with The identification information of the class file specified accordingly is the most identical, is, calls the class file specified after this reparation, otherwise stops Call the class file specified after this reparation.Visible, the present embodiment comes class file essentially by unique mark of class file Confirming, the identification information of class file can be the digital signature of this class file, such as the MD5 of this class file, is calling patch During repaired a.class in bag patch.dex, verify the MD5 of this repaired a.class and specify in Android application The MD5 of original a..class is the most consistent, is then, replaces specifying Android by calling the a.class in patch.dex The calling of original a.class in application, repairs the a.class gone wrong.
In one embodiment of the invention, the class file specified after each reparation in described service packs includes: The description information that the class file specified after this reparation is applied about Android;The then finger after calling reparation from described service packs Before fixed class file performs corresponding function, the method shown in Fig. 1 farther includes: judge to specify whether Android application meets this The description information that the class file specified after reparation is applied about Android, is to call the class file specified after this reparation, no Then stop the class file specifying after calling this reparation.Visible, the present embodiment is essentially by the class file in service packs About Android application description information confirm this service packs target reparation application, the class file in service packs about Android The description information of application can be the version number of Android application of the head annotation at class file, the module title of Android application Deng.Android is specified to apply after loading service packs, if it is judged that the class file in this service packs is about retouching that Android is applied Information of stating is inconsistent with appointment Android application, then deleted by the service packs of this loading.
In one embodiment of the invention, described service packs can generate and be issued to this locality, institute at server State service packs to generate in client this locality, be determined on a case-by-case basis.And, third party perform file can be Server generates and is issued to this locality, and third party performs file and can also generate in client this locality, depending on concrete condition Depending on.
In one embodiment of the invention, the method shown in Fig. 1 farther includes: starting if specifying Android to apply After Preset Time in collapse, unload described service packs.Such as, it is intended that after Android application starts, load service packs Patch.dex, is carried out the former class file in specifying Android to apply by calling the repaired class file in patch.dex Repair, but, if specifying Android application to collapse within upon actuation 20 seconds, i.e. it is considered service packs patch.dex Caused, this service packs patch.dex is deleted, rolled back to original state by specifying Android application.Visible, institute of the present invention The hot-fixing provided should be used to say that reversible for Android.
Fig. 2 shows the flow chart of the hot restorative procedure that a kind of Android applies, from clothes Business device side illustrates the implementation process of this programme.As in figure 2 it is shown, the method includes:
Step S210, generates the appointment Android application after repairing, and obtains all kinds of literary compositions in the appointment Android application after repairing Part.
Step S220, retains the application of preprosthetic appointment Android, obtains all kinds of literary compositions in the application of preprosthetic appointment Android Part.
Step S230, during the Miscellaneous Documents in the application of appointment Android after repairing is applied with preprosthetic appointment Android Miscellaneous Documents compares.
Step S240, for each class file, if the content of this class file changes before and after repairing, then such literary composition Part is the class file specified.
Step S250, puts in patch file by each repaired class file specified, and generates service packs.
Wherein, the repaired class file specified is i.e. the class file specified in the appointment Android application after repairing.
Step S260, is issued to client by described service packs, client load described service packs with to specifying Android Application is repaired.
Visible, that the method shown in Fig. 2 is used in server side generates each embodiment of method shown in Fig. 1 service packs, The principle generating service packs is: in the class file during relatively preprosthetic appointment Android is applied and the appointment Android application after reparation Class file, for same class file, if the content of this class file repair before and after change, illustrate that this class file exists There is a problem before reparation, this class file in the application of appointment Android after reparation is repaired class file, to all processes The class file repaired is packed, and generates service packs, the service packs of generation is issued to client and repairs.With prior art Compare, this programme without the appointments Android application after repairing is carried out the packing of entirety, test, channel issue, but utilization The increment of the class file in the application of appointment Android before and after reparation positions the class file needing to carry out catching, and generates corresponding benefit Fourth bag so that client utilizes this service packs to repair pointedly, the most time saving and energy saving, had both met exploitation demand, and also could Strengthen Consumer's Experience.
In one embodiment of the invention, if the class file in the application of preprosthetic appointment Android is obscured, Then the method shown in Fig. 2 farther includes: retain the class file in the application of preprosthetic appointment Android obscures mapping relations;Then The Miscellaneous Documents in the application of appointment Android after repairing in step S230 and all kinds of literary compositions in the application of preprosthetic appointment Android Part compares and includes: for each class file in the appointment Android application after repairing, obscure mapping relations according to described, really Class file in fixed corresponding preprosthetic appointment Android application, whether the content comparing class file becomes before and after repairing Change.Such as, the class file in the application of preprosthetic appointment Android is obscured by progard obfuscator, generates a class File obscure mapping relations mapping, this mapping indicates the transformation relation obscuring before and after's class file, such as mapping In indicate former a.class and be transformed to x.class, former b.class and be transformed to m.class, get the appointment Android after reparation Miscellaneous Documents in application is: repaired a.class, repaired b.class, is carrying out the a.class before and after repairing Time relatively, first to know the corresponding preprosthetic a.class of x.class according to mapping, then judge the a.class before and after repairing Content whether change, for b.class the most in like manner, repeat no more.Further, service packs is being issued to visitor After the end of family, when the class file in service packs is made a look up and to call by client, need determine according to mapping and specify peace The repaired class file specified in the service packs that the class file specified after obscuring in Zhuo Yingyong is consistent.
In one embodiment of the invention, if preprosthetic appointment Android application in each class file content with MD5 value represents, the method shown in Fig. 2 farther includes: calculate each class file interior during the appointments Android after repairing is applied The MD5 value held;The Miscellaneous Documents in the application of appointment Android after then step S230 will be repaired is applied with preprosthetic appointment Android In Miscellaneous Documents compare and include: each class file during the appointments Android after repairing is applied, by this class file MD5 value compares with the MD5 value of the class file in the application of corresponding preprosthetic appointment Android.
Fig. 3 shows the schematic diagram of the hot repair apparatus for coating that a kind of Android applies.Such as Fig. 3 Shown in, the hot repair apparatus for coating 300 of this Android application includes:
Acquiring unit 310, is suitable to obtain the service packs specifying Android application, and described service packs includes: specify Android to answer The class file specified after reparation in.
Loading unit 320, is suitable to, when specifying Android application to start, load described service packs.
Call unit 330, is suitable to, when specifying Android application to need to call the class file specified, adjust from described service packs With the class file specified after reparation to perform corresponding function.
Visible, when specifying the class file specified in Android application to go wrong to need to be repaired, the device shown in Fig. 3 is straight Obtain the service packs taking the class file specified after comprising the reparation specified in Android application, when Android application needs call appointment Class file time, from this service packs, call the class file specified after corresponding reparation, it is achieved that the normal fortune of Android application OK.Compared with prior art, this repair process is repacked appointment Android application, test without experiencing publisher, is answered to each With market and channel change bag, prompting customer upgrade, prompting user download, utilize newly installed cladding lid to install specifies Android application etc. Series of steps, on the basis of not changing the application of former Android, the burning issue of dynamic restoring Android application in the way of patch, Significantly reduce the rehabilitation cost of Android application.
In one embodiment of the invention, described loading unit 310, be suitable to the file mesh according to described service packs place Record, constructs Classloader, loads described service packs by this Classloader.
Further, described loading unit 320, it is further adapted for obtaining that the process that loads described service packs is corresponding the One loads set, and described service packs is the only element in this first loading set;Obtain specifying respectively holding in Android application Style of writing part carries out the second loading set that the process that loads is corresponding, it is intended that it is that this second loads that each in Android application performs file Element in set;Load set by first and the second loading set is merged into one and loaded set so that described service packs is made For first element in this loading set.
Specifically, described call unit 330, be suitable to when specifying Android application to need to call a class file, according to institute State the order of elements loading set, the class file called required for lookup from each element successively;Need to adjust if found Class file, stop search, directly invoke this class file perform corresponding function;If not finding the class literary composition needing to call Part, jumps to next element and searches the class file needing to call, till finding.
In one embodiment of the invention, the class file specified after each reparation in described service packs includes: The identification information of the class file specified after this reparation;The most described call unit 330, is further adapted for from described service packs Before calling the execution corresponding function of the class file specified after reparation, it is judged that the identification information of the class file specified after this reparation The most identical with the identification information of the corresponding class file specified, it is to call the class file specified after this reparation, otherwise stop Only call the class file specified after this reparation.
In one embodiment of the invention, the class file specified after each reparation in described service packs includes: The description information that the class file specified after this reparation is applied about Android;The most described call unit 330, be further adapted for from Before described service packs calls the execution corresponding function of the class file specified after reparation, it is judged that specify whether Android application meets The description information that the class file specified after this reparation is applied about Android, is to call the class file specified after this reparation, Otherwise stop the class file specifying after calling this reparation.
In one embodiment of the invention, described service packs generates and is issued to this locality at server.
Fig. 4 shows the schematic diagram of the hot repair apparatus for coating that a kind of Android applies.As Shown in Fig. 4, the hot repair apparatus for coating 400 of this Android application includes: acquiring unit 410, loading unit 420, call unit 430, pre- Processing unit 440 and unloading unit 450.
Wherein, acquiring unit 410, loading unit 420, call unit 430 comprise with the acquiring unit 310 shown in Fig. 3, add The corresponding identical function of carrier unit 320, call unit 330, identical part does not repeats them here.
Pretreatment unit 440, is suitable to, before specifying Android application to start, obtain a third party and perform file, should Third party performs file and puts in the specified file catalogue specifying Android application;Perform in file specifying each of Android application In Miscellaneous Documents, inject and indicate this class file that described third party is performed the code that file is quoted.
Loading unit 420, is further adapted for, when specifying Android application to start, first loading described third party's file, then adding Carry specify Android application in respectively perform file.
Unloading unit 450, is suitable to when there is collapse in specifying Android application Preset Time upon actuation, and unloading is described Service packs.
In a specific example, described pretreatment unit 440, be suitable to arrange an Exclude Lists;Obtain and specify peace Each class file in Zhuo Yingyong, it is judged that whether this class file hits described Exclude Lists, if it does not, inject in this class file Indicate this class file that described third party is performed the code that file is quoted;If it is, not injecting codes in this class file. Wherein, described Exclude Lists includes: the offspring class file of the Application class file in specifying Android to apply.
The most in the present embodiment, the class file specified after the reparation in described service packs does not include in described Exclude Lists Class file.
It should be noted that the corresponding phase of each embodiment of each embodiment of Fig. 3-Fig. 4 shown device and method shown in Fig. 1 With, the most it is described in detail, does not repeats them here.
Fig. 5 shows the schematic diagram of the hot remediation server that a kind of Android applies.As Shown in Fig. 5, the hot remediation server 500 of this Android application includes:
Repair process unit 510, is suitable to the appointment Android application generated after repairing, obtains the appointment Android application after repairing In Miscellaneous Documents;And be suitable to retain the application of preprosthetic appointment Android, obtain in the application of preprosthetic appointment Android is each Class file.
Service packs signal generating unit 520, is suitable to the Miscellaneous Documents in the appointment Android application after repairing and preprosthetic finger Miscellaneous Documents in Dingan County's Zhuo application compares;For each class file, if the content of this class file is sent out before and after repairing Changing, then this class file is the class file specified;Each repaired class file specified is put in patch file, generates and mend Fourth bag.
Service packs issues unit 530, is suitable to described service packs is issued to client, client loads described service packs With to specifying Android application to repair.
Visible, the server shown in Fig. 5 generates the service packs that in the most each embodiment, client is used, and generates service packs Principle is: the relatively class file in the application of preprosthetic appointment Android and the class file in the appointment Android application after reparation, right In same class file, if the content of this class file changes before and after repairing, illustrate that this class file occurs before reparation Problem, this class file in the application of appointment Android after reparation is repaired class file, to all classes literary compositions through repairing Part is packed, and generates service packs, the service packs of generation is issued to client and repairs.Compared with prior art, we Case without the appointments Android application after repairing is carried out the packing of entirety, test, channel issue, but before and after utilizing reparation The increment specifying the class file in Android application positions the class file needing to carry out catching, and generates corresponding service packs so that Client utilizes this service packs to repair pointedly, the most time saving and energy saving, had both met exploitation demand, and also can strengthen user's body Test.
In one embodiment of the invention, repair process unit 510, it is further adapted for when preprosthetic appointment Android should When class file in has carried out obscuring, retain the class file in the application of preprosthetic appointment Android obscures mapping relations;Mend Fourth bag signal generating unit 520, is suitable to, for each class file in the appointment Android application after repairing, obscure mapping pass according to described System, determines the class file in the preprosthetic appointment Android application of correspondence, and whether the content comparing class file is sent out before and after repairing Changing.
In one embodiment of the invention, repair process unit 510, it is further adapted for when preprosthetic appointment Android should When the content of each class file in represents with MD5 value, each class file in the application of appointment Android after calculating reparation The MD5 value of content;Service packs signal generating unit 520, is suitable to for each class file in the appointment Android application after repairing, should The MD5 value of class file compares with the MD5 value of the class file in the application of corresponding preprosthetic appointment Android.
It should be noted that the corresponding phase of each embodiment of the specific embodiment of server shown in Fig. 5 and method shown in Fig. 2 With, above have been carried out describing in detail, do not repeat them here.
Fig. 6 shows the schematic diagram of the hot repair complex system that a kind of Android applies.Such as Fig. 6 Shown in, the hot repair complex system 600 of this Android application includes: the hot repair apparatus for coating 610 of Android application, and, the heat of Android application Remediation server 620.
Wherein, the hot repair apparatus for coating 300/400 that the hot repair apparatus for coating 610 of Android application and Android above are applied has Identical function, the hot remediation server 500 that the hot remediation server 620 of Android application and Android above are applied has phase Same function, does not repeats them here.
In sum, when specifying the class file specified in Android application to go wrong to need to be repaired, according to the present invention The technical scheme provided, directly obtains the service packs of the class file specified after comprising the reparation specified in Android application, works as peace When Zhuo Yingyong needs to call the class file specified, from this service packs, call the class file specified after corresponding reparation, it is achieved Android application properly functioning.Compared with prior art, this repair process repacks appointment Android without experiencing publisher Apply, test, change bag, prompting customer upgrade, prompting user's download to each application market and channel, utilize newly installed cladding to cover Series of steps such as specifying Android application is installed, on the basis of not changing the application of former Android, utilizes a service packs to get final product real The hot repair of existing Android application is multiple, significantly reduces the rehabilitation cost of Android application, and repair process user's unaware, both met Exploitation demand, also complies with user's request.
It should be understood that
Algorithm and display are not intrinsic to any certain computer, virtual bench or miscellaneous equipment relevant provided herein. Various fexible units can also be used together with based on teaching in this.As described above, construct required by this kind of device Structure be apparent from.Additionally, the present invention is also not for any certain programmed language.It is understood that, it is possible to use various Programming language realizes the content of invention described herein, and the description done language-specific above is to disclose this Bright preferred forms.
In description mentioned herein, illustrate a large amount of detail.It is to be appreciated, however, that the enforcement of the present invention Example can be put into practice in the case of not having these details.In some instances, it is not shown specifically known method, structure And technology, in order to do not obscure the understanding of this description.
Similarly, it will be appreciated that one or more in order to simplify that the disclosure helping understands in each inventive aspect, exist Above in the description of the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes In example, figure or descriptions thereof.But, the method for the disclosure should not be construed to reflect an intention that i.e. required guarantor The application claims feature more more than the feature being expressly recited in each claim protected.More precisely, as following Claims reflected as, inventive aspect is all features less than single embodiment disclosed above.Therefore, The claims following detailed description of the invention are thus expressly incorporated in this detailed description of the invention, the most each claim itself All as the independent embodiment of the present invention.
Those skilled in the art are appreciated that and can carry out the module in the equipment in embodiment adaptively Change and they are arranged in one or more equipment different from this embodiment.Can be the module in embodiment or list Unit or assembly are combined into a module or unit or assembly, and can put them in addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit excludes each other, can use any Combine all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed appoint Where method or all processes of equipment or unit are combined.Unless expressly stated otherwise, this specification (includes adjoint power Profit requires, summary and accompanying drawing) disclosed in each feature can be carried out generation by providing identical, equivalent or the alternative features of similar purpose Replace.
Although additionally, it will be appreciated by those of skill in the art that embodiments more described herein include other embodiments Some feature included by rather than further feature, but the combination of the feature of different embodiment means to be in the present invention's Within the scope of and form different embodiments.Such as, in the following claims, embodiment required for protection appoint One of meaning can mode use in any combination.
The all parts embodiment of the present invention can realize with hardware, or to run on one or more processor Software module realize, or with combinations thereof realize.It will be understood by those of skill in the art that and can use in practice Microprocessor or digital signal processor (DSP) realize according to embodiments of the present invention Android application hot repair apparatus for coating, The some or all functions of the some or all parts in server and system.The present invention is also implemented as performing Part or all equipment of method as described herein or device program (such as, computer program and computer journey Sequence product).The program of such present invention of realization can store on a computer-readable medium, or can have one or The form of multiple signals.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or There is provided with any other form.
The present invention will be described rather than limits the invention to it should be noted 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 marks that should not will be located between bracket is configured to limitations on claims.Word " comprises " and does not excludes the presence of not Arrange element in the claims or step.Word "a" or "an" before being positioned at element does not excludes the presence of multiple such Element.The present invention and can come real by means of including the hardware of some different elements by means of properly programmed computer Existing.If in the unit claim listing equipment for drying, several in these devices can be by same hardware branch Specifically embody.Word first, second and third use do not indicate that any order.These word explanations can be run after fame Claim.
The invention discloses A1, the hot restorative procedure of a kind of Android application, wherein, the method includes:
Obtaining the service packs specifying Android application, described service packs includes: specify the finger after the reparation in Android application Fixed class file;
When specifying Android application to start, load described service packs;
When specifying Android application to need to call the class file specified, from described service packs, call specifying after reparation Class file is to perform corresponding function.
A2, method as described in A1, wherein, load described service packs and include:
According to the file directory at described service packs place, construct Classloader, load described patch by this Classloader Bag.
A3, method as described in A2, wherein, the described service packs of described loading also includes:
Obtaining the first loading set that the process that loads described service packs is corresponding, described service packs is that this first adds Carry the only element in set;
Obtain the second loading set corresponding to the process specifying each execution file in Android application to load, it is intended that Each file that performs in Android application is the element in this second loading set;
Load set by first and the second loading set is merged into one and loaded set so that described service packs adds as this Carry first element in set.
A4, method as described in A3, wherein, described when specifying Android application to need to call the class file specified, from institute State the class file specified after calling reparation in service packs and include to perform corresponding function:
When specify Android application need to call a class file time, according to described load set order of elements, successively from The class file called required for searching in each element;
If finding the class file needing to call, stopping searching, directly invoking this class file and performing corresponding function;
If not finding the class file needing to call, jumping to next element and searching the class file needing to call, directly To finding.
A5, method as described in A1, wherein, the method farther includes:
Before specifying Android application to start, obtain a third party and perform file, this third party is performed file and puts into Specify in the specified file catalogue of Android application;In each Miscellaneous Documents performed in file specifying Android application, injection refers to Show that this class file performs, to described third party, the code that file is quoted;
When specifying Android application to start, first load described third party's file, reload and specify respectively holding in Android application Style of writing part.
A6, method as described in A5, wherein, described in each Miscellaneous Documents performed in file specifying Android application, Inject and indicate this class file that described third party performs the code that file quotes to include:
One Exclude Lists is set;
Obtain each class file specified in Android application, it is judged that whether this class file hits described Exclude Lists, if No, inject in this class file and indicate this class file that described third party is performed the code that file is quoted;If it is, do not exist Injecting codes in this class file.
A7, method as described in A6, wherein, described Exclude Lists includes:
The offspring class file of the Application class file in specifying Android to apply.
A8, method as described in A6, wherein,
The class file specified after reparation in described service packs does not include the class file in described Exclude Lists.
A9, method as described in A1, wherein,
The class file specified after each reparation in described service packs includes: the class file specified after this reparation Identification information;
Before then the class file specified after calling reparation from described service packs performs corresponding function, the method enters one Step includes: whether judge the identification information of the identification information of the class file specified after this reparation and the corresponding class file specified Identical, it is to call the class file specified after this reparation, otherwise stop the class file specifying after calling this reparation.
A10, method as described in A1, wherein,
The class file specified after each reparation in described service packs includes: the class file specified after this reparation closes Description information in Android application;
Before then the class file specified after calling reparation from described service packs performs corresponding function, the method enters one Step includes: judge the description information that the class file specified after specifying Android application whether to meet this reparation is applied about Android, It is to call the class file specified after this reparation, otherwise stop the class file specifying after calling this reparation.
A11, method as described in A1, wherein,
Described service packs generates and is issued to this locality at server.
A12, method as described in A1, wherein, the method farther includes:
If collapsed in specifying Android application Preset Time upon actuation, unload described service packs.
The invention also discloses B13, the hot restorative procedure of a kind of Android application, wherein, the method includes:
Generate the appointment Android application after repairing, obtain the Miscellaneous Documents in the appointment Android application after repairing;
Retain the application of preprosthetic appointment Android, obtain the Miscellaneous Documents in the application of preprosthetic appointment Android;
The Miscellaneous Documents in the application of appointment Android after repairing and the Miscellaneous Documents in the application of preprosthetic appointment Android Compare;
For each class file, if the content of this class file changes before and after repairing, then this class file is for specifying Class file;
Each repaired class file specified is put in patch file, generates service packs;
Described service packs is issued to client, client loads described service packs with to specifying Android application to repair Multiple.
B14, method as described in B13, wherein, if the class file in the application of preprosthetic appointment Android is mixed Confuse, then the method farther includes: retain the class file in the application of preprosthetic appointment Android obscures mapping relations;
Described will repair after the application of appointments Android in the application of Miscellaneous Documents and preprosthetic appointment Android in all kinds of File compares and includes:
For each class file in the appointment Android application after repairing, obscure mapping relations according to described, determine correspondence The application of preprosthetic appointment Android in class file, compare whether the content of class file changes before and after repairing.
B15, method as described in B13 or B14, wherein, if each class file in the application of preprosthetic appointment Android Content represent with MD5 value, the method farther includes: calculate each class file interior during the appointments Android after repairing is applied The MD5 value held;
The most described will repair after the application of appointments Android in the application of Miscellaneous Documents and preprosthetic appointment Android in each Class file compares and includes: for each class file in the appointments Android application after repairing, by the MD5 value of this class file and The MD5 value of the class file in the application of corresponding preprosthetic appointment Android compares.
The invention also discloses C16, the hot repair apparatus for coating of a kind of Android application, wherein, this device includes:
Acquiring unit, is suitable to obtain the service packs specifying Android application, and described service packs includes: specify in Android application Reparation after the class file specified;
Loading unit, is suitable to, when specifying Android application to start, load described service packs;
Call unit, is suitable to, when specifying Android application to need to call the class file specified, call from described service packs The class file specified after reparation is to perform corresponding function.
C17, device as described in C16, wherein,
Described loading unit, is suitable to the file directory according to described service packs place, constructs Classloader, is added by such Carry device and load described service packs.
C18, device as described in C17, wherein,
Described loading unit, is further adapted for obtaining the first loading set that the process loading described service packs is corresponding, Described service packs is the only element in this first loading set;Obtain specifying each file that performs in Android application to add Second that the process of load is corresponding loads set, it is intended that each execution file in Android application is the unit in this second loading set Element;Load set by first and the second loading set is merged into one and loaded set so that described service packs collects as this loading First element in conjunction.
C19, device as described in C18, wherein,
Described call unit, is suitable to, when specifying Android application to need to call a class file, load set according to described Order of elements, search from each element successively required for the class file that calls;If finding the class file needing to call, Stop searching, directly invoke this class file and perform corresponding function;If not finding the class file needing to call, jump to next Individual element searches the class file needing to call, till finding.
C20, device as described in C16, wherein, this device farther includes: pretreatment unit;
Pretreatment unit, is suitable to, before specifying Android application to start, obtain a third party and perform file, by the 3rd Fang Zhihang file is put in the specified file catalogue specifying Android application;Specify Android application each perform in file all kinds of In file, inject and indicate this class file that described third party is performed the code that file is quoted;
Described loading unit, is further adapted for, when specifying Android application to start, first loading described third party's file, then adding Carry specify Android application in respectively perform file.
C21, device as described in C20, wherein,
Described pretreatment unit, is suitable to arrange an Exclude Lists;Obtain each class file specified in Android application, sentence Whether this class file disconnected hits described Exclude Lists, indicates this class file to the described 3rd if it does not, inject in this class file Fang Zhihang file carries out the code quoted;If it is, not injecting codes in this class file.
C22, device as described in C21, wherein, described Exclude Lists includes:
The offspring class file of the Application class file in specifying Android to apply.
C23, device as described in C21, wherein,
The class file specified after reparation in described service packs does not include the class file in described Exclude Lists.
C24, device as described in C16, wherein,
The class file specified after each reparation in described service packs includes: the class file specified after this reparation Identification information;
The most described call unit, is further adapted for the class file specified after calling reparation from described service packs and performs Before corresponding function, it is judged that the identification information of the class file specified after this reparation is believed with the mark of the corresponding class file specified Cease the most identical, be, call the class file specified after this reparation, otherwise stop the class file specifying after calling this reparation.
C25, device as described in C16, wherein,
The class file specified after each reparation in described service packs includes: the class file specified after this reparation closes Description information in Android application;
The most described call unit, is further adapted for the class file specified after calling reparation from described service packs and performs Before corresponding function, it is judged that the description that the class file specified after specifying Android application whether to meet this reparation is applied about Android Information, is to call the class file specified after this reparation, otherwise stop the class file specifying after calling this reparation.
C26, device as described in C16, wherein,
Described service packs generates and is issued to this locality at server.
C27, device as described in C16, wherein, this device farther includes:
Unloading unit, is suitable to, when there is collapse in specifying Android application Preset Time upon actuation, unload described benefit Fourth bag.
The invention also discloses D28, the hot remediation server of a kind of Android application, wherein, this server includes:
Repair process unit, is suitable to the appointment Android application generated after repairing, obtains in the appointment Android application after repairing Miscellaneous Documents;And be suitable to retain the application of preprosthetic appointment Android, obtain in the application of preprosthetic appointment Android is all kinds of File;
Service packs signal generating unit, the Miscellaneous Documents be suitable in the appointment Android application after repairing specifies peace with preprosthetic Miscellaneous Documents in Zhuo Yingyong compares;For each class file, if the content of this class file becomes before and after repairing Change, then this class file is the class file specified;Each repaired class file specified is put in patch file, generates patch Bag;
Service packs issues unit, is suitable to described service packs is issued to client, by client load described service packs with Repair specifying Android application.
D29, server as described in D28, wherein,
Described repair process unit, the class file being further adapted in preprosthetic appointment Android is applied is obscured Time, retain the class file in the application of preprosthetic appointment Android obscures mapping relations;
Described service packs signal generating unit, is suitable to for each class file in the appointment Android application after repairing, according to institute Stating and obscure mapping relations, determine the class file in the preprosthetic appointment Android application of correspondence, the content comparing class file is being repaiied Whether change before and after Fu.
D30, server as described in D28 or D29, wherein,
Described repair process unit, the content of each class file being further adapted in preprosthetic appointment Android is applied When representing with MD5 value, the MD5 value of the content of each class file in the application of appointment Android after calculating reparation;
Described service packs signal generating unit, is suitable to for each class file in the appointment Android application after repairing, by such The MD5 value of file compares with the MD5 value of the class file in the application of corresponding preprosthetic appointment Android.
The invention also discloses E31, the hot repair complex system of a kind of Android application, wherein, this system includes: such as C16-C27 According to any one of device, and, the server as according to any one of D28-D30.

Claims (10)

1. a hot restorative procedure for Android application, wherein, the method includes:
Obtaining the service packs specifying Android application, described service packs includes: specify specifying after the reparation in Android application Class file;
When specifying Android application to start, load described service packs;
When specifying Android application to need to call the class file specified, from described service packs, call the literary composition of the class specified after reparation Part is to perform corresponding function.
The most the method for claim 1, wherein load described service packs to include:
According to the file directory at described service packs place, construct Classloader, load described service packs by this Classloader.
3. method as claimed in claim 2, wherein, the described service packs of described loading also includes:
Obtaining the first loading set that the process loading described service packs is corresponding, described service packs is this first loading collection Only element in conjunction;
Obtain the second loading set corresponding to the process specifying each execution file in Android application to load, it is intended that Android Each file that performs in application is the element in this second loading set;
Load set by first and the second loading set is merged into one and loaded set so that described service packs collects as this loading First element in conjunction.
4. a hot restorative procedure for Android application, wherein, the method includes:
Generate the appointment Android application after repairing, obtain the Miscellaneous Documents in the appointment Android application after repairing;
Retain the application of preprosthetic appointment Android, obtain the Miscellaneous Documents in the application of preprosthetic appointment Android;
Miscellaneous Documents during the Miscellaneous Documents in the application of appointment Android after repairing is applied with preprosthetic appointment Android is carried out Relatively;
For each class file, if the content of this class file changes before and after repairing, then this class file is the class specified File;
Each repaired class file specified is put in patch file, generates service packs;
Described service packs is issued to client, client loads described service packs with to specifying Android application to repair.
5. method as claimed in claim 4, wherein, if the class file in the application of preprosthetic appointment Android is mixed Confuse, then the method farther includes: retain the class file in the application of preprosthetic appointment Android obscures mapping relations;
Described will repair after the application of appointments Android in the application of Miscellaneous Documents and preprosthetic appointment Android in Miscellaneous Documents Compare and include:
For each class file in the appointment Android application after repairing, obscure mapping relations according to described, determine repairing of correspondence The class file in the application of appointment Android before Fu, whether the content comparing class file changes before and after repairing.
6. a hot repair apparatus for coating for Android application, wherein, this device includes:
Acquiring unit, is suitable to obtain the service packs specifying Android application, and described service packs includes: specify repairing in Android application The class file specified after Fu;
Loading unit, is suitable to, when specifying Android application to start, load described service packs;
Call unit, is suitable to, when specifying Android application to need to call the class file specified, call reparation from described service packs After the class file specified to perform corresponding function.
7. device as claimed in claim 6, wherein,
Described loading unit, is suitable to the file directory according to described service packs place, constructs Classloader, by this Classloader Load described service packs.
8. a hot remediation server for Android application, wherein, this server includes:
Repair process unit, be suitable to generate repair after appointment Android application, obtain repair after appointments Android apply in each Class file;And be suitable to retain the application of preprosthetic appointment Android, obtain the Miscellaneous Documents in the application of preprosthetic appointment Android;
Service packs signal generating unit, being suitable to the Miscellaneous Documents in the appointment Android application after repairing should with preprosthetic appointment Android Miscellaneous Documents in compares;For each class file, if the content of this class file changes, then before and after repairing This class file is the class file specified;Each repaired class file specified is put in patch file, generates service packs;
Service packs issues unit, is suitable to described service packs is issued to client, client loads described service packs with to finger Dingan County's Zhuo application is repaired.
9. server as claimed in claim 8, wherein,
Described repair process unit, is further adapted for when the class file during preprosthetic appointment Android is applied has carried out obscuring, Retain the class file in the application of preprosthetic appointment Android obscures mapping relations;
Described service packs signal generating unit, is suitable to for each class file in the appointment Android application after repairing, according to described mixed Confuse mapping relations, determine the class file in the preprosthetic appointment Android application of correspondence, compare the content of class file before reparation After whether change.
10. a hot repair complex system for Android application, wherein, this system includes: the dress as according to any one of claim 6-7 Put, and, the server as according to any one of claim 8-9.
CN201610411014.1A 2016-06-13 2016-06-13 Hot restorative procedure, device, server and the system of a kind of Android application Pending CN106095502A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610411014.1A CN106095502A (en) 2016-06-13 2016-06-13 Hot restorative procedure, device, server and the system of a kind of Android application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610411014.1A CN106095502A (en) 2016-06-13 2016-06-13 Hot restorative procedure, device, server and the system of a kind of Android application

Publications (1)

Publication Number Publication Date
CN106095502A true CN106095502A (en) 2016-11-09

Family

ID=57845612

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610411014.1A Pending CN106095502A (en) 2016-06-13 2016-06-13 Hot restorative procedure, device, server and the system of a kind of Android application

Country Status (1)

Country Link
CN (1) CN106095502A (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201868A (en) * 2016-06-28 2016-12-07 Tcl集团股份有限公司 A kind of method and apparatus repairing Android application program
CN106775873A (en) * 2016-12-20 2017-05-31 北京五八信息技术有限公司 Update cell phone software, obtain the method and apparatus of patch file
CN106843933A (en) * 2016-12-27 2017-06-13 北京五八信息技术有限公司 A kind of leak restorative procedure of application program, mobile terminal and patch server
CN106874195A (en) * 2017-01-18 2017-06-20 环球智达科技(北京)有限公司 A kind of bug for android applications repairs and continues delivery scheme
CN106951280A (en) * 2017-02-28 2017-07-14 努比亚技术有限公司 Mobile terminal and apply restorative procedure
CN107133068A (en) * 2017-04-18 2017-09-05 努比亚技术有限公司 Mobile terminal and apply restorative procedure
CN107179925A (en) * 2017-04-14 2017-09-19 北京五八信息技术有限公司 Hot update method and device
CN107329783A (en) * 2017-06-26 2017-11-07 中广热点云科技有限公司 A kind of method for loading patch in Android system based on class file
CN107329781A (en) * 2017-06-21 2017-11-07 努比亚技术有限公司 The hot restorative procedure of software, terminal, system and computer-readable recording medium
CN107368330A (en) * 2017-05-26 2017-11-21 阿里巴巴集团控股有限公司 Client patch restorative procedure, device and system
CN107391107A (en) * 2017-06-12 2017-11-24 北京明朝万达科技股份有限公司 The restorative procedure and device of a kind of application program
CN108089870A (en) * 2016-11-21 2018-05-29 百度在线网络技术(北京)有限公司 For repairing the method and apparatus of application
CN108304213A (en) * 2018-01-11 2018-07-20 口碑(上海)信息技术有限公司 Run the hot restorative procedure and device of program
CN108399080A (en) * 2018-03-05 2018-08-14 深圳市华讯方舟软件信息有限公司 A kind of hot update methods of Android App
CN108920170A (en) * 2018-05-15 2018-11-30 玩咖欢聚文化传媒(北京)有限公司 Dynamic restoring method, terminal, medium and the system of Android product installation kit
CN109344619A (en) * 2018-08-15 2019-02-15 北京奇艺世纪科技有限公司 The hot restorative procedure and device of application program
CN109496417A (en) * 2018-06-12 2019-03-19 优视科技新加坡有限公司 Data test method, apparatus, equipment/terminal/server and computer readable storage medium
CN109918098A (en) * 2017-12-12 2019-06-21 优信数享(北京)信息技术有限公司 What a kind of APP heat updated mentions survey method, apparatus and system
CN111078262A (en) * 2018-10-18 2020-04-28 百度在线网络技术(北京)有限公司 Application thermal restoration method and device
CN111142922A (en) * 2018-11-02 2020-05-12 阿里巴巴集团控股有限公司 Application program updating method and device, terminal and server
CN111953475A (en) * 2020-07-23 2020-11-17 上海连尚网络科技有限公司 Method and device for repairing code bugs

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722387A (en) * 2012-05-29 2012-10-10 华为技术有限公司 Dynamic patching method and device
CN103701930A (en) * 2014-01-07 2014-04-02 浙江大学 Mobile application program real-time updating method and system
CN103810006A (en) * 2011-02-21 2014-05-21 北京奇虎科技有限公司 Installation method and device for service packs

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103810006A (en) * 2011-02-21 2014-05-21 北京奇虎科技有限公司 Installation method and device for service packs
CN102722387A (en) * 2012-05-29 2012-10-10 华为技术有限公司 Dynamic patching method and device
CN103701930A (en) * 2014-01-07 2014-04-02 浙江大学 Mobile application program real-time updating method and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ALTSUKI: "Android热补丁动态修复技术(一):从Dex分包原理到热补丁", 《HTTPS://BLOG.CSDN.NET/U010386612/ARTICLE/DETAILS/50885320》 *
QQ空间开发团队: "安卓App热补丁动态修复技术介绍", 《HTTPS://MP.WEIXIN.QQ.COM/S?__BIZ=MZI1MTA1MZM2NW==&MID=400118620&IDX=1&SN=B4FDD5055731290EEF12AD0D17F39D4A&SCENE=1&SRCID=1106IMU9ZGWYBID13E7Y2NEI#WECHAT_REDIRECT》 *
丁津津: "Android热修复技术", 《HTTPS://MODUHACKERS.GITHUB.IO/2016/03/31/ANDROID-HOT-FIX/》 *

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201868A (en) * 2016-06-28 2016-12-07 Tcl集团股份有限公司 A kind of method and apparatus repairing Android application program
CN108089870B (en) * 2016-11-21 2022-01-21 百度在线网络技术(北京)有限公司 Method and apparatus for repairing applications
CN108089870A (en) * 2016-11-21 2018-05-29 百度在线网络技术(北京)有限公司 For repairing the method and apparatus of application
CN106775873A (en) * 2016-12-20 2017-05-31 北京五八信息技术有限公司 Update cell phone software, obtain the method and apparatus of patch file
CN106843933A (en) * 2016-12-27 2017-06-13 北京五八信息技术有限公司 A kind of leak restorative procedure of application program, mobile terminal and patch server
CN106874195A (en) * 2017-01-18 2017-06-20 环球智达科技(北京)有限公司 A kind of bug for android applications repairs and continues delivery scheme
CN106951280A (en) * 2017-02-28 2017-07-14 努比亚技术有限公司 Mobile terminal and apply restorative procedure
CN107179925A (en) * 2017-04-14 2017-09-19 北京五八信息技术有限公司 Hot update method and device
CN107133068A (en) * 2017-04-18 2017-09-05 努比亚技术有限公司 Mobile terminal and apply restorative procedure
CN107368330A (en) * 2017-05-26 2017-11-21 阿里巴巴集团控股有限公司 Client patch restorative procedure, device and system
CN107368330B (en) * 2017-05-26 2020-06-30 阿里巴巴集团控股有限公司 Client patch repair method, device and system
CN107391107A (en) * 2017-06-12 2017-11-24 北京明朝万达科技股份有限公司 The restorative procedure and device of a kind of application program
CN107329781A (en) * 2017-06-21 2017-11-07 努比亚技术有限公司 The hot restorative procedure of software, terminal, system and computer-readable recording medium
CN107329783B (en) * 2017-06-26 2020-04-10 中广热点云科技有限公司 Method for loading patch based on class file in android system
CN107329783A (en) * 2017-06-26 2017-11-07 中广热点云科技有限公司 A kind of method for loading patch in Android system based on class file
CN109918098A (en) * 2017-12-12 2019-06-21 优信数享(北京)信息技术有限公司 What a kind of APP heat updated mentions survey method, apparatus and system
CN108304213A (en) * 2018-01-11 2018-07-20 口碑(上海)信息技术有限公司 Run the hot restorative procedure and device of program
CN108399080A (en) * 2018-03-05 2018-08-14 深圳市华讯方舟软件信息有限公司 A kind of hot update methods of Android App
CN108920170A (en) * 2018-05-15 2018-11-30 玩咖欢聚文化传媒(北京)有限公司 Dynamic restoring method, terminal, medium and the system of Android product installation kit
CN109496417A (en) * 2018-06-12 2019-03-19 优视科技新加坡有限公司 Data test method, apparatus, equipment/terminal/server and computer readable storage medium
CN109344619A (en) * 2018-08-15 2019-02-15 北京奇艺世纪科技有限公司 The hot restorative procedure and device of application program
CN111078262A (en) * 2018-10-18 2020-04-28 百度在线网络技术(北京)有限公司 Application thermal restoration method and device
CN111078262B (en) * 2018-10-18 2023-04-11 百度在线网络技术(北京)有限公司 Application thermal restoration method and device
CN111142922A (en) * 2018-11-02 2020-05-12 阿里巴巴集团控股有限公司 Application program updating method and device, terminal and server
CN111142922B (en) * 2018-11-02 2023-04-25 阿里巴巴集团控股有限公司 Application program updating method, device, terminal and server
CN111953475A (en) * 2020-07-23 2020-11-17 上海连尚网络科技有限公司 Method and device for repairing code bugs
CN111953475B (en) * 2020-07-23 2023-07-04 上海连尚网络科技有限公司 Method and device for repairing code loopholes

Similar Documents

Publication Publication Date Title
CN106095502A (en) Hot restorative procedure, device, server and the system of a kind of Android application
US10019256B2 (en) Systems and methods for incremental software development
US9727327B1 (en) Software distribution framework
US9477462B2 (en) System and method for software product versioning packaging, distribution, and patching
US8645939B2 (en) Use of aliasing in an installer
CN107451474B (en) Software bug fixing method and device for terminal
US20160306737A1 (en) Automated error checking system for a software application and method therefor
US8838964B2 (en) Package audit tool
CN105204916B (en) Project process operation method and device based on environmental variance
US8954949B2 (en) Smart patch delivery system
US20070022411A1 (en) System and method for compiling program code ahead of time
CN106020873A (en) Service pack loading method and device
CN109977008B (en) Method and terminal for making JS code depended on by application program compatible with native library
CN104573420B (en) Prevent the method and apparatus manslaughtered by process
CN110673837B (en) Code repairing method and device, electronic equipment and computer readable storage medium
CN109284225A (en) A kind of quality determining method and electronic equipment of multi-person synergy exploitation programming code
CN105573915A (en) Test method and device based on code coverage rate
CN108304213A (en) Run the hot restorative procedure and device of program
US9009666B1 (en) Systems and methods for testing software and for storing and tracking test assets with the software
CN103250136B (en) The method quoted during for verifying operation
US9465598B2 (en) Deployment of branded software
CN109298883A (en) A kind of automatically generate component file method and electronic equipment under teaching platform
CN106648788A (en) Installing method and device of application program
CN104199774B (en) Program security testing method and device
US8938707B2 (en) Method and system for creating an executable verification plan

Legal Events

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

Application publication date: 20161109