# MDumpDex **Repository Path**: bingghost/MDumpDex ## Basic Information - **Project Name**: MDumpDex - **Description**: dump dex 和 动态加载dex - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2022-11-21 - **Last Updated**: 2022-11-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 动态加载 dex apk plugin try {//加载 dex和 so so已放在lib applicationInfo.nativeLibraryDir File file = new File(context.getCacheDir(), "hook"); File file2 = new File(file, "opt"); File file3 = new File(file, "classes.dex"); file2.mkdirs(); ZipFile zipFile = new ZipFile(context.getPackageResourcePath()); InputStream inputStream = zipFile.getInputStream(zipFile.getEntry("mthook/hook.dex")); FileOutputStream fileOutputStream = new FileOutputStream(file3); byte[] bArr = new byte[1024]; while (true) { int read = inputStream.read(bArr); if (read == -1) { break; } fileOutputStream.write(bArr, 0, read); } fileOutputStream.close(); zipFile.close(); new DexClassLoader(file3.getPath(), file2.getPath(), context.getApplicationInfo().nativeLibraryDir, ClassLoader.getSystemClassLoader()).loadClass("cc.binmt.signature.Hook").getMethod("bind", new Class[]{Context.class}).invoke((Object) null, new Object[]{context}); } catch (Exception e) { e.printStackTrace(); } // String libPath = activityInfo.applicationInfo.nativeLibraryDir; //目标类可能使用的c或者c++的库文件的存放路径