mirror of
https://github.com/revanced/smali.git
synced 2025-05-30 04:30: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 org.jf.smali.smali;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assembles files in the smali assembly language
|
* Assembles files in the smali assembly language
|
||||||
@ -55,6 +57,11 @@ public class SmaliMojo
|
|||||||
*/
|
*/
|
||||||
private File outputFile;
|
private File outputFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @parameter default-value=null
|
||||||
|
*/
|
||||||
|
private File dumpFile;
|
||||||
|
|
||||||
public void execute()
|
public void execute()
|
||||||
throws MojoExecutionException
|
throws MojoExecutionException
|
||||||
{
|
{
|
||||||
@ -62,7 +69,18 @@ public class SmaliMojo
|
|||||||
|
|
||||||
try
|
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)
|
} catch (Exception ex)
|
||||||
{
|
{
|
||||||
throw new MojoExecutionException("oops!", ex);
|
throw new MojoExecutionException("oops!", ex);
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<sourceDirectory>src/test/smali/junit-tests</sourceDirectory>
|
<sourceDirectory>src/test/smali/junit-tests</sourceDirectory>
|
||||||
<outputFile>target/junit-tests/classes.dex</outputFile>
|
<outputFile>target/junit-tests/classes.dex</outputFile>
|
||||||
|
<dumpFile>target/junit-tests/classes.dump</dumpFile>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user