EXtremeZip 2021.7.30 → 2021.8.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/exuz +9 -1
- data/bin/exz +0 -3
- data/lib/extremeunzip.zzaqsu.rb +53 -44
- metadata +25 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d29d30db28b094a5a35df0c023cb36a4100f155180752252163d7a83cf2a588
|
4
|
+
data.tar.gz: 7d88ac0764c25e07ea252df74f0df7e77d58bec63ffcee489d821b92197f0aa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5213098eca531286fa1e6268d668c1e6a39ea79d4489cbd0f2733572542d2eec18ed55d7048e686028ae1bfacbe8eb9be1bd62f36ce4dd147eb46dd22873c49
|
7
|
+
data.tar.gz: 2d49c941b4e8e434d426e0a7d5cdeaf81c8b0d4f7c521bf93e31a248738b9d1ca057132152d8b42ff76a3bcc761f429c947eb48842b887f628212435533cfde7
|
data/bin/exuz
CHANGED
@@ -4,9 +4,17 @@ require 'extremeunzip.zzaqsu'
|
|
4
4
|
|
5
5
|
if ARGV.empty? # 未指定命令行参数。
|
6
6
|
else # 指定了命令行参数。
|
7
|
+
returnCode = 0 # 失败
|
7
8
|
$rootPath = ARGV[0] # 记录要打包的目录树的根目录。
|
8
9
|
|
9
10
|
exuzObject = ExtremeUnZip.new # 解压对象
|
10
11
|
|
11
|
-
exuzObject.exuz($rootPath) # 解压
|
12
|
+
result = exuzObject.exuz($rootPath) # 解压
|
13
|
+
|
14
|
+
if result # 解压成功
|
15
|
+
else # 解压失败
|
16
|
+
returnCode = 1 # 失败
|
17
|
+
end #if result # 解压成功
|
18
|
+
|
19
|
+
exit returnCode # 退出
|
12
20
|
end
|
data/bin/exz
CHANGED
data/lib/extremeunzip.zzaqsu.rb
CHANGED
@@ -42,14 +42,19 @@ def extractVfsDataWithVersionExternalFile(wholeCbor, fileVersion)
|
|
42
42
|
puts("data block counter: #{dataBlockCounter}") # Debug
|
43
43
|
checkMemoryUsage(34)
|
44
44
|
|
45
|
-
|
45
|
+
begin # 解压
|
46
|
+
currentRawData = LZMA.decompress(currentCompressed) # 解压这一块
|
47
|
+
|
46
48
|
|
47
|
-
|
49
|
+
dataFile.syswrite(currentRawData) # 写入内容
|
50
|
+
rescue RuntimeError => e # 解压失败
|
51
|
+
puts "Warning: the exz file may be incomplete." # 报告错误。文件可能不完整。
|
52
|
+
end # begin # 解压
|
48
53
|
|
49
54
|
# victoriaFreshData=victoriaFreshData+currentRawData #追加
|
50
55
|
# victoriaFreshData << currentRawData #追加
|
51
56
|
|
52
|
-
puts("byte size: #{victoriaFreshData.bytesize}") # debug.
|
57
|
+
#puts("byte size: #{victoriaFreshData.bytesize}") # debug.
|
53
58
|
|
54
59
|
dataBlockCounter += 1 # count
|
55
60
|
end # compressedVfsDataList.each do |currentCompressed|
|
@@ -95,6 +100,8 @@ end # extractVfsDataWithVersion(wholeCbor, fileVersion) #根据版本号
|
|
95
100
|
class ExtremeUnZip
|
96
101
|
# 解压
|
97
102
|
def exuz(rootPath)
|
103
|
+
result = true # 解压结果
|
104
|
+
|
98
105
|
wholeFileContent = File.read(rootPath) # 最终文件内容
|
99
106
|
|
100
107
|
checkMemoryUsage(60)
|
@@ -102,49 +109,51 @@ class ExtremeUnZip
|
|
102
109
|
puts wholeFileContent.class # debug
|
103
110
|
|
104
111
|
wholeCborByteArray = wholeFileContent[4..-1] # 从第5个到末尾
|
105
|
-
checkMemoryUsage(65)
|
106
112
|
|
107
113
|
# puts wholeCborByteArray #Debug.
|
108
114
|
|
109
|
-
|
110
|
-
|
111
|
-
#
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
115
|
+
#/usr/local/share/gems/gems/EXtremeZip-2021.7.8/lib/extremeunzip.zzaqsu.rb:110:in `decode': end of buffer reached (EOFError)
|
116
|
+
|
117
|
+
begin # 可能出错。
|
118
|
+
options = {:tolerant => true}
|
119
|
+
|
120
|
+
wholeCbor = CBOR.decode(wholeCborByteArray, options) # 解码
|
121
|
+
|
122
|
+
fileVersion = wholeCbor['version'] # 获取版本号
|
123
|
+
|
124
|
+
if (fileVersion < 14) # 版本号过小
|
125
|
+
checkMemoryUsage(85)
|
126
|
+
puts 'file version too old' # 报告错误
|
127
|
+
else # 版本号够大
|
128
|
+
compressedVfsMenu = wholeCbor['vfsMenu'] # 获取压缩后的目录内容
|
129
|
+
|
130
|
+
checkMemoryUsage(90)
|
131
|
+
replyByteArray = LZMA.decompress(compressedVfsMenu) # 解码目录VFS字节数组内容
|
132
|
+
|
133
|
+
# puts replyByteArray #Debug
|
134
|
+
|
135
|
+
checkMemoryUsage(95)
|
136
|
+
# victoriaFreshData=extractVfsDataWithVersion(wholeCbor, fileVersion) #根据版本号,提取VFS数据内容
|
137
|
+
victoriaFreshDataFile = extractVfsDataWithVersionExternalFile(wholeCbor, fileVersion) # 根据版本号,提取VFS数据内容
|
138
|
+
|
139
|
+
# puts victoriaFreshData #Debug
|
140
|
+
|
141
|
+
checkMemoryUsage(100)
|
142
|
+
$clipDownloader = VictoriaFresh.new # 创建下载器。
|
143
|
+
|
144
|
+
$clipDownloader.releaseFilesExternalDataFile(replyByteArray, victoriaFreshDataFile) # 释放各个文件
|
145
|
+
|
146
|
+
fileToRemove = File.new(victoriaFreshDataFile) # 要删除的文件
|
147
|
+
|
148
|
+
File.delete(fileToRemove) # 删除文件
|
149
|
+
|
150
|
+
end # if (fileVersion<14) #版本号过小
|
151
|
+
|
152
|
+
result =true # 解压成功
|
153
|
+
rescue EOFError => e # 文件内容提前到末尾。一般是压缩包文件未传输完全 。
|
154
|
+
puts "Error: the exz file may be incomplete." # 报告错误。文件可能不完整。
|
155
|
+
|
156
|
+
result = false # 失败
|
157
|
+
end #begin # 可能出错。
|
149
158
|
end # def exuz(rootPath)
|
150
159
|
end # class ExtremeUnZip
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: EXtremeZip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2021.
|
4
|
+
version: 2021.8.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hxcan Cai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cod
|
@@ -68,18 +68,38 @@ dependencies:
|
|
68
68
|
version: 2.3.9
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: VictoriaFreSh
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2021.8.20
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 2021.8.20
|
79
|
+
type: :runtime
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - "~>"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 2021.8.20
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 2021.8.20
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: hx_cbor
|
71
91
|
requirement: !ruby/object:Gem::Requirement
|
72
92
|
requirements:
|
73
93
|
- - ">="
|
74
94
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2021.
|
95
|
+
version: 2021.8.20
|
76
96
|
type: :runtime
|
77
97
|
prerelease: false
|
78
98
|
version_requirements: !ruby/object:Gem::Requirement
|
79
99
|
requirements:
|
80
100
|
- - ">="
|
81
101
|
- !ruby/object:Gem::Version
|
82
|
-
version: 2021.
|
102
|
+
version: 2021.8.20
|
83
103
|
description: Extreme zip.
|
84
104
|
email: caihuosheng@gmail.com
|
85
105
|
executables:
|
@@ -111,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
131
|
- !ruby/object:Gem::Version
|
112
132
|
version: '0'
|
113
133
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
134
|
+
rubygems_version: 3.1.6
|
115
135
|
signing_key:
|
116
136
|
specification_version: 4
|
117
137
|
summary: EXtremeZip
|