CN105512015A - Android target application crash calculation method and device - Google Patents
Android target application crash calculation method and device Download PDFInfo
- Publication number
- CN105512015A CN105512015A CN201510939605.1A CN201510939605A CN105512015A CN 105512015 A CN105512015 A CN 105512015A CN 201510939605 A CN201510939605 A CN 201510939605A CN 105512015 A CN105512015 A CN 105512015A
- Authority
- CN
- China
- Prior art keywords
- function
- unexpected message
- intended application
- exception catching
- hook
- 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.)
- Granted
Links
- 238000004364 calculation method Methods 0.000 title abstract 3
- 238000000034 method Methods 0.000 claims abstract description 186
- 230000000694 effects Effects 0.000 claims abstract description 64
- 230000008569 process Effects 0.000 claims description 160
- 238000012544 monitoring process Methods 0.000 claims description 46
- 230000012447 hatching Effects 0.000 claims description 40
- 238000007619 statistical method Methods 0.000 claims description 14
- 230000008901 benefit Effects 0.000 abstract description 4
- 238000001514 detection method Methods 0.000 abstract 1
- 230000006870 function Effects 0.000 description 213
- 238000002347 injection Methods 0.000 description 9
- 239000007924 injection Substances 0.000 description 9
- 238000012795 verification Methods 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 238000000429 assembly Methods 0.000 description 1
- 230000000712 assembly Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000011230 binding agent Substances 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000000151 deposition Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000005316 response function Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 239000000243 solution Substances 0.000 description 1
- 230000009897 systematic effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
An embodiment of the invention provides an Android target application crash calculation method and relates to the technical field of computers. The method comprises the following steps: whether a window enabling function of Activity of a target application calls an exception catching function is monitored; if the window enabling function of Activity calls the exception catching function, the exception catching function is hooked through a hook function; exception messages are caught through the exception catching function; the exception messages are counted. The method solves the problem that the application crash calculation method in the prior art cannot detect and acquire crash information of certain target application in an Android system, is low in applicability and the like and has the benefit that the comprehensiveness and applicability for detection and acquisition of the crash information of the target application in the Android are improved.
Description
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of Android intended application collapse statistical method and a kind of Android intended application collapse statistic device.
Background technology
Along with the development of smart mobile phone, there is the system of multiple support smart mobile phone.Such as Android (Android) system.Android is a kind of open source code operating system based on Linux, is mainly used in the mobile terminals such as mobile phone.Android platform is made up of operating system, middleware, user interface and application software.
Along with the increase of the market share of android system, increasing developer develops APP (Application, application) based on android system, makes user use Android phone more convenient.
For developer, need the collapse case adding up each APP, to obtain the reason that collapse occurs, improve the performance of corresponding APP further.
It is when creating APP that the APP first had collapses statistical method, by the UncaughtException function of Hook (hook) thread class (thread class), captures the crash info of APP.But this method can only detect the crash info of part APP, self is achieved to the anomaly statistics of the APP of UncaughtExceptionHandler, namely in the inner logic just existed extremely adding up of this APP, utilize the UncaughtException functional based method of above-mentioned Hookthread class, just cannot detect and capture crash info.As can be seen here, the APP in first technology collapses statistical method and possibly cannot detect and the crash info obtaining some APP in android system, and applicability is not strong.
Summary of the invention
In view of the above problems, the present invention is proposed to provide a kind of overcoming the problems referred to above or a kind of Android intended application collapse statistical method solved the problem at least in part and corresponding a kind of Android intended application collapse statistic device.
According to one aspect of the present invention, provide a kind of Android intended application collapse statistical method, comprising:
The window of the Activity of monitoring objective application is enabled function and whether is called exception catching function;
If function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function;
Unexpected message is obtained by described exception catching function;
Described unexpected message is added up.
Preferably, after the step of the described unexpected message that described exception catching function is obtained, also comprise:
Judge whether the unexpected message of repetition;
If there is the unexpected message of repetition, then merger is carried out to the unexpected message repeated.
Preferably, judge whether to comprise the step of the unexpected message of repetition described in:
Judge whether that life period stabs identical unexpected message; If life period stabs identical unexpected message, then enter the step of the unexpected message repeated being carried out to merger.
Preferably, enable before whether function call the step of exception catching function at the window of Activity of monitoring objective application, also comprise:
Described Hook Function is injected the application process of described intended application.
Preferably, the described step described Hook Function being injected the application process of described intended application, comprising:
When system starts, initial hatching process system carried replaces with the first predetermined hatching process;
By described first hatching process, described Hook Function is injected the application process of described intended application.
Preferably, the described step by described first hatching process, described Hook Function being injected the application process of described intended application, being comprised:
Whether start to start by the intended application process of intended application described in described first hatching process monitoring;
If the intended application process of described intended application starts to start, then described Hook Function is injected the application process of described intended application, complete the startup of intended application process.
According to a further aspect in the invention, provide a kind of Android intended application collapse statistic device, comprising:
Monitoring module, the window of Activity being suitable for monitoring objective application is enabled function and whether is called exception catching function; If function call exception catching function enabled by the window of Activity, then enter and hook up module;
Hook up module, be suitable for hooking up described exception catching function by Hook Function;
Acquisition module, is suitable for obtaining unexpected message by described exception catching function;
Statistical module, is suitable for described unexpected message to add up.
Preferably, after described acquisition module, also comprise:
Judge module, is suitable for the unexpected message judging whether repetition; If there is the unexpected message of repetition, then enter merge module;
Merge module, the unexpected message be suitable for repeating carries out merger.
Preferably, described judge module, comprising:
Judge submodule, be suitable for judging whether that life period stabs identical unexpected message; If life period stabs identical unexpected message, then enter merge module.
Preferably, before monitoring module, also comprise:
Injection module, is suitable for the application process described Hook Function being injected described intended application.
Preferably, described injection module, comprising:
Hatching process replaces submodule, and be suitable for when system starts, initial hatching process system carried replaces with the first predetermined hatching process;
Inject submodule, be suitable for the application process by described first hatching process, described Hook Function being injected described intended application.
Preferably, described injection submodule, comprising:
Start monitoring submodule, be suitable for whether starting to start by the intended application process of intended application described in described first hatching process monitoring;
Hook Function injects submodule, if the intended application process being suitable for described intended application starts to start, then described Hook Function is injected the application process of described intended application, completes the startup of intended application process.
According to a further aspect in the invention, provide a kind of Android intended application collapse statistics equipment, comprising:
Storer, is loaded with many executable instructions;
Processor, performs described many executable instructions; Described many executable instructions comprise the method performing following steps:
The window of the Activity of monitoring objective application is enabled function and whether is called exception catching function;
If function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function;
Unexpected message is obtained by described exception catching function;
Described unexpected message is added up.
The window of Activity of monitoring objective application can enable function and whether call exception catching function according to Android intended application of the present invention collapse statistical method, if function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function, unexpected message is obtained by described exception catching function, and described unexpected message is added up, the application crashes statistical method solved thus in first technology possibly cannot detect and obtain the crash info of some intended application in android system, the problems such as applicability is not strong, achieve raising to detect and the beneficial effect obtaining the comprehensive and applicability of intended application crash info in Android.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of instructions, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 shows the flow chart of steps of a kind of according to an embodiment of the invention Android intended application collapse statistical method embodiment;
Fig. 2 shows the flow chart of steps of a kind of according to an embodiment of the invention Android intended application collapse statistical method embodiment;
Fig. 3 shows the structured flowchart of a kind of according to an embodiment of the invention Android intended application collapse statistic device embodiment;
Fig. 4 shows the structured flowchart of a kind of according to an embodiment of the invention Android intended application collapse statistic device embodiment;
Fig. 5 shows the structured flowchart of a kind of according to an embodiment of the invention Android intended application collapse statistics apparatus embodiments.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
Embodiment one
With reference to Fig. 1, show the flow chart of steps of a kind of according to an embodiment of the invention Android intended application collapse statistical method embodiment, specifically can comprise the steps:
Step 110, the window of the Activity of monitoring objective application is enabled function and whether is called exception catching function; If function call exception catching function enabled by the window of Activity, then enter step 120.
Above-mentioned intended application can be included in each application needing to obtain crash info run in android system, as 360 security guards, 360 secure browsers etc.
Activity is substantially the most also one of the most common four large assemblies in Android assembly, and Activity is an application component, provides a screen, and user can be used for mutual in order to complete a certain task.In Android application, Activity is exactly an independent screen usually, can show some controls and also can monitor and the event processing user makes response above it.In actual applications, an Activity is at least comprised in an application.
Exception catching function, i.e. UncaughtException function are the functions of the unexpected message for obtaining the collapse of corresponding intended application, and in actual applications, unexpected message can comprise and cause intended application crash reason, concrete position etc. in the application.In embodiments of the present invention, in units of Activity, the window of the Activity of monitoring objective application is enabled function and whether is called exception catching function.If function call exception catching function enabled by the window of the Activity of intended application, then can enter step 120, and if function never call exception catching function enabled by the window of the Activity of intended application, then do not perform any step.
In actual applications, for an APP, if will start an Activity of this APP, so need the Activity run function of first calling system, namely OnCreate function, then performs subsequent operation.OnCreate function is a message response function, be a function of response WM_CREATE message, and WM_CREATE message is by Create function call.OnCreate function mainly does the initial work of some necessity when this Activity starts, and after this function call is complete, this Activity just starts, or jumps to foreground.But also needing other extensive work, we know: also have onRestart function and onStart function etc. after onCreate.In fact onStart function call is complete, and this Activity does not also start completely, and also just foreground is visible, until this OnCreate just calculates and starts completely after onResume function call.
Step 120, hooks up described exception catching function by Hook Function.
In embodiments of the present invention, Hook Function can be utilized to hook up UncaughtException function, so no matter whether realize UncaughtExceptionHandler in intended application, can continue to perform for intended application and enable in function at the window of Activity the logic hooking up exception catching function.Thus outside process can be made can to add up the unexpected message of intended application.
In actual applications, if function enabled by the window monitoring the Activity of intended application, i.e. OnCreate function, calls exception catching function, then show that now intended application occurs abnormal and causes collapse, then can trigger and call Hook Function and hook up exception catching function.
Step 130, obtains unexpected message by described exception catching function.
As above-mentioned, the effect of exception catching function obtains the unexpected message causing intended application to be collapsed, so in embodiments of the present invention, after utilizing Hook Function to hook up exception catching function, can obtain by exception catching function the unexpected message causing intended application to be collapsed.
Step 140, adds up described unexpected message.
In actual applications, the unexpected message of acquisition can be added up according to current system time, and leave in message queue, then can also be according to demand, this message queue is sent to the first process, is then undertaken recording or carrying out follow-up displaying by the first process.Certainly, also can carry out adding up and depositing according to other modes, this embodiment of the present invention is not limited.
Preferably, after step 140, also comprise:
Sub-step 251, sends to the first process by adding up the unexpected message obtained with the form of broadcast.
In embodiments of the present invention, statistics unexpected message is performed by the application process of intended application, if so will process adding up the unexpected message obtained, then needs other process.The form of broadcast so can be utilized in the embodiment of the present invention to send to the first process by adding up the unexpected message obtained, and the first process then receives the unexpected message of adding up and obtaining, and records or show it.
In embodiments of the present invention, can by aforementioned Hook Function after statistics unexpected message, by the unexpected message of statistics with the form transmission of broadcast, the first process then receives this broadcast, and the unexpected message of therefrom adding up processes.
In actual applications, the process sending the unexpected message of statistics by the form broadcasted is centered by ActivityManagerService.Broadcast sender by broadcast transmission to ActivityManagerService, after ActivityManagerService receives this broadcast, will check which process have subscribed this broadcast in the registration center of oneself, then this broadcast transmission in these processes.In short, the transmit path of broadcast is exactly from sender to ActivityManagerService, then from ActivityManagerService to recipient, two processes in the middle of this have all been come by Binder inter-process communication mechanisms.
In embodiments of the present invention, the broadcast that the unexpected message of the first process subscription statistics is corresponding can be set in advance in the registration center of ActivityManagerService.
Sub-step 252, after described first process receives the unexpected message of described statistics, is undertaken recording or showing by the unexpected message of described statistics.
First process, after receiving the unexpected message of statistics, can show the unexpected message of this statistics on the specific interface of the android system of correspondence.
In embodiments of the present invention, after the unexpected message receiving whole statistics that a certain APP comprises, then the unexpected message of each statistics can be shown on specific interface.Certainly, also can show the unexpected message of statistics according to other modes, to this, the embodiment of the present invention is not limited.
In embodiments of the present invention, the window of the Activity of monitoring objective application is enabled function and whether is called exception catching function, if function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function, unexpected message is obtained by described exception catching function, and described unexpected message is added up, all can apply in android system, obtain the unexpected message that intended application collapse is corresponding, thus improve the comprehensive and applicability of intended application collapse statistics.
Embodiment two
With reference to Fig. 2, show the flow chart of steps of a kind of according to an embodiment of the invention Android intended application collapse statistical method embodiment, specifically can comprise the steps:
Step 210, injects the application process of described intended application by Hook Function.
In embodiments of the present invention, the Authority Verification result that Hook Function returns for tackling Authority Verification function, performs the logical process Authority Verification result represented by checking being back to system simultaneously.So the embodiment of the present invention needs the application process first Hook Function being injected each application.
Preferably, step 210, comprising:
Sub-step 211, when system starts, initial hatching process system carried replaces with the first predetermined hatching process.
In actual applications, the normal boot process of android system is roughly: start up system->init process reads init.rc->init process creation zygote (incubator) process that starts->zygote process creation java virtual machine loading zygoteInit class-> and waits for that the establishment message->zygote process of ActivityManagerService to socket write establishment process is according to the corresponding process of described establishment message establishing by socket-> that described virtual machine registration needs are monitored.
In embodiments of the present invention, in order to realize the monitoring to each application call Authority Verification function, first initial to android system incubator process and zygote process is needed to replace, replace with the first incubator process of specifying, an i.e. zygote process, one zygote process can monitor the application process of each application the need of establishment, namely monitor aforementioned socket and whether have establishment message, if had, create this application process, this application process of function call injection is respectively hooked up by the embodiment of the present invention in constructive process, a zygote process can create one and specify process in android system simultaneously, read privately owned class in order to calling interface from assigned address and complete the read registration of privately owned class android system, the each privately owned class being about to read normal operation also can not have influence on the operation of other programs in android system.
In actual applications this application process is injected in the SO storehouse hooking up function corresponding, this SO storehouse comprises the logical code of Hook Function, thus can monitor this application process and whether call Authority Verification function.
In android system, all program process and system service process SystemServer breed (fork) out by zygote process, therefore, the present invention replaces with a zygote process by the zygote process that android system is initial and realizes monitoring and injection process.
Certainly, after the zygote process that replacement android system is initial is a zygote process, need to restart android system.The function of the zygote process after replacement, except comprising the function of initial zygote process, also added each application of monitoring and whether calls Authority Verification function.
In actual applications, Xposed framework can be utilized to realize incubator process initial for android system being replaced with the first incubator process of specifying.Wherein, Xposed framework aly can not revise APK (AndroidPackage, Android installation kit) when affect program run framework services, many powerful modules can be produced based on it, and operate when function is not conflicted simultaneously.So, in embodiments of the present invention, utilize Xposed framework, incubator process initial for android system is replaced with the first incubator process of specifying, but other original any functions of android system can not be affected.
Sub-step 212, injects the application process of described intended application by described Hook Function by described first hatching process.
Based on the logic of an aforementioned zygote process, by a zygote process, Hook Function can be injected the application process of each application.
Preferably, sub-step 212, comprising:
Whether sub-step 2121, start to start by the intended application process of intended application described in described first hatching process monitoring.
In actual applications, before each application call Authority Verification function, first need the application process starting this application, and then application process can be utilized to call Authority Verification function.
In embodiments of the present invention, can by the first application process that respectively apply of hatching process monitoring whether start.
Sub-step 2122, if the intended application process of described intended application starts to start, then injects the application process of described intended application, completes the startup of intended application process by described Hook Function.
The essence of hook (Hook) function is one section of program in order to disposal system message, can pass through system call, its injected system.In embodiments of the present invention, when application process starts, by a zygote process, Hook Function can be injected each application process, then completes the startup of application process.
In actual applications this application process is injected in the SO storehouse hooking up function corresponding, this SO storehouse comprises the logical code of Hook Function, thus can monitor this application process and whether call Authority Verification function.
Step 220, the window of the Activity of monitoring objective application is enabled function and whether is called exception catching function; If function call exception catching function enabled by the window of Activity, then enter step 230.
Step 230, hooks up described exception catching function by Hook Function.
Step 240, obtains unexpected message by described exception catching function.
Step 250, adds up described unexpected message.
Step 260, judges whether the unexpected message of repetition; If there is the unexpected message of repetition, then enter step 270.
In actual applications, when carrying out collapse statistics for intended application, after opening an interface, tester may switch to another interface, the position of the Activity that then last interface is corresponding in stack can move down, and the Activity that the interface of new generation is corresponding can replace Activity corresponding to last interface in the position of stack top.The program that now last interface is corresponding still keeps the state run on backstage.
So, when intended application occurs extremely causing collapse, the Activity of then now corresponding with intended application display and all can simultaneously call exception catching function at the Activity of running background, then step 230-250 is performed, so will for these abnormal conditions, obtain multiple unexpected message, so in this case, the multiple unexpected messages obtained are the same simultaneously.
As can be seen here, may occur that the unexpected message obtained is the situation of repetition in actual applications, so in embodiments of the present invention, the unexpected message of repetition can be judged whether.
In embodiments of the present invention, in order to improve efficiency and the validity of follow-up performance evaluation and Optimization Work, duplicate removal process can be carried out to the unexpected message obtained.First, the unexpected message judging successively whether to have repetition in the unexpected message after adding up is needed.If there is the unexpected message repeated, then can carry out merger to the unexpected message repeated, if there is not the unexpected message of repetition, then not perform any operation.
Preferably, step 260, comprising:
Sub-step 261, judges whether that life period stabs identical unexpected message; If life period stabs identical unexpected message, then enter step 270.
Timestamp is a character string normally, identifies the time at certain a moment uniquely.In actual applications, there is the timestamp of mark acquisition time in the unexpected message utilizing exception catching function to obtain.
Unexpected message according to aforesaid repetition obtains simultaneously, timestamp so be wherein identical or difference between timestamp between each unexpected message in very little scope.So in embodiments of the present invention, preferably, can by judging whether that life period stabs identical unexpected message, or whether the difference between the timestamp judging each unexpected message is less than threshold value, such as whether be less than 1s, thus determine whether the unexpected message of repetition.
Step 270, carries out merger to the unexpected message repeated.
In embodiments of the present invention, merger just refers to the unexpected message for repeating, only retain wherein any one.In addition, in embodiments of the present invention, for the unexpected message repeated, the unexpected message read first in storage space can be only retained in, to complete the merger to repeating unexpected message.Certainly, other mode also can be adopted to carry out merger, and to this, the embodiment of the present invention is not limited.
Such as, the unexpected message that as if statistics obtains is respectively A, B, C, D, and wherein the timestamp of A with B is the same, and the timestamp of C with D is the same.
Then through step 260-270, the unexpected message finally obtained can be A or B, C or D.As, A, C, or A, D, or B, C, or B, D.
In embodiments of the present invention, the window of the Activity of same monitoring objective application is enabled function and whether is called exception catching function, if function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function, unexpected message is obtained by described exception catching function, and described unexpected message is added up, all can apply in android system, obtain the unexpected message that intended application collapse is corresponding, thus improve the comprehensive and applicability of intended application collapse statistics.
And, in embodiments of the present invention, specific first hatching process is utilized to replace hatching process original in android system, thus achieve each intended application Hook Function being injected android system, utilize Hook Function to monitor each application and whether call exception catching function, if then utilize Hook Function to hook up exception catching function, then the exception catching function by hooking up obtains unexpected message, thus all can apply in android system, obtain the unexpected message that intended application collapse is corresponding, further increase the comprehensive and applicability of intended application collapse statistics.
In addition, in embodiments of the present invention, by judging to add up the unexpected message obtaining whether existing in unexpected message repetition, and merger is carried out to the unexpected message repeated, thus the duplicate removal process achieved unexpected message, thus the repetition rate of obtained unexpected message can be reduced, improve validity, and the efficiency of follow-up test People Analysis can be improved.
For embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the embodiment of the present invention is not by the restriction of described sequence of movement, because according to the embodiment of the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and involved action might not be that the embodiment of the present invention is necessary.
Embodiment three
With reference to Fig. 3, show the structured flowchart of a kind of according to an embodiment of the invention Android intended application collapse statistic device embodiment, specifically can comprise as lower module:
Monitoring module 310, the window of Activity being suitable for monitoring objective application is enabled function and whether is called exception catching function; If function call exception catching function enabled by the window of Activity, then enter and hook up module.
Hook up module 320, be suitable for hooking up described exception catching function by Hook Function.
Acquisition module 330, is suitable for obtaining unexpected message by described exception catching function.
Statistical module 340, is suitable for described unexpected message to add up.
In embodiments of the present invention, the window of the Activity of monitoring objective application is enabled function and whether is called exception catching function, if function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function, unexpected message is obtained by described exception catching function, and described unexpected message is added up, all can apply in android system, obtain the unexpected message that intended application collapse is corresponding, thus improve the comprehensive and applicability of intended application collapse statistics.
Embodiment four
With reference to Fig. 4, show the structured flowchart of a kind of according to an embodiment of the invention Android intended application collapse statistic device embodiment, specifically can comprise as lower module:
Injection module 410, is suitable for the application process described Hook Function being injected described intended application.Specifically comprise:
Hatching process replaces submodule 411, and be suitable for when system starts, initial hatching process system carried replaces with the first predetermined hatching process.
Inject submodule 412, be suitable for the application process by described first hatching process, described Hook Function being injected described intended application.
Preferably, inject submodule 412, comprising:
Start monitoring submodule, be suitable for whether starting to start by the intended application process of intended application described in described first hatching process monitoring.
Hook Function injects submodule, if the intended application process being suitable for described intended application starts to start, then described Hook Function is injected the application process of described intended application, completes the startup of intended application process.
Monitoring module 420, the window of Activity being suitable for monitoring objective application is enabled function and whether is called exception catching function; If function call exception catching function enabled by the window of Activity, then enter and hook up module.
Hook up module 430, be suitable for hooking up described exception catching function by Hook Function.
Acquisition module 440, is suitable for obtaining unexpected message by described exception catching function.
Statistical module 450, is suitable for described unexpected message to add up.
Judge module 460, is suitable for the unexpected message judging whether repetition; If there is the unexpected message of repetition, then enter merge module.Specifically comprise:
Judge submodule 461, be suitable for judging whether that life period stabs identical unexpected message; If life period stabs identical unexpected message, then enter merge module.
Merge module 470, the unexpected message be suitable for repeating carries out merger.
In embodiments of the present invention, the window of the Activity of same monitoring objective application is enabled function and whether is called exception catching function, if function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function, unexpected message is obtained by described exception catching function, and described unexpected message is added up, all can apply in android system, obtain the unexpected message that intended application collapse is corresponding, thus improve the comprehensive and applicability of intended application collapse statistics.
And, in embodiments of the present invention, specific first hatching process is utilized to replace hatching process original in android system, thus achieve each intended application Hook Function being injected android system, the first hatching process monitoring is utilized respectively to apply whether call exception catching function, if then utilize Hook Function to hook up exception catching function, then the exception catching function by hooking up obtains unexpected message, thus all can apply in android system, obtain the unexpected message that intended application collapse is corresponding, further increase the comprehensive and applicability of intended application collapse statistics.
In addition, in embodiments of the present invention, by judging to add up the unexpected message obtaining whether existing in unexpected message repetition, and merger is carried out to the unexpected message repeated, thus the duplicate removal process achieved unexpected message, thus the repetition rate of obtained unexpected message can be reduced, improve validity, and the efficiency of follow-up test People Analysis can be improved.
For device embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Embodiment five
With reference to Fig. 5, show the structured flowchart of a kind of according to an embodiment of the invention Android intended application collapse statistics apparatus embodiments, described equipment 500 specifically comprises:
Storer 510, is loaded with many executable instructions.
Processor 520, performs described many executable instructions; Described many executable instructions comprise the method performing following steps:
The window of the Activity of monitoring objective application is enabled function and whether is called exception catching function;
If function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function;
Unexpected message is obtained by described exception catching function;
Described unexpected message is added up.
It should be noted that, described executable instruction can comprise the method performing above-mentioned arbitrary steps.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, equivalent or similar object alternative features replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary array mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that and microprocessor or digital signal processor (DSP) can be used in practice to realize according to the embodiment of the present invention
android intended application collapse statisticsthe some or all functions of the some or all parts in equipment.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
The invention discloses A1, a kind of Android intended application collapse statistical method, comprising:
The window of the Activity of monitoring objective application is enabled function and whether is called exception catching function;
If function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function;
Unexpected message is obtained by described exception catching function;
Described unexpected message is added up.
A2, method as described in A1, after the step of the described unexpected message obtained by described exception catching function, also comprise:
Judge whether the unexpected message of repetition;
If there is the unexpected message of repetition, then merger is carried out to the unexpected message repeated.
A3, method as described in A2, described in judge whether to comprise the step of the unexpected message of repetition:
Judge whether that life period stabs identical unexpected message; If life period stabs identical unexpected message, then enter the step of the unexpected message repeated being carried out to merger.
A4, method as described in A1, enable before whether function call the step of exception catching function at the window of the Activity of monitoring objective application, also comprise:
Described Hook Function is injected the application process of described intended application.
A5, method as described in A4, the described step described Hook Function being injected the application process of described intended application, comprising:
When system starts, initial hatching process system carried replaces with the first predetermined hatching process;
By described first hatching process, described Hook Function is injected the application process of described intended application.
A6, method as described in A5, the described step by described first hatching process, described Hook Function being injected the application process of described intended application, being comprised:
Whether start to start by the intended application process of intended application described in described first hatching process monitoring;
If the intended application process of described intended application starts to start, then described Hook Function is injected the application process of described intended application, complete the startup of intended application process.
The invention also discloses B7, a kind of Android intended application collapse statistic device, comprising:
Monitoring module, the window of Activity being suitable for monitoring objective application is enabled function and whether is called exception catching function; If function call exception catching function enabled by the window of Activity, then enter and hook up module;
Hook up module, be suitable for hooking up described exception catching function by Hook Function;
Acquisition module, is suitable for obtaining unexpected message by described exception catching function;
Statistical module, is suitable for described unexpected message to add up.
B8, device as described in B7, after described acquisition module, also comprise:
Judge module, is suitable for the unexpected message judging whether repetition; If there is the unexpected message of repetition, then enter merge module;
Merge module, the unexpected message be suitable for repeating carries out merger.
B9, device as described in B8, described judge module, comprising:
Judge submodule, be suitable for judging whether that life period stabs identical unexpected message; If life period stabs identical unexpected message, then enter merge module.
B10, device as described in B7, before monitoring module, also comprise:
Injection module, is suitable for the application process described Hook Function being injected described intended application.
B11, device as described in B10, described injection module, comprising:
Hatching process replaces submodule, and be suitable for when system starts, initial hatching process system carried replaces with the first predetermined hatching process;
Inject submodule, be suitable for the application process by described first hatching process, described Hook Function being injected described intended application.
B12, device as described in B11, described injection submodule, comprising:
Start monitoring submodule, be suitable for whether starting to start by the intended application process of intended application described in described first hatching process monitoring;
Hook Function injects submodule, if the intended application process being suitable for described intended application starts to start, then described Hook Function is injected the application process of described intended application, completes the startup of intended application process.
The invention also discloses C13, a kind of Android intended application collapse statistics equipment, comprising:
Storer, is loaded with many executable instructions;
Processor, performs described many executable instructions; Described many executable instructions comprise the method performing following steps:
The window of the Activity of monitoring objective application is enabled function and whether is called exception catching function;
If function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function;
Unexpected message is obtained by described exception catching function;
Described unexpected message is added up.
Claims (10)
1. an Android intended application collapse statistical method, comprising:
The window of the Activity of monitoring objective application is enabled function and whether is called exception catching function;
If function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function;
Unexpected message is obtained by described exception catching function;
Described unexpected message is added up.
2. method according to claim 1, is characterized in that, after the step of the described unexpected message obtained by described exception catching function, also comprises:
Judge whether the unexpected message of repetition;
If there is the unexpected message of repetition, then merger is carried out to the unexpected message repeated.
3. method according to claim 2, is characterized in that, described in judge whether to comprise the step of the unexpected message of repetition:
Judge whether that life period stabs identical unexpected message; If life period stabs identical unexpected message, then enter the step of the unexpected message repeated being carried out to merger.
4. method according to claim 1, is characterized in that, enables before whether function call the step of exception catching function, also comprise at the window of Activity of monitoring objective application:
Described Hook Function is injected the application process of described intended application.
5. method according to claim 4, is characterized in that, the described step described Hook Function being injected the application process of described intended application, comprising:
When system starts, initial hatching process system carried replaces with the first predetermined hatching process;
By described first hatching process, described Hook Function is injected the application process of described intended application.
6. method according to claim 5, is characterized in that, the described step by described first hatching process, described Hook Function being injected the application process of described intended application, being comprised:
Whether start to start by the intended application process of intended application described in described first hatching process monitoring;
If the intended application process of described intended application starts to start, then described Hook Function is injected the application process of described intended application, complete the startup of intended application process.
7. an Android intended application collapse statistic device, comprising:
Monitoring module, the window of Activity being suitable for monitoring objective application is enabled function and whether is called exception catching function; If function call exception catching function enabled by the window of Activity, then enter and hook up module;
Hook up module, be suitable for hooking up described exception catching function by Hook Function;
Acquisition module, is suitable for obtaining unexpected message by described exception catching function;
Statistical module, is suitable for described unexpected message to add up.
8. device according to claim 7, is characterized in that, after described acquisition module, also comprises:
Judge module, is suitable for the unexpected message judging whether repetition; If there is the unexpected message of repetition, then enter merge module;
Merge module, the unexpected message be suitable for repeating carries out merger.
9. device according to claim 8, is characterized in that, described judge module, comprising:
Judge submodule, be suitable for judging whether that life period stabs identical unexpected message; If life period stabs identical unexpected message, then enter merge module.
10. an Android intended application collapse statistics equipment, comprising:
Storer, is loaded with many executable instructions;
Processor, performs described many executable instructions; Described many executable instructions comprise the method performing following steps:
The window of the Activity of monitoring objective application is enabled function and whether is called exception catching function;
If function call exception catching function enabled by the window of Activity, then hook up described exception catching function by Hook Function;
Unexpected message is obtained by described exception catching function;
Described unexpected message is added up.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510939605.1A CN105512015B (en) | 2015-12-15 | 2015-12-15 | A kind of Android intended application collapse statistical method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510939605.1A CN105512015B (en) | 2015-12-15 | 2015-12-15 | A kind of Android intended application collapse statistical method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105512015A true CN105512015A (en) | 2016-04-20 |
CN105512015B CN105512015B (en) | 2018-09-04 |
Family
ID=55720016
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510939605.1A Active CN105512015B (en) | 2015-12-15 | 2015-12-15 | A kind of Android intended application collapse statistical method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105512015B (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106227672A (en) * | 2016-08-10 | 2016-12-14 | 中车株洲电力机车研究所有限公司 | A kind of built-in application program fault catches and processing method |
CN106681801A (en) * | 2016-05-09 | 2017-05-17 | 腾讯科技(深圳)有限公司 | Method and apparatus for executing events |
CN106776090A (en) * | 2016-11-29 | 2017-05-31 | 郑州云海信息技术有限公司 | A kind of method for collecting information when RHEL operating systems are without response |
CN107491383A (en) * | 2017-08-17 | 2017-12-19 | 杭州师范大学 | Catching method, device and the mobile terminal of application crashes Operation Log |
CN108121633A (en) * | 2016-11-30 | 2018-06-05 | 北京国双科技有限公司 | Exception catching method and device |
CN108268332A (en) * | 2017-08-10 | 2018-07-10 | 广州神马移动信息科技有限公司 | Webpage abnormality monitoring method, equipment and system |
CN108334415A (en) * | 2017-01-20 | 2018-07-27 | 百度在线网络技术(北京)有限公司 | A kind of fault-tolerance processing method, device, terminal and storage medium |
CN109408261A (en) * | 2018-09-26 | 2019-03-01 | 中国平安财产保险股份有限公司 | Application crash processing method, device, computer equipment and storage medium |
CN110221928A (en) * | 2019-06-11 | 2019-09-10 | Oppo广东移动通信有限公司 | Information recording method, device, terminal and storage medium |
CN110888781A (en) * | 2019-11-21 | 2020-03-17 | 腾讯科技(深圳)有限公司 | Application blockage detection method and detection device |
CN113407417A (en) * | 2021-07-14 | 2021-09-17 | 广州博冠信息科技有限公司 | Method, apparatus, medium, and device for capturing and receiving abnormality |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1492320A (en) * | 2002-10-25 | 2004-04-28 | 华为技术有限公司 | Windows program abnormality capturing and positioning method |
CN1704908A (en) * | 2004-05-26 | 2005-12-07 | 华为技术有限公司 | Method for locating program abnormity |
US8255931B2 (en) * | 2008-02-11 | 2012-08-28 | Blue Coat Systems, Inc. | Method for implementing ejection-safe API interception |
JP5116606B2 (en) * | 2008-08-07 | 2013-01-09 | 横河電機株式会社 | Software analysis system |
CN103678091A (en) * | 2013-12-19 | 2014-03-26 | 北京奇虎科技有限公司 | Method and device for processing crash data of application software |
-
2015
- 2015-12-15 CN CN201510939605.1A patent/CN105512015B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1492320A (en) * | 2002-10-25 | 2004-04-28 | 华为技术有限公司 | Windows program abnormality capturing and positioning method |
CN1704908A (en) * | 2004-05-26 | 2005-12-07 | 华为技术有限公司 | Method for locating program abnormity |
US8255931B2 (en) * | 2008-02-11 | 2012-08-28 | Blue Coat Systems, Inc. | Method for implementing ejection-safe API interception |
JP5116606B2 (en) * | 2008-08-07 | 2013-01-09 | 横河電機株式会社 | Software analysis system |
CN103678091A (en) * | 2013-12-19 | 2014-03-26 | 北京奇虎科技有限公司 | Method and device for processing crash data of application software |
Non-Patent Citations (1)
Title |
---|
LANGRESSER: "android和IOS平台的崩溃捕获和收集", 《HTTP://BLOG.CSDN.NET/LANGRESSER_KING/ARTICLE/DETAILS/8288195》 * |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106681801A (en) * | 2016-05-09 | 2017-05-17 | 腾讯科技(深圳)有限公司 | Method and apparatus for executing events |
CN106227672B (en) * | 2016-08-10 | 2019-07-09 | 中车株洲电力机车研究所有限公司 | A kind of built-in application program failure captures and processing method |
CN106227672A (en) * | 2016-08-10 | 2016-12-14 | 中车株洲电力机车研究所有限公司 | A kind of built-in application program fault catches and processing method |
CN106776090A (en) * | 2016-11-29 | 2017-05-31 | 郑州云海信息技术有限公司 | A kind of method for collecting information when RHEL operating systems are without response |
CN108121633A (en) * | 2016-11-30 | 2018-06-05 | 北京国双科技有限公司 | Exception catching method and device |
CN108121633B (en) * | 2016-11-30 | 2021-08-17 | 北京国双科技有限公司 | Abnormity capturing method and device |
CN108334415A (en) * | 2017-01-20 | 2018-07-27 | 百度在线网络技术(北京)有限公司 | A kind of fault-tolerance processing method, device, terminal and storage medium |
CN108268332A (en) * | 2017-08-10 | 2018-07-10 | 广州神马移动信息科技有限公司 | Webpage abnormality monitoring method, equipment and system |
CN107491383A (en) * | 2017-08-17 | 2017-12-19 | 杭州师范大学 | Catching method, device and the mobile terminal of application crashes Operation Log |
CN109408261A (en) * | 2018-09-26 | 2019-03-01 | 中国平安财产保险股份有限公司 | Application crash processing method, device, computer equipment and storage medium |
CN110221928A (en) * | 2019-06-11 | 2019-09-10 | Oppo广东移动通信有限公司 | Information recording method, device, terminal and storage medium |
CN110888781A (en) * | 2019-11-21 | 2020-03-17 | 腾讯科技(深圳)有限公司 | Application blockage detection method and detection device |
CN110888781B (en) * | 2019-11-21 | 2021-11-16 | 腾讯科技(深圳)有限公司 | Application blockage detection method and detection device |
CN113407417A (en) * | 2021-07-14 | 2021-09-17 | 广州博冠信息科技有限公司 | Method, apparatus, medium, and device for capturing and receiving abnormality |
Also Published As
Publication number | Publication date |
---|---|
CN105512015B (en) | 2018-09-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105512015A (en) | Android target application crash calculation method and device | |
CN105573755A (en) | Method and device for acquiring application Activity rendering time | |
CN110941528B (en) | Log buried point setting method, device and system based on fault | |
CN104978529B (en) | Abnormality eliminating method, abnormality processing system and the abnormality processing server of webpage front-end | |
US10664385B1 (en) | Debugging in an actor-based system | |
CN105468529A (en) | Accurate traversal method and apparatus for UI controls of android application | |
CN104375861A (en) | Installation-free operation method and device for application programs based on Android platform and terminal | |
CN104572327A (en) | Method, device and system for processing browser crash | |
CN111144839B (en) | Project construction method, continuous integration system and terminal equipment | |
CN106980565B (en) | Upgrading process monitoring method and device | |
CN109672553A (en) | Gateway Dynamic Configuration, system, computer equipment and storage medium | |
CN111190573A (en) | Application program point burying method and device and electronic equipment | |
CN105577799A (en) | Method and device for detecting fault of database cluster | |
CN111026581A (en) | Application program repairing method, device, system, storage medium and electronic device | |
CN110209520B (en) | Method and device for improving SSD (solid State disk) testing efficiency, computer equipment and storage medium | |
US20190121985A1 (en) | Detecting vulnerabilities in applications during execution | |
CN107741891B (en) | Object reconstruction method, medium, device and computing equipment | |
CN106997313B (en) | Signal processing method and system of application program and terminal equipment | |
CN104484176A (en) | Android system window object acquiring method and android system window object acquiring device | |
CN104915593A (en) | Binding removing processing method and system for software | |
CN105630672A (en) | Automatic application monitoring method and device | |
CN114020513A (en) | Method and device for processing log information | |
CN113342376B (en) | Method and device for upgrading operating system of Internet of things equipment | |
CN107451050B (en) | Function acquisition method and device and server | |
CN113778800B (en) | Error information processing method, device, system, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220719 Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Patentee before: Qizhi software (Beijing) Co.,Ltd. |
|
TR01 | Transfer of patent right |