Comments (1)
@Proxy 可以实现,不过如果这个函数调用的地方比较多的话,生成的额外字节码也会比较多。
也可以考虑用 @RepalceInvoke 注解实现, 举个例子,比如想要代理应用内 调用 PackageManager.isInstantApp的函数的话,可以改成下面的写法。
@ReplaceInvoke(isStatic = false)
@TargetClass(value = "android.content.pm.PackageManager",scope = Scope.SELF)
@TargetMethod(methodName = "isInstantApp")
public static boolean isInstantApp(PackageManager packageManager){
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
boolean r = packageManager.isInstantApp();
}
return true;
}
from lancetx.
Related Issues (20)
- 同样卡在编译期间 HOT 3
- 可以做类似,AspectJ的Pointcut功能吗? HOT 1
- 编译期报错 HOT 4
- demo 编译报错 gradle-6.7.1-all HOT 4
- koltin data class 会导致fastjson 反序列化失败 HOT 4
- 外部类的构造方法有办法代理吗? 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.