Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] UI Re-Design (v0.11) #24

Closed
wants to merge 10 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8.x', '9.x', '10.x', '11.x', '12.x', '13.x' ]
java: [ '13.x' ]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run build with Gradle Wrapper
run: chmod +x ./gradlew && ./gradlew build
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
.versions/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
Binary file added Example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Its functionality is akin to similar projects:
... but this Java version is significantly simpler and is no longer under
active development.

> Note: This tool is a CLI tool that provides a GUI interface.

## Overview

![Example Visual](docs/Example.png)

Kaitai Struct is a declarative language used to describe various
binary data structures, laid out in files or in memory: i.e. binary
file formats, network stream packet formats, etc.
Expand All @@ -26,12 +32,39 @@ that can read described data structure from a file / stream and give
access to it in a nice, easy-to-comprehend API.

## Build
Install java, maven and, if on windows, git-bash
Install java, gradle and, if on windows, git-bash

Run in console:

```bash
mvn install
gradlew build KaitaiStructGUI
```

## How to use

Since this tool is accessed via the command line, here is a quick introduction on how to use it. For example:

```bash
java -jar ./build/libs/kaitai_struct_gui-0.11.jar -ksy ./docs/png.ksy ./docs/Example.png
```

> Note: To apply dark-mode, just use `-dark` as an extra argument.

### Parameter overview

```text
Usage: <path/to/jar> [options] Path to the binary
Options:
-h, --help
Show this help message.
Default: false
-dark
Enables dark layout.
Default: false
-java
Path to generated Java file
-ksy
Path to the .ksy file
```

## Licensing
Expand Down Expand Up @@ -59,4 +92,8 @@ Vis tool depends on the following libraries:
* [kaitai_struct_compiler](https://github.com/kaitai_struct_compiler) — GPLv3+ license
* [fastparse](http://www.lihaoyi.com/fastparse/) — MIT license
* [snakeyaml](https://bitbucket.org/asomov/snakeyaml) — Apache 2.0 license
* [JHexView](https://github.com/Mingun/JHexView) — LGPL-2.1 license
* [JHexViewer](https://github.com/rendner/jhexviewer) — MIT license
* [Proto4j-IconManager](https://github.com/Proto4j/proto4j-iconmgr) — MIT License
* [Apache-Batik](https://xmlgraphics.apache.org/batik) — Apache 2.0 license
* [JetBrains-Icons](https://jetbrains.design/intellij/resources/icons_list/) — Apache 2.0 license
* [JCommander](https://jcommander.org) — Apache 2.0 license
73 changes: 73 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
plugins {
id 'java'

}

group 'io.kaitai'
version '0.11'

compileJava.options.encoding = 'UTF-8'
// Version 13 is needed because proto4j-iconmgr is available
// only at version 13+
sourceCompatibility = 13
targetCompatibility = 13

repositories {
mavenCentral()

}

dependencies {
// Library used for displaying SVG images
implementation 'org.apache.xmlgraphics:batik-all:1.16'

// Just comment out this line and the library won't be included in the
// project build.
implementation 'com.formdev:flatlaf:2.6'

implementation fileTree('lib')
implementation 'io.kaitai:kaitai-struct-runtime:0.10'
implementation 'io.kaitai:kaitai-struct-compiler_2.12:0.10'
implementation 'com.beust:jcommander:1.72'
implementation 'io.github.proto4j:proto4j-iconmgr:0.1'
implementation 'org.mdkt.compiler:InMemoryJavaCompiler:1.3.0'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}


jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes('Main-Class': 'io.kaitai.struct.visualizer.Main')
}
}

//noinspection ConfigurationAvoidance
task KaitaiStructGUI(type: Jar) {
manifest.from jar.manifest
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
} {
// preventing signed jars into the final JAR
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
with jar
}

java {
withSourcesJar()
// Comment out the next statement if you don't want ot generate
// the Javadoc files
// withJavadocJar()
}

test {
useJUnitPlatform()
}
Binary file added docs/Example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Example_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading