Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add an Life-cycle Method #73

Closed
N1rv0us opened this issue Dec 29, 2021 · 1 comment
Closed

How to add an Life-cycle Method #73

N1rv0us opened this issue Dec 29, 2021 · 1 comment

Comments

@N1rv0us
Copy link

N1rv0us commented Dec 29, 2021

Hello, Dear Developer

I want to use --lifecycles-paths feature to define some special callees. I referenced the example in mariana-trench/configuration/lifecycles.json and wrote the following

[
  {
    "base_class_name": "Landroid/os/AsyncTask;",
    "method_name": "asynctask_lifecycle_wrapper",
    "callees": [
      {
        "method_name": "onPreExecute",
        "return_type": "V",
        "argument_types": []
      }
    ]
  }
]

Obviously, I want to add a method with the signature "Landroid/os/AsyncTask;->onPreExecute()V";
Also, in my target apk, there are subclasses that override this method.

But from the log output, it looks like I didn't succeed in adding lifecycle-methods

INFO Building source index...
INFO Built source index in 0.02s.
INFO Inferring types...
INFO Inferred types in 0.03s.
INFO Created class properties in 0.00s.
INFO Building class hierarchies...
INFO Built class hierarchies in 0.01s.
INFO Building fields cache...
INFO Built fields cache in 0.02s.
INFO Creating life-cycle wrapper methods...
INFO Created 0 life-cycle methods for classes inheriting from `Landroid/os/AsyncTask;`
INFO Created lifecycle methods in 0.00s.
INFO Building override graph...
INFO Built override graph in 0.10s.

Unfortunately, I didn't find any documentation on the use of the lifecycle-method, so I hope you can add some, or tell me how to add it.

@N1rv0us
Copy link
Author

N1rv0us commented Jan 4, 2022

Through reading the source code, I basically understood the cause of the bug, and also had a preliminary understanding of the lifecycle feature .
However, I still don't understand much about the design of this feature, so I hope you can update this part of the documentation soon.

Thanks a lot

@N1rv0us N1rv0us closed this as completed Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant