1919 * 此处无Bug
2020 */
2121public class ObfDex {
22- public static void obf (String dir , int depth , String [] obfClass ) {
22+ public static void obf (String dir , int depth , String [] obfClass , String [] blackClass ) {
2323 File file = new File (dir );
2424 if (file .isDirectory ()) {
2525 File [] files = file .listFiles ();
2626 if (files == null )
2727 return ;
2828 for (File input : files ) {
2929 if (input .isFile ()) {
30- handleDex (input , depth , obfClass );
30+ handleDex (input , depth , obfClass , blackClass );
3131 } else {
32- obf (input .getAbsolutePath (), depth , obfClass );
32+ obf (input .getAbsolutePath (), depth , obfClass , blackClass );
3333 }
3434 }
3535 } else {
36- handleDex (file , depth , obfClass );
36+ handleDex (file , depth , obfClass , blackClass );
3737 }
3838 }
3939
40- private static void handleDex (File input , int depth , String [] obfClass ) {
40+ private static void handleDex (File input , int depth , String [] obfClass , String [] blackClass ) {
4141 if (!input .getAbsolutePath ().endsWith (".dex" ))
4242 return ;
4343 File tempJar = null ;
@@ -47,7 +47,7 @@ private static void handleDex(File input, int depth, String[] obfClass) {
4747 tempJar = new File (input .getParent (), System .currentTimeMillis () + "obf" + input .getName () + ".jar" );
4848 splitDex = new File (input .getParent (), System .currentTimeMillis () + "split" + input .getName () + ".dex" );
4949 obfDex = new File (input .getParent (), System .currentTimeMillis () + "obf" + input .getName () + ".dex" );
50- long l = DexLib2Utils .splitDex (input , splitDex , Arrays .asList (obfClass ));
50+ long l = DexLib2Utils .splitDex (input , splitDex , Arrays .asList (obfClass ), Arrays . asList ( blackClass ) );
5151 if (l <= 0 ) {
5252 System .out .println ("Obfuscator Class not found" );
5353 return ;
0 commit comments