EXtremeZip 2021.7.26 → 2021.8.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/exuz +9 -1
  3. data/lib/extremeunzip.zzaqsu.rb +45 -41
  4. metadata +25 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a88244b30d9541c3a6fc61fb5fc7de5aac85e0bfec208d55ff54a6ba0f7123cd
4
- data.tar.gz: 7f7b278d2c58e6f089d6c5c9dbfd87ddd857e108da17623f1a9f1bd1814bf029
3
+ metadata.gz: a29e7883f12edfc3bd5d53e38920712122607db3dec46c68ff27eb3e6795ca97
4
+ data.tar.gz: 44ba92f62eb58df2eeff1a36dfa1f58526607028096b4c03d2e1363682b83f99
5
5
  SHA512:
6
- metadata.gz: 12cb1c8fb34ac0bd2a8169556a1bbf32008a155eed146607b710041e96838c207914ab1dda70fea67e115ec5847a4ff05e2434393ecbc35dcbc15f6a80801dbf
7
- data.tar.gz: 594aa5ea1c15ff8b47db32963486aeb65ae235c9f488371793a6c54a23631230c70d0f541fdfad4c240300f59214e0a4f2f27ac28cc5fa695b746ad1432bbbb1
6
+ metadata.gz: 1b41d07dcaa62be1902802f028142bce2fe9a9004afc40a57b4d26205a1b8eb2707ca59587ec7b79fd091d6f41439be81404371da73b7d6cbca0712dcda76339
7
+ data.tar.gz: 0245dfe4f75783146a8350d8bdc8677a4539df0110fdd9b47c38882a4382b6dbd17be615d23421a067ae81a6d2a75e39820ab239916b30fef2de2628a742522e
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
@@ -95,6 +95,8 @@ end # extractVfsDataWithVersion(wholeCbor, fileVersion) #根据版本号
95
95
  class ExtremeUnZip
96
96
  # 解压
97
97
  def exuz(rootPath)
98
+ result = true # 解压结果
99
+
98
100
  wholeFileContent = File.read(rootPath) # 最终文件内容
99
101
 
100
102
  checkMemoryUsage(60)
@@ -102,49 +104,51 @@ class ExtremeUnZip
102
104
  puts wholeFileContent.class # debug
103
105
 
104
106
  wholeCborByteArray = wholeFileContent[4..-1] # 从第5个到末尾
105
- checkMemoryUsage(65)
106
107
 
107
108
  # puts wholeCborByteArray #Debug.
108
109
 
109
- checkMemoryUsage(70)
110
- wholeCbor = CBOR.decode(wholeCborByteArray) # 解码
111
- # wholeCbor=wholeCborByteArray.from_cbor #解码CBOR
112
-
113
- # puts wholeCbor #Debug.
114
- checkMemoryUsage(75)
115
-
116
- fileVersion = wholeCbor['version'] # 获取版本号
117
-
118
- puts 'fileVersion:' # Debug
119
- checkMemoryUsage(80)
120
- puts fileVersion # Debug.
121
-
122
- if (fileVersion < 14) # 版本号过小
123
- checkMemoryUsage(85)
124
- puts 'file version too old' # 报告错误
125
- else # 版本号够大
126
- compressedVfsMenu = wholeCbor['vfsMenu'] # 获取压缩后的目录内容
127
-
128
- checkMemoryUsage(90)
129
- replyByteArray = LZMA.decompress(compressedVfsMenu) # 解码目录VFS字节数组内容
130
-
131
- # puts replyByteArray #Debug
132
-
133
- checkMemoryUsage(95)
134
- # victoriaFreshData=extractVfsDataWithVersion(wholeCbor, fileVersion) #根据版本号,提取VFS数据内容
135
- victoriaFreshDataFile = extractVfsDataWithVersionExternalFile(wholeCbor, fileVersion) # 根据版本号,提取VFS数据内容
136
-
137
- # puts victoriaFreshData #Debug
138
-
139
- checkMemoryUsage(100)
140
- $clipDownloader = VictoriaFresh.new # 创建下载器。
141
-
142
- $clipDownloader.releaseFilesExternalDataFile(replyByteArray, victoriaFreshDataFile) # 释放各个文件
143
-
144
- fileToRemove = File.new(victoriaFreshDataFile) # 要删除的文件
145
-
146
- File.delete(fileToRemove) # 删除文件
147
-
148
- end # if (fileVersion<14) #版本号过小
110
+ #/usr/local/share/gems/gems/EXtremeZip-2021.7.8/lib/extremeunzip.zzaqsu.rb:110:in `decode': end of buffer reached (EOFError)
111
+
112
+ begin # 可能出错。
113
+ options = {:tolerant => true}
114
+
115
+ wholeCbor = CBOR.decode(wholeCborByteArray, options) # 解码
116
+
117
+ fileVersion = wholeCbor['version'] # 获取版本号
118
+
119
+ if (fileVersion < 14) # 版本号过小
120
+ checkMemoryUsage(85)
121
+ puts 'file version too old' # 报告错误
122
+ else # 版本号够大
123
+ compressedVfsMenu = wholeCbor['vfsMenu'] # 获取压缩后的目录内容
124
+
125
+ checkMemoryUsage(90)
126
+ replyByteArray = LZMA.decompress(compressedVfsMenu) # 解码目录VFS字节数组内容
127
+
128
+ # puts replyByteArray #Debug
129
+
130
+ checkMemoryUsage(95)
131
+ # victoriaFreshData=extractVfsDataWithVersion(wholeCbor, fileVersion) #根据版本号,提取VFS数据内容
132
+ victoriaFreshDataFile = extractVfsDataWithVersionExternalFile(wholeCbor, fileVersion) # 根据版本号,提取VFS数据内容
133
+
134
+ # puts victoriaFreshData #Debug
135
+
136
+ checkMemoryUsage(100)
137
+ $clipDownloader = VictoriaFresh.new # 创建下载器。
138
+
139
+ $clipDownloader.releaseFilesExternalDataFile(replyByteArray, victoriaFreshDataFile) # 释放各个文件
140
+
141
+ fileToRemove = File.new(victoriaFreshDataFile) # 要删除的文件
142
+
143
+ File.delete(fileToRemove) # 删除文件
144
+
145
+ end # if (fileVersion<14) #版本号过小
146
+
147
+ result =true # 解压成功
148
+ rescue EOFError => e # 文件内容提前到末尾。一般是压缩包文件未传输完全 。
149
+ puts "Error: the exz file may be incomplete." # 报告错误。文件可能不完整。
150
+
151
+ result = false # 失败
152
+ end #begin # 可能出错。
149
153
  end # def exuz(rootPath)
150
154
  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.7.26
4
+ version: 2021.8.22
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-07-26 00:00:00.000000000 Z
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.5.28
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 2021.5.28
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - "~>"
84
+ - !ruby/object:Gem::Version
85
+ version: 2021.5.28
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 2021.5.28
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.7.26
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.7.26
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.0.3
134
+ rubygems_version: 3.1.6
115
135
  signing_key:
116
136
  specification_version: 4
117
137
  summary: EXtremeZip