Embodiment
Below in conjunction with accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Ground is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.Generally exist
The component of the embodiment of the present invention described and illustrated in accompanying drawing can be arranged and designed with a variety of configurations herein.Cause
This, the detailed description of the embodiments of the invention to providing in the accompanying drawings is not intended to limit claimed invention below
Scope, but be merely representative of the present invention selected embodiment.Based on embodiments of the invention, those skilled in the art are not having
There is the every other embodiment obtained on the premise of making creative work, belong to the scope of protection of the invention.
It should be noted that:Similar label and letter represents similar terms in following accompanying drawing, therefore, once a certain item exists
It is defined in one accompanying drawing, then it further need not be defined and explained in subsequent accompanying drawing.Meanwhile, in this hair
In bright description, term " first ", " second " etc. are only used for distinguishing description, and it is not intended that indicating or implying relatively important
Property.
Fig. 1 is referred to, Fig. 1 shows that one kind can be applied to dynamic base method for preventing fraudulent-using provided in an embodiment of the present invention, dress
The structured flowchart for the electronic equipment 100 put.As a kind of embodiment, the electronic equipment can be PC
(personal computer, PC), tablet personal computer, smart mobile phone, personal digital assistant (personal digital
Assistant, PDA), the terminal such as wearable device.
As shown in figure 1, electronic equipment 100 includes memory 101, storage control 102, it is one or more (only to show in figure
Go out one) processor 103, Peripheral Interface 104, radio-frequency module 105, display unit 106 etc..These components pass through one or many
Bar communication bus/signal wire 107 is mutually communicated.
The dynamic base tamper-proof side that memory 101 can be used in storage software program and module, such as embodiment of the present invention
Method and the corresponding programmed instruction/module of device, processor 103 by operation be stored in software program in memory 101 and
Module, so that various function application and data processing are performed, such as dynamic base method for preventing fraudulent-using provided in an embodiment of the present invention.
Memory 101 may include high speed random access memory, may also include nonvolatile memory, such as one or more
Magnetic storage device, flash memory or other non-volatile solid state memories.Processor 103 and other possible components are to depositing
The access of reservoir 101 can be carried out under the control of storage control 102.
Various input/output devices are coupled to processor 103 and memory 101 by Peripheral Interface 104.In some realities
Apply in example, Peripheral Interface 104, processor 103 and storage control 102 can be realized in one single chip.Some other
In example, they can be realized by independent chip respectively.
Radio-frequency module 105 is used to receiving and sending electromagnetic wave, realizes the mutual conversion of electromagnetic wave and electric signal, so that
Communicated with communication network or other equipment.
Display module 106 provides a display interface between server 100 and user.Specifically, display module 106
Exported to user's display image, the content of these images output may include word, figure, video and its any combination.
It is appreciated that the structure shown in Fig. 1 be only signal, electronic equipment 100 may also include it is more more than shown in Fig. 1 or
The less component of person, or with the configuration different from shown in Fig. 1.Each component shown in Fig. 1 can use hardware, software
Or its combination is realized.
Include core logic functions in the state chained library that application program in usual electronic equipment can be configured.Dynamic chain
Connect storehouse to be employed after program is loaded into internal memory, then be employed routine call execution.Such as application in android system
So files of program etc.., can be with but existing dynamic link library can not only be called by the application program where itself
By third-party application call, therefore it can be affected in terms of the security to dynamic link library.In order to change
It is apt to the problem, the embodiments of the invention provide a kind of dynamic base method for preventing fraudulent-using, device, electronic equipment and readable storage medium storing program for executing.
First embodiment
Fig. 2 is referred to, the step flow chart of the dynamic base method for preventing fraudulent-using provided for first embodiment of the invention.Below
Fig. 2 will be combined, the dynamic base method for preventing fraudulent-using that the present embodiment is provided will be described in detail.
Step S210, receives the recalls information for being used to call dynamic base that application program is sent, the recalls information is to add
Carry the information of the file in dynamic base.
Because many application programs are based on performance and the factor such as cross-platform considers, included in the installation kit of application program
There is dynamic base, dynamic base is used for the logic function for storing the core for performing application program.Wherein application program belongs to upper layer group
Part, and dynamic base belongs to the lower layer components of application program.
Application program sends recalls information, dynamic base returns to knot in the file in needing loading dynamic base to dynamic base
Fruit notifies that notifying application program, it is loading the file called in dynamic base.
As another embodiment, application program need load dynamic base in file when, can also to independently of
The management program of dynamic base sends recalls information, and is notified from this management program to application program returning result.
Step S220, judges the file for whether having the application program to need in the dynamic base.
Dynamic base connect or independently of dynamic base management program receive application program transmission recalls information when, look into
The file for whether having application program to need is looked in dynamic base.If so, then performing next step flow;If no, terminating flow.
Whether step S230, judgement calls the application program of the dynamic base legal.
Can be not only the application program tune where it by upper layer application due to the dynamic base in Android application programs
With, it can also be called by third party application, and third party application can cause danger to calling for dynamic base to dynamic base
Evil.Therefore, dynamic base method for preventing fraudulent-using provided in an embodiment of the present invention needs to carry out identity to the application program for calling dynamic base
Checking, to examine the identity of application program whether legal.The identity of only application program is legal, and this application program could succeed
Call dynamic base.
Step S240, if the determination result is YES, then returns to the application program and agrees to recalls information.
When dynamic base or management program independently of dynamic base judge to call the application program of dynamic base legal, to this
Application program, which is returned, agrees to recalls information.As a kind of embodiment, dynamic base is returned " 0 " to application program, and journey is applied in expression
Sequence calls success, can successfully load dynamic library file.
As a kind of embodiment, application program can call the calling interface of dynamic base, realize to dynamic library file
Call.Specifically, application program calls the corresponding preset interface of dynamic base by calling interface so that the information in dynamic base
It is loaded into internal memory, realizes and dynamic base is called.
When dynamic base or management program independently of dynamic base judge to call the application program of dynamic base illegal.Make
For a kind of embodiment, dynamic base is returned " -1 " to application program, represents application call failure, it is impossible to successfully loaded dynamic
State library file.
Dynamic library file method for preventing fraudulent-using provided in an embodiment of the present invention, needs to call dynamic library file in application program
When, recalls information is sent to dynamic base or independently of the management program of dynamic base, dynamic base is tested when receiving recalls information
Whether card calls the identity of the application program of dynamic base legal.Call this dynamic base application program it is legal when, dynamic base to
Application program, which is returned, agrees to recalls information.In application call dynamic base, judge whether application program is legal, protection is dynamic
State storehouse is not utilized by third party, improves the security of dynamic base.
Second embodiment
Fig. 3 is referred to, the step flow chart of the dynamic base method for preventing fraudulent-using provided for second embodiment of the invention.Second
The dynamic base method for preventing fraudulent-using that embodiment is provided includes:
Step S310, receives the recalls information for calling dynamic base that application program is sent, and the recalls information is dynamic for loading
The information of file in state storehouse.
Step S320, judges the file for whether having the application program to need in the dynamic base.
If the file for having the application program to need in dynamic base, performs next step.
Step S331, obtains the signature of the application program.
As a kind of embodiment, because application program belongs to upper component, dynamic base belongs to lower layer components, and lower floor
Component can not directly obtain the object of upper component.Therefore dynamic base can not directly obtain the signature of application program, and then correspondingly
Verified with the identity of program.
As a kind of embodiment, dynamic base is when receiving the recalls information of application program transmission, and acquisition is sent to
The Context objects of the application program of recalls information.Information is obtained from the Context objects of application program to calling dynamic
The identity of the application program in storehouse is verified.When obtaining the Context objects of application program, being obtained by reflection technology should
With the Context objects of program.
Due to including the signature of the application program in the Context objects of application program, therefore dynamic base is being got
After the Context objects of application program, the signature of the application program is obtained from Context objects.
Certainly, the signature can be present in the dynamic base in a variety of forms, as a kind of embodiment, using journey
The signature of sequence is present in the inside of dynamic base in the form of character string.Therefore, dynamic base obtains the signature word of the application program
Symbol string.
Step S332, by the valid application program prestored in the signature of the application program and the dynamic base
Signature is matched, and judges whether the application program is legal.
If the match is successful, it is legal to judge;
If it fails to match, judge illegal.
After the signature in getting the Context objects of application program, the application is judged by the signature
Whether the identity of program is legal.
The step for judging whether the application program comprising the signature is legal is specifically included:
By the signature of the application program got and the label of the valid application program prestored in the dynamic base
Name is matched.
Due to the signature of application program being previously stored with dynamic base where valid application program i.e. dynamic base, dynamic
Storehouse is after the signature for the application program for calling it is got, by the signature of the application program got and the conjunction prestored
The signature of method application program is contrasted.
It is used as a kind of embodiment, because the signature of application program can exist with character string forms, what dynamic base was got
The signature of application program is the signature character string of the application program, the label of the valid application program prestored in dynamic base
The signature character string of entitled valid application program.Dynamic base is in matching, to the signature word of the valid application program prestored
Symbol string is matched with the signature character string of the application program got.Certainly, in matching, signature character string can be ignored
Capital and small letter.
When the match is successful, the application program of the sign comprising the signature is legal, judges that the application program is closed
Method;When matching unsuccessful, the application program of the sign comprising the signature is illegal, judges that the application program does not conform to
Method.
Step S340, if the determination result is YES, then returns to the application program and agrees to recalls information.
When the signature character string of the application program of acquisition and the valid application procedure match success prestored, characterize and adjust
It is legal with the application program of dynamic base.Dynamic base is returned to the application program agrees to recalls information.As a kind of embodiment,
Dynamic base is returned " 0 " to application program, is represented application call success, can successfully be loaded dynamic library file.
When the signature character string of the application program of acquisition and the valid application procedure match prestored fail, characterize and adjust
It is illegal with the application program of dynamic base.As a kind of embodiment, dynamic base is returned " -1 " to application program, represents application
Routine call fails, it is impossible to successfully load dynamic library file.
In embodiment two, step S310, S320 and S340 and a kind of step S210, S220 of embodiment and
S240 is identical.Embodiment refers to embodiment one, repeats no more here.
3rd embodiment
Fig. 4 is referred to, the structured flowchart of the dynamic base anti-theft apparatus 300 provided for third embodiment of the invention.It is described
Dynamic base anti-theft apparatus 300 includes:
Receiving unit 310, the recalls information for being used to call dynamic base for receiving application program transmission is described to call
Information is the information for loading the file in dynamic base.
Second judging unit 320, for the file for judging whether to there is the application program to need in the dynamic base.
First judging unit 330, during for being in the second judging unit judged result, the dynamic base is called in judgement
The application program it is whether legal.
Wherein, the first judging unit 330 includes:
First acquisition unit 331, the signature for obtaining the application program.
As a kind of embodiment, the first acquisition unit 331 includes:
Second acquisition unit 3311, the Context objects for obtaining the application program for calling the dynamic base.
Second acquisition unit also includes second and obtains subelement, and second, which obtains subelement, is used to obtain by reflection technology
Call the Context objects of the application program of the dynamic base.
3rd acquiring unit 3312, for obtaining described answer from the Context objects of the application program got
With the signature of program.
Matching unit 332, for by the application program got signature with prestored in the dynamic base it is legal
The signature of application program is matched.If the match is successful, the application program comprising the signature is characterized legal.If matching
Failure, characterizes the application program comprising the signature illegal.
Returning unit 340, the judged result for the first judging unit is when being, to return and agree to the application program
Recalls information.
The dynamic base anti-theft apparatus that the embodiments of the present invention are provided, needs to call dynamic library file in application program
When, recalls information is sent to dynamic library file or independently of the management program of dynamic base, dynamic base is receiving recalls information
When, the signature character string of application program is obtained, the signature character string for the valid application program that dynamic base is prestored is with obtaining
To the signature character string of application program matched, call the identity of its application program whether legal to verify.
During with success, show to call the application program of this dynamic base legal, dynamic base is returned to application program agrees to recalls information.
During application call dynamic base, judge whether application program is legal, protect dynamic base not utilized by third party, improve dynamic
The security in state storehouse.The specific implementation process of dynamic base anti-theft apparatus provided in an embodiment of the present invention may refer to above-mentioned side
Method embodiment, this is no longer going to repeat them.
In the present embodiment, each module can be that now, above-mentioned each module can be stored in user by software code realization
In the memory 101 of terminal 100.Each module can equally be realized by hardware such as IC chip above.
In summary, dynamic base method for preventing fraudulent-using provided in an embodiment of the present invention, device, electronic equipment and readable storage
Medium, when application program needs to call dynamic library file, recalls information is sent to dynamic library file, dynamic library file is connecing
When receiving recalls information, the signature character string of application program, the signature for the valid application program that dynamic base is prestored are obtained
Character string is matched with the signature character string of the application program got, and the identity for calling its application program with checking is
It is no legal.When the match is successful, show to call the application program of this dynamic base legal, dynamic base is returned to application program to be agreed to
Recalls information.In application call dynamic base, judge whether application program is legal, protect dynamic base not by third party's profit
With improving the security of dynamic base.
It should be noted that each embodiment in this specification is described by the way of progressive, each embodiment weight
Point explanation be all between difference with other embodiment, each embodiment identical similar part mutually referring to.
For device class embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, related part
Illustrate referring to the part of embodiment of the method.
In several embodiments provided herein, it should be understood that disclosed apparatus and method, it can also lead to
Other modes are crossed to realize.Device embodiment described above is only schematical, for example, the flow chart in accompanying drawing and
Block diagram shows the system in the cards of the device of multiple embodiments according to the present invention, method and computer program product
Framework, function and operation.At this point, each square frame in flow chart or block diagram can represent a module, program segment or
A part for code a, part for the module, program segment or code is used to realize defined logic work(comprising one or more
The executable instruction of energy.It should also be noted that in some implementations as replacement, the function of being marked in square frame also may be used
With with different from the order marked in accompanying drawing generation.For example, two continuous square frames can essentially be held substantially in parallel
OK, they can also be performed in the opposite order sometimes, and this is depending on involved function.It is also noted that block diagram and/
Or the combination of each square frame in flow chart and the square frame in block diagram and/or flow chart, function as defined in execution can be used
Or the special hardware based system of action is realized, or can be with the combination of specialized hardware and computer instruction come reality
It is existing.
In addition, each functional module in each embodiment of the invention can integrate to form an independent portion
Point or modules individualism, can also two or more modules be integrated to form an independent part.
If the function is realized using in the form of software function module and is used as independent production marketing or in use, can
To be stored in a computer read/write memory medium.Based on it is such understand, technical scheme substantially or
Say that the part of the part contributed to prior art or the technical scheme can be embodied in the form of software product,
The computer software product is stored in a storage medium, including some instructions are make it that a computer equipment (can
To be personal computer, server, or network equipment etc.) perform whole or the portion of each embodiment methods described of the invention
Step by step.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory),
Random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with store program codes
Medium.It should be noted that herein, such as first and second or the like relational terms are used merely to a reality
Body or operation make a distinction with another entity or operation, and not necessarily require or imply between these entities or operation
There is any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to
Cover including for nonexcludability, so that process, method, article or equipment including a series of key elements not only include that
A little key elements, but also other key elements including being not expressly set out, or also include be this process, method, article or
The intrinsic key element of equipment.In the absence of more restrictions, the key element limited by sentence "including a ...", not
Also there is other identical element in the process including the key element, method, article or equipment in exclusion.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area
For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made is any
Modification, equivalent substitution, improvement etc., should be included in the scope of the protection.It should be noted that:Similar label and word
Mother represents similar terms in following accompanying drawing, therefore, once it is defined in a certain Xiang Yi accompanying drawing, then in subsequent accompanying drawing
In it further need not be defined and explained.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, and appoints
What those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, all should
It is included within the scope of the present invention.Therefore, protection scope of the present invention should it is described using scope of the claims as
It is accurate.