Add custom output name, assembly data, icon, and garble settings to builder
This commit is contained in:
@@ -91,6 +91,52 @@ if (persistenceCheckbox && persistenceMethodContainer) {
|
||||
});
|
||||
}
|
||||
|
||||
const obfuscateCheckbox = document.querySelector('input[name="obfuscate"]');
|
||||
const garbleSettingsContainer = document.getElementById("garble-settings-container");
|
||||
if (obfuscateCheckbox && garbleSettingsContainer) {
|
||||
obfuscateCheckbox.addEventListener("change", () => {
|
||||
if (obfuscateCheckbox.checked) {
|
||||
garbleSettingsContainer.classList.remove("hidden");
|
||||
} else {
|
||||
garbleSettingsContainer.classList.add("hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let pendingIconBase64 = null;
|
||||
const iconUpload = document.getElementById("icon-upload");
|
||||
const iconLabel = document.getElementById("icon-label");
|
||||
const iconClear = document.getElementById("icon-clear");
|
||||
|
||||
if (iconUpload) {
|
||||
iconUpload.addEventListener("change", () => {
|
||||
const file = iconUpload.files[0];
|
||||
if (!file) return;
|
||||
if (file.size > 1024 * 1024) {
|
||||
alert("Icon file must be under 1MB");
|
||||
iconUpload.value = "";
|
||||
return;
|
||||
}
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
const base64 = reader.result.split(",")[1];
|
||||
pendingIconBase64 = base64;
|
||||
if (iconLabel) iconLabel.textContent = file.name;
|
||||
if (iconClear) iconClear.classList.remove("hidden");
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
}
|
||||
|
||||
if (iconClear) {
|
||||
iconClear.addEventListener("click", () => {
|
||||
pendingIconBase64 = null;
|
||||
if (iconUpload) iconUpload.value = "";
|
||||
if (iconLabel) iconLabel.textContent = "Choose .ico file";
|
||||
iconClear.classList.add("hidden");
|
||||
});
|
||||
}
|
||||
|
||||
async function init() {
|
||||
try {
|
||||
updateServerUrlPlaceholder();
|
||||
@@ -215,6 +261,16 @@ form?.addEventListener("submit", async (e) => {
|
||||
'input[name="no-printing"]',
|
||||
).checked;
|
||||
|
||||
const outputNameVal = form.querySelector("#output-name")?.value.trim() || "";
|
||||
const garbleLiterals = form.querySelector('input[name="garble-literals"]')?.checked || false;
|
||||
const garbleTiny = form.querySelector('input[name="garble-tiny"]')?.checked || false;
|
||||
const garbleSeedVal = form.querySelector("#garble-seed")?.value.trim() || "";
|
||||
const assemblyTitle = form.querySelector("#assembly-title")?.value.trim() || "";
|
||||
const assemblyProduct = form.querySelector("#assembly-product")?.value.trim() || "";
|
||||
const assemblyCompany = form.querySelector("#assembly-company")?.value.trim() || "";
|
||||
const assemblyVersion = form.querySelector("#assembly-version")?.value.trim() || "";
|
||||
const assemblyCopyright = form.querySelector("#assembly-copyright")?.value.trim() || "";
|
||||
|
||||
const buildConfig = {
|
||||
platforms,
|
||||
serverUrl: serverUrl || undefined,
|
||||
@@ -228,6 +284,16 @@ form?.addEventListener("submit", async (e) => {
|
||||
persistenceMethod: enablePersistence ? persistenceMethod : undefined,
|
||||
hideConsole,
|
||||
noPrinting,
|
||||
outputName: outputNameVal || undefined,
|
||||
garbleLiterals: obfuscate ? garbleLiterals : undefined,
|
||||
garbleTiny: obfuscate ? garbleTiny : undefined,
|
||||
garbleSeed: obfuscate && garbleSeedVal ? garbleSeedVal : undefined,
|
||||
assemblyTitle: assemblyTitle || undefined,
|
||||
assemblyProduct: assemblyProduct || undefined,
|
||||
assemblyCompany: assemblyCompany || undefined,
|
||||
assemblyVersion: assemblyVersion || undefined,
|
||||
assemblyCopyright: assemblyCopyright || undefined,
|
||||
iconBase64: pendingIconBase64 || undefined,
|
||||
};
|
||||
|
||||
const hasAndroid = platforms.some(p => p.startsWith('android-'));
|
||||
|
||||
@@ -231,6 +231,23 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Output Name -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-300 mb-2" for="output-name">
|
||||
Output Filename
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="output-name"
|
||||
name="output-name"
|
||||
placeholder="agent (default)"
|
||||
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg focus:outline-none focus:border-blue-500 transition-colors"
|
||||
/>
|
||||
<p class="text-xs text-slate-500 mt-1">
|
||||
Optional: Custom name prefix for output binaries (letters, numbers, . _ - only)
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Mutex -->
|
||||
<div>
|
||||
<label
|
||||
@@ -387,6 +404,71 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Garble Settings (shown when obfuscate is checked) -->
|
||||
<div id="garble-settings-container" class="hidden">
|
||||
<label class="block text-sm font-medium text-slate-300 mb-2">
|
||||
<i class="fa-solid fa-mask text-purple-400"></i> Garble Settings
|
||||
</label>
|
||||
<div class="flex flex-col gap-2 pl-3 border-l-2 border-purple-500/40">
|
||||
<label class="flex items-center gap-2 p-3 bg-slate-800/60 border border-slate-700 rounded-lg cursor-pointer">
|
||||
<input type="checkbox" name="garble-literals" class="w-4 h-4" />
|
||||
<div class="flex flex-col">
|
||||
<span>Obfuscate Literals (-literals)</span>
|
||||
<span class="text-xs text-slate-500">Obfuscate string and byte slice literals</span>
|
||||
</div>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 p-3 bg-slate-800/60 border border-slate-700 rounded-lg cursor-pointer">
|
||||
<input type="checkbox" name="garble-tiny" class="w-4 h-4" />
|
||||
<div class="flex flex-col">
|
||||
<span>Tiny Mode (-tiny)</span>
|
||||
<span class="text-xs text-slate-500">Remove extra info like filenames and line numbers from panics</span>
|
||||
</div>
|
||||
</label>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-slate-400 mb-1" for="garble-seed">Seed</label>
|
||||
<input type="text" id="garble-seed" name="garble-seed" placeholder="random (default)"
|
||||
class="w-full px-3 py-2 bg-slate-800/80 border border-slate-700 rounded-lg text-sm focus:outline-none focus:border-purple-500 transition-colors" />
|
||||
<p class="text-xs text-slate-500 mt-1">Alphanumeric seed for reproducible builds</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Windows Assembly / PE Metadata -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-300 mb-2">
|
||||
<i class="fa-brands fa-windows text-blue-400"></i> Windows Assembly Data
|
||||
<span class="text-xs text-slate-500 font-normal ml-1">(optional, Windows only)</span>
|
||||
</label>
|
||||
<div class="flex flex-col gap-2">
|
||||
<input type="text" id="assembly-title" name="assembly-title" placeholder="File Description"
|
||||
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg text-sm focus:outline-none focus:border-blue-500 transition-colors" />
|
||||
<input type="text" id="assembly-product" name="assembly-product" placeholder="Product Name"
|
||||
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg text-sm focus:outline-none focus:border-blue-500 transition-colors" />
|
||||
<input type="text" id="assembly-company" name="assembly-company" placeholder="Company Name"
|
||||
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg text-sm focus:outline-none focus:border-blue-500 transition-colors" />
|
||||
<input type="text" id="assembly-version" name="assembly-version" placeholder="File Version (e.g. 1.0.0.0)"
|
||||
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg text-sm focus:outline-none focus:border-blue-500 transition-colors" />
|
||||
<input type="text" id="assembly-copyright" name="assembly-copyright" placeholder="Copyright"
|
||||
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg text-sm focus:outline-none focus:border-blue-500 transition-colors" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Icon Upload -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-300 mb-2">
|
||||
<i class="fa-solid fa-image text-yellow-400"></i> Custom Icon
|
||||
<span class="text-xs text-slate-500 font-normal ml-1">(optional, Windows .ico, max 1MB)</span>
|
||||
</label>
|
||||
<div class="flex items-center gap-3">
|
||||
<label class="flex items-center gap-2 px-4 py-2 bg-slate-800/60 border border-slate-700 rounded-lg cursor-pointer hover:border-yellow-500 transition-colors text-sm">
|
||||
<i class="fa-solid fa-upload text-yellow-400"></i>
|
||||
<span id="icon-label">Choose .ico file</span>
|
||||
<input type="file" id="icon-upload" name="icon-upload" accept=".ico" class="hidden" />
|
||||
</label>
|
||||
<button type="button" id="icon-clear" class="hidden text-xs text-red-400 hover:text-red-300">Clear</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Build Button -->
|
||||
<button
|
||||
type="submit"
|
||||
|
||||
Reference in New Issue
Block a user