apply plugin: 'com.android.application'

android {
    compileSdk 34
    defaultConfig {
        applicationId "com.vsmartcard.acardemulator"
        minSdk 21
        //noinspection ExpiredTargetSdkVersion
        targetSdk 34
        versionCode 8
        versionName "3.5"
        base.archivesName = "ACardEmulator-$versionName"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    buildFeatures {
        buildConfig true
    }
    flavorDimensions = ["distribution"]
    productFlavors {
        full {
            dimension "distribution"
        }
        fdroid {
            dimension "distribution"
            applicationIdSuffix ".fdroid"
        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/external/jcardsim/src/main/java'
        main.java.exclude('com/licel/jcardsim/smartcardio/*')
        main.java.exclude('com/licel/jcardsim/remote/*')
        main.java.exclude('com/licel/jcardsim/utils/APDUScriptTool*')
        main.java.exclude('com/licel/jcardsim/io/JavaxSmartCardInterface*')
        main.java.exclude('com/licel/jcardsim/io/CAD*')
        main.java.exclude('javacard/framework/service/CardRemoteObject*')
        main.java.exclude('javacard/framework/service/RMIService*')
        main.java.srcDirs += 'src/main/external/GidsApplet/src'
        main.java.exclude('com/mysmartlogon/gidsAppletTests/*')
        main.java.srcDirs += 'src/main/external/IsoApplet/src'
        main.java.srcDirs += 'src/main/external/PivApplet/src'
        main.java.srcDirs += 'src/main/external/android-scio/src/main'
        main.java.srcDirs += 'src/main/external/ykneo-openpgp/applet/src'
        main.java.srcDirs += 'src/main/external/ykneo-oath/applet/src'
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.12.0'
    implementation 'com.journeyapps:zxing-android-embedded:4.3.0@aar'
    implementation 'com.google.zxing:core:3.4.1'
    implementation 'org.bouncycastle:bcprov-jdk14:1.46'
    fullImplementation files('libs/sdk-v1.0.0.jar')
}