Comments (4)
暂未支持 对构造函数调用的 代理
有计划考虑支持下不
from lancetx.
暂未支持 对构造函数调用的 代理
有计划考虑支持下不
我找个时间试下
from lancetx.
暂未支持 对构造函数调用的 代理
from lancetx.
针对你的示例 ,可以更新到 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)
- hook abstract 抽象方法 HOT 1
- 同样卡在编译期间 HOT 3
- 可以做类似,AspectJ的Pointcut功能吗? HOT 1
- 编译期报错 HOT 4
- demo 编译报错 gradle-6.7.1-all HOT 4
- koltin data class 会导致fastjson 反序列化失败 HOT 4
- 是否考虑添加native方法的hook功能? HOT 1
- Could not initialize class com.ss.android.ugc.bytex.common.utils.GradleDaemonIgnoreClassLoaderSingletonManager HOT 7
- 能否支持增量编译?一拳超人 HOT 3
- 应是运行不起来,我也不知道啥错了 HOT 13
- gradle输出警告日志 HOT 3
- java.lang.reflect.UndeclaredThrowableException HOT 2
- 加入compose依赖就不行了,编译不通过 HOT 1
- LancetX织入不生效 HOT 2
- 不支持增量构建? HOT 2
- 请问支持对kotlin代码进行织入吗 HOT 1
- 适配AGP8 HOT 1
- 编译报错:java.lang.NoClassDefFoundError: Could not initialize class com.ss.android.ugc.bytex.common.utils.GradleDaemonIgnoreClassLoaderSingletonManager HOT 3
- 有计划支持增量编译吗? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lancetx.