Update app.py
Browse files
app.py
CHANGED
|
@@ -47,9 +47,11 @@ async def generate_dll(
|
|
| 47 |
except Exception:
|
| 48 |
pass
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
# Tüm çıktıları (stdout ve stderr) yakalayarak çalıştır
|
| 53 |
try:
|
| 54 |
process = subprocess.run([
|
| 55 |
"/app/dumper/Il2CppDumper",
|
|
@@ -57,23 +59,13 @@ async def generate_dll(
|
|
| 57 |
metadata_path,
|
| 58 |
output_dir
|
| 59 |
], capture_output=True)
|
| 60 |
-
stdout_text = process.stdout.decode('utf-8', errors='replace')
|
| 61 |
-
stderr_text = process.stderr.decode('utf-8', errors='replace')
|
| 62 |
except subprocess.CalledProcessError as e:
|
| 63 |
-
|
| 64 |
-
stderr_text = e.stderr.decode('utf-8', errors='replace') if e.stderr else ""
|
| 65 |
|
| 66 |
if os.path.exists(dll_path):
|
| 67 |
return FileResponse(dll_path, media_type="application/octet-stream", filename="Assembly-CSharp.dll")
|
| 68 |
else:
|
| 69 |
-
|
| 70 |
-
created_files = []
|
| 71 |
-
for root, dirs, files in os.walk(output_dir):
|
| 72 |
-
for file in files:
|
| 73 |
-
created_files.append(os.path.relpath(os.path.join(root, file), output_dir))
|
| 74 |
-
|
| 75 |
-
full_log = f"IL2CPPDUMPER DETAYLI RAPORU:\n\n{stdout_text}\n{stderr_text}\n\nÜretilen Dosyalar: {created_files}"
|
| 76 |
-
return {"error": "İşlem başarısız. DLL üretilemedi. Geliştirici logunu inceleyin.", "details": full_log}
|
| 77 |
|
| 78 |
@app.post("/extract")
|
| 79 |
async def extract_dialogues(
|
|
|
|
| 47 |
except Exception:
|
| 48 |
pass
|
| 49 |
|
| 50 |
+
# İŞTE O MEŞHUR 'S' HARFİNİ KALDIRDIĞIMIZ VE DİNAMİKLEŞTİRDİĞİMİZ KISIM
|
| 51 |
+
dll_path = os.path.join(output_dir, "DummyDll", "Assembly-CSharp.dll")
|
| 52 |
+
if not os.path.exists(dll_path):
|
| 53 |
+
dll_path = os.path.join(output_dir, "DummyDlls", "Assembly-CSharp.dll") # Ne olur ne olmaz diye yedeği
|
| 54 |
|
|
|
|
| 55 |
try:
|
| 56 |
process = subprocess.run([
|
| 57 |
"/app/dumper/Il2CppDumper",
|
|
|
|
| 59 |
metadata_path,
|
| 60 |
output_dir
|
| 61 |
], capture_output=True)
|
|
|
|
|
|
|
| 62 |
except subprocess.CalledProcessError as e:
|
| 63 |
+
pass # Artık hataları yoksayıyoruz çünkü logdan gördük ki hata verse de dosyayı üretiyor.
|
|
|
|
| 64 |
|
| 65 |
if os.path.exists(dll_path):
|
| 66 |
return FileResponse(dll_path, media_type="application/octet-stream", filename="Assembly-CSharp.dll")
|
| 67 |
else:
|
| 68 |
+
return {"error": "İşlem başarısız.", "details": "DLL dosyası bulunamadı."}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
@app.post("/extract")
|
| 71 |
async def extract_dialogues(
|