YAHFA
YAHFA copied to clipboard
hook 常量
android.os.Build
public static final String MODEL = getString("ro.product.model");
静态常量可以hook吗
常量为什么不用反射要用hook呢
static final variables are inlined by compiler and their references are automatically replaced with a value they hold everywhere they are used so they basically do not exist at runtime and thus changing them has no effect. You have to find a different strategy. E.g. hook method where such constant is used.
用反射 https://github.com/rk700/YAHFA/issues/12