apply plugin: 'com.android.model.application'

model {
    repositories {
        libs(PrebuiltLibraries) {
            Substrate {
                binaries.withType(SharedLibraryBinary) {
                    sharedLibraryFile = file("src/main/prebuildSo/libsubstrate.so")
                }
            }
            SubstrateDvm {
                binaries.withType(SharedLibraryBinary) {
                    sharedLibraryFile = file("src/main/prebuildSo/libsubstrate-dvm.so")
                }
            }
            TKHook {
                binaries.withType(SharedLibraryBinary) {
                    sharedLibraryFile = file("src/main/prebuildSo/libTKHooklib.so")
                }
            }
        }
    }

    android.sources {
        main {
            jni {
                dependencies {
                    library "Substrate"
                    library "SubstrateDvm"
                    library "TKHook"
                }
            }
        }
    }

    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.2"

        defaultConfig {
            applicationId "cydiasubstrate.hooktools"
            minSdkVersion.apiLevel 16
            targetSdkVersion.apiLevel 19


        }

        ndk {
            moduleName "substrate-dvm"
            ldLibs.addAll(["log", "dl"])
            cppFlags.addAll(["-Wpointer-arith", "-fpermissive", "-Wformat"])
        }

        productFlavors {
            create("f8") {
                ndk.abiFilters.add("armeabi")
            }
        }

        buildTypes {
            release {
                minifyEnabled false
                proguardFiles.add(file("proguard-rules.pro"))
            }
        }
    }
}


dependencies {
    compile files('libs/substrate-api.jar')
    compile 'com.android.support:appcompat-v7:19.1.0'
}
