from pathlib import Path
import platform

def determine_system():
    if platform.system() == 'Windows':
        return 'windows.exe'
    elif platform.system() in ['Linux', 'Darwin']:
        return "linux"
    else:
        print(f"Unknown system: {platform.system()}")
        exit(-1)    

SOURCE_APK_DIR = Path("source-apk")

BUILD_DIR = Path("build")
EXTRACTED_DIR = BUILD_DIR / "extracted"
PATCHED_RSC_DIR = BUILD_DIR / "patched_resources"
PATCHED_SMALI_DIR = BUILD_DIR / "patched_smali"
MERGED_RSC_DIR = BUILD_DIR / "merged_resources"
COMPILED_SMALI_DIR = BUILD_DIR / "compiled_smali"
ASSEMBLED_APK = BUILD_DIR / "assembled_apk" / "tumblr-ykit.apk"
ALIGNED_APK = BUILD_DIR / "signed_apk" / "tumblr-ykit_aligned.apk"
SIGNED_APK = BUILD_DIR / "signed_apk" / "tumblr-ykit.apk"
SIGNED_APK_DEBUG = BUILD_DIR / "signed_apk" / "tumblr-ykit_debug.apk"

SRC_DIR = Path("src")
SRC_RESOURCES_DIR = SRC_DIR / "resources"
SRC_SMALI_DIR = SRC_DIR / "smali"
SRC_RESOURCE_PATCHES_DIR = SRC_DIR / "patches" / "resource"
SRC_SMALI_PATCHES_DIR = SRC_DIR / "patches" / "smali"

# Tools

JAVA_BIN = "java"
APKTOOL = "tools/apktool_2.9.3.jar"
SMALI_COMPILER = "tools/smali-3.0.5.jar"
APKSIGNER = 'tools/apksigner.jar'
ZIPALIGN = 'tools/zipalign-' + determine_system()