const http = require('http'); const fs = require('fs'); const path = require('path'); const PORT = 8888; const APK_PATH = path.join(__dirname, 'build', 'app', 'outputs', 'flutter-apk', 'app-release.apk'); const server = http.createServer((req, res) => { if (req.url === '/download' || req.url === '/app-release.apk' || req.url === '/motorsignal.apk') { if (!fs.existsSync(APK_PATH)) { res.writeHead(404, { 'Content-Type': 'text/plain' }); return res.end('APK not found. Please build first.'); } const stat = fs.statSync(APK_PATH); res.writeHead(200, { 'Content-Type': 'application/vnd.android.package-archive', 'Content-Length': stat.size, 'Content-Disposition': 'attachment; filename="motorsignal-evolution.apk"' }); fs.createReadStream(APK_PATH).pipe(res); } else { res.writeHead(200, { 'Content-Type': 'text/html' }); res.end(`
Release APK (All Screens & Landscape/Portrait Adaptive)
Download APK (62.6 MB)