Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
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
HuangJunbo
antSword
Commits
42602cc9
Commit
42602cc9
authored
Jun 15, 2021
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Move: Core/JSPJS) JSP_JS 类型改为 JSPJS
parent
a9b39301
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
141 additions
and
35 deletions
+141
-35
app.entry.js
source/app.entry.js
+6
-6
index.js
source/core/index.js
+1
-1
b64reverse.js
source/core/jspjs/decoder/b64reverse.js
+34
-0
b64rot13.js
source/core/jspjs/decoder/b64rot13.js
+40
-0
base64.js
source/core/jspjs/decoder/base64.js
+1
-1
default.js
source/core/jspjs/decoder/default.js
+0
-0
hex.js
source/core/jspjs/decoder/hex.js
+32
-0
index.js
source/core/jspjs/index.js
+7
-7
base.js
source/core/jspjs/template/base.js
+0
-0
command.js
source/core/jspjs/template/command.js
+0
-0
mysql.js
source/core/jspjs/template/database/mysql.js
+0
-0
oracle.js
source/core/jspjs/template/database/oracle.js
+0
-0
sqlserver.js
source/core/jspjs/template/database/sqlserver.js
+0
-0
filemanager.js
source/core/jspjs/template/filemanager.js
+0
-0
index.js
source/modules/database/jspjs/index.js
+3
-3
encoders.js
source/modules/settings/encoders.js
+16
-16
form.js
source/modules/shellmanager/list/form.js
+1
-1
No files found.
source/app.entry.js
View file @
42602cc9
...
...
@@ -174,7 +174,7 @@ antSword['encoders'] = (function () {
asp
:
[],
aspx
:
[],
jsp
:
[],
jsp
_
js
:
[],
jspjs
:
[],
php
:
[],
custom
:
[]
};
...
...
@@ -182,7 +182,7 @@ antSword['encoders'] = (function () {
asp
:
[],
aspx
:
[],
jsp
:
[],
jsp
_
js
:
[],
jspjs
:
[],
php
:
[],
custom
:
[]
};
...
...
@@ -191,7 +191,7 @@ antSword['encoders'] = (function () {
!
fs
.
existsSync
(
userencoder_path
)
?
fs
.
mkdirSync
(
userencoder_path
)
:
null
;
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jsp
_
js'
,
'custom'
].
map
((
t
)
=>
{
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jspjs'
,
'custom'
].
map
((
t
)
=>
{
!
fs
.
existsSync
(
path
.
join
(
userencoder_path
,
`
${
t
}
`
))
?
fs
.
mkdirSync
(
path
.
join
(
userencoder_path
,
`
${
t
}
`
))
:
null
;
...
...
@@ -232,7 +232,7 @@ antSword['decoders'] = (function () {
aspx
:
[],
php
:
[],
jsp
:
[],
jsp
_
js
:
[],
jspjs
:
[],
custom
:
[]
};
var
decoders_path
=
{
...
...
@@ -240,7 +240,7 @@ antSword['decoders'] = (function () {
aspx
:
[],
php
:
[],
jsp
:
[],
jsp
_
js
:
[],
jspjs
:
[],
custom
:
[]
};
let
userdecoder_path
=
path
.
join
(
remote
.
process
.
env
.
AS_WORKDIR
,
'antData/encoders'
);
...
...
@@ -248,7 +248,7 @@ antSword['decoders'] = (function () {
!
fs
.
existsSync
(
userdecoder_path
)
?
fs
.
mkdirSync
(
userdecoder_path
)
:
null
;
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jsp
_
js'
,
'custom'
].
map
((
t
)
=>
{
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jspjs'
,
'custom'
].
map
((
t
)
=>
{
!
fs
.
existsSync
(
path
.
join
(
userdecoder_path
,
`
${
t
}
`
))
?
fs
.
mkdirSync
(
path
.
join
(
userdecoder_path
,
`
${
t
}
`
))
:
null
;
...
...
source/core/index.js
View file @
42602cc9
...
...
@@ -14,7 +14,7 @@ class Core {
constructor
()
{
// 加载子模块列表
let
cores
=
{};
[
'php'
,
'asp'
,
'aspx'
,
'jsp'
,
'jsp
_
js'
,
'custom'
,
'php4'
].
map
((
_
)
=>
{
[
'php'
,
'asp'
,
'aspx'
,
'jsp'
,
'jspjs'
,
'custom'
,
'php4'
].
map
((
_
)
=>
{
cores
[
_
]
=
require
(
`./
${
_
}
/index`
);
});
// 返回子模块对象
...
...
source/core/jspjs/decoder/b64reverse.js
0 → 100644
View file @
42602cc9
/**
* jspjs::b64reverse解码器
*/
'use strict'
;
module
.
exports
=
{
/**
* @returns {string} asenc 将返回数据反转
*/
asoutput
:
()
=>
{
return
`function asenc(str){
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var ret = "";
try {
ret = new Base64().getEncoder().encodeToString(str.getBytes());
} catch (e) {
ret = new BASE64Encoder().encode(str.getBytes());
}
ret = ret.replaceAll("\\r|\\n", "");
return new StringBuffer(ret).reverse();
}
`
.
replace
(
/
\n\s
+/g
,
''
);
},
/**
* 解码 Buffer
* @param {Buffer} buff 要被解码的 Buffer
* @returns {Buffer} 解码后的 Buffer
*/
decode_buff
:
(
buff
)
=>
{
return
Buffer
.
from
(
Buffer
.
from
(
buff
).
reverse
().
toString
(),
'base64'
);
}
}
\ No newline at end of file
source/core/jspjs/decoder/b64rot13.js
0 → 100644
View file @
42602cc9
/**
* jspjs::rot13解码器
*/
'use strict'
;
const
rot13encode
=
(
s
)
=>
{
//use a Regular Expression to Replace only the characters that are a-z or A-Z
return
s
.
replace
(
/
[
a-zA-Z
]
/g
,
function
(
c
)
{
// Get the character code of the current character and add 13 to it If it is
// larger than z's character code then subtract 26 to support wrap around.
return
String
.
fromCharCode
((
c
<=
"Z"
?
90
:
122
)
>=
(
c
=
c
.
charCodeAt
(
0
)
+
13
)
?
c
:
c
-
26
);
});
};
module
.
exports
=
{
asoutput
:
(
tag_s
,
tag_e
)
=>
{
return
`function asenc(str){
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var ret = "";
try {
ret = new Base64().getEncoder().encodeToString(str.getBytes());
} catch (e) {
ret = new BASE64Encoder().encode(str.getBytes());
}
ret = ret.replaceAll("\\r|\\n", "");
return ret.replace(/[a-zA-Z]/g,function(c){
return String.fromCharCode((c <= "Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);
});
}
`
.
replace
(
/
\n\s
+/g
,
''
);
},
decode_buff
:
(
buff
)
=>
{
return
Buffer
.
from
(
rot13encode
(
buff
.
toString
()),
'base64'
);
}
}
source/core/jsp
_
js/decoder/base64.js
→
source/core/jspjs/decoder/base64.js
View file @
42602cc9
/**
* jsp
_
js::base64解码器
* jspjs::base64解码器
*/
'use strict'
;
...
...
source/core/jsp
_
js/decoder/default.js
→
source/core/jspjs/decoder/default.js
View file @
42602cc9
File moved
source/core/jspjs/decoder/hex.js
0 → 100644
View file @
42602cc9
/**
* jspjs::reverse解码器
*/
'use strict'
;
module
.
exports
=
{
/**
* @returns {string} asenc 将返回数据反转
*/
asoutput
:
()
=>
{
return
`function asenc(str){
var h = "0123456789ABCDEF";
var bytes = str.getBytes(cs);
var sb = new StringBuilder(bytes.length * 2);
for (var i = 0; i < bytes.length; i++) {
sb.append(h.charAt((bytes[i] & 0xf0) >> 4));
sb.append(h.charAt((bytes[i] & 0x0f) >> 0));
}
return sb.toString();
}
`
.
replace
(
/
\n\s
+/g
,
''
);
},
/**
* 解码 Buffer
* @param {Buffer} buff 要被解码的 Buffer
* @returns {Buffer} 解码后的 Buffer
*/
decode_buff
:
(
buff
)
=>
{
return
Buffer
.
from
(
buff
.
toString
(),
'hex'
);
}
}
source/core/jsp
_
js/index.js
→
source/core/jspjs/index.js
View file @
42602cc9
/**
* JSP
_
JS服务端脚本模板
* JSPJS服务端脚本模板
* 开写:2021/04/06
* 更新:-
* 作者:yzddMr6 <https://github.com/yzddmr6>
...
...
@@ -8,7 +8,7 @@
const
Base
=
require
(
'../base'
);
class
JSP
_
JS
extends
Base
{
class
JSPJS
extends
Base
{
constructor
(
opts
)
{
super
(
opts
);
// 解析模板
...
...
@@ -20,18 +20,18 @@ class JSP_JS extends Base {
'database/mysql'
,
'database/oracle'
].
map
((
_
)
=>
{
this
.
parseTemplate
(
`./jsp
_
js/template/
${
_
}
`
);
this
.
parseTemplate
(
`./jspjs/template/
${
_
}
`
);
});
// 解析编码器
this
.
encoders
.
map
((
_
)
=>
{
this
.
parseEncoder
(
`./jsp
_
js/encoder/
${
_
}
`
);
this
.
parseEncoder
(
`./jspjs/encoder/
${
_
}
`
);
});
this
.
decoders
.
map
((
_
)
=>
{
this
.
parseDecoder
(
`./jsp
_
js/decoder/
${
_
}
`
);
this
.
parseDecoder
(
`./jspjs/decoder/
${
_
}
`
);
});
}
...
...
@@ -45,7 +45,7 @@ class JSP_JS extends Base {
}
get
decoders
()
{
return
[
"default"
,
"base64"
];
return
[
"default"
,
"base64"
,
"hex"
,
"b64reverse"
,
"b64rot13"
];
}
/**
* HTTP请求数据组合函数
...
...
@@ -132,4 +132,4 @@ class JSP_JS extends Base {
}
}
module
.
exports
=
JSP_JS
;
\ No newline at end of file
module
.
exports
=
JSPJS
;
\ No newline at end of file
source/core/jsp
_
js/template/base.js
→
source/core/jspjs/template/base.js
View file @
42602cc9
File moved
source/core/jsp
_
js/template/command.js
→
source/core/jspjs/template/command.js
View file @
42602cc9
File moved
source/core/jsp
_
js/template/database/mysql.js
→
source/core/jspjs/template/database/mysql.js
View file @
42602cc9
File moved
source/core/jsp
_
js/template/database/oracle.js
→
source/core/jspjs/template/database/oracle.js
View file @
42602cc9
File moved
source/core/jsp
_
js/template/database/sqlserver.js
→
source/core/jspjs/template/database/sqlserver.js
View file @
42602cc9
File moved
source/core/jsp
_
js/template/filemanager.js
→
source/core/jspjs/template/filemanager.js
View file @
42602cc9
File moved
source/modules/database/jsp
_
js/index.js
→
source/modules/database/jspjs/index.js
View file @
42602cc9
//
// 数据库驱动::JSP
_
JS 支持数据库: Any
// 数据库驱动::JSPJS 支持数据库: Any
// time: 2021/6/5
// by: yzddMr6
//
...
...
@@ -10,7 +10,7 @@ const dialog = antSword.remote.dialog;
const
fs
=
require
(
'fs'
);
const
Decodes
=
antSword
.
Decodes
;
class
JSP
_
JS
{
class
JSPJS
{
constructor
(
opt
)
{
this
.
opt
=
opt
;
...
...
@@ -930,4 +930,4 @@ class JSP_JS {
}
module
.
exports
=
JSP_JS
;
\ No newline at end of file
module
.
exports
=
JSPJS
;
\ No newline at end of file
source/modules/settings/encoders.js
View file @
42602cc9
...
...
@@ -66,10 +66,10 @@ class Encoders {
type
:
'button'
,
text
:
"JSP"
},
{
id
:
'new_jsp
_
js'
,
id
:
'new_jspjs'
,
icon
:
'file-code-o'
,
type
:
'button'
,
text
:
"JSP
_
JS"
text
:
"JSPJS"
},
{
type
:
'separator'
},
{
...
...
@@ -102,10 +102,10 @@ class Encoders {
type
:
'button'
,
text
:
"JSP"
},
{
id
:
'new_jsp
_
js_decoder'
,
id
:
'new_jspjs_decoder'
,
icon
:
'file-code-o'
,
type
:
'button'
,
text
:
"JSP
_
JS"
text
:
"JSPJS"
},
{
type
:
'separator'
},
{
...
...
@@ -153,7 +153,7 @@ class Encoders {
case
"new_jsp"
:
that
.
createEncoder
(
id
);
break
;
case
"new_jsp
_
js"
:
case
"new_jspjs"
:
that
.
createEncoder
(
id
);
break
;
case
"new_php"
:
...
...
@@ -169,7 +169,7 @@ class Encoders {
case
"new_jsp_decoder"
:
that
.
createEncoder
(
id
,
'decoder'
);
break
;
case
"new_jsp
_
js_decoder"
:
case
"new_jspjs_decoder"
:
that
.
createEncoder
(
id
,
'decoder'
);
break
;
case
"new_custom_decoder"
:
...
...
@@ -211,7 +211,7 @@ class Encoders {
combobox
.
put
(
"aspx"
,
"ASPX"
);
combobox
.
put
(
"php"
,
"PHP"
);
combobox
.
put
(
"jsp"
,
"JSP"
);
combobox
.
put
(
"jsp
_js"
,
"JSP_
JS"
);
combobox
.
put
(
"jsp
js"
,
"JSP
JS"
);
combobox
.
put
(
"custom"
,
"CUSTOM"
);
grid
.
attachEvent
(
"onEditCell"
,
function
(
stage
,
rId
,
cInd
,
nValue
,
oValue
)
{
...
...
@@ -243,7 +243,7 @@ class Encoders {
break
case
2
:
// type
if
(
nValue
!=
"asp"
&&
nValue
!=
"aspx"
&&
nValue
!=
"php"
&&
nValue
!=
"jsp"
&&
nValue
!=
"jsp
_
js"
&&
nValue
!=
"custom"
)
{
if
(
nValue
!=
"asp"
&&
nValue
!=
"aspx"
&&
nValue
!=
"php"
&&
nValue
!=
"jsp"
&&
nValue
!=
"jspjs"
&&
nValue
!=
"custom"
)
{
toastr
.
error
(
LANG
[
'message'
][
"etype_error"
],
LANG_T
[
'error'
]);
return
}
...
...
@@ -783,23 +783,23 @@ module.exports = {
aspx
:
[],
php
:
[],
jsp
:
[],
jsp
_
js
:
[],
custom
:
[]
jspjs
:
[],
custom
:
[]
,
};
var
encoders_path
=
{
asp
:
[],
aspx
:
[],
php
:
[],
jsp
:
[],
jsp
_
js
:
[],
custom
:
[]
jspjs
:
[],
custom
:
[]
,
};
let
userencoder_path
=
path
.
join
(
remote
.
process
.
env
.
AS_WORKDIR
,
'antData/encoders'
);
// 初始化
!
fs
.
existsSync
(
userencoder_path
)
?
fs
.
mkdirSync
(
userencoder_path
)
:
null
;
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jsp
_
js'
,
'custom'
].
map
((
t
)
=>
{
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jspjs'
,
'custom'
].
map
((
t
)
=>
{
!
fs
.
existsSync
(
path
.
join
(
userencoder_path
,
`
${
t
}
`
))
?
fs
.
mkdirSync
(
path
.
join
(
userencoder_path
,
`
${
t
}
`
))
:
null
;
...
...
@@ -834,7 +834,7 @@ module.exports = {
aspx
:
[],
php
:
[],
jsp
:
[],
jsp
_
js
:
[],
jspjs
:
[],
custom
:
[]
};
var
decoders_path
=
{
...
...
@@ -842,7 +842,7 @@ module.exports = {
aspx
:
[],
php
:
[],
jsp
:
[],
jsp
_
js
:
[],
jspjs
:
[],
custom
:
[]
};
let
userdecoder_path
=
path
.
join
(
remote
.
process
.
env
.
AS_WORKDIR
,
'antData/encoders'
);
...
...
@@ -850,7 +850,7 @@ module.exports = {
!
fs
.
existsSync
(
userdecoder_path
)
?
fs
.
mkdirSync
(
userdecoder_path
)
:
null
;
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jsp
_
js'
,
'custom'
].
map
((
t
)
=>
{
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jspjs'
,
'custom'
].
map
((
t
)
=>
{
!
fs
.
existsSync
(
path
.
join
(
userdecoder_path
,
`
${
t
}
`
))
?
fs
.
mkdirSync
(
path
.
join
(
userdecoder_path
,
`
${
t
}
`
))
:
null
;
...
...
source/modules/shellmanager/list/form.js
View file @
42602cc9
...
...
@@ -281,7 +281,7 @@ class Form {
}
else
if
(
file_match
.
jsp
.
test
(
id
)
==
true
)
{
typecombo
.
selectOption
(
typecombo
.
getOption
(
'jsp'
).
index
);
}
else
if
(
file_match
.
jsp
.
test
(
id
)
==
true
)
{
typecombo
.
selectOption
(
typecombo
.
getOption
(
'jsp
_
js'
).
index
);
typecombo
.
selectOption
(
typecombo
.
getOption
(
'jspjs'
).
index
);
}
else
if
(
file_match
.
custom
.
test
(
id
)
==
true
)
{
typecombo
.
selectOption
(
typecombo
.
getOption
(
'custom'
).
index
);
}
...
...
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