Code Monkey home page Code Monkey logo

Comments (4)

WangZhen0908 avatar WangZhen0908 commented on May 11, 2024 1

暂未支持 对构造函数调用的 代理

有计划考虑支持下不

from lancetx.

Knight-ZXW avatar Knight-ZXW commented on May 11, 2024 1

暂未支持 对构造函数调用的 代理

有计划考虑支持下不

我找个时间试下

from lancetx.

Knight-ZXW avatar Knight-ZXW commented on May 11, 2024

暂未支持 对构造函数调用的 代理

from lancetx.

Knight-ZXW avatar Knight-ZXW commented on May 11, 2024

针对你的示例 ,可以更新到 0.0.7 版本 ,可以用 @ReplaceNewInvoke, 该注解 表示替换 new xx() 指令, 函数的第一个参数表示 原类型,第二个参数表示替换后的类型.
示例如下

    @ReplaceNewInvoke()
    public static void replaceIntent(Intent intent, WrappedIntent newIntent){
    }

通过该注解 ,代码中所有调用
Intent a = new Intent()
Intent b =new Intent("aa")
都会被替换为
Intent a = new WrappedIntent ()
Intent b =new WrappedIntent ("aa")

package com.knightboost.lancetx.weaver;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;

public class WrappedIntent extends Intent {

public WrappedIntent(Intent o) {
    super(o);
}

public WrappedIntent(String action) {
    super(action);
    Throwable throwable = new Throwable();
    Log.e("LancetXProxy", "newIntent 调用了", throwable);
}

public WrappedIntent(String action, Uri uri) {
    super(action, uri);
}

public WrappedIntent(Context packageContext, Class<?> cls) {
    super(packageContext, cls);
}

public WrappedIntent(String action, Uri uri, Context packageContext, Class<?> cls) {
    super(action, uri, packageContext, cls);
}

}

from lancetx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.