CN107133150A - A kind of method and device of Android anti-replays - Google Patents
A kind of method and device of Android anti-replays Download PDFInfo
- Publication number
- CN107133150A CN107133150A CN201710339161.7A CN201710339161A CN107133150A CN 107133150 A CN107133150 A CN 107133150A CN 201710339161 A CN201710339161 A CN 201710339161A CN 107133150 A CN107133150 A CN 107133150A
- Authority
- CN
- China
- Prior art keywords
- code
- main thread
- details
- abnormal information
- thread code
- 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
- 238000000034 method Methods 0.000 title claims abstract description 28
- 230000002159 abnormal effect Effects 0.000 claims abstract description 40
- 230000005540 biological transmission Effects 0.000 abstract description 12
- 230000005856 abnormality Effects 0.000 abstract description 10
- 230000006870 function Effects 0.000 description 3
- 239000003550 marker Substances 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000005611 electricity Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000004044 response 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/3051—Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a kind of method of Android anti-replays, by the way that when service boardcast are invoked, catch the exception information;According to abnormal information, judge whether to meet default condition of revealing all the details;If so, being revealed all the details to pre-set code, pre-set code is the first main thread code, the second main thread code, by any one in the first main thread code and the non-main thread code of the second main thread code establishment or any combination.This method is according to the abnormal information captured, judge whether to meet the condition for preventing to retransmit, when satisfaction reveals all the details condition, respective code is revealed all the details, prevent from, because the situation that certain reason constantly performs the abnormality code occurs, then preventing the continuous generation of repeating transmission problem.In addition, the invention also discloses a kind of device of Android anti-replays, having one-to-one advantage with the above method.
Description
Technical field
The present invention relates to internet arena, more particularly to a kind of method and device of Android anti-replays.
Background technology
In the process of running, repeating transmission problem occurs android system often.Repeating transmission problem can refer to certain in some applications
Exception occurs in some codes normally run in most equipment, and based on some unknown causes, system can be circulated constantly
Perform this section of abnormality code.I.e. some non-artificial clicks, continuously arouse Service BoardCast, perform abnormality code.Retransmit
Problem may finally cause application crashes.
Prior art can only utilize the collapse catch mechanism of android system in itself, to capture such collapse, but can not
Prevent the generation of such collapse.If repeating transmission can not be prevented in time, the electricity of user equipment may be wasted, user is constantly consumed
Flow, more serious meeting causes user can not use application.In summary, how to solve Android retransmit constantly occur ask
Topic is those skilled in the art's urgent problem to be solved.
The content of the invention
It is an object of the invention to provide a kind of method and device of Android anti-replays, it is therefore intended that solves prior art
The problem of Android retransmits continuous generation can not be prevented.
In order to solve the above technical problems, the present invention provides a kind of method of Android anti-replays, this method includes:
When service boardcast are invoked, catch the exception information;
According to the abnormal information, judge whether to meet default condition of revealing all the details;
If so, revealed all the details to pre-set code, the pre-set code be the first main thread code, the second main thread code,
By any one in first main thread code and the non-main thread code of second main thread code establishment or any
Combination.
Alternatively, it is described according to the abnormal information, judge whether that meeting the default condition of revealing all the details includes:
According to the abnormal information, judge occur whether frequency of abnormity is more than or equal to predetermined threshold value;
When the frequency of abnormity is more than or equal to the predetermined threshold value, judge that the pre-set code meets the default pocket
Sill strip part.
Alternatively, first main thread code is application main thread codes, and second main thread code is
Main thread code in service boardcast Life cycle.
Alternatively, it is described pre-set code is revealed all the details after also include:
Record the abnormal information.
In addition, present invention also offers a kind of device of Android anti-replays, the device includes:
Trapping module, for when service boardcast are invoked, to catch the exception information;
Judge module, for according to the abnormal information, judging whether to meet default condition of revealing all the details;
Reveal all the details module, for if so, revealed all the details to pre-set code, the pre-set code is the first main thread code, the
Appointing in two main thread codes, the non-main thread code created by first main thread code and second main thread code
Meaning is a kind of or is combined.
Alternatively, the judge module includes:
First judging unit, for whether according to the abnormal information, judging to occur frequency of abnormity more than or equal to default
Threshold value;
Second judging unit, for when the frequency of abnormity is more than or equal to the predetermined threshold value, judging described default
Code meets the default condition of revealing all the details.
Alternatively, in addition to:
Logging modle, for recording the abnormal information.
The method and device of Android anti-replays provided by the present invention, by being invoked in service boardcast
When, catch the exception information;According to abnormal information, judge whether to meet default condition of revealing all the details;If so, carrying out pocket to pre-set code
Bottom, pre-set code is the first main thread code, the second main thread code, created by the first main thread code and the second main thread code
Any one in the non-main thread code built or any combination.The application judges whether full according to the abnormal information captured
Foot prevents the condition retransmitted, and when satisfaction reveals all the details condition, respective code is revealed all the details, and prevents because certain reason is constantly performed
The situation of the abnormality code occurs, and then prevents the continuous generation of repeating transmission problem.
Brief description of the drawings
, below will be to embodiment or existing for the clearer explanation embodiment of the present invention or the technical scheme of prior art
The accompanying drawing used required in technology description is briefly described, it should be apparent that, drawings in the following description are only this hair
Some bright embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can be with root
Other accompanying drawings are obtained according to these accompanying drawings.
A kind of flow of the embodiment for the Android anti-replay methods that Fig. 1 is provided by the embodiment of the present invention is shown
It is intended to;
The structured flowchart for the Android anti-replay devices that Fig. 2 is provided by the embodiment of the present invention.
Embodiment
In order that those skilled in the art more fully understand the present invention program, with reference to the accompanying drawings and detailed description
The present invention is described in further detail.Obviously, described embodiment is only a part of embodiment of the invention, rather than
Whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creative work premise
Lower obtained every other embodiment, belongs to the scope of protection of the invention.
Refer to Fig. 1, a kind of specific embodiment party for the Android anti-replay methods that Fig. 1 is provided by the embodiment of the present invention
The schematic flow sheet of formula, this method comprises the following steps:
Step 101:When service boardcast are invoked, catch the exception information;
It should be noted that can using android system from response abnormality mechanism come the information that catchs the exception.
Above-mentioned abnormal information can be embodied in abnormality code and correlative code information, i.e. system operationally, meeting
The abnormal code of automatic capture, i.e. system can automatic throw exception code so which code occurs extremely in acquisition system.
Step 102:According to the abnormal information, judge whether to meet default condition of revealing all the details;
It is understood that the above-mentioned default condition of revealing all the details can be embodied in the same area and occur exception often
It is few, i.e., by the number of times for judging abnormal information occur, to be confirmed whether to reveal all the details to corresponding code region.
It is above-mentioned according to the abnormal information as a kind of embodiment, judge whether to meet default condition of revealing all the details
Process can be specially:According to the abnormal information, judge occur whether frequency of abnormity is more than or equal to predetermined threshold value;When described
When frequency of abnormity is more than or equal to the predetermined threshold value, judge that the pre-set code meets the default condition of revealing all the details.
It should be noted that above-mentioned predetermined threshold value can be set according to the actual requirements, it is alternatively possible to be set
For 3, i.e., when being continuously collected into the identical abnormal information of 3 times or more than 3 times, it is determined that respective code meets condition of revealing all the details, can
To carry out processing of revealing all the details to respective code.
Occur abnormal number of times to count, specifically can be using current version as marker bit, when occurring abnormal, corresponding mark
Note position adds one, adds up successively.At this point it is possible to by marker bit, to confirm the number of times for identical abnormal information occur.
As can be seen that using occur identical abnormal number of times as whether the condition revealed all the details, can be effectively prevented from repeat send out
The raw appearance for repeatedly retransmitting problem.
Step 103:If so, being revealed all the details to pre-set code, the pre-set code is the first main thread code, the second main line
Any one in range code, the non-main thread code created by first main thread code and second main thread code
Or any combination.
It should be noted that above-mentioned pre-set code can refer to the code for causing repeating transmission problem to occur.In view of system by
When unknown cause is continuously waken up using related service boardcast, application main thread generation can be performed
Code, the main thread code of service boardcast correlation life cycles, and the non-main line created by above-mentioned two main thread
Range code.Therefore when the code in above three region occurs abnormal, system can be caused repeating transmission problem occur.
As a kind of embodiment, above-mentioned first main thread code can be application main thread codes, on
It can be the main thread code in service boardcast Life cycle to state the second main thread code.Then above-mentioned non-main line
Range code can be by the main thread generation in application main thread codes and service boardcast Life cycle
The non-main thread code that code is created.
When meet reveal all the details condition when, then the code in above three region is revealed all the details.It should be evident that can be simultaneously
Code in above three region is revealed all the details, individually one of region can also be revealed all the details, it is of course also possible to right
The code in certain several region is revealed all the details.
As can be seen that the occurring principle based on the problem of repeating transmission, it is determined that cause the code region of repeating transmission problem free of discontinuities, and then
Respective code region is revealed all the details, the uninterrupted generation of repeating transmission problem effectively can be prevented and protect.
The inquiry of relevant abnormalities information for convenience, can record captured abnormal information.
As a kind of embodiment, it is above-mentioned pre-set code is revealed all the details after can also include:Record is described
Abnormal information.
Specifically, after being revealed all the details to respective code region, it can be reported by backstage and record the abnormal information.
It is of course also possible to just record relevant abnormalities information before revealing all the details, it is not limited thereto.
The method for the Android anti-replays that the embodiment of the present invention is provided, by being invoked in service boardcast
When, catch the exception information;According to abnormal information, judge whether to meet default condition of revealing all the details;If so, carrying out pocket to pre-set code
Bottom, pre-set code is the first main thread code, the second main thread code, created by the first main thread code and the second main thread code
Any one in the non-main thread code built or any combination.This method judges whether full according to the abnormal information captured
Foot prevents the condition retransmitted, and when satisfaction reveals all the details condition, respective code is revealed all the details, and prevents because certain reason is constantly performed
The situation of the abnormality code occurs, and then prevents the continuous generation of repeating transmission problem.
Android anti-replays device provided in an embodiment of the present invention is introduced below, Android described below prevents
Retransmission apparatus can be mutually to should refer to above-described Android anti-replays method.
The structured flowchart for the Android anti-replay devices that Fig. 2 is provided by the embodiment of the present invention, reference picture 2Android prevents
Retransmission apparatus can include:
Trapping module 201, for when service boardcast are invoked, to catch the exception information;
Judge module 202, for according to the abnormal information, judging whether to meet default condition of revealing all the details;
Module of revealing all the details 203, for if so, revealed all the details to pre-set code, the pre-set code be the first main thread code,
In second main thread code, the non-main thread code created by first main thread code and second main thread code
Any one is combined.
Alternatively, the judge module includes:
First judging unit, for whether according to the abnormal information, judging to occur frequency of abnormity more than or equal to default
Threshold value;
Second judging unit, for when the frequency of abnormity is more than or equal to the predetermined threshold value, judging described default
Code meets the default condition of revealing all the details.
Alternatively, in addition to:
Logging modle, for recording the abnormal information.
The device for the Android anti-replays that the embodiment of the present invention is provided, by being invoked in service boardcast
When, catch the exception information;According to abnormal information, judge whether to meet default condition of revealing all the details;If so, carrying out pocket to pre-set code
Bottom, pre-set code is the first main thread code, the second main thread code, created by the first main thread code and the second main thread code
Any one in the non-main thread code built or any combination.The device judges whether full according to the abnormal information captured
Foot prevents the condition retransmitted, and when satisfaction reveals all the details condition, respective code is revealed all the details, and prevents because certain reason is constantly performed
The situation of the abnormality code occurs, and then prevents the continuous generation of repeating transmission problem.
The embodiment of each in this specification is described by the way of progressive, what each embodiment was stressed be with it is other
Between the difference of embodiment, each embodiment same or similar part mutually referring to.For being filled disclosed in embodiment
For putting, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is referring to method part
Explanation.
Professional further appreciates that, with reference to the unit of each example of the embodiments described herein description
And algorithm steps, can be realized with electronic hardware, computer software or the combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software, generally describes the composition and step of each example according to function in the above description.These
Function is performed with hardware or software mode actually, depending on the application-specific and design constraint of technical scheme.Specialty
Technical staff can realize described function to each specific application using distinct methods, but this realization should not
Think beyond the scope of this invention.
Directly it can be held with reference to the step of the method or algorithm that the embodiments described herein is described with hardware, processor
Capable software module, or the two combination are implemented.Software module can be placed in random access memory (RAM), internal memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
The method and device to Android anti-replays provided by the present invention is described in detail above.Herein should
The principle and embodiment of the present invention are set forth with specific case, the explanation of above example is only intended to help and managed
Solve the method and its core concept of the present invention.It should be pointed out that for those skilled in the art, not departing from
On the premise of the principle of the invention, some improvement and modification can also be carried out to the present invention, these are improved and modification also falls into this hair
In bright scope of the claims.
Claims (7)
1. a kind of method of Android anti-replays, it is characterised in that including:
When service boardcast are invoked, catch the exception information;
According to the abnormal information, judge whether to meet default condition of revealing all the details;
If so, being revealed all the details to pre-set code, the pre-set code is the first main thread code, the second main thread code, by institute
State any one in the non-main thread code that the first main thread code and second main thread code are created or any combination.
2. the method as described in claim 1, it is characterised in that described according to the abnormal information, judges whether to meet default
The condition of revealing all the details includes:
According to the abnormal information, judge occur whether frequency of abnormity is more than or equal to predetermined threshold value;
When the frequency of abnormity is more than or equal to the predetermined threshold value, judge that the pre-set code meets the default bar of revealing all the details
Part.
3. method as claimed in claim 2, it is characterised in that first main thread code is application main threads
Code, second main thread code is the main thread code in service boardcast Life cycle.
4. method as claimed in claim 3, it is characterised in that it is described pre-set code is revealed all the details after also include:
Record the abnormal information.
5. a kind of device of Android anti-replays, it is characterised in that including:
Trapping module, for when service boardcast are invoked, to catch the exception information;
Judge module, for according to the abnormal information, judging whether to meet default condition of revealing all the details;
Reveal all the details module, for if so, being revealed all the details to pre-set code, the pre-set code to be the first main thread code, the second master
It is any one in thread code, the non-main thread code created by first main thread code and second main thread code
Plant or be combined.
6. device as claimed in claim 5, it is characterised in that the judge module includes:
First judging unit, for according to the abnormal information, judging occur whether frequency of abnormity is more than or equal to predetermined threshold value;
Second judging unit, for when the frequency of abnormity is more than or equal to the predetermined threshold value, judging the pre-set code
Meet the default condition of revealing all the details.
7. device as claimed in claim 6, it is characterised in that also include:
Logging modle, for recording the abnormal information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710339161.7A CN107133150B (en) | 2017-05-15 | 2017-05-15 | Method and device for preventing Android from retransmitting |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710339161.7A CN107133150B (en) | 2017-05-15 | 2017-05-15 | Method and device for preventing Android from retransmitting |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107133150A true CN107133150A (en) | 2017-09-05 |
CN107133150B CN107133150B (en) | 2020-12-15 |
Family
ID=59733102
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710339161.7A Active CN107133150B (en) | 2017-05-15 | 2017-05-15 | Method and device for preventing Android from retransmitting |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107133150B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103309668A (en) * | 2013-06-17 | 2013-09-18 | 深圳Tcl新技术有限公司 | Method and device for processing uncaught exception of application programs |
KR20140004819A (en) * | 2012-06-20 | 2014-01-14 | (주)쉬프트웍스 | Method for detecting fake and falsification of application by using android obfuscation |
CN104798355A (en) * | 2012-09-18 | 2015-07-22 | 思杰系统有限公司 | Mobile device management and security |
CN104885092A (en) * | 2012-11-13 | 2015-09-02 | 奥克兰服务有限公司 | Security system and method for operating systems |
CN106294167A (en) * | 2016-08-16 | 2017-01-04 | 济南大学 | The automatic traversal method of Android Application Program Interface and system |
-
2017
- 2017-05-15 CN CN201710339161.7A patent/CN107133150B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20140004819A (en) * | 2012-06-20 | 2014-01-14 | (주)쉬프트웍스 | Method for detecting fake and falsification of application by using android obfuscation |
CN104798355A (en) * | 2012-09-18 | 2015-07-22 | 思杰系统有限公司 | Mobile device management and security |
CN104885092A (en) * | 2012-11-13 | 2015-09-02 | 奥克兰服务有限公司 | Security system and method for operating systems |
CN103309668A (en) * | 2013-06-17 | 2013-09-18 | 深圳Tcl新技术有限公司 | Method and device for processing uncaught exception of application programs |
CN106294167A (en) * | 2016-08-16 | 2017-01-04 | 济南大学 | The automatic traversal method of Android Application Program Interface and system |
Also Published As
Publication number | Publication date |
---|---|
CN107133150B (en) | 2020-12-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9612953B1 (en) | Data placement based on data properties in a tiered storage device system | |
US9811457B2 (en) | Data placement based on data retention in a tiered storage device system | |
CN110073639A (en) | Packet loss tolerant transmission control protocol congestion control | |
CN106533639A (en) | Data retransmission method and device | |
CN107888428A (en) | A kind of bandwidth adjusting method, device, equipment and readable storage medium storing program for executing | |
CN107257374A (en) | Transaction processing method and system on a kind of block chain | |
CN107623642A (en) | A kind of message traffic control method and device | |
US20240106737A1 (en) | Application-aware links | |
CN109213637A (en) | Data recovery method, device and medium for cluster nodes of distributed file system | |
CN107834556A (en) | A kind of power failure processing method and system | |
CN105897933A (en) | Service request processing method and device | |
CN110113392A (en) | A kind of monitoring APP client buries a method and apparatus for acquisition integrality | |
CN111314174A (en) | Network dial testing method and device based on block chain and SDN edge computing network system | |
US20220345389A1 (en) | Clock-synchronized edge-based network functions | |
CN103995901B (en) | A kind of method for determining back end failure | |
CN107678955A (en) | A kind of computational methods, device, equipment and the storage medium of functional interface time delay | |
CN109308245A (en) | A kind of server resource method for early warning, device, equipment and readable storage medium storing program for executing | |
CN107133150A (en) | A kind of method and device of Android anti-replays | |
CN107678807A (en) | A kind of software realizes the method and device of state machine | |
CN106482742A (en) | The acquisition methods of meter step data and device | |
WO2014015662A2 (en) | Control method and device | |
CN106503250B (en) | A kind of log tracks method and apparatus | |
CN110362448A (en) | A kind of GPU management-control method and relevant apparatus | |
CN105471838A (en) | Data processing method and device applied to L2TP | |
CN109040064A (en) | A kind of server seals and stops method, apparatus, equipment and readable storage medium storing program for executing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |