https://github.com/miyako/legacyzip
support legacy Windows XP ZipCrypto archives in ShiftJIS
https://github.com/miyako/legacyzip
4d-class 4d-component zip zipcrypto
Last synced: 19 days ago
JSON representation
support legacy Windows XP ZipCrypto archives in ShiftJIS
- Host: GitHub
- URL: https://github.com/miyako/legacyzip
- Owner: miyako
- License: mit
- Created: 2024-10-28T04:30:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-04T14:46:52.000Z (over 1 year ago)
- Last Synced: 2025-01-08T17:55:14.153Z (about 1 year ago)
- Topics: 4d-class, 4d-component, zip, zipcrypto
- Language: 4D
- Homepage: https://miyako.github.io/LegacyZip/
- Size: 8.03 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


[](LICENSE)

# LegacyZip
## dependencies.json
```json
{
"dependencies": {
"LegacyZip": {
"github": "miyako/LegacyZip",
"version": "latest"
}
}
}
```
```4d
var $LegacyZip : cs.LegacyZip
$LegacyZip:=cs.LegacyZip.new()
$src:=Folder(fk desktop folder).folder("test")
If ($src.exists)
$src.delete(Delete with contents)
End if
$src.create()
$src.file("あいうえお.txt").setText("あいうえお")
$src.folder("かきくけこ").create()
$dst:=Folder(fk desktop folder).file("test.zip")
If ($dst.exists)
$dst.delete()
End if
$options:={cp932: True; method: "deflate"; password: "dddd"; encryption: "zipcrypto"}
$worker:=$LegacyZip.zip($src; $dst; $options)
$worker.wait()
ALERT($LegacyZip.data.join("\r"))
$src:=$dst
$dst:=Folder(fk desktop folder).folder("zipcrypto")
$dst.create(Delete with contents)
$worker:=$LegacyZip.unzip($src; $dst; $options)
$worker.wait()
ALERT($LegacyZip.data.join("\r"))
```
## objective
* support legacy Windows XP `ZipCrypto` archives in `ShiftJIS`
### encryption
* use https://github.com/hillu/go-archive-zip-crypto for `ZipCrypto`
* use https://github.com/noridas80/zi18np for `ShiftJIS`
## Go Build
```
GOOS=darwin GOARCH=arm64 go build -o zip-arm main.go
GOOS=darwin GOARCH=amd64 go build -o zip-amd main.go
lipo -create zip-arm zip-amd -output uuid
GOOS=windows GOARCH=amd64 go build -o zip.exe main.go
```
## CLI
```
zip -src "path.zip" \
-dst "path" \
-cp932 \
-password "password"\
-unzip \
-encryption zipcrypto \
-method deflate
```
|flag|default|other|
|:-|:-:|:-:|
|cp932|false|true|
|unzip|false|true|
|src|||
|dst|||
|password|||
|encryption (requires password)|zipcrypto|aes128 aes192 aes256|
|method|deflate|store|