-
Notifications
You must be signed in to change notification settings - Fork 342
Open
Description
使用Insert 插桩如果目标方法包含注解,会存在以下问题:
插桩后方法如下:
// 原因:旧方法只是改名了
@ReactProp(name = "selectionColor", customType = "Color")
private void setSelectionColor$___twin___(ReactEditText view, @Nullable Integer color) {
if (color == null) {
view.setHighlightColor(
DefaultStyleValuesUtil.getDefaultTextColorHighlight(view.getContext()));
} else {
view.setHighlightColor(color.intValue());
}
setCursorColor(view, color);
}
// 新增方法: 缺少对应的注解
public void setSelectionColor(ReactEditText paramReactEditText, Integer paramInteger) {
ReactTextInputManager$_lancet.com_lagos_emobility_client_lancet_RnBugfix_setSelectionColor(this, paramReactEditText, paramInteger);
}
private static class ReactTextInputManager$_lancet {
@TargetClass("com.facebook.react.views.textinput.ReactTextInputManager")
@Insert("setSelectionColor")
static void com_lagos_emobility_client_lancet_RnBugfix_setSelectionColor(ReactTextInputManager param1ReactTextInputManager, @Nullable ReactEditText param1ReactEditText, Integer param1Integer) {
if (param1Integer != null) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setShape(0);
gradientDrawable.setColor(param1Integer.intValue());
gradientDrawable.setSize(SystemUtils.dip2px((Context)ClientApp.mAppContext, 2.0F), SystemUtils.dip2px((Context)ClientApp.mAppContext, 20.0F));
if (Build.VERSION.SDK_INT >= 29)
param1ReactEditText.setTextCursorDrawable((Drawable)gradientDrawable);
}
param1ReactTextInputManager.setSelectionColor$___twin___(param1ReactEditText, param1Integer);
}
}Metadata
Metadata
Assignees
Labels
No labels