Skip to content

Commit

Permalink
Merge pull request #6 from umjammer/1.0.6
Browse files Browse the repository at this point in the history
1.0.6
  • Loading branch information
umjammer authored Feb 7, 2024
2 parents d264964 + 5f5d26d commit 16e4d13
Show file tree
Hide file tree
Showing 60 changed files with 515 additions and 267 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: macos-latest
runs-on: macos-14

strategy:
fail-fast: false
Expand All @@ -30,20 +30,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,8 +44,12 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -66,6 +61,8 @@ jobs:
#- run: |
# make bootstrap
# make release
- name: Build with Maven
run: mvn -B package --file pom.xml -Dmaven.test.skip=true

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
29 changes: 18 additions & 11 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven
name: Java CI

on:
push:
Expand All @@ -12,15 +12,22 @@ on:
jobs:
build:

runs-on: macos-latest
runs-on: macos-14

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Checkout repository
uses: actions/checkout@v4

- name: Check w/o SNAPSHOT when "bump version"
if: ${{ contains(github.event.head_commit.message, 'bump version') }}
run: grep "<version>" pom.xml | head -1 | grep -v SNAPSHOT

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
2 changes: 2 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jdk:
- openjdk17
3 changes: 3 additions & 0 deletions local.properties.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#test.d88=/foo/bar.D88
#file.rar1=/foo/bar.rar
#test.asar=/foo/bar.asar
133 changes: 106 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>vavi</groupId>
<artifactId>vavi-util-archive-sandbox</artifactId>
<version>1.0.5</version>
<version>1.0.6</version>

<name>Vavi Archiving Sandbox API</name>
<url>https://github.com/umjammer/vavi-util-archive-sandbox</url>
Expand All @@ -21,7 +21,7 @@
<description>Vavi Archiving Sandbox API</description>

<properties>
<sevenzipjbinding.platform>mac-x86_64</sevenzipjbinding.platform>
<sevenzipjbinding.platform>${os.name}-${os.arch}</sevenzipjbinding.platform>
</properties>

<profiles>
Expand All @@ -30,7 +30,6 @@
<activation>
<os>
<family>mac</family>
<arch>x86_64</arch>
</os>
</activation>
<properties>
Expand All @@ -53,7 +52,7 @@
<!-- $ mvn -P asar exec:java -Dexec.args='"file" "outdir"' -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<version>3.1.0</version>
<executions>
<execution>
<goals>
Expand All @@ -69,24 +68,53 @@
</plugins>
</build>
</profile>

<profile>
<id>shade</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>vavi.util.archive.ArchivesMain</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<release>17</release>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native2ascii-maven-plugin</artifactId>
<version>2.0.1</version>
<version>2.1.0</version>
<executions>
<execution>
<goals>
Expand All @@ -103,7 +131,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.2.2</version>
<configuration>
<argLine>-Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties</argLine>
<trimStackTrace>false</trimStackTrace>
Expand All @@ -124,7 +152,7 @@
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.9.0</version>
<version>5.10.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -133,31 +161,40 @@

<dependencies>
<dependency>
<groupId>com.github.umjammer</groupId>
<groupId>com.github.umjammer</groupId> <!-- vavi / -->
<artifactId>vavi-util-archive</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>com.github.umjammer</groupId>
<artifactId>klab-commons-cli</artifactId>
<version>1.3.0</version>
<groupId>com.github.umjammer</groupId> <!-- vavi / com.github.umjammer -->
<artifactId>vavi-commons-sandbox</artifactId>
<version>0.4.4</version>
</dependency>
<dependency>

<dependency> <!-- asar 1 -->
<groupId>com.github.Scroetchen</groupId>
<artifactId>asar</artifactId>
<version>e785ea9acd</version>
<exclusions>
<exclusion>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20231013</version>
</dependency>

<dependency> <!-- asar 2 -->
<groupId>com.anatawa12.asar4j</groupId>
<artifactId>file</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.github.umjammer</groupId>
<artifactId>vavi-commons-sandbox</artifactId>
<version>0.4.2</version>
</dependency>
<dependency>

<dependency> <!-- xar -->
<groupId>com.github.sprylab</groupId>
<artifactId>xar</artifactId>
<version>0.9.9</version>
Expand All @@ -166,14 +203,49 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
<exclusion> <!-- https://nvd.nist.gov/vuln/detail/CVE-2017-1000190 -->
<groupId>org.simpleframework</groupId>
<artifactId>simple-xml</artifactId>
</exclusion>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</exclusion>
<exclusion>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>5.0.0-alpha.11</version>
<exclusions>
<exclusion>
<groupId>com.squareup.okio</groupId>
<artifactId>okio-jvm</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio-jvm</artifactId>
<version>3.4.0</version>
</dependency>
<dependency> <!-- https://github.com/ngallagher/simplexml/issues/18#issuecomment-533047324 -->
<groupId>com.carrotsearch.thirdparty</groupId>
<artifactId>simple-xml-safe</artifactId>
<version>2.7.1</version>
</dependency>

