基本反射,getField不能获取private修饰(可以父类获取) 所以当报错使用getDeclaredField(不能向父类获取),任然报错需要向父级查找。 private fun getField(cls: Class<*>,str: String): Field? { var mCls:Class<*>? = cls try { return mCls?.getField(str) } catch (e: NoSuchFieldException) { while(true)…
通过获取当前顶层Activity的DecorView去根据规则查找目标View,如:SurfaceView/GlSurfaceView/WebView/指定类名View等,最终将其从父容器remove添加到悬浮窗内 1. 悬浮窗View WindowManager设置全局悬浮窗 open var params: WindowManager.LayoutParams = WindowManager.LayoutParams().apply { type = if (Build.VERSION.SD…
getView内通过parent来获取ListView/GridView findViewWithTag方法去获取对应的ImageView(ImageView设置tag) public class GmGalleryGridAdapter extends BaseAdapter { private Context context; private List<GmLocalMedia> data; private final ExecutorService executorService; …
对于静态方法无需实例即可调用 try { Class<?> lifecycleManagerClass = Class.forName("com.ssy185.sdk.gamehelper.web.LifecycleManager"); // 获取静态实例 Method inst = lifecycleManagerClass.getMethod("inst"); // 调用非静态方法 Method init = lifecycleManagerClass.getMethod("init"…
连点器悬浮面板全部附加于Activity的DecorView实现。具体分为:点位连点器和路径连点器点位连点器使用的While+Thread实现轮询点位分发路径连点器使用的是状态机点位分发 1. 点位连点器 1.1 单击、双击、长按 class GmTouchSpotView : LinearLayout { constructor(context: Context) : super(context) { init() } constructor(context: Context, attrs: …
public class AdImageView extends AppCompatImageView { private int mDx; private int mMinDx; public AdImageView(@NonNull Context context) { super(context); } public AdImageView(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, at…
替换Instrumentation public class GmInstrumentationHooker { private static final String TAG = "Hooker"; public static void hookInstrumentation() { Class<?> activityThread = null; try { activityThread = Class.forName("android.app.ActivityThread"); …
public class GmStoragePermissionFragment extends Fragment { private static GmOnPermissionResult gmOnPermissionResult; public static void requestPermission(Activity activity, GmOnPermissionResult permissionResult) { gmOnPermissionResult = permissionRe…
1. FlutterBoost源码 FlutterBoostApp->pop方法 Future<bool> pop( {String? uniqueId, Object? result, bool onBackPressed = false}) async { BoostContainer? container; if (uniqueId != null) { container = _findContainerByUniqueId(uniqueId); if (container …
1. Scroller public void fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY) {} public void startScrollBy(int dx,int dy) { mScroller.forceFinished(true); int startX = getScrollX(); int startY = getScroll…