EXtremeZip 2021.7.8 → 2021.8.21

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 +43 -41
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d967b1fd71318b619a278a51c6a3ce645c9ce88b103d3c58f025d9ca147cbb8
4
- data.tar.gz: 47572d3f25d9b4752d6709aed79b2b2486757a5608858e43ea7eb38ecc20a7c3
3
+ metadata.gz: b7b62dc9821468e67a58130b9722834776fc64562169d58bd311cb104bc8e1e7
4
+ data.tar.gz: f1db8e352f62866f9c3dacfd92e2e80a7a79438796b56f456dbfd8659191ac78
5
5
  SHA512:
6
- metadata.gz: 55f00f36a4c24c26a6a92d0a9739b87899fc49e003f1502f9025024979387120dfff8e0d1625a6e2d84fd9db27c6cc7d687045a6b3e0b79d5fdd5574940a90af
7
- data.tar.gz: 95839ed46e4eb76929a98ffc55cccb25972aa868f0c24b3a5c4455521b413fa4eec5634032eaf454084c5e1bc92ca09bb30bf7920e9a66e8b611e016e9c15c83
6
+ metadata.gz: 9299113acf4f48acbf3ebc7e9911df423808d9f3bd5ee18e199ed8f2135348cd56eb8196c3a2ba4b9476ec4518dee74be551689791008d9122989b8324d0cd17
7
+ data.tar.gz: 4581bfc6106c4f3d141011b0ff454555f29ca83d06f64b9ea8732903974c8c615064e0270cca9c887513813bf30d9e7f8f34321c30002d81e5450417ba1c6223
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,49 @@ 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
+ wholeCbor = CBOR.decode(wholeCborByteArray) # 解码
114
+
115
+ fileVersion = wholeCbor['version'] # 获取版本号
116
+
117
+ if (fileVersion < 14) # 版本号过小
118
+ checkMemoryUsage(85)
119
+ puts 'file version too old' # 报告错误
120
+ else # 版本号够大
121
+ compressedVfsMenu = wholeCbor['vfsMenu'] # 获取压缩后的目录内容
122
+
123
+ checkMemoryUsage(90)
124
+ replyByteArray = LZMA.decompress(compressedVfsMenu) # 解码目录VFS字节数组内容
125
+
126
+ # puts replyByteArray #Debug
127
+
128
+ checkMemoryUsage(95)
129
+ # victoriaFreshData=extractVfsDataWithVersion(wholeCbor, fileVersion) #根据版本号,提取VFS数据内容
130
+ victoriaFreshDataFile = extractVfsDataWithVersionExternalFile(wholeCbor, fileVersion) # 根据版本号,提取VFS数据内容
131
+
132
+ # puts victoriaFreshData #Debug
133
+
134
+ checkMemoryUsage(100)
135
+ $clipDownloader = VictoriaFresh.new # 创建下载器。
136
+
137
+ $clipDownloader.releaseFilesExternalDataFile(replyByteArray, victoriaFreshDataFile) # 释放各个文件
138
+
139
+ fileToRemove = File.new(victoriaFreshDataFile) # 要删除的文件
140
+
141
+ File.delete(fileToRemove) # 删除文件
142
+
143
+ end # if (fileVersion<14) #版本号过小
144
+
145
+ result =true # 解压成功
146
+ rescue EOFError => e # 文件内容提前到末尾。一般是压缩包文件未传输完全 。
147
+ puts "Error: the exz file may be incomplete." # 报告错误。文件可能不完整。
148
+
149
+ result = false # 失败
150
+ end #begin # 可能出错。
149
151
  end # def exuz(rootPath)
150
152
  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.8
4
+ version: 2021.8.21
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-08 00:00:00.000000000 Z
11
+ date: 2021-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cod