private void installMultiDexesBeforeLollipop(PluginInfo pi, String dexPath, ClassLoader parent) {

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            return;
        }

        try {

            // get paths of extra dex
            List<File> dexFiles = getExtraDexFiles(pi, dexPath);

            if (dexFiles != null && dexFiles.size() > 0) {

                List<Object[]> allElements = new LinkedList<>();

                // get dexElements of main dex
                Class<?> clz = Class.forName("dalvik.system.BaseDexClassLoader");
                Object pathList = ReflectUtils.readField(clz, this, "pathList");
                Object[] mainElements = (Object[]) ReflectUtils.readField(pathList.getClass(), pathList, "dexElements");
                allElements.add(mainElements);

                // get dexElements of extra dex (need to load dex first)
                String optimizedDirectory = pi.getExtraOdexDir().getAbsolutePath();

                for (File file : dexFiles) {
                    if (LogDebug.LOG && RePlugin.getConfig().isPrintDetailLog()) {
                        LogDebug.d(TAG, "dex file:" + file.getName());
                    }

                    DexClassLoader dexClassLoader = new DexClassLoader(file.getAbsolutePath(), optimizedDirectory, optimizedDirectory, parent);

                    Object obj = ReflectUtils.readField(clz, dexClassLoader, "pathList");
                    Object[] dexElements = (Object[]) ReflectUtils.readField(obj.getClass(), obj, "dexElements");
                    allElements.add(dexElements);
                }

                // combine Elements
                Object combineElements = combineArray(allElements);

                // rewrite Elements combined to classLoader
                ReflectUtils.writeField(pathList.getClass(), pathList, "dexElements", combineElements);

                // delete extra dex, after optimized
                FileUtils.forceDelete(pi.getExtraDexDir());

                //Test whether the Extra Dex is installed
                if (LogDebug.LOG && RePlugin.getConfig().isPrintDetailLog()) {

                    Object object = ReflectUtils.readField(pathList.getClass(), pathList, "dexElements");
                    int length = Array.getLength(object);
                    LogDebug.d(TAG, "dexElements length:" + length);
                }
            }

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
install extra dexes

@param pi
@param dexPath
@param parent
@deprecated apply to ROM before Lollipop,may be deprecated
replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/PluginDexClassLoader.java