CN116775172B - Method and system for achieving Android data acquisition through reflection - Google Patents

Method and system for achieving Android data acquisition through reflection Download PDF

Info

Publication number
CN116775172B
CN116775172B CN202311076212.3A CN202311076212A CN116775172B CN 116775172 B CN116775172 B CN 116775172B CN 202311076212 A CN202311076212 A CN 202311076212A CN 116775172 B CN116775172 B CN 116775172B
Authority
CN
China
Prior art keywords
component
life cycle
initial
data
result data
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
Application number
CN202311076212.3A
Other languages
Chinese (zh)
Other versions
CN116775172A (en
Inventor
沈洋
钱刚
吴涛
王洪兴
胡琳璘
王兵
付强
杜琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Sun Hi Tech Co ltd
Original Assignee
Chengdu Sun Hi Tech Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chengdu Sun Hi Tech Co ltd filed Critical Chengdu Sun Hi Tech Co ltd
Priority to CN202311076212.3A priority Critical patent/CN116775172B/en
Publication of CN116775172A publication Critical patent/CN116775172A/en
Application granted granted Critical
Publication of CN116775172B publication Critical patent/CN116775172B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a method and a system for realizing Android data acquisition through reflection, which relate to the technical field of Android mobile terminals, and comprise the following steps: s1, acquiring an initial component, and establishing a life cycle component for deceptively carrying out the life cycle of an Android system in the initial component; s2, acquiring a registry of the initial component through reflection; s3, setting the life cycle as a creation state by using the life cycle component, and registering by using a registry under the creation state; s4, after registration of the registry is completed, using a life cycle component to set the life cycle into a starting and recovering state, and calling a corresponding starting function of the initial component to start the target component; s5, setting a coroutine waiting function, processing the returned data in the coroutine waiting function to obtain result data, returning the result data to the initial component, and ending the flow. According to the Android system and the Android system, the life cycle component is set, and the Android system is based on reflection to acquire data, so that the code logic is simplified, and the flexibility and maintainability of a program are improved.

Description

Method and system for achieving Android data acquisition through reflection
Technical Field
The invention relates to the technical field of Android mobile terminals, in particular to a method and a system for acquiring data by reflection.
Background
In the prior art, the method for acquiring data based on the Android mobile terminal is as follows: calling a startactionforresult (an interface function for returning a request to an Android system) method in an activity of a calling party, and transmitting an intent object and a request code, wherein the request code is used for distinguishing different requests when a result is returned and can be any non-negative integer; the system starts a new activity at this time, the activity can display a user interface or execute certain tasks, and the user interacts with the new activity and completes corresponding operation; when a result needs to be returned, setting a result code and result data by using a setrequest function, and calling a finish function to end the current activity, wherein the system returns the result data and the request code to the calling party activity; the caller activity reuses the onActivity result function, in the function, which request returned result can be judged according to the request code, and the result is processed, thus completing the Android to acquire data.
However, the following problems exist with the above method: 1. complicated logic such as callback processing, result processing and the like is needed to be processed by using startactionyforresult, so that the complexity of codes is increased; 2. the use of startactyforresult can only handle communications between activities, requiring the addition of additional processing logic for communications of other components or services; 3. when startactionforresult is used, logic such as callback and result processing needs to be performed, so that a code structure is unclear, and maintainability of a program is affected.
Disclosure of Invention
In order to solve the problems of high code complexity, low flexibility and poor maintainability in the existing method for acquiring data by Android, the invention provides a method for acquiring data by Android through reflection, which comprises the following steps:
s1, acquiring an initial component, and establishing a life cycle component for decepting the life cycle of an Android system in the initial component;
s2, acquiring a registry of the initial component through reflection;
s3, setting the life cycle as a creation state by using the life cycle component, and registering by using the registry under the creation state;
s4, after the registration of the registry is completed, using the life cycle component to set the life cycle into a starting and recovering state, and calling a corresponding starting function of the initial component to start the target component;
s5, setting a coroutine waiting function, processing the data returned by the target component in the coroutine waiting function to obtain result data, returning the result data to the initial component, and ending the flow.
In steps S1-S5, the reflection mechanism refers to a method and a method for dynamically loading classes and acquiring detailed information of the classes when a component or a program runs, so as to operate the attributes and the methods of the classes or the objects. For Android, many components (such as Activity or Fragment) have life cycles, and in the past, corresponding operations are performed in corresponding life cycles through life cycle callback functions of the components, but this mode may cause poor code regularity, so by setting a life cycle component in an initial component, logic related to the life cycle of the initial component may be migrated into the life cycle component, and by executing operations on the life cycle component, changes in the life cycle state of the initial component are responded. The principle of the invention is as follows: according to the method, firstly, the life cycle component for the life cycle deception of the Android system is arranged in the initial component, the life cycle component is operated to respond to the change of the life cycle state of the initial component, then the starting function in the initial component is dynamically called through reflection to start the target component, and the data is returned through the carrying waiting function processing.
Further, the step S5 further includes: acquiring a return code of the result data, judging whether the return code is 0, and if so, processing the result data by the initial component; if not, returning to the initial assembly after intercepting the result data.
And judging whether the return code is 0, if so, indicating that the return is successful, and processing the result data by the initial component. When the return code is not 0, the data return failure is indicated, and the data which is returned to the initial assembly after the data which is returned to the failure is intercepted.
Further, intercepting the result data includes intercepting and acquiring an error code of the result data, analyzing the error code to obtain a corresponding abnormal result, and returning the abnormal result to the initial component.
When the result data fails to return, the component is generally crashed or a corresponding error code appears, and the user inquires the reason of the failure of returning the result data based on the error code, so that the steps are complicated. In order to improve user experience, a user can directly know the reason of component breakdown or data return failure, intercept the result data of the return failure to obtain the corresponding error code, analyze the error code to obtain the corresponding result, and return the result to the initial component.
Further, step S5 further includes: and after verifying and filtering the data returned by the target component, processing the data in the coroutine waiting function.
The return data of the target component can be directly obtained through the reflection of the obtaining registry field, but the problem of security risk caused by malicious utilization of an attacker also exists, so that the security of the component is threatened, and therefore when the data returned by the target component is obtained, verification and filtration are performed first, and then the data is returned to the cooperative waiting function for processing.
Further, in each of steps S1 to S5, the method further includes managing a lifecycle of the initial component: and monitoring the state of the initial component, and acquiring a life cycle function corresponding to the initial component in the state, wherein in the life cycle component, the life cycle of the initial component is managed by utilizing the life cycle function.
The system can control the life cycle of the component more flexibly by acquiring the registry field through reflection, but brings the challenges of life cycle management, and needs to consider the problems of state transition, memory management and the like of the component, so that the life cycle of the initial component is managed through the life cycle component.
Further, the lifecycle component manages the lifecycle of the initial component by way of weak references or static internal classes.
In the life cycle component, the life cycle function is used for managing the life cycle of the initial component, and because the life cycle length of each stage of the initial component is different, the object with long life cycle can hold the reference of the object with short life cycle, and although the object with short life cycle is not used any more, the object with long life cycle can not be recycled because of holding the reference of the object with long life cycle, so that the memory leakage is caused, and therefore, the problem is solved by adopting a weak reference or static internal class mode.
Further, step S5 further includes: judging whether the initial assembly is destroyed, if so, performing resource releasing operation in a preset function of the life cycle assembly, and if not, not performing operation.
When the initial component is destroyed, operations such as manually releasing resources and cancelling a listener in a preset function ontrol in the life cycle component are needed to avoid memory leakage.
Further, step S5 further includes: and when the initial component is destroyed and the resource releasing operation is judged to be carried out in the preset function of the life cycle component, destroying the life cycle component.
Because the defined life cycle component may execute some operations outside the life cycle of the initial component, attention is required to be paid to state transition of the initial component, and when the initial component is destroyed and operations such as resource release and the like are performed, destruction processing needs to be performed on the life cycle component, so that memory leakage caused by continuous execution of operations after the initial component is destroyed is avoided.
Further, before step S1, the method further includes: acquiring an Android version, judging whether the version is larger than a preset version, and if yes, executing step S1; if not, after updating the version of the Android, executing step S1.
In the Android with high version and low version, the field names and types of the registry may be different, and then the reflection operation fails, so that in order to ensure that the reflection operation is successful, the Android version needs to be ensured to reach more than 11 levels. If the Android version is larger than Android11, directly executing step S1; if the Android version is smaller than or equal to Android11, updating the version of Android is needed, and then step S1 is executed.
In order to solve the problems of high code complexity, low flexibility and poor maintainability in the existing method for acquiring data by Android, the invention also provides a system for acquiring data by Android through reflection, which comprises the following steps:
the first acquisition unit is used for acquiring an initial component, and establishing a life cycle component for decepting the life cycle of the Android system in the initial component;
a second acquisition unit configured to acquire a registry of the initial component by reflection;
a registration unit configured to set a lifecycle to a creation state using the lifecycle component, where registration is performed using the registry in the creation state;
the starting unit is used for setting the life cycle into a starting and recovering state by using the life cycle component after the registration of the registry is completed, and calling a starting function corresponding to the initial component to start the target component;
and the processing unit is used for setting a coroutine waiting function, processing the data returned by the target component in the coroutine waiting function to obtain result data, returning the result data to the initial component, and ending the flow.
The one or more technical schemes provided by the invention have at least the following technical effects or advantages:
the invention dynamically calls the starting function in the initial component to start the target component by setting the life cycle component and based on the reflection mechanism, and processes the returned data by the cooperative waiting function, thereby simplifying the code logic and improving the flexibility, the regularity and the maintainability of the program.
Drawings
The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention;
FIG. 1 is a schematic flow chart of a method for realizing Android acquisition data through reflection in the invention;
fig. 2 is a schematic diagram of a system for implementing Android data acquisition by reflection in the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description. In addition, the embodiments of the present invention and the features in the embodiments may be combined with each other without collision.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than within the scope of the description, and the scope of the invention is therefore not limited to the specific embodiments disclosed below.
Example 1;
referring to fig. 1, a flow chart of a method for realizing Android data acquisition by reflection in the invention is shown, and the method comprises the following steps:
s1, acquiring an initial component, and establishing a life cycle component for decepting the life cycle of an Android system in the initial component;
s2, acquiring a registry of the initial component through reflection;
s3, setting the life cycle as a creation state by using the life cycle component, and registering by using the registry under the creation state;
s4, after the registration of the registry is completed, using the life cycle component to set the life cycle into a starting state and a recovery state, and then calling a corresponding starting function of the initial component to start the target component;
s5, setting a coroutine waiting function, processing the data returned by the target component in the coroutine waiting function to obtain result data, returning the result data to the initial component, and ending the flow.
Wherein, the reflection mechanism refers to that in the running state of the component, all the attributes and methods of the class can be obtained for any class, and any one of the attributes and methods can be called for a given object, and the method of dynamically obtaining the content of the class and dynamically calling the object is called reflection.
In the embodiment of the invention, an initial component (activity) is acquired, a life cycle component (such as a life cycle device) for spoofing the life cycle of the Android system is established in the initial component, a registry (an actigitrtry field) of the initial component is acquired through reflection, all actigityResulthost (initiator) in the initial component is stored in the field, the life cycle component is used for setting the life cycle state to be a created state (created) at this time, in this state, registration is carried out by using the registry, after registration is completed, the life cycle state is set to be a start (started) state and a recovery (resumpted) state by using the life cycle component, then a launch method (start function) in the initiator is called to start the target component, and data returned by the target component is processed by a cooperative waiting function is set, so that the acquisition and processing of the Android to the data are realized.
Further, whether a multi-stage component exists between the initial component and the target component is judged, when it is judged that the multi-stage component exists between the initial component and the target component, if a transfer intent object is adopted and a returned result is processed by using a request code and a result code, the complexity of the code and the maintenance difficulty are further increased, so that steps S1 to S4 in the scheme are adopted to sequentially start each stage of component until the target component is started, a coroutine waiting function is finally set, data returned by the target component is processed in the coroutine waiting function to obtain result data, the result data is returned to the initial component, and finally, the flow is ended. The method is executed by adopting the scheme aiming at the starting of the multi-stage assembly, so that the code logic can be further simplified, and the flexibility, the regularity and the maintainability of the program are further improved.
Wherein, the step S5 further includes: acquiring a return code of the result data, judging whether the return code is 0, and if so, processing the result data by the initial component; if not, returning to the initial assembly after intercepting the result data.
And judging whether the return code is 0, if so, indicating that the result data is returned successfully, and processing the result data by the initial component. If the return code is not 0, it indicates that the result data return is unsuccessful, which is that the result data needs to be intercepted and processed before returning to the original component.
The intercepting processing of the result data comprises intercepting and acquiring error codes of the result data, analyzing the error codes to obtain corresponding abnormal results, and returning the abnormal results to the initial assembly.
When the result data is abnormal in return, the error code is returned or the component is directly crashed, the user needs to inquire the reason of failure in return of the result according to the error code, the steps are complicated, and the user is not aware of how to inquire for people lacking related knowledge, so that in order to improve the user experience, the user can directly know the reason of the failure of the component or the failure of data return, intercept the result data which is failed in return to obtain the corresponding error code, analyze the error code to obtain the corresponding result, and return the result to the initial component.
Wherein, step S5 further comprises: and after verifying and filtering the data returned by the target component, processing the data in the coroutine waiting function.
The returned data of the target component can be directly obtained through the reflection of the obtaining registry field, but the problem of security risk caused by malicious utilization of an attacker also exists, so that the security of the component is threatened, and therefore when the returned data of the target component is obtained, verification and filtration are carried out first, and then the returned data is returned to the coroutine waiting function for processing.
Wherein, in each of steps S1 to S5, the method further comprises managing a lifecycle of the initial component: and monitoring the state of the initial component, and acquiring a life cycle function corresponding to the initial component in the state, wherein in the life cycle component, the life cycle of the initial component is managed by utilizing the life cycle function.
The registration table field can be acquired through reflection to control the life cycle of the component more flexibly, but the life cycle management challenge is brought, and the problems of state conversion, memory management and the like of the component are required to be considered, so that the life cycle of the initial component is managed through the life cycle function, and the navigation conversion effect before each stage of the life cycle of the initial component is achieved. For example, a good lifecycle function helps to prevent components or applications from suffering from the following problems: when a user answers an incoming call while using an application, or switches to another application, the user crashes; when the user does not actively use the program, precious system resources are consumed; when the user leaves the application and returns later, the user's progress is lost; when the screen rotates between landscape and portrait, the user's progress is crashed or lost.
Wherein the lifecycle component manages the lifecycle of the initial component by weak reference or static internal class.
In the life cycle component, the life cycle function is used for managing the life cycle of the initial component, and because the life cycle length of each stage of the initial component is different, the object with long life cycle can hold the reference of the object with short life cycle, and although the object with short life cycle is not used any more, the object with long life cycle can not be recycled because of holding the reference of the object with long life cycle, thus causing memory leakage, and therefore, the problem is solved by adopting a weak reference or static internal class mode. The weak reference can be adopted to solve the problem of memory leakage, and when the garbage collector scans that only objects with weak reference exist, whether the current space is insufficient or not, the weak reference objects can be collected, so that the occurrence of memory leakage is prevented; the reason for the memory leakage is solved by adopting the static internal class, and after adopting the static internal class, the implicit reference to the external class is not held, so that the problem of the memory leakage is avoided.
Wherein, step S5 further comprises: judging whether the initial assembly is destroyed, if so, performing resource releasing operation in a preset function of the life cycle assembly, and if not, not performing operation.
When the initial component is destroyed, operations such as manually releasing resources and cancelling a listener in a preset function on the life cycle component are needed to avoid memory leakage.
Wherein, step S5 further comprises: and when the initial component is destroyed and the resource releasing operation is judged to be carried out in the preset function of the life cycle component, destroying the life cycle component.
Because the defined life cycle component may perform some operations outside the life cycle of the initial component, attention needs to be paid to state transition of the initial component, and when the initial component is destroyed and operations such as resource release and the like are performed, destruction processing needs to be performed on the life cycle component, so that memory leakage caused by continuous execution of operations after the initial component is destroyed is avoided. Before step S1, acquiring an Android version, judging whether the version is greater than a preset version, if yes, executing step S1; if not, after updating the version of the Android, executing step S1.
Since field names and types of registries may be different in high-version and low-version Android, and then reflection operation fails, in order to ensure that the reflection operation is successful, it is necessary to ensure that the Android version reaches more than 11 levels. If the Android version is larger than Android11, directly executing step S1; if the Android version is smaller than or equal to Android11, updating the version of Android is needed, and then step S1 is executed. The above determination of the Android version is to ensure that the reflection energy operation is successful, or whether the object can be acquired by catch when the object is acquired by reflection, if yes, the step S1 is continuously executed, and if not, the Android version needs to be updated, and then the step S1 is executed.
Example 2;
referring to fig. 2, a schematic diagram of a system for implementing Android data acquisition by reflection in the present invention is shown, where the system includes:
the first acquisition unit is used for acquiring an initial component, and establishing a life cycle component for decepting the life cycle of the Android system in the initial component;
a second acquisition unit configured to acquire a registry of the initial component by reflection;
a registration unit configured to set a lifecycle to a creation state using the lifecycle component, where registration is performed using the registry in the creation state;
the starting unit is used for setting the life cycle into a starting and recovering state by using the life cycle component after the registration of the registry is completed, and calling a starting function corresponding to the initial component to start the target component;
and the processing unit is used for setting a coroutine waiting function, processing the data returned by the target component in the coroutine waiting function to obtain result data, returning the result data to the initial component, and ending the flow. While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (5)

1. The method for realizing Android data acquisition through reflection is characterized by comprising the following steps:
s1, acquiring an initial component, and establishing a life cycle component for decepting the life cycle of an Android system in the initial component;
s2, acquiring a registry of the initial component through reflection;
s3, setting the life cycle as a creation state by using the life cycle component, and registering by using the registry under the creation state;
s4, after the registration of the registry is completed, using the life cycle component to set the life cycle into a starting and recovering state, and calling a corresponding starting function of the initial component to start the target component;
s5, setting a coroutine waiting function, processing data returned by the target component in the coroutine waiting function to obtain result data, returning the result data to the initial component, and ending the flow;
step S5 further includes obtaining a return code of the result data, and determining whether the return code is 0, if yes, the initial component processes the result data; if not, returning to the initial assembly after intercepting the result data;
the intercepting processing of the result data comprises the following steps: intercepting and acquiring error codes of the result data, analyzing and processing the error codes to obtain corresponding abnormal results, and returning the abnormal results to the initial assembly;
step S5 further includes: after verifying and filtering the data returned by the target component, processing the data in the coroutine waiting function; judging whether the initial assembly is destroyed, if so, performing resource releasing operation in a preset function of the life cycle assembly, and if not, not performing operation; and when the initial component is destroyed and the resource releasing operation is judged to be carried out in the preset function of the life cycle component, destroying the life cycle component.
2. The method for implementing Android obtaining data by reflection according to claim 1, wherein in each of step S1 to step S5, said method further comprises managing a life cycle of said initial component: and monitoring the state of the initial component, and acquiring a life cycle function corresponding to the initial component in the state, wherein in the life cycle component, the life cycle of the initial component is managed by utilizing the life cycle function.
3. The method for obtaining data by reflection according to claim 1, wherein the lifecycle component manages the lifecycle of the initial component by weak reference or static internal class.
4. The method for obtaining data by reflection according to claim 1, wherein before step S1, the method further comprises: acquiring an Android version, judging whether the version is larger than a preset version, and if yes, executing step S1; if not, after updating the version of the Android, executing step S1.
5. A system for implementing Android acquisition data by reflection, the system comprising:
the first acquisition unit is used for acquiring an initial component, and establishing a life cycle component for decepting the life cycle of the Android system in the initial component;
a second acquisition unit configured to acquire a registry of the initial component by reflection;
a registration unit configured to set a lifecycle to a creation state using the lifecycle component, where registration is performed using the registry in the creation state;
the starting unit is used for setting the life cycle into a starting and recovering state by using the life cycle component after the registration of the registry is completed, and calling a starting function corresponding to the initial component to start the target component;
the processing unit is used for setting a coroutine waiting function, processing the data returned by the target component in the coroutine waiting function to obtain result data, returning the result data to the initial component, and ending the flow;
the processing unit is further configured to obtain a return code of the result data, determine whether the return code is 0, and if yes, process the result data by the initial component; if not, returning to the initial assembly after intercepting the result data;
the intercepting processing of the result data comprises the following steps: intercepting and acquiring error codes of the result data, analyzing and processing the error codes to obtain corresponding abnormal results, and returning the abnormal results to the initial assembly;
the processing unit is also used for processing the data returned by the target component in the coroutine waiting function after verifying and filtering the data; judging whether the initial assembly is destroyed, if so, performing resource releasing operation in a preset function of the life cycle assembly, and if not, not performing operation; and when the initial component is destroyed and the resource releasing operation is judged to be carried out in the preset function of the life cycle component, destroying the life cycle component.
CN202311076212.3A 2023-08-25 2023-08-25 Method and system for achieving Android data acquisition through reflection Active CN116775172B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311076212.3A CN116775172B (en) 2023-08-25 2023-08-25 Method and system for achieving Android data acquisition through reflection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311076212.3A CN116775172B (en) 2023-08-25 2023-08-25 Method and system for achieving Android data acquisition through reflection

Publications (2)

Publication Number Publication Date
CN116775172A CN116775172A (en) 2023-09-19
CN116775172B true CN116775172B (en) 2023-11-03

Family

ID=88008475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311076212.3A Active CN116775172B (en) 2023-08-25 2023-08-25 Method and system for achieving Android data acquisition through reflection

Country Status (1)

Country Link
CN (1) CN116775172B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005036383A2 (en) * 2003-10-10 2005-04-21 Koninklijke Philips Electronics N.V. Java lifecycle model for bd-discs
CN103927180A (en) * 2014-04-21 2014-07-16 广州市久邦数码科技有限公司 Implementation method for functional plug-ins based on Android system and system of functional plug-ins based on Android system
CN105183457A (en) * 2015-08-13 2015-12-23 北京金山安全软件有限公司 Method and device for monitoring interface life cycle callback
WO2016048404A1 (en) * 2014-09-24 2016-03-31 Oracle International Corporation Method to modify android application life cycle to control its execution in a containerized workspace environment
CN106874764A (en) * 2017-01-16 2017-06-20 南开大学 A kind of method that Android application readjustment sequences are automatically generated based on call back function modeling
CN107390969A (en) * 2017-06-16 2017-11-24 深圳市金立通信设备有限公司 A kind of method and terminal for controlling suspended window
CN114706695A (en) * 2022-03-24 2022-07-05 无锡科技职业学院 Data bus design method suitable for Android application
CN115309516A (en) * 2021-05-07 2022-11-08 腾讯科技(深圳)有限公司 Application life cycle detection method and device and computer equipment
CN116028149A (en) * 2022-08-31 2023-04-28 荣耀终端有限公司 Window rendering method, system, device, storage medium and computer program product

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005036383A2 (en) * 2003-10-10 2005-04-21 Koninklijke Philips Electronics N.V. Java lifecycle model for bd-discs
CN103927180A (en) * 2014-04-21 2014-07-16 广州市久邦数码科技有限公司 Implementation method for functional plug-ins based on Android system and system of functional plug-ins based on Android system
WO2016048404A1 (en) * 2014-09-24 2016-03-31 Oracle International Corporation Method to modify android application life cycle to control its execution in a containerized workspace environment
CN105183457A (en) * 2015-08-13 2015-12-23 北京金山安全软件有限公司 Method and device for monitoring interface life cycle callback
CN106874764A (en) * 2017-01-16 2017-06-20 南开大学 A kind of method that Android application readjustment sequences are automatically generated based on call back function modeling
CN107390969A (en) * 2017-06-16 2017-11-24 深圳市金立通信设备有限公司 A kind of method and terminal for controlling suspended window
CN115309516A (en) * 2021-05-07 2022-11-08 腾讯科技(深圳)有限公司 Application life cycle detection method and device and computer equipment
CN114706695A (en) * 2022-03-24 2022-07-05 无锡科技职业学院 Data bus design method suitable for Android application
CN116028149A (en) * 2022-08-31 2023-04-28 荣耀终端有限公司 Window rendering method, system, device, storage medium and computer program product

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Android应用中片段组件的污点分析;胡望胜 等;《计算机与现代化》(第07期);42-47 *
Auditing Anti-Malware Tools by Evolving Android Malware and Dynamic Loading Technique;Y. Xue 等;《IEEE Transactions on Information Forensics and Security》;第12卷(第07期);1529-1544 *

Also Published As

Publication number Publication date
CN116775172A (en) 2023-09-19

Similar Documents

Publication Publication Date Title
CN108023808B (en) Message distribution method and device in application program
US20090124251A1 (en) Method of Assessing Compatibility Between Applications and Processor Devices
CN103577757A (en) Virus defending method and device
CN109684155B (en) Monitoring configuration method, device, equipment and readable storage medium
CN108958785B (en) Application program upgrading method and device
CN113872812B (en) Information processing method, network equipment and terminal equipment
CN116775172B (en) Method and system for achieving Android data acquisition through reflection
CN110704131B (en) Method and device for calling native application by HTML5 application
CN111107093B (en) Application login method, device, terminal and storage medium
CN110673970B (en) Cross-process calling system and method based on web application
CN110928630A (en) Activation control method, device and equipment for application program window and storage medium
CN113365346B (en) Paging method, paging device, electronic equipment and storage medium
CN106598770B (en) Native layer exception reporting processing method and device in Android system
CN114297062A (en) Service testing method and device, electronic equipment and storage medium
CN112770277B (en) Forwarding number verification method and device, mobile terminal and computing equipment
CN111984341B (en) Project monitoring method and device, electronic equipment and storage medium
JP2004362591A (en) Service provision method of server to user by controlling user's confidential id
CN117201577B (en) Communication method and system of cross-platform API and SPI based on PISA
CN110597557A (en) System information acquisition method, terminal and medium
CN115065510B (en) Login method, device, system, electronic equipment and readable storage medium
CN114327466B (en) Method and system for realizing message decoupling between vehicle-mounted APP modules
CN114500012B (en) Verification code login method and system and electronic equipment
CN110234105B (en) Method and device for detecting whether VLR verifies service rejection instruction
CN116820666A (en) Chaos application virtualization engine scheduling method, system and medium
CN111324888B (en) Verification method and device for application program starting, electronic equipment and storage medium

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
CB03 Change of inventor or designer information

Inventor after: Shen Yang

Inventor after: Qian Gang

Inventor after: Wu Tao

Inventor after: Wang Hongxing

Inventor after: Hu Linlin

Inventor after: Wang Bing

Inventor after: Fu Qiang

Inventor after: Du Qi

Inventor before: Shen Yang

Inventor before: Qian Gang

Inventor before: Wu Tao

Inventor before: Wang Hongxing

Inventor before: Hu Linlin

Inventor before: Wang Bing

Inventor before: Fu Qiang

Inventor before: Du Qi

CB03 Change of inventor or designer information