Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
149e9b4b
Commit
149e9b4b
authored
Mar 16, 2019
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cosmetis unrar
parent
a360b175
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
unrar.js
cps/static/js/unrar.js
+14
-13
No files found.
cps/static/js/unrar.js
View file @
149e9b4b
...
...
@@ -405,7 +405,7 @@ function rarMakeDecodeTables(BitLength, offset, dec, size) {
}
// TODO: implement
function
U
npack15
()
{
//bstream, Solid) {
function
u
npack15
()
{
//bstream, Solid) {
info
(
"ERROR! RAR 1.5 compression not supported"
);
}
...
...
@@ -416,7 +416,7 @@ var rOldDist = [0, 0, 0, 0];
var
lastDist
=
0
;
var
lastLength
=
0
;
function
U
npack20
(
bstream
)
{
//, Solid) {
function
u
npack20
(
bstream
)
{
//, Solid) {
var
destUnpSize
=
rBuffer
.
data
.
length
;
var
oldDistPtr
=
0
;
var
Length
;
...
...
@@ -553,7 +553,7 @@ function rarReadTables20(bstream) {
}
function
U
npack29
(
bstream
)
{
function
u
npack29
(
bstream
)
{
// lazy initialize rDDecode and rDBits
var
DDecode
=
new
Array
(
rDC
);
...
...
@@ -650,8 +650,8 @@ function Unpack29(bstream) {
var
DistNum
=
num
-
259
;
Distance
=
rOldDist
[
DistNum
];
for
(
var
I
=
DistNum
;
I
>
0
;
I
--
)
{
rOldDist
[
I
]
=
rOldDist
[
I
-
1
];
for
(
var
I
2
=
DistNum
;
I2
>
0
;
I2
--
)
{
rOldDist
[
I
2
]
=
rOldDist
[
I2
-
1
];
}
rOldDist
[
0
]
=
Distance
;
...
...
@@ -707,10 +707,10 @@ function rarReadVMCode(bstream) {
//do something here with cheking readbuf
vmCode
.
push
(
bstream
.
readBits
(
8
));
}
return
RarAddVMCode
(
FirstByte
,
vmCode
,
Length
);
return
rarAddVMCode
(
vmCode
);
}
function
RarAddVMCode
(
firstByte
,
vmCode
,
length
)
{
function
rarAddVMCode
(
vmCode
)
{
//console.log(vmCode);
if
(
vmCode
.
length
>
0
)
{
info
(
"Error! RarVM not supported yet!"
);
...
...
@@ -752,24 +752,23 @@ function unpack(v) {
// TODO: implement what happens when unpVer is < 15
var
Ver
=
v
.
header
.
unpVer
<=
15
?
15
:
v
.
header
.
unpVer
,
Solid
=
v
.
header
.
LHD_SOLID
,
bstream
=
new
bitjs
.
io
.
BitStream
(
v
.
fileData
.
buffer
,
true
/* rtl */
,
v
.
fileData
.
byteOffset
,
v
.
fileData
.
byteLength
);
rBuffer
=
new
bitjs
.
io
.
ByteBuffer
(
v
.
header
.
unpackedSize
);
info
(
"Unpacking "
+
v
.
filename
+
" RAR v"
+
Ver
);
switch
(
Ver
)
{
switch
(
Ver
)
{
case
15
:
// rar 1.5 compression
U
npack15
();
//(bstream, Solid);
u
npack15
();
//(bstream, Solid);
break
;
case
20
:
// rar 2.x compression
case
26
:
// files larger than 2GB
U
npack20
(
bstream
);
//, Solid);
u
npack20
(
bstream
);
//, Solid);
break
;
case
29
:
// rar 3.x compression
case
36
:
// alternative hash
U
npack29
(
bstream
);
u
npack29
(
bstream
);
break
;
}
// switch(method)
...
...
@@ -870,7 +869,9 @@ var unrar = function(arrayBuffer) {
return
aname
>
bname
?
1
:
-
1
;
});
info
(
localFiles
.
map
(
function
(
a
)
{
return
a
.
filename
;}).
join
(
", "
));
info
(
localFiles
.
map
(
function
(
a
)
{
return
a
.
filename
;
}).
join
(
", "
));
for
(
var
i
=
0
;
i
<
localFiles
.
length
;
++
i
)
{
var
localfile
=
localFiles
[
i
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment