Skip to content

Commit 808da15

Browse files
author
htejera
committed
Initial commit.
1 parent beed645 commit 808da15

40 files changed

+2841
-0
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@
2121

2222
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2323
hs_err_pid*
24+
/target/
25+
/test-outputy
26+
*.prefs
27+
28+
# Eclipse oh Ecplise
29+
*.project
30+
*.classpath

pom.xml

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.mobilebox</groupId>
6+
<artifactId>java-http-libimobiledevice</artifactId>
7+
<version>1.0.0</version>
8+
<name>java-http-libimobiledevice</name>
9+
<description>This is a simple "REST" service wrapper of libimobiledevice to communicate with services of Apple iOS devices using native protocols. This service works on Linux and macOS.</description>
10+
11+
<properties>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<maven.compiler.source>1.8</maven.compiler.source>
14+
<maven.compiler.target>1.8</maven.compiler.target>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.testng</groupId>
20+
<artifactId>testng</artifactId>
21+
<version>6.11</version>
22+
</dependency>
23+
24+
<dependency>
25+
<groupId>org.buildobjects</groupId>
26+
<artifactId>jproc</artifactId>
27+
<version>2.2.2</version>
28+
</dependency>
29+
30+
<dependency>
31+
<groupId>org.aeonbits.owner</groupId>
32+
<artifactId>owner</artifactId>
33+
<version>1.0.8</version>
34+
</dependency>
35+
36+
<dependency>
37+
<groupId>org.assertj</groupId>
38+
<artifactId>assertj-core</artifactId>
39+
<version>3.6.2</version>
40+
</dependency>
41+
42+
<dependency>
43+
<groupId>com.shekhargulati</groupId>
44+
<artifactId>strman</artifactId>
45+
<version>0.4.0</version>
46+
</dependency>
47+
48+
<dependency>
49+
<groupId>com.googlecode.plist</groupId>
50+
<artifactId>dd-plist</artifactId>
51+
<version>1.20</version>
52+
</dependency>
53+
54+
<dependency>
55+
<groupId>com.sparkjava</groupId>
56+
<artifactId>spark-core</artifactId>
57+
<version>2.6.0</version>
58+
</dependency>
59+
60+
<dependency>
61+
<groupId>com.google.code.gson</groupId>
62+
<artifactId>gson</artifactId>
63+
<version>2.8.1</version>
64+
</dependency>
65+
66+
<dependency>
67+
<groupId>com.google.guava</groupId>
68+
<artifactId>guava</artifactId>
69+
<version>25.1-jre</version>
70+
</dependency>
71+
72+
<dependency>
73+
<groupId>org.slf4j</groupId>
74+
<artifactId>slf4j-simple</artifactId>
75+
<version>1.7.21</version>
76+
</dependency>
77+
78+
<dependency>
79+
<groupId>com.jayway.restassured</groupId>
80+
<artifactId>rest-assured</artifactId>
81+
<version>2.4.1</version>
82+
<scope>test</scope>
83+
</dependency>
84+
85+
<dependency>
86+
<groupId>org.assertj</groupId>
87+
<artifactId>assertj-core</artifactId>
88+
<version>2.0.0</version>
89+
<scope>test</scope>
90+
</dependency>
91+
92+
<dependency>
93+
<groupId>net.javacrumbs.json-unit</groupId>
94+
<artifactId>json-unit</artifactId>
95+
<version>1.14.0</version>
96+
<scope>test</scope>
97+
</dependency>
98+
99+
<dependency>
100+
<groupId>net.javacrumbs.json-unit</groupId>
101+
<artifactId>json-unit-fluent</artifactId>
102+
<version>1.14.0</version>
103+
<scope>test</scope>
104+
</dependency>
105+
</dependencies>
106+
107+
<build>
108+
<plugins>
109+
<plugin>
110+
<groupId>org.apache.maven.plugins</groupId>
111+
<artifactId>maven-compiler-plugin</artifactId>
112+
<version>2.3.1</version>
113+
<configuration>
114+
<source>1.8</source>
115+
<target>1.8</target>
116+
</configuration>
117+
</plugin>
118+
<!-- Generate apiDoc execute: mvn exec:exec -->
119+
<plugin>
120+
<groupId>org.codehaus.mojo</groupId>
121+
<artifactId>exec-maven-plugin</artifactId>
122+
<version>1.6.0</version>
123+
<executions>
124+
<execution>
125+
<goals>
126+
<goal>exec</goal>
127+
</goals>
128+
</execution>
129+
</executions>
130+
<configuration>
131+
<executable>apidoc</executable>
132+
<arguments>
133+
<argument>-i</argument>
134+
<argument>src/main/java</argument>
135+
</arguments>
136+
</configuration>
137+
</plugin>
138+
<plugin>
139+
<groupId>org.apache.maven.plugins</groupId>
140+
<artifactId>maven-shade-plugin</artifactId>
141+
<version>2.3</version>
142+
<configuration>
143+
<createDependencyReducedPom>true</createDependencyReducedPom>
144+
<filters>
145+
<filter>
146+
<artifact>*:*</artifact>
147+
<excludes>
148+
<exclude>META-INF/*.SF</exclude>
149+
<exclude>META-INF/*.DSA</exclude>
150+
<exclude>META-INF/*.RSA</exclude>
151+
</excludes>
152+
</filter>
153+
</filters>
154+
</configuration>
155+
<executions>
156+
<execution>
157+
<phase>package</phase>
158+
<goals>
159+
<goal>shade</goal>
160+
</goals>
161+
<configuration>
162+
<transformers>
163+
<transformer
164+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
165+
<mainClass>com.mobilebox.service.IOSService</mainClass>
166+
</transformer>
167+
</transformers>
168+
</configuration>
169+
</execution>
170+
</executions>
171+
</plugin>
172+
</plugins>
173+
</build>
174+
</project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.mobilebox.configuration;
2+
3+
import org.aeonbits.owner.Config;
4+
import org.aeonbits.owner.Config.Sources;
5+
6+
@Sources("file:ios-service.config")
7+
public interface Configuration extends Config {
8+
9+
@Key("service.port")
10+
@DefaultValue("5005")
11+
int serverPort();
12+
13+
@Key("libimobiledevice.path")
14+
@DefaultValue("/usr/local/bin/")
15+
String libiPath();
16+
17+
@Key("libimobiledevice.timeout")
18+
@DefaultValue("20000")
19+
int timeout();
20+
21+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.mobilebox.device.services;
2+
3+
import com.mobilebox.executor.Service;
4+
5+
/**
6+
* Service to move crash reports from a device to a local directory.
7+
*/
8+
public class DeviceCrashReport extends Service {
9+
10+
private final String OPTION_EXTRACT = "-e";
11+
12+
public DeviceCrashReport() {
13+
setName("idevicecrashreport");
14+
}
15+
16+
/**
17+
* Extract raw crash report into separate '.crash' file
18+
*
19+
* @param udid Target specific device by its 40-digit device UDID.
20+
* @param directory Full path to the local directory
21+
* @return
22+
*/
23+
public String getCrashReport(final String udid, final String path) {
24+
return exec(new String[] {"-u", udid, OPTION_EXTRACT, path});
25+
}
26+
27+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.mobilebox.device.services;
2+
3+
import java.util.Optional;
4+
5+
import com.mobilebox.executor.Service;
6+
7+
/**
8+
* Simple service to get and set the clock on a device.
9+
*/
10+
public class DeviceDate extends Service {
11+
12+
public DeviceDate() {
13+
setName("idevicedate");
14+
}
15+
16+
/**
17+
* Gets the current date.
18+
*
19+
* @param udid Target specific device by its 40-digit device UDID
20+
* @return The device current date.
21+
*/
22+
public String getDate(final String udid) {
23+
return exec(udid, Optional.empty());
24+
}
25+
26+
}

0 commit comments

Comments
 (0)