mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
feat: support xxl-job executor NettyHandler (#30)
Only support jdk8, in jdk11 or jdk17 env, you should use file write and use urlClassLoader to load injectorClass or else.
This commit is contained in:
@@ -60,6 +60,16 @@ export function MainConfigCard({
|
||||
} else {
|
||||
setShellTypes([]);
|
||||
}
|
||||
|
||||
if (
|
||||
(value === "SpringWebFlux" || value === "XXLJOB") &&
|
||||
Number.parseInt(form.getValues("targetJdkVersion") as string) < 52
|
||||
) {
|
||||
form.setValue("targetJdkVersion", "52");
|
||||
} else {
|
||||
form.resetField("targetJdkVersion");
|
||||
}
|
||||
form.resetField("bypassJavaModule");
|
||||
form.resetField("shellTool");
|
||||
form.resetField("shellType");
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ export function PackageConfigCard({
|
||||
const [options, setOptions] = useState<Array<Option>>([]);
|
||||
|
||||
const shellType = form.watch("shellType");
|
||||
const server = form.watch("server");
|
||||
const { t } = useTranslation();
|
||||
|
||||
useEffect(() => {
|
||||
@@ -33,7 +34,10 @@ export function PackageConfigCard({
|
||||
if (shellType.startsWith("Agent")) {
|
||||
return name.startsWith("Agent");
|
||||
}
|
||||
return !name.startsWith("Agent");
|
||||
if (server.startsWith("XXL")) {
|
||||
return !name.startsWith("Agent");
|
||||
}
|
||||
return !name.startsWith("Agent") && !name.toLowerCase().startsWith("xxl");
|
||||
});
|
||||
setOptions(
|
||||
filteredOptions.map((name) => {
|
||||
@@ -46,7 +50,7 @@ export function PackageConfigCard({
|
||||
if (filteredOptions.length > 0) {
|
||||
form.setValue("packingMethod", filteredOptions[0]);
|
||||
}
|
||||
}, [form, packerConfig, shellType, t]);
|
||||
}, [form, packerConfig, server, shellType, t]);
|
||||
|
||||
return (
|
||||
<Card className="w-full">
|
||||
|
||||
@@ -78,6 +78,26 @@ function AgentResult({ packResult, generateResult }: { packResult: string; gener
|
||||
);
|
||||
}
|
||||
|
||||
function JarResult({ packResult, generateResult }: { packResult: string; generateResult?: GenerateResult }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="flex items-center justify-center">
|
||||
<Button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
downloadBytes(
|
||||
packResult,
|
||||
undefined,
|
||||
`${generateResult?.shellConfig.server}${generateResult?.shellConfig.shellTool}MemShell`,
|
||||
)
|
||||
}
|
||||
>
|
||||
{t("download")} Jar
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function FeedbackAlert() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
@@ -206,6 +226,7 @@ export function ShellResult({
|
||||
}: { packResult: string; packMethod: string; generateResult?: GenerateResult }) {
|
||||
const showCode = packMethod === "JSP";
|
||||
const isAgent = packMethod.startsWith("Agent");
|
||||
const isJar = packMethod === "Jar";
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Fragment>
|
||||
@@ -220,16 +241,20 @@ export function ShellResult({
|
||||
<div className="mb-4">
|
||||
<BasicInfo generateResult={generateResult} />
|
||||
</div>
|
||||
{!isAgent && (
|
||||
<CodeViewer
|
||||
code={packResult}
|
||||
wrapLongLines={!showCode}
|
||||
showLineNumbers={showCode}
|
||||
language={showCode ? "java" : "text"}
|
||||
height={400}
|
||||
/>
|
||||
{!isAgent && !isJar && (
|
||||
<Fragment>
|
||||
<div className="flex items-center justify-end text-sm text-muted-foreground">({packResult.length})</div>
|
||||
<CodeViewer
|
||||
code={packResult}
|
||||
wrapLongLines={!showCode}
|
||||
showLineNumbers={showCode}
|
||||
language={showCode ? "java" : "text"}
|
||||
height={400}
|
||||
/>
|
||||
</Fragment>
|
||||
)}
|
||||
{isAgent && <AgentResult packResult={packResult} generateResult={generateResult} />}
|
||||
{isJar && <JarResult packResult={packResult} generateResult={generateResult} />}
|
||||
</TabsContent>
|
||||
<TabsContent value="shell" className="mt-4">
|
||||
<Alert>
|
||||
|
||||
@@ -46,9 +46,10 @@ export const resources = {
|
||||
title: "Package Method",
|
||||
packer: {
|
||||
Base64: "Base64",
|
||||
GzipBase64: "GzipBase64",
|
||||
BCEL: "BCEL",
|
||||
JSP: "JSP",
|
||||
JAR: "JAR",
|
||||
Jar: "Jar",
|
||||
EL: "EL",
|
||||
SpEL: "SpEL",
|
||||
OGNL: "OGNL",
|
||||
@@ -59,6 +60,8 @@ export const resources = {
|
||||
AgentJar: "AgentJar",
|
||||
Deserialize: "Deserialize(Only CB4, 1.9.x)",
|
||||
ScriptEngine: "ScriptEngine",
|
||||
XxlJob: "XXL-JOB Executor",
|
||||
XxlJob230: "XXL-JOB (2.3.0+) Executor",
|
||||
},
|
||||
},
|
||||
tips: {
|
||||
@@ -154,18 +157,10 @@ export const resources = {
|
||||
packageConfig: {
|
||||
title: "打包方式",
|
||||
packer: {
|
||||
Base64: "Base64",
|
||||
BCEL: "BCEL",
|
||||
JSP: "JSP",
|
||||
JAR: "JAR",
|
||||
EL: "EL 表达式",
|
||||
SpEL: "SpEL 表达式",
|
||||
OGNL: "OGNL 表达式",
|
||||
MVEL: "MVEL 表达式",
|
||||
Freemarker: "Freemarker",
|
||||
Velocity: "Velocity",
|
||||
Groovy: "Groovy",
|
||||
AgentJar: "AgentJar",
|
||||
Deserialize: "反序列化(仅支持 CB4, 1.9.x)",
|
||||
ScriptEngine: "脚本引擎",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user