Spaces:
Runtime error
Runtime error
| const { exec } = require("child_process"); | |
| const processApk = (jobId, data, updateCallback) => { | |
| updateCallback({ status: "processing", progress: "10%" }); | |
| const buildCommand = `flutter build apk --release --obfuscate --split-debug-info=./debug/${jobId}`; | |
| updateCallback({ status: "compiling", progress: "50%" }); | |
| setTimeout(() => { | |
| const success = true; | |
| if (success) { | |
| updateCallback({ | |
| status: "completed", | |
| progress: "100%", | |
| downloadUrl: `https://api.fprojects.id/download/${jobId}.apk`, | |
| securityLevel: "high", | |
| obfuscated: true | |
| }); | |
| } else { | |
| updateCallback({ | |
| status: "failed", | |
| error: "compilation error" | |
| }); | |
| } | |
| }, 10000); | |
| }; | |
| module.exports = { | |
| processApk | |
| }; |