-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--HG-- branch : 2.x
- Loading branch information
Showing
7 changed files
with
62 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package a; | ||
|
||
import com.googlecode.d2j.smali.Baksmali; | ||
import com.googlecode.d2j.smali.BaksmaliDexFileVisitor; | ||
import com.googlecode.d2j.smali.BaksmaliDumper; | ||
import com.googlecode.d2j.smali.Smali; | ||
import com.googlecode.dex2jar.tools.BaseCmd; | ||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
import java.nio.file.FileSystem; | ||
import java.nio.file.Path; | ||
|
||
public class BaksmaliTest { | ||
|
||
|
||
@Test | ||
public void t() throws Exception { | ||
File dir = new File("../dex-translator/src/test/resources/dexes"); | ||
File[] fs = dir.listFiles(); | ||
if (fs != null) { | ||
for (File f : fs) { | ||
if (f.getName().endsWith(".dex") || f.getName().endsWith(".apk")) { | ||
dotest(f.toPath()); | ||
} | ||
} | ||
} | ||
} | ||
|
||
private void dotest(Path f) throws Exception { | ||
Path smali0 = new File("target/" + f.getFileName() + "-smali0.zip").toPath(); | ||
try (FileSystem fs0 = BaseCmd.createZip(smali0)) { | ||
Baksmali.from(f).to(fs0.getPath("/")); | ||
} | ||
Path smali1 = new File("target/" + f.getFileName() + "-smali1.zip").toPath(); | ||
try (FileSystem fs0 = BaseCmd.openZip(smali0); FileSystem fs1 = BaseCmd.createZip(smali1)) { | ||
BaksmaliDumper baksmaliDumper = new BaksmaliDumper(); | ||
BaksmaliDexFileVisitor v = new BaksmaliDexFileVisitor(fs1.getPath("/"), baksmaliDumper); | ||
Smali.smali(fs0.getPath("/"), v); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 0 additions & 37 deletions
37
dex-translator/src/test/java/com/googlecode/dex2jar/test/BaksmaliTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters