CN105512015B - A kind of Android intended application collapse statistical method and device - Google Patents
A kind of Android intended application collapse statistical method and device Download PDFInfo
- Publication number
- CN105512015B CN105512015B CN201510939605.1A CN201510939605A CN105512015B CN 105512015 B CN105512015 B CN 105512015B CN 201510939605 A CN201510939605 A CN 201510939605A CN 105512015 B CN105512015 B CN 105512015B
- Authority
- CN
- China
- Prior art keywords
- function
- intended application
- unexpected message
- application
- exception catching
- 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.)
- Active
Links
- 238000007619 statistical method Methods 0.000 title claims abstract description 17
- 238000000034 method Methods 0.000 claims abstract description 179
- 230000000694 effects Effects 0.000 claims abstract description 63
- 238000012544 monitoring process Methods 0.000 claims abstract description 43
- 230000006870 function Effects 0.000 claims description 241
- 230000008569 process Effects 0.000 claims description 154
- 230000012447 hatching Effects 0.000 claims description 40
- 238000002347 injection Methods 0.000 claims description 14
- 239000007924 injection Substances 0.000 claims description 14
- 238000010978 in-process monitoring Methods 0.000 claims description 7
- 235000013399 edible fruits Nutrition 0.000 claims 1
- 238000005516 engineering process Methods 0.000 abstract description 7
- 230000000875 corresponding effect Effects 0.000 description 16
- 238000012795 verification Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000003252 repetitive effect Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 239000011230 binding agent Substances 0.000 description 1
- 238000004891 communication 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
- 230000003993 interaction Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 239000000243 solution Substances 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 present invention provides a kind of Android intended applications to collapse statistical method, is related to field of computer technology.The method includes:The window of the Activity of monitoring objective application enables whether function calls exception catching function;If the window of Activity enables function call exception catching function, the exception catching function is hooked up by Hook Function;Unexpected message is obtained by the exception catching function;The unexpected message is counted.The present invention solves the crash info that the application crashes statistical method in first technology possibly can not detect and obtain certain intended applications in android system, the problems such as applicability is not strong achieves the advantageous effect for improving and detecting and obtain the comprehensive and applicability of intended application crash info in Android.
Description
Technical field
The present invention relates to field of computer technology, collapse statistical method and one kind more particularly to a kind of Android intended application
Android intended application collapses statistic device.
Background technology
With the development of smart mobile phone, there are a variety of systems for supporting smart mobile phone.Such as Android (Android) system
System.Android is a kind of open source code operating system based on Linux, is mainly used for the mobile terminals such as mobile phone.
Android platform is made of operating system, middleware, user interface and application software.
With the increase of the occupation rate of market of android system, more and more developers are developed based on android system
APP (Application, using), keep user more convenient using Android phone.
For developer, the collapse case for counting each APP is needed, to obtain the reason of collapsing, further
Improve the performance of corresponding APP.
The APP collapse statistical methods first having are to pass through Hook (hook) thread classes (thread class) when creating APP
UncaughtException functions capture the crash info of APP.But this method can only detect the collapse letter of part APP
Breath, the anomaly statistics of the APP for itself having been realized in UncaughtExceptionHandler, i.e., inside the APP just
It has existed to the abnormal logic counted, utilizes the function sides UncaughtException of above-mentioned Hook thread classes
Method can not just detect and capture crash info.It can be seen that formerly the APP collapse statistical methods in technology possibly can not detect
And the crash info of certain APP in android system is obtained, applicability is not strong.
Invention content
In view of the above problems, it is proposed that the present invention overcoming the above problem in order to provide one kind or solves at least partly
State a kind of Android intended application collapse statistical method of problem and a kind of corresponding Android intended application collapse statistic device.
One side according to the present invention provides a kind of Android intended application collapse statistical method, including:
The window of the Activity of monitoring objective application enables whether function calls exception catching function;
If the window of Activity enables function call exception catching function, the exception is hooked up by Hook Function
Capture function;
Unexpected message is obtained by the exception catching function;
The unexpected message is counted.
Preferably, after the step of unexpected message that the exception catching function is obtained, further include:
Judge whether there is the unexpected message of repetition;
If there is the unexpected message repeated, then merger is carried out to the unexpected message repeated.
Preferably, the step of unexpected message for judging whether there is repetition, including:
Judge whether the identical unexpected message of timestamp;If there is the identical unexpected message of timestamp, then enter
The step of merger is carried out to the unexpected message repeated.
Preferably, the step whether function calls exception catching function enabled in the window of the Activity of monitoring objective application
Before rapid, further include:
The Hook Function is injected in the application process of the intended application.
Preferably, the step in the application process that the Hook Function is injected to the intended application, including:
When system starts, the initial hatching process that system carries is replaced with into scheduled first hatching process;
The Hook Function is injected in the application process of the intended application by the first hatching process.
Preferably, it is described by the first hatching process by the Hook Function inject the application of the intended application into
Step in journey, including:
Whether the intended application process for hatching intended application described in process monitoring by described first starts to start;
If the intended application process of the intended application starts to start, the Hook Function is injected into the target and is answered
Application process completes the startup of intended application process.
According to another aspect of the present invention, a kind of Android intended application collapse statistic device is provided, including:
The window of monitoring module, the Activity suitable for monitoring objective application enables whether function calls exception catching letter
Number;If the window of Activity enables function call exception catching function, enters and hook up module;
Module is hooked up, the exception catching function is hooked up suitable for passing through Hook Function;
Acquisition module is suitable for obtaining unexpected message by the exception catching function;
Statistical module, suitable for counting the unexpected message.
Preferably, after the acquisition module, further include:
Judgment module, suitable for judging whether there is the unexpected message of repetition;If there is the unexpected message repeated, then enter merger
Module;
Merger module is suitable for carrying out merger to the unexpected message repeated.
Preferably, the judgment module, including:
Judging submodule, suitable for judging whether the identical unexpected message of timestamp;It is identical if there is timestamp
Unexpected message then enters merger module.
Preferably, before monitoring module, further include:
Injection module, suitable for injecting the Hook Function in the application process of the intended application.
Preferably, the injection module, including:
Hatching process replaces submodule, is suitable for when system starts, and the initial hatching process that system carries is replaced with pre-
The first fixed hatching process;
Submodule is injected, suitable for the Hook Function is injected answering for the intended application by the first hatching process
With in process.
Preferably, the injection submodule, including:
Start monitoring submodule, the intended application process for being suitable for hatching intended application described in process monitoring by described first
Whether start to start;
Hook Function injects submodule, if the intended application process suitable for the intended application starts to start, by institute
The application process that Hook Function injects the intended application is stated, the startup of intended application process is completed.
According to another aspect of the present invention, a kind of Android intended application collapse statistics equipment is provided, including:
Memory is loaded with a plurality of executable instruction;
Processor executes a plurality of executable instruction;The a plurality of executable instruction includes executing the side of following steps
Method:
The window of the Activity of monitoring objective application enables whether function calls exception catching function;
If the window of Activity enables function call exception catching function, the exception is hooked up by Hook Function
Capture function;
Unexpected message is obtained by the exception catching function;
The unexpected message is counted.
The window for the Activity that Android intended application collapse statistical method according to the present invention can be applied with monitoring objective
It enables whether function calls exception catching function, if the window of Activity enables function call exception catching function, leads to
It crosses Hook Function and hooks up the exception catching function, unexpected message is obtained by the exception catching function, and by the exception
Message is counted, and the application crashes statistical method thus solved in first technology possibly can not detect and obtain Android systems
The problems such as crash info of certain intended applications in system, applicability is not strong, achieves raising and detects and obtain target in Android
The advantageous effect of the comprehensive and applicability of application crashes information.
Above description is only the general introduction of technical solution of the present invention, in order to better understand the technical means of the present invention,
And can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, below the special specific implementation mode for lifting the present invention.
Description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit are common for this field
Technical staff will become clear.Attached drawing only for the purpose of illustrating preferred embodiments, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of step of Android intended application collapse statistical method embodiment according to an embodiment of the invention
Rapid flow chart;
Fig. 2 shows a kind of steps of Android intended application collapse statistical method embodiment according to an embodiment of the invention
Rapid flow chart;
Fig. 3 shows a kind of knot of Android intended application collapse statistic device embodiment according to an embodiment of the invention
Structure block diagram;
Fig. 4 shows a kind of knot of Android intended application collapse statistic device embodiment according to an embodiment of the invention
Structure block diagram;
Fig. 5 shows a kind of knot of Android intended application collapse statistics apparatus embodiments according to an embodiment of the invention
Structure block diagram.
Specific implementation mode
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Completely it is communicated to those skilled in the art.
Embodiment one
Referring to Fig.1, show that a kind of Android intended application collapse statistical method according to an embodiment of the invention is implemented
The step flow chart of example, can specifically include following steps:
Step 110, the window of the Activity of monitoring objective application enables whether function calls exception catching function;If
The window of Activity enables function call exception catching function, then enters step 120.
Above-mentioned intended application may include each application for needing to obtain crash info run in android system,
Such as 360 security guards, 360 secure browsers.
It is also most commonly seen one of four big components that Activity, which is most basic in Android components, and Activity is
One application component, provides a screen, and user can be used for interaction to complete a certain task.In an Android
In, an Activity is exactly usually an individual screen, it can show that some controls can also be monitored simultaneously above
The event of processing user responds.In practical applications, an Activity is included at least in an application.
Exception catching function, i.e. UncaughtException functions are the exceptions for obtaining corresponding intended application collapse
The function of message, in practical applications, unexpected message may include cause intended application crash reason, it is specific in the application
Position etc..In embodiments of the present invention, as unit of Activity, the window of the Activity of monitoring objective application enables letter
Whether number calls exception catching function.If the window of the Activity of intended application enables function call exception catching function,
120 can be then entered step, and if the window of the Activity of intended application enables function never call exception catching function,
Any step is not executed.
In practical applications, it for an APP, if to start an Activity of the APP, needs first to call
The Activity run functions of system, i.e. OnCreate functions, then execute subsequent operation.OnCreate functions are a message
Receptance function is in response to a function of WM_CREATE message, and WM_CREATE message is by Create function calls.
OnCreate functions mainly do some necessary initial works when this Activity starts, after this function call is complete, this
A Activity is not to say that and just has been started up, or jumps to foreground.But other extensive works are also needed to, we
Know:There are onRestart functions and onStart functions etc. after onCreate.Actually onStart function calls finish
This Activity not yet completely start, also only foreground as it can be seen that after onResume function calls this OnCreate
It just calculates and starts completely.
Step 120, the exception catching function is hooked up by Hook Function.
In embodiments of the present invention, UncaughtException functions can be hooked up using Hook Function, then no matter mesh
Whether UncaughtExceptionHandler is had been carried out in mark application, can be continued to execute for intended application
The window of Activity enables the logic that exception catching function is hooked up in function.So as to so that external process can be to target
The unexpected message of application is counted.
In practical applications, if the window for monitoring the Activity of intended application enables function, i.e. OnCreate functions,
Exception catching function is called, then shows that intended application occurs abnormal and causes to collapse at this time, then can trigger calling Hook Function
Hook up exception catching function.
Step 130, unexpected message is obtained by the exception catching function.
As above-mentioned, the effect of exception catching function is to obtain the unexpected message for causing intended application to be collapsed, so in this hair
In bright embodiment, after hooking up exception catching function using Hook Function, can be obtained by exception catching function causes target to be answered
With the unexpected message of collapse.
Step 140, the unexpected message is counted.
In practical applications, the unexpected message of acquisition can be counted according to current system time, and be stored in
In message queue, then the message queue can also be sent to the first process, then remembered by the first process according to demand
Record or carry out subsequent displaying.It is of course also possible to be counted and stored otherwise, not to this embodiment of the present invention
It is limited.
Preferably, after step 140, further include:
The unexpected message that statistics obtains is sent to the first process by sub-step 251 in the form of broadcasting.
In embodiments of the present invention, statistics unexpected message is executed by the application process of intended application, if that wanting
The unexpected message obtained to statistics is handled, then needs other process.Broadcast can be utilized so in the embodiment of the present invention
Form the obtained unexpected message of statistics is sent to the first process, the first process then receives the unexpected message that statistics obtains, right
It is recorded or is shown.
It in embodiments of the present invention, can be by aforementioned Hook Function after counting unexpected message, by the unexpected message of statistics
It is sent in the form of broadcast, the first process then receives the broadcast, and the unexpected message therefrom counted is handled.
In practical applications, in the form of broadcast send statistics unexpected message process be with
Centered on ActivityManagerService.The sender of broadcast by broadcast transmission to ActivityManagerService,
After ActivityManagerService receives this broadcast, it will check which process is ordered in the registration center of oneself
The broadcast is read, then in this broadcast transmission to these processes.In short, the transmitting path of broadcast is exactly from sender
To ActivityManagerService, then from ActivityManagerService to recipient, this two intermediate process
All completed by Binder inter-process communication mechanisms.
In embodiments of the present invention, first can be set in the registration center of ActivityManagerService in advance
Process subscribes to the corresponding broadcast of unexpected message of statistics.
Sub-step 252, after first process receives the unexpected message of the statistics, by the unexpected message of the statistics
It is recorded or is shown.
First process, can be on the specific interface of corresponding android system after receiving the unexpected message of statistics
Show the unexpected message of the statistics.
In embodiments of the present invention, can receive the unexpected message all counted that a certain APP is included and then
The unexpected message of each statistics is shown on specific interface.It is of course also possible to the unexpected message of statistics is shown otherwise,
In this regard, the embodiment of the present invention is not limited.
In embodiments of the present invention, the window of the Activity of monitoring objective application enables whether function calls exception catching
Function hooks up the exception by Hook Function and catches if the window of Activity enables function call exception catching function
Function is obtained, unexpected message is obtained by the exception catching function, and the unexpected message is counted, can be directed to
It is all applied in android system, obtains intended application and collapse corresponding unexpected message, to improve intended application collapse system
The comprehensive and applicability of meter.
Embodiment two
With reference to Fig. 2, show that a kind of Android intended application collapse statistical method according to an embodiment of the invention is implemented
The step flow chart of example, can specifically include following steps:
Step 210, Hook Function is injected in the application process of the intended application.
In embodiments of the present invention, Hook Function is used to intercept the Authority Verification of Authority Verification function return as a result, simultaneously
The logical process that system is back to by the Authority Verification result verified will be indicated by executing.So the embodiment of the present invention needs elder generation
Hook Function is injected in the application process of each application.
Preferably, step 210, including:
Sub-step 211, when system starts, by system carry initial hatching process replace with scheduled first hatch into
Journey.
In practical applications, the normal boot process of android system is substantially:Activation system->Init processes are read
Start init.rc->Init process creations zygote (incubator) process->Zygote process creation java virtual machines are loaded into
ZygoteInit classes->The socket-monitored is needed by virtual machine registration>It waits for
The establishment message-of establishment process is written to socket by ActivityManagerService>Zygote processes are according to the establishment
Message establishing corresponds to process.
In embodiments of the present invention, in order to realize the monitoring to each application call Authority Verification function, it is right first to need
The initial incubator process, that is, zygote processes of android system are replaced, and replace with the first specified incubator process, i.e.,
Whether the first zygote processes, the application process that the first zygote processes can monitor each application need to create, that is, before monitoring
State whether socket has establishment message, if there is then creating the application process, by each of the embodiment of the present invention during establishment
The function call injection application process is hooked up, while the first zygote processes can create a specified process in android system,
Privately owned class is read from designated position to calling interface and complete registration of the read privately owned class in android system, i.e.,
Each privately owned class of reading normal operation can will not be influenced into the operation of other programs in android system.
The corresponding libraries SO of function will be hooked up in practical applications and inject the application process, which includes patrolling for Hook Function
Code is collected, so as to monitor whether the application process calls Authority Verification function.
In android system, all program process and system service process System Server be all by
Zygote processes breed (fork) come out, therefore, the present invention can be replaced with by the initial zygote processes of android system
First zygote processes realize monitoring and injection process.
Certainly, it after replacing the initial zygote processes of android system and being the first zygote processes, needs to restart
Android system.The function of replaced first zygote processes is other than the function including initial zygote processes, also
It is added to whether each application of monitoring calls Authority Verification function.
In practical applications, Xposed frames can be utilized to realize to replace the initial incubator process of android system
For the first specified incubator process.Wherein, Xposed frames be it is a can not change APK (AndroidPackage, peace
Tall and erect installation kit) in the case of influence program operation framework services, many powerful modules can be produced based on it, and
In the case where function does not conflict while operating.So in embodiments of the present invention, using Xposed frames, by Android systems
The incubator process for uniting initial replaces with the first specified incubator process, but does not interfere with original its of android system
His any function.
Sub-step 212, by the first hatching process by the Hook Function inject the application of the intended application into
Cheng Zhong.
Based on the logic of aforementioned first zygote processes, Hook Function injection can respectively be answered by the first zygote processes
In application process.
Preferably, sub-step 212, including:
Whether sub-step 2121, the intended application process for hatching intended application described in process monitoring by described first start
Start.
In practical applications, before each application call Authority Verification function, it is necessary first to start the application of the application into
Journey, 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 notes the Hook Function if the intended application process of the intended application starts to start
Enter the application process of the intended application, completes the startup of intended application process.
The essence of hook (Hook) function is one section of program to processing system message, can be called by system,
Its injected system.It in embodiments of the present invention, can be when application process starts, by the first zygote processes, by Hook Function
It injects in each application process, then completes the startup of application process.
The corresponding libraries SO of function will be hooked up in practical applications and inject the application process, which includes patrolling for Hook Function
Code is collected, so as to monitor whether the application process calls Authority Verification function.
Step 220, the window of the Activity of monitoring objective application enables whether function calls exception catching function;If
The window of Activity enables function call exception catching function, then enters step 230.
Step 230, the exception catching function is hooked up by Hook Function.
Step 240, unexpected message is obtained by the exception catching function.
Step 250, the unexpected message is counted.
Step 260, the unexpected message of repetition is judged whether there is;If there is the unexpected message repeated, then 270 are entered step.
In practical applications, when carrying out collapse statistics for intended application, after opening an interface, tester can
Another interface can be switched to, then positions of the corresponding Activity in previous interface in stack can move down, newly generated interface pair
The Activity answered can replace the corresponding Activity in previous interface in the position of stack top.The corresponding program in previous interface is still at this time
So in the state remained operational from the background.
So when intended application occur it is abnormal lead to collapse when, then display corresponding with intended application at this time
Activity and exception catching function can be all called simultaneously in the Activity of running background, then execute step 230-250,
The abnormal conditions will be so directed to, while obtaining multiple unexpected messages, then in this case, acquired multiple exceptions
Message is the same.
It can be seen that in practical applications it is possible that the unexpected message obtained is the case where repetition, so in this hair
In bright embodiment, the unexpected message of repetition is determined whether.
It in embodiments of the present invention, can be right in order to improve the efficiency and validity of subsequent performance evaluation and Optimization Work
The unexpected message of acquisition carries out duplicate removal processing.Firstly, it is necessary to judge whether there be the different of repetition in the unexpected message after statistics successively
Normal message.If there is the unexpected message repeated, merger can be carried out to the unexpected message repeated, if there is no the exceptions repeated to disappear
Breath, then do not execute any operation.
Preferably, step 260, including:
Sub-step 261 judges whether the identical unexpected message of timestamp;Disappear if there is the identical exception of timestamp
Breath, then enter step 270.
Timestamp is typically a character string, uniquely identifies the time at certain a moment.In practical applications, exception is utilized
It captures and there is the timestamp that mark obtains the time in the unexpected message that function obtains.
It is obtained simultaneously according to the unexpected message of repetition above-mentioned, then timestamp therein is identical or each
The difference between timestamp between unexpected message is to a very small extent.So in embodiments of the present invention, it is preferable that can be with
By judging whether the identical unexpected message of timestamp, or judge whether is difference between the timestamp of each unexpected message
Less than threshold value, than such as whether less than 1s, determining whether the unexpected message of repetition.
Step 270, merger is carried out to the unexpected message repeated.
In embodiments of the present invention, merger refer to just for repeat unexpected message, only retain wherein any one.Separately
Outside, in embodiments of the present invention, for the unexpected message repeated, it can only be retained in and be read for the first time in memory space
Unexpected message, to complete the merger to repeating unexpected message.It is of course also possible to use other modes carry out merger, in this regard, this
Inventive embodiments are not limited.
For example, it is assumed that the obtained unexpected message of statistics is respectively A, B, C, D, wherein A as the timestamp of B, C and D's
Timestamp is the same.
Then pass through step 260-270, finally obtained unexpected message can be A or B, C or D.Such 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 enables whether function calls exception
Function is captured, if the window of Activity enables function call exception catching function, is hooked up by Hook Function described different
Often capture function obtains unexpected message by the exception catching function, and the unexpected message is counted, and can be directed to
It is all applied in android system, obtains intended application and collapse corresponding unexpected message, to improve intended application collapse system
The comprehensive and applicability of meter.
Moreover, in embodiments of the present invention, original in android system incubate is replaced using specific first hatching process
Change process injects Hook Function in each intended application of android system to realize, and is respectively answered using Hook Function monitoring
With whether exception catching function is called, if then hooking up exception catching function using Hook Function, the then exception by hooking up
It captures function and obtains unexpected message, all applied so as to be directed in android system, it is corresponding to obtain intended application collapse
Unexpected message further improves the comprehensive and applicability of intended application collapse statistics.
In addition, in embodiments of the present invention, by judging that statistics obtains disappearing with the presence or absence of the exception repeated in unexpected message
Breath, and the unexpected message to repeating carries out merger, to realize the duplicate removal processing to unexpected message, so as to reduce
The repetitive rate of acquired unexpected message improves validity, and can also improve the efficiency of follow-up test personnel analysis.
For embodiment of the method, for simple description, therefore it is all expressed as a series of combination of actions, but this field
Technical staff should know that the embodiment of the present invention is not limited by the described action sequence, because implementing according to the present invention
Example, certain steps can be performed in other orders or simultaneously.Next, those skilled in the art should also know that, specification
Described in embodiment belong to preferred embodiment, necessary to the involved action not necessarily embodiment of the present invention.
Embodiment three
With reference to Fig. 3, show that a kind of Android intended application collapse statistic device according to an embodiment of the invention is implemented
The structure diagram of example, can specifically include following module:
The window of monitoring module 310, the Activity suitable for monitoring objective application enables whether function calls exception catching
Function;If the window of Activity enables function call exception catching function, enters and hook up module.
Module 320 is hooked up, the exception catching function is hooked up suitable for passing through Hook Function.
Acquisition module 330 is suitable for obtaining unexpected message by the exception catching function.
Statistical module 340, suitable for counting the unexpected message.
In embodiments of the present invention, the window of the Activity of monitoring objective application enables whether function calls exception catching
Function hooks up the exception by Hook Function and catches if the window of Activity enables function call exception catching function
Function is obtained, unexpected message is obtained by the exception catching function, and the unexpected message is counted, can be directed to
It is all applied in android system, obtains intended application and collapse corresponding unexpected message, to improve intended application collapse system
The comprehensive and applicability of meter.
Example IV
With reference to Fig. 4, show that a kind of Android intended application collapse statistic device according to an embodiment of the invention is implemented
The structure diagram of example, can specifically include following module:
Injection module 410, suitable for injecting the Hook Function in the application process of the intended application.It specifically includes:
Hatching process replaces submodule 411, is suitable for when system starts, and the initial hatching process that system carries is replaced with
Scheduled first hatching process.
Submodule 412 is injected, is suitable for hatching process by described first and the Hook Function is injected into the intended application
Application process in.
Preferably, submodule 412 is injected, including:
Start monitoring submodule, the intended application process for being suitable for hatching intended application described in process monitoring by described first
Whether start to start.
Hook Function injects submodule, if the intended application process suitable for the intended application starts to start, by institute
The application process that Hook Function injects the intended application is stated, the startup of intended application process is completed.
The window of monitoring module 420, the Activity suitable for monitoring objective application enables whether function calls exception catching
Function;If the window of Activity enables function call exception catching function, enters and hook up module.
Module 430 is hooked up, the exception catching function is hooked up suitable for passing through Hook Function.
Acquisition module 440 is suitable for obtaining unexpected message by the exception catching function.
Statistical module 450, suitable for counting the unexpected message.
Judgment module 460, suitable for judging whether there is the unexpected message of repetition;If there is the unexpected message repeated, then enter
Merger module.It specifically includes:
Judging submodule 461, suitable for judging whether the identical unexpected message of timestamp;It is identical if there is timestamp
Unexpected message, then enter merger module.
Merger module 470 is suitable for carrying out merger to the unexpected message repeated.
In embodiments of the present invention, the window of the Activity of same monitoring objective application enables whether function calls exception
Function is captured, if the window of Activity enables function call exception catching function, is hooked up by Hook Function described different
Often capture function obtains unexpected message by the exception catching function, and the unexpected message is counted, and can be directed to
It is all applied in android system, obtains intended application and collapse corresponding unexpected message, to improve intended application collapse system
The comprehensive and applicability of meter.
Moreover, in embodiments of the present invention, original in android system incubate is replaced using specific first hatching process
Change process injects Hook Function in each intended application of android system to realize, and utilizes the first hatching process monitoring
Whether each application call exception catching function, if then hooking up exception catching function using Hook Function, then by hooking up
Exception catching function obtains unexpected message, is all applied so as to be directed in android system, obtains intended application collapse pair
The unexpected message answered further improves the comprehensive and applicability of intended application collapse statistics.
In addition, in embodiments of the present invention, by judging that statistics obtains disappearing with the presence or absence of the exception repeated in unexpected message
Breath, and the unexpected message to repeating carries out merger, to realize the duplicate removal processing to unexpected message, so as to reduce
The repetitive rate of acquired unexpected message improves validity, and can also improve the efficiency of follow-up test personnel analysis.
For device embodiments, since it is basically similar to the method embodiment, so fairly simple, the correlation of description
Place illustrates referring to the part of embodiment of the method.
Embodiment five
With reference to Fig. 5, show that a kind of Android intended application collapse statistics equipment according to an embodiment of the invention is implemented
The structure diagram of example, the equipment 500 specifically include:
Memory 510 is loaded with a plurality of executable instruction.
Processor 520 executes a plurality of executable instruction;The a plurality of executable instruction includes executing following steps
Method:
The window of the Activity of monitoring objective application enables whether function calls exception catching function;
If the window of Activity enables function call exception catching function, the exception is hooked up by Hook Function
Capture function;
Unexpected message is obtained by the exception catching function;
The unexpected message is counted.
It should be noted that the executable instruction may include the method for executing above-mentioned arbitrary steps.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together with teaching based on this.As described above, it constructs required by this kind of system
Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that can utilize various
Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention
Example can be put into practice without these specific details.In some instances, well known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of each inventive aspect,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect
Shield the present invention claims the more features of feature than being expressly recited in each claim.More precisely, as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following specific implementation mode are expressly incorporated in the specific implementation mode, wherein each claim itself
All as a separate embodiment of the present invention.
Those skilled in the art, which are appreciated that, to carry out adaptively the module in the equipment in embodiment
Change and they are arranged in the one or more equipment different from the embodiment.It can be the module or list in embodiment
Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it may be used any
Combination is disclosed to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so to appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power
Profit requires, abstract and attached drawing) disclosed in each feature can be by providing identical, equivalent or similar purpose alternative features come generation
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed
One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be with hardware realization, or to run on one or more processors
Software module realize, or realized with combination thereof.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) are according to the ... of the embodiment of the present invention to realizeAndroid intended application collapse statisticsIf
The some or all functions of some or all components in standby.The present invention is also implemented as described here for executing
Method some or all equipment or program of device (for example, computer program and computer program product).This
The program of the realization present invention of sample can may be stored on the computer-readable medium, or can be with one or more signal
Form.Such signal can be downloaded from internet website and be obtained, and either be provided on carrier signal or with any other
Form provides.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference mark between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real
It is existing.In the unit claims listing several devices, several in these devices can be by the same hardware branch
To embody.The use of word first, second, and third does not indicate that any sequence.These words can be explained and be run after fame
Claim.
The invention discloses A1, a kind of Android intended applications to collapse statistical method, including:
The window of the Activity of monitoring objective application enables whether function calls exception catching function;
If the window of Activity enables function call exception catching function, the exception is hooked up by Hook Function
Capture function;
Unexpected message is obtained by the exception catching function;
The unexpected message is counted.
After the step of A2, method as described in A1, the unexpected message that the exception catching function is obtained, also wrap
It includes:
Judge whether there is the unexpected message of repetition;
If there is the unexpected message repeated, then merger is carried out to the unexpected message repeated.
The step of A3, method as described in A2, the unexpected message for judging whether there is repetition, including:
Judge whether the identical unexpected message of timestamp;If there is the identical unexpected message of timestamp, then enter
The step of merger is carried out to the unexpected message repeated.
A4, the method as described in A1 enable whether function calls exception in the window of the Activity of monitoring objective application
Before the step of capturing function, further include:
The Hook Function is injected in the application process of the intended application.
A5, the method as described in A4, the step in the application process that the Hook Function is injected to the intended application
Suddenly, including:
When system starts, the initial hatching process that system carries is replaced with into scheduled first hatching process;
The Hook Function is injected in the application process of the intended application by the first hatching process.
A6, the method as described in A5, it is described to hatch process by the Hook Function injection target by described first
Step in the application process of application, including:
Whether the intended application process for hatching intended application described in process monitoring by described first starts to start;
If the intended application process of the intended application starts to start, the Hook Function is injected into the target and is answered
Application process completes the startup of intended application process.
The invention also discloses B7, a kind of Android intended applications to collapse statistic device, including:
The window of monitoring module, the Activity suitable for monitoring objective application enables whether function calls exception catching letter
Number;If the window of Activity enables function call exception catching function, enters and hook up module;
Module is hooked up, the exception catching function is hooked up suitable for passing through Hook Function;
Acquisition module is suitable for obtaining unexpected message by the exception catching function;
Statistical module, suitable for counting the unexpected message.
B8, the device as described in B7 after the acquisition module, further include:
Judgment module, suitable for judging whether there is the unexpected message of repetition;If there is the unexpected message repeated, then enter merger
Module;
Merger module is suitable for carrying out merger to the unexpected message repeated.
B9, the device as described in B8, the judgment module, including:
Judging submodule, suitable for judging whether the identical unexpected message of timestamp;It is identical if there is timestamp
Unexpected message then enters merger module.
B10, the device as described in B7 further include before monitoring module:
Injection module, suitable for injecting the Hook Function in the application process of the intended application.
B11, the device as described in B10, the injection module, including:
Hatching process replaces submodule, is suitable for when system starts, and the initial hatching process that system carries is replaced with pre-
The first fixed hatching process;
Submodule is injected, suitable for the Hook Function is injected answering for the intended application by the first hatching process
With in process.
B12, the device as described in B11, the injection submodule, including:
Start monitoring submodule, the intended application process for being suitable for hatching intended application described in process monitoring by described first
Whether start to start;
Hook Function injects submodule, if the intended application process suitable for the intended application starts to start, by institute
The application process that Hook Function injects the intended application is stated, the startup of intended application process is completed.
The invention also discloses C13, a kind of Android intended application collapse statistics equipment, including:
Memory is loaded with a plurality of executable instruction;
Processor executes a plurality of executable instruction;The a plurality of executable instruction includes executing the side of following steps
Method:
The window of the Activity of monitoring objective application enables whether function calls exception catching function;
If the window of Activity enables function call exception catching function, the exception is hooked up by Hook Function
Capture function;
Unexpected message is obtained by the exception catching function;
The unexpected message is counted.
Claims (11)
1. a kind of Android intended application collapses statistical method, including:
Hook Function is injected in the application process of intended application;
The window of the Activity of monitoring objective application enables whether function calls exception catching function;
If the window of Activity enables function call exception catching function, the exception catching is hooked up by Hook Function
Function;
Unexpected message is obtained by the exception catching function;
The unexpected message is counted;
The unexpected message that statistics obtains is sent to external first process in the form of broadcasting.
2. according to the method described in claim 1, it is characterized in that, the unexpected message that the exception catching function is obtained
The step of after, further include:
Judge whether there is the unexpected message of repetition;
If there is the unexpected message repeated, then merger is carried out to the unexpected message repeated.
3. according to the method described in claim 2, it is characterized in that, the step of the unexpected message for judging whether there is repetition,
Including:
Judge whether the identical unexpected message of timestamp;If there is the identical unexpected message of timestamp, then enter counterweight
Multiple unexpected message carries out the step of merger.
4. according to the method described in claim 1, it is characterized in that, described inject the intended application by the Hook Function
Step in application process, including:
When system starts, the initial hatching process that system carries is replaced with into scheduled first hatching process;
The Hook Function is injected in the application process of the intended application by the first hatching process.
5. according to the method described in claim 4, it is characterized in that, described hatch process by the hook letter by described first
Number injects the step in the application process of the intended application, including:
Whether the intended application process for hatching intended application described in process monitoring by described first starts to start;
If the intended application process of the intended application starts to start, the Hook Function is injected into the intended application
Application process completes the startup of intended application process.
6. a kind of Android intended application collapses statistic device, including:
Injection module is suitable for injecting Hook Function in the application process of intended application;
The window of monitoring module, the Activity suitable for monitoring objective application enables whether function calls exception catching function;Such as
The window of fruit Activity enables function call exception catching function, then enters and hook up module;
Module is hooked up, the exception catching function is hooked up suitable for passing through Hook Function;
Acquisition module is suitable for obtaining unexpected message by the exception catching function;
Statistical module, suitable for counting the unexpected message, later, the unexpected message that statistics is obtained is in the form of broadcasting
It is sent to external first process.
7. device according to claim 6, which is characterized in that after the acquisition module, further include:
Judgment module, suitable for judging whether there is the unexpected message of repetition;If there is the unexpected message repeated, then enter merger mould
Block;
Merger module is suitable for carrying out merger to the unexpected message repeated.
8. device according to claim 7, which is characterized in that the judgment module, including:
Judging submodule, suitable for judging whether the identical unexpected message of timestamp;If there is the identical exception of timestamp
Message then enters merger module.
9. device according to claim 6, which is characterized in that the injection module, including:
Hatching process replaces submodule, is suitable for when system starts, and the initial hatching process that system carries is replaced with scheduled
First hatching process;
Inject submodule, suitable for by the first hatching process by the Hook Function inject the application of the intended application into
Cheng Zhong.
10. device according to claim 9, which is characterized in that the injection submodule, including:
Start monitoring submodule, be suitable for by it is described first hatching process monitoring described in intended application intended application process whether
Start to start;
Hook Function injects submodule, if the intended application process suitable for the intended application starts to start, by the hook
Subfunction injects the application process of the intended application, completes the startup of intended application process.
11. a kind of Android intended application collapse statistics equipment, including:
Memory is loaded with a plurality of executable instruction;
Processor executes a plurality of executable instruction;The a plurality of executable instruction includes the method for executing following steps:
The window of the Activity of monitoring objective application enables whether function calls exception catching function;
If the window of Activity enables function call exception catching function, the exception catching is hooked up by Hook Function
Function;
Unexpected message is obtained by the exception catching function;
The unexpected message is counted.
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 CN105512015A (en) | 2016-04-20 |
CN105512015B true 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) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106681801B (en) * | 2016-05-09 | 2019-07-23 | 腾讯科技(深圳)有限公司 | The execution method and apparatus of event |
CN106227672B (en) * | 2016-08-10 | 2019-07-09 | 中车株洲电力机车研究所有限公司 | A kind of built-in application program failure captures 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 |
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 |
CN109408261B (en) * | 2018-09-26 | 2023-06-20 | 中国平安财产保险股份有限公司 | Application program crash processing method and device, computer equipment and storage medium |
CN110221928B (en) * | 2019-06-11 | 2021-06-04 | Oppo广东移动通信有限公司 | Information recording method, information recording apparatus, terminal, and storage medium |
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 |
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 |
---|
android和IOS平台的崩溃捕获和收集;langresser;《http://blog.csdn.net/langresser_king/article/details/8288195》;20121212;正文第5页 * |
Also Published As
Publication number | Publication date |
---|---|
CN105512015A (en) | 2016-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105512015B (en) | A kind of Android intended application collapse statistical method and device | |
CN105468529B (en) | A kind of accurate traversal method of Android application UI controls and device | |
CN109635523B (en) | Application program detection method and device and computer readable storage medium | |
CN110941528B (en) | Log buried point setting method, device and system based on fault | |
CN110704306B (en) | Assertion processing method, device, equipment and storage medium in test | |
CN110912738B (en) | Business exception processing method, device, platform and electronic equipment | |
US20160283356A1 (en) | Event-driven automation testing for mobile devices | |
CN109558313B (en) | Method and device for constructing abnormal test scene | |
CN111159520B (en) | Sample identification method, device and safety emergency response system | |
CN109657468B (en) | Virus behavior detection method, device and computer readable storage medium | |
CN111597120A (en) | Interface test apparatus, method, electronic device, and computer-readable storage medium | |
CN109657475A (en) | Code vulnerabilities check method, apparatus, equipment and storage medium | |
CN108509795B (en) | Method, device and storage medium for monitoring E L F file call system function | |
CN106529304A (en) | Android application concurrent vulnerability detection system | |
CN104484176B (en) | A kind of Android system window object acquisition methods and device | |
CN117493188A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN105573891B (en) | A kind of Android application power consumption statistical method and device | |
CN113934642B (en) | Software compatibility testing method based on dynamic and static combination | |
CN115061907A (en) | Test method and test system, electronic device, and storage medium | |
CN106713215B (en) | Information processing method, terminal and server | |
CN114629686A (en) | Vulnerability attack detection method and device | |
CN110008107A (en) | Test method, device and the computer readable storage medium of application | |
CN112286803A (en) | Test case detection method and device | |
CN113378180A (en) | Vulnerability detection method and device, computer equipment and readable storage medium | |
CN112948276A (en) | Fuzzy test method and device and electronic equipment |
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 |