sayaka 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sayaka-0.2.0/.github/workflows/CI.yml +181 -0
- sayaka-0.2.0/.gitignore +72 -0
- sayaka-0.2.0/Cargo.lock +164 -0
- sayaka-0.2.0/Cargo.toml +12 -0
- sayaka-0.2.0/LICENSE +21 -0
- sayaka-0.2.0/PKG-INFO +88 -0
- sayaka-0.2.0/README.md +77 -0
- sayaka-0.2.0/pyproject.toml +24 -0
- sayaka-0.2.0/python/sayaka/__init__.py +5 -0
- sayaka-0.2.0/python/sayaka/py.typed +0 -0
- sayaka-0.2.0/python/sayaka/sayaka.pyi +15 -0
- sayaka-0.2.0/python/tests/compressed_data.bin +0 -0
- sayaka-0.2.0/python/tests/decompressed_data.bin +0 -0
- sayaka-0.2.0/python/tests/miki_decrypted.bin +0 -0
- sayaka-0.2.0/python/tests/miki_encrypted.bin +0 -0
- sayaka-0.2.0/python/tests/miki_old_decrypted.bin +0 -0
- sayaka-0.2.0/python/tests/miki_old_encrypted.bin +0 -0
- sayaka-0.2.0/python/tests/test_all.py +46 -0
- sayaka-0.2.0/src/lib.rs +211 -0
- sayaka-0.2.0/src/lz4inv.rs +130 -0
- sayaka-0.2.0/src/miki.rs +503 -0
- sayaka-0.2.0/uv.lock +194 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# This file is autogenerated by maturin v1.8.6
|
|
2
|
+
# To update, run
|
|
3
|
+
#
|
|
4
|
+
# maturin generate-ci github
|
|
5
|
+
#
|
|
6
|
+
name: CI
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches:
|
|
11
|
+
- main
|
|
12
|
+
- master
|
|
13
|
+
tags:
|
|
14
|
+
- '*'
|
|
15
|
+
pull_request:
|
|
16
|
+
workflow_dispatch:
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
linux:
|
|
23
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
24
|
+
strategy:
|
|
25
|
+
matrix:
|
|
26
|
+
platform:
|
|
27
|
+
- runner: ubuntu-22.04
|
|
28
|
+
target: x86_64
|
|
29
|
+
- runner: ubuntu-22.04
|
|
30
|
+
target: x86
|
|
31
|
+
- runner: ubuntu-22.04
|
|
32
|
+
target: aarch64
|
|
33
|
+
- runner: ubuntu-22.04
|
|
34
|
+
target: armv7
|
|
35
|
+
- runner: ubuntu-22.04
|
|
36
|
+
target: s390x
|
|
37
|
+
- runner: ubuntu-22.04
|
|
38
|
+
target: ppc64le
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
- uses: actions/setup-python@v5
|
|
42
|
+
with:
|
|
43
|
+
python-version: 3.x
|
|
44
|
+
- name: Build wheels
|
|
45
|
+
uses: PyO3/maturin-action@v1
|
|
46
|
+
with:
|
|
47
|
+
target: ${{ matrix.platform.target }}
|
|
48
|
+
args: --release --out dist --find-interpreter
|
|
49
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
50
|
+
manylinux: auto
|
|
51
|
+
- name: Upload wheels
|
|
52
|
+
uses: actions/upload-artifact@v4
|
|
53
|
+
with:
|
|
54
|
+
name: wheels-linux-${{ matrix.platform.target }}
|
|
55
|
+
path: dist
|
|
56
|
+
|
|
57
|
+
musllinux:
|
|
58
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
59
|
+
strategy:
|
|
60
|
+
matrix:
|
|
61
|
+
platform:
|
|
62
|
+
- runner: ubuntu-22.04
|
|
63
|
+
target: x86_64
|
|
64
|
+
- runner: ubuntu-22.04
|
|
65
|
+
target: x86
|
|
66
|
+
- runner: ubuntu-22.04
|
|
67
|
+
target: aarch64
|
|
68
|
+
- runner: ubuntu-22.04
|
|
69
|
+
target: armv7
|
|
70
|
+
steps:
|
|
71
|
+
- uses: actions/checkout@v4
|
|
72
|
+
- uses: actions/setup-python@v5
|
|
73
|
+
with:
|
|
74
|
+
python-version: 3.x
|
|
75
|
+
- name: Build wheels
|
|
76
|
+
uses: PyO3/maturin-action@v1
|
|
77
|
+
with:
|
|
78
|
+
target: ${{ matrix.platform.target }}
|
|
79
|
+
args: --release --out dist --find-interpreter
|
|
80
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
81
|
+
manylinux: musllinux_1_2
|
|
82
|
+
- name: Upload wheels
|
|
83
|
+
uses: actions/upload-artifact@v4
|
|
84
|
+
with:
|
|
85
|
+
name: wheels-musllinux-${{ matrix.platform.target }}
|
|
86
|
+
path: dist
|
|
87
|
+
|
|
88
|
+
windows:
|
|
89
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
90
|
+
strategy:
|
|
91
|
+
matrix:
|
|
92
|
+
platform:
|
|
93
|
+
- runner: windows-latest
|
|
94
|
+
target: x64
|
|
95
|
+
- runner: windows-latest
|
|
96
|
+
target: x86
|
|
97
|
+
steps:
|
|
98
|
+
- uses: actions/checkout@v4
|
|
99
|
+
- uses: actions/setup-python@v5
|
|
100
|
+
with:
|
|
101
|
+
python-version: 3.x
|
|
102
|
+
architecture: ${{ matrix.platform.target }}
|
|
103
|
+
- name: Build wheels
|
|
104
|
+
uses: PyO3/maturin-action@v1
|
|
105
|
+
with:
|
|
106
|
+
target: ${{ matrix.platform.target }}
|
|
107
|
+
args: --release --out dist --find-interpreter
|
|
108
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
109
|
+
- name: Upload wheels
|
|
110
|
+
uses: actions/upload-artifact@v4
|
|
111
|
+
with:
|
|
112
|
+
name: wheels-windows-${{ matrix.platform.target }}
|
|
113
|
+
path: dist
|
|
114
|
+
|
|
115
|
+
macos:
|
|
116
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
117
|
+
strategy:
|
|
118
|
+
matrix:
|
|
119
|
+
platform:
|
|
120
|
+
- runner: macos-13
|
|
121
|
+
target: x86_64
|
|
122
|
+
- runner: macos-14
|
|
123
|
+
target: aarch64
|
|
124
|
+
steps:
|
|
125
|
+
- uses: actions/checkout@v4
|
|
126
|
+
- uses: actions/setup-python@v5
|
|
127
|
+
with:
|
|
128
|
+
python-version: 3.x
|
|
129
|
+
- name: Build wheels
|
|
130
|
+
uses: PyO3/maturin-action@v1
|
|
131
|
+
with:
|
|
132
|
+
target: ${{ matrix.platform.target }}
|
|
133
|
+
args: --release --out dist --find-interpreter
|
|
134
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
135
|
+
- name: Upload wheels
|
|
136
|
+
uses: actions/upload-artifact@v4
|
|
137
|
+
with:
|
|
138
|
+
name: wheels-macos-${{ matrix.platform.target }}
|
|
139
|
+
path: dist
|
|
140
|
+
|
|
141
|
+
sdist:
|
|
142
|
+
runs-on: ubuntu-latest
|
|
143
|
+
steps:
|
|
144
|
+
- uses: actions/checkout@v4
|
|
145
|
+
- name: Build sdist
|
|
146
|
+
uses: PyO3/maturin-action@v1
|
|
147
|
+
with:
|
|
148
|
+
command: sdist
|
|
149
|
+
args: --out dist
|
|
150
|
+
- name: Upload sdist
|
|
151
|
+
uses: actions/upload-artifact@v4
|
|
152
|
+
with:
|
|
153
|
+
name: wheels-sdist
|
|
154
|
+
path: dist
|
|
155
|
+
|
|
156
|
+
release:
|
|
157
|
+
name: Release
|
|
158
|
+
runs-on: ubuntu-latest
|
|
159
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
|
|
160
|
+
needs: [linux, musllinux, windows, macos, sdist]
|
|
161
|
+
permissions:
|
|
162
|
+
# Use to sign the release artifacts
|
|
163
|
+
id-token: write
|
|
164
|
+
# Used to upload release artifacts
|
|
165
|
+
contents: write
|
|
166
|
+
# Used to generate artifact attestation
|
|
167
|
+
attestations: write
|
|
168
|
+
steps:
|
|
169
|
+
- uses: actions/download-artifact@v4
|
|
170
|
+
- name: Generate artifact attestation
|
|
171
|
+
uses: actions/attest-build-provenance@v2
|
|
172
|
+
with:
|
|
173
|
+
subject-path: 'wheels-*/*'
|
|
174
|
+
- name: Publish to PyPI
|
|
175
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
176
|
+
uses: PyO3/maturin-action@v1
|
|
177
|
+
env:
|
|
178
|
+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
179
|
+
with:
|
|
180
|
+
command: upload
|
|
181
|
+
args: --non-interactive --skip-existing wheels-*/*
|
sayaka-0.2.0/.gitignore
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/target
|
|
2
|
+
|
|
3
|
+
# Byte-compiled / optimized / DLL files
|
|
4
|
+
__pycache__/
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
.venv/
|
|
14
|
+
env/
|
|
15
|
+
bin/
|
|
16
|
+
build/
|
|
17
|
+
develop-eggs/
|
|
18
|
+
dist/
|
|
19
|
+
eggs/
|
|
20
|
+
lib/
|
|
21
|
+
lib64/
|
|
22
|
+
parts/
|
|
23
|
+
sdist/
|
|
24
|
+
var/
|
|
25
|
+
include/
|
|
26
|
+
man/
|
|
27
|
+
venv/
|
|
28
|
+
*.egg-info/
|
|
29
|
+
.installed.cfg
|
|
30
|
+
*.egg
|
|
31
|
+
|
|
32
|
+
# Installer logs
|
|
33
|
+
pip-log.txt
|
|
34
|
+
pip-delete-this-directory.txt
|
|
35
|
+
pip-selfcheck.json
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.coverage
|
|
41
|
+
.cache
|
|
42
|
+
nosetests.xml
|
|
43
|
+
coverage.xml
|
|
44
|
+
|
|
45
|
+
# Translations
|
|
46
|
+
*.mo
|
|
47
|
+
|
|
48
|
+
# Mr Developer
|
|
49
|
+
.mr.developer.cfg
|
|
50
|
+
.project
|
|
51
|
+
.pydevproject
|
|
52
|
+
|
|
53
|
+
# Rope
|
|
54
|
+
.ropeproject
|
|
55
|
+
|
|
56
|
+
# Django stuff:
|
|
57
|
+
*.log
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
.DS_Store
|
|
61
|
+
|
|
62
|
+
# Sphinx documentation
|
|
63
|
+
docs/_build/
|
|
64
|
+
|
|
65
|
+
# PyCharm
|
|
66
|
+
.idea/
|
|
67
|
+
|
|
68
|
+
# VSCode
|
|
69
|
+
.vscode/
|
|
70
|
+
|
|
71
|
+
# Pyenv
|
|
72
|
+
.python-version
|
sayaka-0.2.0/Cargo.lock
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "autocfg"
|
|
7
|
+
version = "1.4.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "heck"
|
|
13
|
+
version = "0.5.0"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "indoc"
|
|
19
|
+
version = "2.0.6"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd"
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "libc"
|
|
25
|
+
version = "0.2.172"
|
|
26
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
+
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
|
|
28
|
+
|
|
29
|
+
[[package]]
|
|
30
|
+
name = "memoffset"
|
|
31
|
+
version = "0.9.1"
|
|
32
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
+
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
34
|
+
dependencies = [
|
|
35
|
+
"autocfg",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[[package]]
|
|
39
|
+
name = "once_cell"
|
|
40
|
+
version = "1.21.3"
|
|
41
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
42
|
+
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
|
43
|
+
|
|
44
|
+
[[package]]
|
|
45
|
+
name = "portable-atomic"
|
|
46
|
+
version = "1.11.0"
|
|
47
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
48
|
+
checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e"
|
|
49
|
+
|
|
50
|
+
[[package]]
|
|
51
|
+
name = "proc-macro2"
|
|
52
|
+
version = "1.0.95"
|
|
53
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
54
|
+
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
|
|
55
|
+
dependencies = [
|
|
56
|
+
"unicode-ident",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[[package]]
|
|
60
|
+
name = "pyo3"
|
|
61
|
+
version = "0.25.0"
|
|
62
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
63
|
+
checksum = "f239d656363bcee73afef85277f1b281e8ac6212a1d42aa90e55b90ed43c47a4"
|
|
64
|
+
dependencies = [
|
|
65
|
+
"indoc",
|
|
66
|
+
"libc",
|
|
67
|
+
"memoffset",
|
|
68
|
+
"once_cell",
|
|
69
|
+
"portable-atomic",
|
|
70
|
+
"pyo3-build-config",
|
|
71
|
+
"pyo3-ffi",
|
|
72
|
+
"pyo3-macros",
|
|
73
|
+
"unindent",
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
[[package]]
|
|
77
|
+
name = "pyo3-build-config"
|
|
78
|
+
version = "0.25.0"
|
|
79
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
80
|
+
checksum = "755ea671a1c34044fa165247aaf6f419ca39caa6003aee791a0df2713d8f1b6d"
|
|
81
|
+
dependencies = [
|
|
82
|
+
"once_cell",
|
|
83
|
+
"target-lexicon",
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
[[package]]
|
|
87
|
+
name = "pyo3-ffi"
|
|
88
|
+
version = "0.25.0"
|
|
89
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
90
|
+
checksum = "fc95a2e67091e44791d4ea300ff744be5293f394f1bafd9f78c080814d35956e"
|
|
91
|
+
dependencies = [
|
|
92
|
+
"libc",
|
|
93
|
+
"pyo3-build-config",
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
[[package]]
|
|
97
|
+
name = "pyo3-macros"
|
|
98
|
+
version = "0.25.0"
|
|
99
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
100
|
+
checksum = "a179641d1b93920829a62f15e87c0ed791b6c8db2271ba0fd7c2686090510214"
|
|
101
|
+
dependencies = [
|
|
102
|
+
"proc-macro2",
|
|
103
|
+
"pyo3-macros-backend",
|
|
104
|
+
"quote",
|
|
105
|
+
"syn",
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
[[package]]
|
|
109
|
+
name = "pyo3-macros-backend"
|
|
110
|
+
version = "0.25.0"
|
|
111
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
112
|
+
checksum = "9dff85ebcaab8c441b0e3f7ae40a6963ecea8a9f5e74f647e33fcf5ec9a1e89e"
|
|
113
|
+
dependencies = [
|
|
114
|
+
"heck",
|
|
115
|
+
"proc-macro2",
|
|
116
|
+
"pyo3-build-config",
|
|
117
|
+
"quote",
|
|
118
|
+
"syn",
|
|
119
|
+
]
|
|
120
|
+
|
|
121
|
+
[[package]]
|
|
122
|
+
name = "quote"
|
|
123
|
+
version = "1.0.40"
|
|
124
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
125
|
+
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
|
|
126
|
+
dependencies = [
|
|
127
|
+
"proc-macro2",
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
[[package]]
|
|
131
|
+
name = "sayaka"
|
|
132
|
+
version = "0.2.0"
|
|
133
|
+
dependencies = [
|
|
134
|
+
"pyo3",
|
|
135
|
+
]
|
|
136
|
+
|
|
137
|
+
[[package]]
|
|
138
|
+
name = "syn"
|
|
139
|
+
version = "2.0.101"
|
|
140
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
141
|
+
checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf"
|
|
142
|
+
dependencies = [
|
|
143
|
+
"proc-macro2",
|
|
144
|
+
"quote",
|
|
145
|
+
"unicode-ident",
|
|
146
|
+
]
|
|
147
|
+
|
|
148
|
+
[[package]]
|
|
149
|
+
name = "target-lexicon"
|
|
150
|
+
version = "0.13.2"
|
|
151
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
152
|
+
checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a"
|
|
153
|
+
|
|
154
|
+
[[package]]
|
|
155
|
+
name = "unicode-ident"
|
|
156
|
+
version = "1.0.18"
|
|
157
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
158
|
+
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
|
|
159
|
+
|
|
160
|
+
[[package]]
|
|
161
|
+
name = "unindent"
|
|
162
|
+
version = "0.2.4"
|
|
163
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
164
|
+
checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
|
sayaka-0.2.0/Cargo.toml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "sayaka"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
edition = "2024"
|
|
5
|
+
|
|
6
|
+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
7
|
+
[lib]
|
|
8
|
+
name = "sayaka"
|
|
9
|
+
crate-type = ["cdylib"]
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
pyo3 = "0.25.0"
|
sayaka-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 baiqwerdvd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sayaka-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sayaka
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
10
|
+
|
|
11
|
+
# Sayaka
|
|
12
|
+
|
|
13
|
+
Sayaka is a Rust-backed Python module for decrypting and decompressing data for an anime game. It leverages [PyO3](https://pyo3.rs/) to provide a high-performance decompression function directly from Python.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
### Prerequisites
|
|
18
|
+
|
|
19
|
+
- Rust (edition 2024)
|
|
20
|
+
- Python (version 3.12 or higher)
|
|
21
|
+
- [maturin](https://github.com/PyO3/maturin) for building the extension module
|
|
22
|
+
|
|
23
|
+
### Build and Install
|
|
24
|
+
|
|
25
|
+
1. Clone the repository:
|
|
26
|
+
|
|
27
|
+
```powershell
|
|
28
|
+
git clone https://github.com/baiqwerdvd/sayaka.git
|
|
29
|
+
cd sayaka
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
2. Build the module using maturin:
|
|
33
|
+
|
|
34
|
+
```powershell
|
|
35
|
+
uv sync
|
|
36
|
+
uv run maturin develop --release
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
Import the module in your Python code to decrypt or decompress data. The module provides three main functions:
|
|
42
|
+
- `decompress_buffer`: Decompresses data using LZ4 compression.
|
|
43
|
+
- `miki_decrypt`: Decrypts data encrypted with the Miki algorithm.
|
|
44
|
+
- `miki_decrypt_old`: Decrypts data encrypted with the old Miki algorithm.
|
|
45
|
+
- `miki_decrypt_and_decompress`: Combines decryption and decompression in one step.
|
|
46
|
+
- `miki_decrypt_and_decompress_old`: Combines decryption and decompression for the old Miki algorithm.
|
|
47
|
+
|
|
48
|
+
The function accepts any object implementing Buffer protocol (for example `bytes`, `bytearray`, `memoryview`) as input for the data.
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
import sayaka
|
|
52
|
+
|
|
53
|
+
with open("compressed_data.bin", "rb") as f:
|
|
54
|
+
compressed_data = f.read()
|
|
55
|
+
|
|
56
|
+
decompressed_size = 9796
|
|
57
|
+
decompressed_data = sayaka.decompress_buffer(compressed_data, decompressed_size)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
import sayaka
|
|
62
|
+
|
|
63
|
+
with open("miki_encrypted.bin", "rb") as f:
|
|
64
|
+
encrypted_data = f.read()
|
|
65
|
+
|
|
66
|
+
decrypted_data = sayaka.miki_decrypt(encrypted_data)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
import sayaka
|
|
71
|
+
|
|
72
|
+
with open("miki_old_encrypted.bin", "rb") as f:
|
|
73
|
+
encrypted_data = f.read()
|
|
74
|
+
|
|
75
|
+
decrypted_data = sayaka.miki_decrypt_old(encrypted_data)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
81
|
+
|
|
82
|
+
## Acknowledgments
|
|
83
|
+
|
|
84
|
+
- [PyO3](https://github.com/PyO3/pyo3) for making Python/Rust interop simple.
|
|
85
|
+
- The LZ4 compression library for inspiration.
|
|
86
|
+
- [Lz4Inv](https://github.com/MooncellWiki/lz4inv) for providing a reference implementation.
|
|
87
|
+
- [YarikStudio](https://github.com/FrothierNine346/YarikStudio) for decryption logic.
|
|
88
|
+
|
sayaka-0.2.0/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Sayaka
|
|
2
|
+
|
|
3
|
+
Sayaka is a Rust-backed Python module for decrypting and decompressing data for an anime game. It leverages [PyO3](https://pyo3.rs/) to provide a high-performance decompression function directly from Python.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Rust (edition 2024)
|
|
10
|
+
- Python (version 3.12 or higher)
|
|
11
|
+
- [maturin](https://github.com/PyO3/maturin) for building the extension module
|
|
12
|
+
|
|
13
|
+
### Build and Install
|
|
14
|
+
|
|
15
|
+
1. Clone the repository:
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
git clone https://github.com/baiqwerdvd/sayaka.git
|
|
19
|
+
cd sayaka
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
2. Build the module using maturin:
|
|
23
|
+
|
|
24
|
+
```powershell
|
|
25
|
+
uv sync
|
|
26
|
+
uv run maturin develop --release
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
Import the module in your Python code to decrypt or decompress data. The module provides three main functions:
|
|
32
|
+
- `decompress_buffer`: Decompresses data using LZ4 compression.
|
|
33
|
+
- `miki_decrypt`: Decrypts data encrypted with the Miki algorithm.
|
|
34
|
+
- `miki_decrypt_old`: Decrypts data encrypted with the old Miki algorithm.
|
|
35
|
+
- `miki_decrypt_and_decompress`: Combines decryption and decompression in one step.
|
|
36
|
+
- `miki_decrypt_and_decompress_old`: Combines decryption and decompression for the old Miki algorithm.
|
|
37
|
+
|
|
38
|
+
The function accepts any object implementing Buffer protocol (for example `bytes`, `bytearray`, `memoryview`) as input for the data.
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
import sayaka
|
|
42
|
+
|
|
43
|
+
with open("compressed_data.bin", "rb") as f:
|
|
44
|
+
compressed_data = f.read()
|
|
45
|
+
|
|
46
|
+
decompressed_size = 9796
|
|
47
|
+
decompressed_data = sayaka.decompress_buffer(compressed_data, decompressed_size)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
import sayaka
|
|
52
|
+
|
|
53
|
+
with open("miki_encrypted.bin", "rb") as f:
|
|
54
|
+
encrypted_data = f.read()
|
|
55
|
+
|
|
56
|
+
decrypted_data = sayaka.miki_decrypt(encrypted_data)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
import sayaka
|
|
61
|
+
|
|
62
|
+
with open("miki_old_encrypted.bin", "rb") as f:
|
|
63
|
+
encrypted_data = f.read()
|
|
64
|
+
|
|
65
|
+
decrypted_data = sayaka.miki_decrypt_old(encrypted_data)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
71
|
+
|
|
72
|
+
## Acknowledgments
|
|
73
|
+
|
|
74
|
+
- [PyO3](https://github.com/PyO3/pyo3) for making Python/Rust interop simple.
|
|
75
|
+
- The LZ4 compression library for inspiration.
|
|
76
|
+
- [Lz4Inv](https://github.com/MooncellWiki/lz4inv) for providing a reference implementation.
|
|
77
|
+
- [YarikStudio](https://github.com/FrothierNine346/YarikStudio) for decryption logic.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["maturin>=1.8,<2.0"]
|
|
3
|
+
build-backend = "maturin"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sayaka"
|
|
7
|
+
requires-python = ">=3.9"
|
|
8
|
+
classifiers = [
|
|
9
|
+
"Programming Language :: Rust",
|
|
10
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
11
|
+
"Programming Language :: Python :: Implementation :: PyPy",
|
|
12
|
+
]
|
|
13
|
+
dynamic = ["version"]
|
|
14
|
+
|
|
15
|
+
[tool.maturin]
|
|
16
|
+
python-source = "python"
|
|
17
|
+
features = ["pyo3/extension-module"]
|
|
18
|
+
|
|
19
|
+
[dependency-groups]
|
|
20
|
+
dev = ["maturin>=1.8.6", "pytest>=8.3.5", "ruff>=0.11.12"]
|
|
21
|
+
|
|
22
|
+
[tool.basedpyright]
|
|
23
|
+
typeCheckingMode = "all"
|
|
24
|
+
pythonVersion = "3.9"
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
from .sayaka import decompress_buffer as decompress_buffer
|
|
2
|
+
from .sayaka import miki_decrypt as miki_decrypt
|
|
3
|
+
from .sayaka import miki_decrypt_old as miki_decrypt_old
|
|
4
|
+
from .sayaka import miki_decrypt_and_decompress as miki_decrypt_and_decompress
|
|
5
|
+
from .sayaka import miki_decrypt_old_and_decompress as miki_decrypt_old_and_decompress
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from typing import Union
|
|
2
|
+
|
|
3
|
+
ByteString = Union[bytes, bytearray, memoryview]
|
|
4
|
+
|
|
5
|
+
def decompress_buffer(
|
|
6
|
+
decompress_bytes: ByteString, uncompressed_size: int
|
|
7
|
+
) -> bytes: ...
|
|
8
|
+
def miki_decrypt(encrypted_bytes: ByteString) -> bytes: ...
|
|
9
|
+
def miki_decrypt_old(encrypted_bytes: ByteString) -> bytes: ...
|
|
10
|
+
def miki_decrypt_and_decompress(
|
|
11
|
+
encrypted_bytes: ByteString, uncompressed_size: int
|
|
12
|
+
) -> bytes: ...
|
|
13
|
+
def miki_decrypt_old_and_decompress(
|
|
14
|
+
encrypted_bytes: ByteString, uncompressed_size: int
|
|
15
|
+
) -> bytes: ...
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|