mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 04:10:13 +02:00
Added support for specifying a dump file
git-svn-id: https://smali.googlecode.com/svn/trunk@195 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
9685e92ac0
commit
103dd1612d
@ -23,6 +23,8 @@ import org.apache.maven.project.MavenProject;
|
||||
import org.jf.smali.smali;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Assembles files in the smali assembly language
|
||||
@ -55,6 +57,11 @@ public class SmaliMojo
|
||||
*/
|
||||
private File outputFile;
|
||||
|
||||
/**
|
||||
* @parameter default-value=null
|
||||
*/
|
||||
private File dumpFile;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
@ -62,7 +69,18 @@ public class SmaliMojo
|
||||
|
||||
try
|
||||
{
|
||||
smali.main(new String[]{"--output=" + outputFile.getAbsolutePath(), sourceDirectory.getAbsolutePath()});
|
||||
List<String> args = new ArrayList<String>();
|
||||
args.add("--output=" + outputFile.getAbsolutePath());
|
||||
|
||||
if (dumpFile != null) {
|
||||
args.add("--dump-to=" + dumpFile.getAbsolutePath());
|
||||
}
|
||||
|
||||
args.add(sourceDirectory.getAbsolutePath());
|
||||
|
||||
|
||||
|
||||
smali.main(args.toArray(new String[args.size()]));
|
||||
} catch (Exception ex)
|
||||
{
|
||||
throw new MojoExecutionException("oops!", ex);
|
||||
|
@ -25,6 +25,7 @@
|
||||
<configuration>
|
||||
<sourceDirectory>src/test/smali/junit-tests</sourceDirectory>
|
||||
<outputFile>target/junit-tests/classes.dex</outputFile>
|
||||
<dumpFile>target/junit-tests/classes.dump</dumpFile>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
Loading…
x
Reference in New Issue
Block a user