feat: support Alibaba & Apache dubbo service

This commit is contained in:
ReaJason
2026-04-26 13:53:20 +08:00
parent 0ea0aea4ec
commit fbca58878a
35 changed files with 1715 additions and 409 deletions
@@ -4,6 +4,10 @@ import type { MemShellResult } from "@/types/memshell";
import { AgentResult } from "./agent";
import { JarResult } from "./jar-result";
import { MultiPackResult } from "./multi-packer";
import { useCallback } from "react";
import { base64ToBytes, downloadBytes, downloadContent } from "@/lib/utils";
import { Button } from "@/components/ui/button";
import { DownloadIcon } from "lucide-react";
export function ResultComponent({
packResult,
@@ -48,6 +52,28 @@ export function ResultComponent({
);
}
const shellClassName = generateResult?.shellClassName;
const handleDownload = useCallback(() => {
const fileName =
shellClassName?.substring(shellClassName?.lastIndexOf(".") ?? 0) ?? "";
if (packMethod.includes("JSP")) {
const fileExtension = packMethod.includes("JSPX") ? ".jspx" : ".jsp";
const content = new Blob([packResult as string], { type: "text/plain" });
return downloadContent(content, fileName, fileExtension);
} else if (
packMethod.includes("JavaCommons") ||
packMethod.includes("Hessian")
) {
const content = new Blob([base64ToBytes(packResult as string)], {
type: "application/octet-stream",
});
return downloadContent(content, fileName, ".data");
} else if (packMethod === "Base64") {
return downloadBytes(packResult as string, shellClassName);
}
}, [packMethod, packResult, shellClassName]);
return (
<CodeViewer
code={packResult ?? ""}
@@ -59,6 +85,22 @@ export function ResultComponent({
<span className="text-muted-foreground">({packResult?.length})</span>
</div>
}
button={
packMethod.includes("JSP") ||
packMethod === "Base64" ||
packMethod.includes("JavaCommons") ||
packMethod.includes("Hessian") ? (
<Button
variant="ghost"
size="icon"
type="button"
className="h-7 w-7 [&_svg]:h-4 [&_svg]:w-4"
onClick={handleDownload}
>
<DownloadIcon className="h-4 w-4" />
</Button>
) : null
}
wrapLongLines={!showCode}
showLineNumbers={showCode}
language={showCode ? "java" : "text"}