1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-04-24 10:09:49 +02:00

Convert Makefile to pom.xml, an exercise in patience.

Ugh.
This commit is contained in:
joe 2014-03-10 18:13:43 -07:00
parent e641d72332
commit 1b2dadb94b
3 changed files with 44 additions and 37 deletions
java
.gitignore
androidpayload/ndkstager

2
java/.gitignore vendored

@ -12,3 +12,5 @@
*.orig *.orig
*.rej *.rej
*~ *~
androidpayload/ndkstager/libs
androidpayload/ndkstager/obj

@ -1,9 +0,0 @@
framework_dir = ../../../metasploit-framework/
all:
ndk-build
install: all
cp libs/armeabi/libdalvikstager.so $(framework_dir)/data/android/libdalvikstager.so

@ -2,10 +2,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.metasploit</groupId> <groupId>com.metasploit</groupId>
<artifactId>Metasploit-AndroidLibrary</artifactId> <artifactId>Metasploit-AndroidNDKStager</artifactId>
<version>1-SNAPSHOT</version> <version>1-SNAPSHOT</version>
<packaging>apk</packaging> <name>Android NDK Stager</name>
<name>Android Meterpreter</name>
<properties> <properties>
<deploy.path>../metasploit-framework</deploy.path> <deploy.path>../metasploit-framework</deploy.path>
@ -24,24 +23,48 @@
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId> <artifactId>maven-antrun-plugin</artifactId>
<artifactId>android-maven-plugin</artifactId> <version>1.7</version>
<version>3.5.3</version> </plugin>
<plugin>
<extensions>true</extensions> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>
<!-- Disable the default-jar behavior (phase is nulled) -->
<plugin> <plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default-jar</id>
<phase/>
</execution>
</executions>
</plugin>
<!-- Execute the ndk-build command. I had to wrap this -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration> <configuration>
<sdk> <executable>${android.ndk.path}/ndk-build</executable>
<!-- platform or api level (api level 4 = platform 1.6)--> <arguments>
<platform>3</platform> <argument>APP_ABI=all</argument>
</sdk> </arguments>
</configuration> </configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
@ -61,20 +84,11 @@
<goal>run</goal> <goal>run</goal>
</goals> </goals>
<configuration> <configuration>
<target> <tasks>
<condition property="dx.filename" value="dx.bat"> <copy todir="${project.basedir}/../../${deploy.path}/data/android/">
<os family="windows" /> <fileset dir="${project.basedir}/libs" />
</condition> </copy>
<property name="dx.filename" value="dx" /> </tasks>
<echo>Building ndk stager...</echo>
<exec executable="${android.sdk.path}/platform-tools/${dx.filename}" failonerror="true">
<arg value="--verbose" />
<arg value="--dex" />
<arg value="--output=${project.basedir}/../../${deploy.path}/data/android/shell.jar" />
<arg value="${project.basedir}/target/dx/shell" />
</exec>
</target>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>