通过NativeActivity获取InputQueue对象 private fun getField(cls: Class<*>, str: String): Field? { // 传入Activity Class var mCls: Class<*>? = cls try { return mCls?.getField(str) } catch (e: NoSuchFieldException) { while (true) { try { val field = mCls?.…
优于try和catch之前执行,无论是否异常都会执行 static int fun1(){ try{ return 1; }finally { System.out.println("finally"); } } // 输出 finally // 1 public static void main(String[] args) { System.out.println(fun1()); } public static int fun1() { int result = 0; try { …
getField不能获取private修饰(可以向父类查找) 当查找不到使用getDeclaredField(不能向父类查找),任然报错需要向父级查找(获取所有Field或Method通过name匹配查找)静态static方法执行无需传入对象实例 private fun getField(cls: Class<*>,str: String): Field? { var mCls:Class<*>? = cls try { return mCls?.getField(str…
通过获取当前顶层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; …
Manifest.xml文件注入修改 def injectManifest(dump: GameDump): # 解包后的 AndroidManifest.xml 路径 manifest_path = dump.get_android_manifest_xml_path() ET.register_namespace('android', 'http://schemas.android.com/apk/res/android') # manifest_path = r'C:\Users\shub…
对于静态方法无需实例即可调用 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"); …