CN109960666B - Method and system for obtaining reflection and aidl and clearing cache - Google Patents
Method and system for obtaining reflection and aidl and clearing cache Download PDFInfo
- Publication number
- CN109960666B CN109960666B CN201711404839.1A CN201711404839A CN109960666B CN 109960666 B CN109960666 B CN 109960666B CN 201711404839 A CN201711404839 A CN 201711404839A CN 109960666 B CN109960666 B CN 109960666B
- Authority
- CN
- China
- Prior art keywords
- module
- packet
- reflection
- aidl
- calling
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0891—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/24—Object-oriented
Abstract
The invention provides a method and a system for obtaining reflection and aidl and cleaning a cache, wherein the method comprises the following steps: packaging the packet manager into a corresponding interface through a reflection module; self-defining a packet observer class, and calling back to obtain the size information of each packet; creating a packet state observer object and a packet size observer object for the reflection module to call; transmitting the packet state observer object into parameters in the aidl form so as to successfully return the cache information of all applied packet files; and calling an interface of the packet manager through the reflection module to indirectly call the hidden api to clear the memory. The method and the device can read and clean the cache information of other software without root, thereby obtaining larger memory space.
Description
Technical Field
The invention relates to the technical field of mobile security, in particular to a method for obtaining reflection and aidl and clearing a cache.
Background
With the rapid development of the mobile internet, in many cases, the caching of all applications in the mobile phone is very important for java developers, but the developers can only obtain the caching information and size of the applications under their own package names if using java language, and cannot obtain the caching information of all applications. This is because google imposes security restrictions on the android system, and does not publicly provide api, thereby wasting a lot of memory space.
Disclosure of Invention
The present invention is directed to solving at least one of the above problems.
Therefore, an object of the present invention is to provide a method for acquiring and cleaning cache of reflection and aidl, which can read and clean cache information of other software without using root, thereby obtaining a larger memory space.
It is another object of the present invention to provide a reflection and aidl fetch and flush buffer system.
In order to achieve the above object, an embodiment of the first aspect of the present invention provides a method for acquiring reflection and aidl and cleaning a buffer, including the following steps: packaging the packet manager into a corresponding interface through a reflection module; self-defining a packet observer class, and calling back to obtain the size information of each packet; creating a packet state observer object and a packet size observer object for the reflection module to call; transmitting the packet state observer object into parameters in the aidl form so as to successfully return the cache information of all applied packet files; and calling an interface of the packet manager through the reflection module to indirectly call the hidden api to clear the memory.
According to the reflection and aidl obtaining and cache cleaning method provided by the embodiment of the invention, on the basis of the condition that a root local system is not needed, a running byte code file is called through a reflection module in Java, an observer object is created through communication between aidl processes, and the reflection module is called to violently obtain cache information, so that the cache information of other software can be read and cleaned without using the root, and a larger memory space is obtained.
In addition, the reflection and aidl acquiring and buffer cleaning method according to the above embodiment of the present invention may further have the following additional technical features:
in some examples, further comprising: the hidden private method is constructed by calling the reflection module to pass in the packet state observer object in the form of aidl.
In some examples, after passing in the form of aidl the packet state observer object also includes: and transmitting a maximum value of a long type to simulate a cache cleaning function in the mobile phone system.
In some examples, the encapsulating, by the reflection module, the packet manager into the respective interface further comprises: binding a field module, a Method module and a Class module with an android component, violently acquiring a function interface of an object, a value of a member object and a value of a set member object according to the name of a byte code file, and violently acquiring a private api Method by calling a reflection module to interact with a java layer.
In some examples, the package status observer object is passed into the parameters in aidl form by a hidden private Method by invoking the Method module.
In order to achieve the above object, an embodiment of a second aspect of the present invention provides a reflection and aidl acquiring and cleaning buffer system, including: the encapsulation module is used for encapsulating the packet manager into a corresponding interface through the reflection module; the acquisition module is used for self-defining a packet observer class and calling back to acquire the size information of each packet; the creating module is used for creating a packet state observer object and a packet size observer object so as to be called by the reflecting module; the transmitting module is used for transmitting the packet state observer object into the parameters in the aidl form so as to successfully return the cache information of all the applied packet files; and the clearing module is used for indirectly calling the hidden api to clear the memory through the interface of the reflection module calling packet manager.
According to the reflection and aidl obtaining and cleaning cache system provided by the embodiment of the invention, on the basis of the condition that a root local system is not needed, a running byte code file is called through a reflection module in Java, an observer object is created through communication between aidl processes, and the reflection module is called to violently obtain cache information, so that the cache information of other software can be read and cleaned without using the root, and a larger memory space is obtained.
In addition, the reflection and aidl acquiring and cleaning buffer system according to the above embodiment of the present invention may also have the following additional technical features:
in some examples, the clean-up module is further to construct a hidden private method by calling the reflection module to pass the packet state observer object in the form of aidl.
In some examples, after the packet status observer object is passed in the form of aidl, the scrubbing module is also used to pass in a long type maximum to simulate the cache scrubbing function within the handset system settings.
In some examples, the encapsulation module is configured to bind a field module, a Method module, and a Class module with an android component, violently acquire a function interface of an object, a value of a member object, and a value of a set member object according to a byte code file name, and violently acquire a private api Method by calling the reflection module to interact with a java layer.
In some examples, the import module is to import the package status observer object into the parameters in aidl form by calling the Method module through a hidden private Method.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow diagram of a reflection and aidl fetch and flush cache method according to one embodiment of the present invention;
FIG. 2 is a detailed flow diagram of a method for reflection and aidl acquisition and cache clean-up according to an embodiment of the present invention;
fig. 3 is a block diagram of a reflection and aidl fetch and flush cache system according to one embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, and are used only for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
The following describes a method and system for reflection and aidl acquisition and buffer cleaning according to embodiments of the present invention with reference to the accompanying drawings.
Fig. 1 is a flow diagram of a reflection and aidl acquisition and cache cleaning method according to one embodiment of the invention. Fig. 2 is a detailed flow diagram of a method for reflection and aidl acquisition and cache cleaning according to an embodiment of the present invention. As shown in fig. 1, in conjunction with fig. 2, the method comprises the steps of:
step S1: and encapsulating the packet manager into a corresponding interface through the reflection module. Wherein, the reflection module is in java.
Specifically, encapsulating the packet manager into a corresponding interface through the reflection module further includes: binding a field module, a Method module and a Class module with an android component, violently acquiring a function interface of an object, a value of a member object and a value of a set member object according to the name of a byte code file, and violently acquiring a private api Method by calling a reflection module to interact with a java layer.
Step S2: and self-defining a packet observer class, and calling back to obtain the size information of each packet.
Step S3: a packet state observer object and a packet size observer object are created for the reflection module to call.
Step S4: the package status observer object is passed into the parameters in aidl form to successfully return the cache information for all application's package files.
Specifically, the package status observer object is passed into the parameters in aidl form by calling the Method module through a hidden private Method, so as to successfully return the cache information of the package files of all applications.
Step S5: and calling an interface of the packet manager through the reflection module to indirectly call the hidden api to clear the memory.
Further, in one embodiment of the present invention, the method further comprises: the hidden private method is constructed by calling the reflection module to pass in the packet state observer object in the form of aidl.
Further, after the packet status observer object is introduced in the form of aidl, the method further includes: and a maximum value of a long type is introduced to simulate a cache cleaning function in the mobile phone system, so that the purpose of cleaning all software cache information is realized.
That is to say, the method according to the embodiment of the present invention, aiming at the situation that all the cache information in the mobile phone cannot be directly obtained, successfully obtains all the cache information of the applications without root by calling the reflection and the inter-process communication aidl, for example, many mobile security apps have a cache cleaning function, but many mobile security apps are dummy data, and deceive the user. Specifically, dynamic calling and modification are carried out on a bytecode file in a running state by using a reflection mechanism in java, member variables and a method of one class can be obtained at will during running, only reflection is not enough to obtain cache information of an android frame, cross-process communication of aidl is carried out by matching ipc communication, a transmitted request is converted into a binder object for circulation after being serialized, and then dynamic reflection is carried out on the cache information and the size of all installation packages, reflection and aidl are called by using the same idea, and a simulation system api clears the cache information, so that all caches of all applications of a mobile phone are cleared.
In summary, according to the reflection and aidl obtaining and cache cleaning method provided by the embodiment of the present invention, based on that, in the case of not using a root native system, a running bytecode file is called through a reflection module in Java, an observer object is created through aidl interprocess communication, and a reflection module is called to violently obtain cache information, so that the cache information of other software can be read and cleaned without using a root, and a larger memory space is obtained.
Further embodiments of the present invention also provide a reflection and aidl acquisition and cleaning buffer system.
Fig. 3 is a block diagram of a reflection and aidl fetch and flush cache system according to one embodiment of the present invention. As shown in fig. 3, the reflection and aidl acquisition and cleaning buffer system 100 includes: an encapsulation module 110, an acquisition module 120, a creation module 130, an import module 140, and a clean-up module 150.
The encapsulation module 110 is configured to encapsulate the packet manager into a corresponding interface through the reflection module. Wherein, the reflection module is in java.
Specifically, the encapsulation module 110 encapsulates the packet manager into a corresponding interface through the reflection module, and further includes: binding a field module, a Method module and a Class module with an android component, violently acquiring a function interface of an object, a value of a member object and a value of a set member object according to the name of a byte code file, and violently acquiring a private api Method by calling a reflection module to interact with a java layer.
The obtaining module 120 is configured to self-define a packet watcher class, and call back to obtain size information of each packet.
The creation module 130 is used to create a packet state observer object and a packet size observer object for the reflection module call.
The import module 140 is used to import the package status observer object into the parameters in aidl form in order to successfully return the cache information of the package files of all applications.
In particular, the import module 140 is used to import the package status observer object into the parameters in aidl form by calling the Method module through a hidden private Method in order to successfully return the cache information of the package files of all applications.
The cleaning module 150 is used for indirectly calling the hidden api to clean the memory through the interface of the reflection module calling the packet manager.
Further, in one embodiment of the present invention, clean-up module 150 is also used to construct a hidden private method by calling the reflection module to pass the packet state observer object in the form of aidl.
Further, after the packet state observer object is transmitted in the aidl form, the cleaning module 150 is further configured to transmit a maximum value of a long type to simulate a cache cleaning function in a mobile phone system setting, so as to achieve the purpose of cleaning all software cache information.
That is to say, the system according to the embodiment of the present invention, aiming at the situation that all the cache information in the mobile phone cannot be directly obtained, successfully obtains all the cache information of the applications without root by calling the reflection and the inter-process communication aidl, for example, many mobile security apps have a cache cleaning function, but many mobile security apps are dummy data, and deceive the user. Specifically, dynamic calling and modification are carried out on a bytecode file in a running state by using a reflection mechanism in java, member variables and a method of one class can be obtained at will during running, only reflection is not enough to obtain cache information of an android frame, cross-process communication of aidl is carried out by matching ipc communication, a transmitted request is converted into a binder object for circulation after being serialized, and then dynamic reflection is carried out on the cache information and the size of all installation packages, reflection and aidl are called by using the same idea, and a simulation system api clears the cache information, so that all caches of all applications of a mobile phone are cleared.
It should be noted that a specific implementation manner of the reflection and addl obtaining and cache cleaning system according to the embodiment of the present invention is similar to a specific implementation manner of the reflection and addl obtaining and cache cleaning method according to the embodiment of the present invention, and reference is specifically made to the description of the method section, and details are not described here again in order to reduce redundancy.
In summary, according to the reflection and aidl obtaining and cleaning cache system in the embodiment of the present invention, based on that, in the case of not using a root native system, a running bytecode file is called through a reflection module in Java, an observer object is created through aidl interprocess communication, and a reflection module is called to violently obtain cache information, so that the cache information of other software can be read and cleaned without using a root, and a larger memory space is obtained.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims (8)
1. A method for acquiring reflection and aidl and cleaning a buffer is characterized by comprising the following steps:
packaging the packet manager into a corresponding interface through a reflection module;
self-defining a packet observer class, and calling back to obtain the size information of each packet;
creating a packet state observer object and a packet size observer object for the reflection module to call;
transmitting the packet state observer object into parameters in the aidl form so as to successfully return the cache information of all applied packet files;
calling an interface of a packet manager through a reflection module to indirectly call the hidden api to clear the memory;
wherein encapsulating the packet manager into a corresponding interface via the reflection module further comprises: binding a field module, a Method module and a Class module with an android component, violently acquiring a function interface of an object, a value of a member object and a value of a set member object according to the name of a byte code file, and violently acquiring a private api Method by calling a reflection module to interact with a java layer.
2. The reflection and aidl acquisition and buffer cleaning method according to claim 1, further comprising:
the hidden private method is constructed by calling the reflection module to pass in the packet state observer object in the form of aidl.
3. The reflection and aidl capture and buffer clean up method of claim 1, further comprising, after passing the packet state observer object in the form of aidl,:
and transmitting a maximum value of a long type to simulate a cache cleaning function in the mobile phone system.
4. The reflection and aidl get and flush buffer Method according to claim 1, wherein the packet status observer object is passed into the parameters in aidl form by a hidden private Method by calling the Method module.
5. A reflection and aidl acquisition and flush cache system, comprising:
the encapsulation module is used for encapsulating the packet manager into a corresponding interface through the reflection module;
the acquisition module is used for self-defining a packet observer class and calling back to acquire the size information of each packet;
the creating module is used for creating a packet state observer object and a packet size observer object so as to be called by the reflecting module;
the transmitting module is used for transmitting the packet state observer object into the parameters in the aidl form so as to successfully return the cache information of all the applied packet files;
the clearing module is used for indirectly calling the hidden api to clear the memory by calling the interface of the packet manager through the reflection module;
the encapsulation module is used for binding the field module, the Method module and the Class module with the android component, violently acquiring a function interface of an object according to the name of a byte code file, setting the value of the member object and the value of the member object, and violently acquiring the private api Method by calling the reflection module to interact with the java layer.
6. The reflection and aidl get and flush cache system according to claim 5, wherein the flush module is further configured to construct a hidden private method by calling the reflection module to pass the packet state observer object in the aidl.
7. The reflection and addl acquisition and cleaning buffer system of claim 5, wherein after the packet status observer object is introduced in addl form, the cleaning module is further configured to introduce a maximum of long type to simulate the buffer cleaning function within the handset system setup.
8. The reflection and aidl get and clear cache system of claim 5, wherein the import module is to import the packet status observer object into the parameters in aidl form by calling the Method module through a hidden private Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711404839.1A CN109960666B (en) | 2017-12-22 | 2017-12-22 | Method and system for obtaining reflection and aidl and clearing cache |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711404839.1A CN109960666B (en) | 2017-12-22 | 2017-12-22 | Method and system for obtaining reflection and aidl and clearing cache |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109960666A CN109960666A (en) | 2019-07-02 |
CN109960666B true CN109960666B (en) | 2021-05-11 |
Family
ID=67019274
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711404839.1A Active CN109960666B (en) | 2017-12-22 | 2017-12-22 | Method and system for obtaining reflection and aidl and clearing cache |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109960666B (en) |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102541733B (en) * | 2011-12-26 | 2015-10-07 | 成都三零瑞通移动通信有限公司 | Software fast scanning method under a kind of Android |
US8893222B2 (en) * | 2012-11-13 | 2014-11-18 | Auckland Uniservices Ltd. | Security system and method for the android operating system |
CN104793966A (en) * | 2014-01-21 | 2015-07-22 | 中国科学院声学研究所 | Display and loading method and system of Android local application |
CN105096389B (en) * | 2015-08-20 | 2018-07-13 | 百度在线网络技术(北京)有限公司 | Ticket taking machine and its implementation |
CN105956456B (en) * | 2016-04-26 | 2019-02-19 | 南京邮电大学 | A kind of pair of android system carries out the implementation method of quadruple combinations signature verification |
CN106502668B (en) * | 2016-10-20 | 2019-08-23 | 武汉斗鱼网络科技有限公司 | A kind of interface package method and system for realizing Android JNI reflection |
-
2017
- 2017-12-22 CN CN201711404839.1A patent/CN109960666B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN109960666A (en) | 2019-07-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
AU2014386583B8 (en) | Inter-process communication method based on application layer of android and basic application communication system | |
WO2021052437A1 (en) | Application start method and electronic device | |
JP5192118B2 (en) | Platform system for mobile terminals | |
CN108563517B (en) | Calling method and device of system interface | |
CN109933443A (en) | Inter-process communication methods, device, computer equipment and readable storage medium storing program for executing | |
US10791070B2 (en) | Service implementation method, apparatus, and system based on fix protocol | |
CN111684778B (en) | Implementation method of application function and electronic equipment | |
CN102938776A (en) | Dynamic page processing system based on Asynchronous JavaScript and XML (ajax) technique | |
CN104267972A (en) | Brower local interface expansion method and device | |
CN102685303B (en) | Communication means and device | |
CN103176834A (en) | Method and device for calling expansion interface | |
CN112491948A (en) | Non-invasive monomer application micro-service method and device and computer equipment | |
CN111209122A (en) | Interface calling method and device, electronic equipment and storage medium | |
CN111506366B (en) | Plug-in calling method, device, electronic equipment and storage medium | |
CN112764946A (en) | Cross-process data transmission method and device, electronic equipment and storage medium | |
CN111858101A (en) | Cloud architecture system-oriented adaptation method, device, equipment and storage medium | |
CN102843394B (en) | The frame mounting of network application and operation method | |
CN109960666B (en) | Method and system for obtaining reflection and aidl and clearing cache | |
WO2021057390A1 (en) | Method for launching quick application, and related device | |
CN107977243A (en) | A kind of third party's interface call method and device | |
CN104980511B (en) | A kind of game data access method, system and game web page server | |
CN111324395A (en) | Calling method, calling device and computer-readable storage medium | |
CN113326498A (en) | Authority multiplexing method, resource access method based on authority multiplexing and related equipment | |
KR101863677B1 (en) | System and method for interfacing between terminal and smart card | |
CN108415727A (en) | Abnormality eliminating method and storage medium in electronic device, Web application and developments |
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 |