Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
51 changes: 51 additions & 0 deletions IMPROVEMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Project Improvements

## Maven Migration

This project has been migrated to use **Maven** as the build system for better dependency management and standardized project structure.

## Requirements

- **Maven** - Required for building and running the project
- **Azul Zulu JDK** - Recommended for macOS (better JavaFX compatibility)
- **ADB tools** - Required for device communication (install via Homebrew: `brew install android-platform-tools`)

## Basic Commands

### Compile
```bash
mvn clean compile
```

### Run Application
```bash
mvn javafx:run
```

### Build JAR
```bash
mvn clean package
```
The executable JAR will be created in `target/XiaomiADBFastbootTools.jar`

### Clean Build Artifacts
```bash
mvn clean
```

## Project Structure

The project now follows standard Maven conventions:
- `src/main/java/` - Java source files
- `src/main/resources/` - Resources (images, FXML, binaries)
- `src/test/java/` - Test files
- `target/` - Build output (ignored by Git)
- `pom.xml` - Maven configuration

## Benefits

- ✅ Automatic dependency management
- ✅ Standardized project structure
- ✅ Better IDE integration
- ✅ Cross-platform builds
- ✅ Security vulnerability management
186 changes: 186 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>com.saki</groupId>
<artifactId>xiaomi-adb-fastboot-tools</artifactId>
<version>3.0.0</version>
<packaging>jar</packaging>

<name>Xiaomi ADB/Fastboot Tools</name>
<description>A JavaFX application for managing Xiaomi devices via ADB and Fastboot</description>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- JavaFX Version -->
<javafx.version>17.0.2</javafx.version>
<javafx.maven.plugin.version>0.0.8</javafx.maven.plugin.version>

<!-- Other Dependencies -->
<commons.io.version>2.16.0</commons.io.version>
<maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
<maven.surefire.plugin.version>3.0.0</maven.surefire.plugin.version>
<maven.shade.plugin.version>3.4.1</maven.shade.plugin.version>
</properties>

<dependencies>
<!-- JavaFX Controls -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>

<!-- JavaFX FXML -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>

<!-- Apache Commons IO -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
</dependencies>

<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</pluginRepository>
</pluginRepositories>

<build>
<finalName>XiaomiADBFastbootTools</finalName>

<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>

<plugins>
<!-- Maven Compiler Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>

<!-- JavaFX Maven Plugin -->
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx.maven.plugin.version}</version>
<configuration>
<mainClass>xiaomiadbfastboottools.XiaomiADBFastbootTools</mainClass>
</configuration>
<executions>
<execution>
<id>default-cli</id>
<configuration>
<mainClass>xiaomiadbfastboottools.XiaomiADBFastbootTools</mainClass>
</configuration>
</execution>
</executions>
</plugin>

<!-- Maven Surefire Plugin (for tests) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
</plugin>

<!-- Maven Shade Plugin (creates executable JAR with dependencies) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven.shade.plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>xiaomiadbfastboottools.XiaomiADBFastbootTools</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<!-- Profiles for different platforms -->
<profiles>
<profile>
<id>macos</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<javafx.platform>mac</javafx.platform>
</properties>
</profile>

<profile>
<id>windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<javafx.platform>win</javafx.platform>
</properties>
</profile>

<profile>
<id>linux</id>
<activation>
<os>
<family>unix</family>
<name>!mac os x</name>
</os>
</activation>
<properties>
<javafx.platform>linux</javafx.platform>
</properties>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public Command(TextInputControl control){
if (System.getProperty("os.name").toLowerCase().contains("linux"))
prefix = "";
else if (System.getProperty("os.name").toLowerCase().contains("mac os"))
prefix = "./";
// prefix = "./";
prefix = "";
else prefix = "temp/";
}

Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
Binary file removed src/windows/AdbWinApi.dll
Binary file not shown.
Binary file removed src/windows/AdbWinUsbApi.dll
Binary file not shown.
Binary file removed src/windows/adb.exe
Binary file not shown.
Binary file removed src/windows/fastboot.exe
Binary file not shown.