package com.oneliang.tools.autodex.test;

import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Arrays;

import com.oneliang.Constant;
import com.oneliang.thirdparty.asm.util.AsmUtil;
import com.oneliang.tools.autodex.AutoDexUtil;
import com.oneliang.util.file.FileUtil;
import com.oneliang.util.logging.BaseLogger;
import com.oneliang.util.logging.Logger;
import com.oneliang.util.logging.LoggerManager;

public class TestAutoDexUtil {

	private static final String allClassesJar="/D:/allClasses.jar";
	private static final String androidManifestFullFilename="/D:/wechat_base/app/public/AndroidManifest.xml";
	private static final String mainDexOtherClasses=".ui.NoRomSpaceDexUI,.svg.SVGPreload,.svg.SVGBuildConfig,.plugin.exdevice.jni.C2JavaExDevice,.svg.graphics.SVGCodeDrawable,com.tenpay.cert.CertUtil,.svg.WeChatSVGRenderC2Java,com.tencent.kingkong.database.SQLiteDoneException,.crash.CrashUploaderService,.app.MMApplicationWrapper,.app.WorkerProfile,.app.PusherProfile,.app.ToolsProfile,.app.SandBoxProfile,.app.ExDeviceProfile,.plugin.sandbox.SubCoreSandBox,.sdk.platformtools.CrashMonitorForJni,.jni.utils.UtilsJni,.plugin.accountsync.Plugin,.plugin.sandbox.Plugin,.ui.base.preference.PreferenceScreen,.lan_cs.Client,.lan_cs.Server,.svg.SVGResourceRegister,.jni.platformcomm.PlatformCommBridge";
	private static final String outputDirectory="/D:/split";
	private static final boolean debug=false;

	public static void main(String[] args) throws Exception{
		LoggerManager.registerLogger(AutoDexUtil.class, new BaseLogger(Logger.Level.INFO));
		LoggerManager.registerLogger(AsmUtil.class, new BaseLogger(Logger.Level.VERBOSE));
		System.setOut(new PrintStream(new FileOutputStream("/D:/mainDex.txt")));
		FileUtil.deleteAllFile(outputDirectory);
		AutoDexUtil.autoDex(allClassesJar, androidManifestFullFilename, Arrays.asList(mainDexOtherClasses.split(Constant.Symbol.COMMA)), outputDirectory, debug);
	}
	
}

@@ -54,28 +54,16 @@
 .io.File
-OutputStream
 ;%0Aimport
@@ -72,22 +72,22 @@
 ava.
-io.PrintStream
+util.ArrayList
 ;%0Aim
@@ -108,16 +108,39 @@
 .Arrays;
+%0Aimport java.util.List;
 %0A%0Aimport
@@ -332,19 +332,161 @@
 logging.
-Bas
+AbstractLogger;%0Aimport com.oneliang.util.logging.BaseLogger;%0Aimport com.oneliang.util.logging.ComplexLogger;%0Aimport com.oneliang.util.logging.Fil
 eLogger;
@@ -1642,88 +1642,267 @@
 %0A%09%09L
-oggerManager.registerLogger(AutoDexUtil.class, new BaseLogger(Logger.Level.INFO)
+ist%3CAbstractLogger%3E loggerList=new ArrayList%3CAbstractLogger%3E();%0A%09%09loggerList.add(new BaseLogger(Logger.Level.INFO));%0A%09%09loggerList.add(new FileLogger(Logger.Level.VERBOSE,new File(%22/D:/a.txt%22)));%0A%09%09Logger logger=new ComplexLogger(Logger.Level.ERROR, loggerList
 );%0A%09
@@ -1932,18 +1932,22 @@
 Logger(A
-sm
+utoDex
 Util.cla
@@ -1954,47 +1954,74 @@
 ss, 
-new BaseLogger(Logger.Level.VERBOSE)
+logger);%0A%09%09LoggerManager.registerLogger(AsmUtil.class, logger
 );%0A
+//
 %09%09Sy

update test