<dependency> <!-- used by archiveR -->
<groupId>com.github.kevin-wayne</groupId>
<artifactId>algs4</artifactId>
<version>master-SNAPSHOT</version>
<version>fc511547db</version>
</dependency>
<dependency>

<dependency> <!-- 7z -->
<groupId>net.sf.sevenzipjbinding</groupId>
<artifactId>sevenzipjbinding</artifactId>
<version>16.02-2.01</version>
Expand Down Expand Up @@ -204,5 +276,12 @@
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.36</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
20 changes: 13 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
[![](https://jitpack.io/v/umjammer/vavi-util-archive-sandbox.svg)](https://jitpack.io/#umjammer/vavi-util-archive-sandbox)
[![Java CI with Maven](https://github.com/umjammer/vavi-util-archive-sandbox/workflows/Java%20CI%20with%20Maven/badge.svg)](https://github.com/umjammer/vavi-util-archive-sandbox/actions)
[![Release](https://jitpack.io/v/umjammer/vavi-util-archive-sandbox.svg)](https://jitpack.io/#umjammer/vavi-util-archive-sandbox)
[![Java CI](https://github.com/umjammer/vavi-util-archive-sandbox/workflows/Java%20CI%20with%20Maven/badge.svg)](https://github.com/umjammer/vavi-util-archive-sandbox/actions)
[![CodeQL](https://github.com/umjammer/vavi-util-archive-sandbox/workflows/CodeQL/badge.svg)](https://github.com/umjammer/vavi-util-archive-sandbox/actions)
![Java](https://img.shields.io/badge/Java-8-b07219)
![Java](https://img.shields.io/badge/Java-17-b07219)
[![Parent](https://img.shields.io/badge/Parent-vavi--util--archive-pink)](https://github.com/umjammer/vavi-util-archive)

# vavi-util-archive-sandbox

🌏 Extract the world more!

extract all archive types in the same way!</br>
archives are able to mount as fuse also using [vavi-nio-file-archive](https://github.com/umjammer/vavi-apps-fuse/tree/master/vavi-nio-file-archive)
and [vavi-net-fuse](https://github.com/umjammer/vavi-apps-fuse/tree/master/vavi-net-fuse)

## Status

| name | mathod | read | write | comment | library |
|------------|------------|------|-------|----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
| d88 | filesystem || - | | |
| d88 | archiving || - | | |
| rar | archiving | - | - | COM | [jacob](https://github.com/freemansoft/jacob-project) |
| rar | archiving | 🚧 | - | | [unrar](https://github.com/Lesik/unrar-free) c port |
| stuffit | archiving | 🚧 | - | | [unsit](https://github.com/deadw00d/contrib/blob/1c4ab445a23fb0d0baf33aeb13284ccbfc26ff9f/aminet/util/arc/unsit/unsit.c) c port |
Expand All @@ -29,14 +30,19 @@ and [vavi-net-fuse](https://github.com/umjammer/vavi-apps-fuse/tree/master/vavi-
| arj | archiving | 🚧 | - | | [c](https://github.com/tripsin/unarj) |
| arj | archiving |* | - | unsupported files exist | [commons-compress](https://commons.apache.org/proper/commons-compress/) |
| archiveR | streaming | 🚧 | - | TODO engine.io-nize | [ArchiveR](https://github.com/prog-ai/ArchivR) |
| sevenzip | archiving || - | multi | [sevenzipjbinding](https://github.com/borisbrodski/sevenzipjbinding) |
| sevenzip | archiving || - | multi, **arm64 not supported** | [sevenzipjbinding](https://github.com/borisbrodski/sevenzipjbinding) |

<sub>* chosen as spi</sub>

## Install

* [maven](https://jitpack.io/#umjammer/vavi-util-archive-sandbox)

## Usage

```java
Path inXar = Paths.get("foo/bar.xar");
Archive archive = Archives.getArchive(Paths.get("foo/bar.xar").toFile());
Path outDir = Paths.get("foo/bar");
Archive archive = Archives.getArchive(inXar.toFile());
for (Entry entry : archive.entries()) {
Files.copy(archive.getInputStream(entry), outDir.resolve(entry.getName()));
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/vavi/util/archive/ComArchive.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@


/**
* KBA front end.
*
* @target 1.1
* Represents a KBA front end.
*
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (nsano)
* @version 0.00 030211 nsano initial version <br>
Expand Down
Loading

0 comments on commit 16e4d13

Please sign in to comment.