Reaperxxxx commited on
Commit
ecbd587
Β·
verified Β·
1 Parent(s): 8677520

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +5 -3
index.js CHANGED
@@ -9,7 +9,7 @@ const axios = require('axios');
9
  const crypto = require('crypto');
10
 
11
  const app = express();
12
- const PORT = 3000;
13
 
14
  // ── DOWNLOAD HASH ─────────────────────────────────────────────────────────────
15
  // A stable hash generated once at startup. Share this URL to download the APK.
@@ -214,7 +214,9 @@ app.post('/patch', express.json({ limit: '10mb' }), (req, res) => {
214
  const { token, characters } = req.body;
215
  if (!token || !characters) return res.status(400).json({ error: 'Missing token or characters' });
216
 
217
- const sessionDir = path.join(os.tmpdir(), token);
 
 
218
  const originalApk = path.join(sessionDir, 'original.apk');
219
  const patchedApk = path.join(sessionDir, 'patched_unsigned.apk');
220
  const alignedApk = path.join(sessionDir, 'patched_aligned.apk');
@@ -297,7 +299,7 @@ app.get('/', (req, res) => {
297
  });
298
 
299
  // ── START ─────────────────────────────────────────────────────────────────────
300
- app.listen(7860, () => {
301
  console.log(`\n🦸 Super City Editor backend running at http://localhost:${PORT}`);
302
  console.log(`\n⬇ Direct APK download: http://localhost:${PORT}/download/${DOWNLOAD_HASH}\n`);
303
  try { ensureKeystore(); } catch (e) { console.warn('Keystore not ready yet:', e.message); }
 
9
  const crypto = require('crypto');
10
 
11
  const app = express();
12
+ const PORT = 7860;
13
 
14
  // ── DOWNLOAD HASH ─────────────────────────────────────────────────────────────
15
  // A stable hash generated once at startup. Share this URL to download the APK.
 
214
  const { token, characters } = req.body;
215
  if (!token || !characters) return res.status(400).json({ error: 'Missing token or characters' });
216
 
217
+ const sessionDir = token === 'persistent'
218
+ ? PERSISTENT_DIR
219
+ : path.join(os.tmpdir(), token);
220
  const originalApk = path.join(sessionDir, 'original.apk');
221
  const patchedApk = path.join(sessionDir, 'patched_unsigned.apk');
222
  const alignedApk = path.join(sessionDir, 'patched_aligned.apk');
 
299
  });
300
 
301
  // ── START ─────────────────────────────────────────────────────────────────────
302
+ app.listen(PORT, () => {
303
  console.log(`\n🦸 Super City Editor backend running at http://localhost:${PORT}`);
304
  console.log(`\n⬇ Direct APK download: http://localhost:${PORT}/download/${DOWNLOAD_HASH}\n`);
305
  try { ensureKeystore(); } catch (e) { console.warn('Keystore not ready yet:', e.message); }