Refine search
public void register(Register register, String group) { List<String> paths = getDexFilePaths(mContext); for (final String path : paths) { DexFile dexfile = null; try { if (path.endsWith(EXTRACTED_SUFFIX)) { dexfile = DexFile.loadDex(path, path + ".tmp", 0); } else { dexfile = new DexFile(path); } Enumeration<String> dexEntries = dexfile.entries(); while (dexEntries.hasMoreElements()) { String className = dexEntries.nextElement(); if (className.startsWith(COMPONENT_PACKAGE_NAME)) { registerClass(register, group, className); } } } catch (Throwable e) { Log.w(AndServer.TAG, "An exception occurred while registering components.", e); } finally { if (dexfile != null) { try { dexfile.close(); } catch (Throwable ignore) { } } } } }
@Override protected Class<?> findClass(String className) throws ClassNotFoundException { Class<?> clazz = dexFile.loadClass(className, this); if (clazz == null && (className.startsWith("com.dodola.rocoofix") || className.startsWith("com.lody.legend") || className.startsWith("com.alipay.euler.andfix") )) { return Class.forName(className); } if (clazz == null) { throw new ClassNotFoundException(className); } return clazz; } };
try { DexFile df = new DexFile(context.getPackageCodePath()); for (Enumeration<String> iter = df.entries(); iter.hasMoreElements();) { String s = iter.nextElement(); } } catch (IOException e) { e.printStackTrace(); }
File optfile = new File(mOptDir, file.getName()); final DexFile dexFile = DexFile.loadDex(file.getAbsolutePath(), optfile.getAbsolutePath(), Context.MODE_PRIVATE); ClassLoader classLoader = context.getClassLoader(); Enumeration<String> entrys = dexFile.entries(); Class<?> clazz = null; while (entrys.hasMoreElements()) { String entry = entrys.nextElement(); clazz = dexFile.loadClass(entry, patchClassLoader); if (clazz != null) { fixClass(clazz, classLoader);
Object o = constructor.newInstance(apkFile, false, apkFile, DexFile.loadDex(apkFile.getCanonicalPath(), optDexFile.getAbsolutePath(), 0));
String sourceDir = context.getApplicationInfo().sourceDir; DexFile dexFile = new DexFile(sourceDir);
/** * Invokes the {@link DexFile#close()} method, ignoring IOExceptions. */ /*package*/ @SuppressWarnings("deprecation") static void closeSilently(final dalvik.system.DexFile dexFile) { if (dexFile != null) { try { dexFile.close(); } catch (final IOException ignored) { } } }
String path = "/path/to/your/library.jar" try { DexFile dx = DexFile.loadDex(path, File.createTempFile("opt", "dex", getCacheDir()).getPath(), 0); // Print all classes in the DexFile for(Enumeration<String> classNames = dx.entries(); classNames.hasMoreElements();) { String className = classNames.nextElement(); System.out.println("class: " + className); } } catch (IOException e) { Log.w(TAG, "Error opening " + path, e); }
final File dexClasses = new File("/sdcard/dexcontainer.zip"); DexFile dexFile = DexFile.loadDex(dexClasses.getAbsolutePath(), getFilesDir().getAbsolutePath() + "/outputdexcontainer.dex", 0); Enumeration<String> classFileNames = dexFile.entries(); while (classFileNames.hasMoreElements()) { String className = classFileNames.nextElement(); dexFile.loadClass(className, classLoader); }
Object o = constructor.newInstance(apkFile, false, apkFile, DexFile.loadDex(apkFile.getCanonicalPath(), optDexFile.getAbsolutePath(), 0));
/** * Optimize the Dalvik-Cache for the specified package. * * @param pkg package name * @throws IOException */ @Deprecated public void preOpt(String pkg) throws IOException { InstalledAppInfo info = getInstalledAppInfo(pkg, 0); if (info != null && !info.dependSystem) { DexFile.loadDex(info.apkPath, info.getOdexFile().getPath(), 0).close(); } }
DexFile df = new DexFile(new File("/system/app/Settings.apk")); @SuppressWarnings("unused") ClassLoader cl = context.getClassLoader();
DexFile dexFile = new DexFile(loadPackageParam.appInfo.sourceDir); Enumeration<String> classNames = dexFile.entries(); while (classNames.hasMoreElements()) { final String className = classNames.nextElement();
DexFile dexfile = DexFile.loadDex(url_jar_path, File.createTempFile("opt", "dex", context.getCacheDir()).getPath(), 0); // Print all classes in the DexFile Enumeration<String> classNames = dexfile.entries(); String classname = ""; while (true) { if (! classNames.hasMoreElements()) { break; } classname = classNames.nextElement(); }
Enumeration<String> entries = dex.entries(); while (entries.hasMoreElements()) { String entry = entries.nextElement(); Class<?> entryClass = dex.loadClass(entry, classLoader); if (entryClass != null && entryClass.getSuperclass() == theClass) { Log.d(TAG, "Found: " + entryClass.getName());
extraDexs[index] = DexFile.loadDex(entryPath, outputPathName, 0);
@Override public void run() { DexFile dexFile = null; try { mTimingLogger.addSplit("DexFile.loadDex E: " + mSourcePathName); ARTUtils.setIsDex2oatEnabled(true); dexFile = DexFile.loadDex(mSourcePathName, mOutputPathName, 0); mTimingLogger.addSplit("DexFile.loadDex X"); } catch (IOException e) { VLog.w(e, "DexFile.loadDex error"); mTimingLogger.addSplit("Error"); } finally { if (dexFile != null) { try { dexFile.close(); } catch (IOException e) { // nothing can be done, just ignore it } } } mTimingLogger.dumpToLog(); } }
public static DexClassLoader getDex(Context apps) { ApplicationInfo info = apps.getApplicationInfo(); String dexPath=info.sourceDir; String dexOutputDir=info.dataDir; String libPath=info.nativeLibraryDir; DexClassLoader dl= new DexClassLoader(dexPath, dexOutputDir, libPath, apps.getClass().getClassLoader()); try { Enumeration<URL> gaga = dl.getResources("com.example.mylib_test"); System.out.println(1); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { DexFile df = new DexFile(dexOutputDir); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return dl; } public static List<Class> getClassByPackage(String packageName){