From b0c4909cd6b582345756e39498a86b1c0f0fc695 Mon Sep 17 00:00:00 2001 From: Sergey Makarov Date: Thu, 12 Oct 2023 13:19:51 +0300 Subject: [PATCH 1/8] Add .idea gitignore --- .idea/.gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml From 7a4218244b6967ccba4b52211fe8f6c73b7a240a Mon Sep 17 00:00:00 2001 From: Sergey Makarov Date: Thu, 12 Oct 2023 13:20:39 +0300 Subject: [PATCH 2/8] Update root .gitignore file --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 47065ee..050d011 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,10 @@ +*.iml +.gradle /local.properties +/.idea/* +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties From 96646aff278fa2728a1272e65757c8561d580361 Mon Sep 17 00:00:00 2001 From: Sergey Makarov Date: Thu, 12 Oct 2023 13:23:18 +0300 Subject: [PATCH 3/8] Add app/.gitignore file --- app/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 app/.gitignore diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file From 07f0486145bd139744247530c284469282662381 Mon Sep 17 00:00:00 2001 From: Sergey Makarov Date: Thu, 12 Oct 2023 13:44:40 +0300 Subject: [PATCH 4/8] Migrate app/build.gradle to kts; dependencies updates --- app/build.gradle | 83 ------------------------------------------ app/build.gradle.kts | 87 ++++++++++++++++++++++++++++++++++++++++++++ gradle.properties | 3 +- 3 files changed, 88 insertions(+), 85 deletions(-) delete mode 100644 app/build.gradle create mode 100644 app/build.gradle.kts diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 8523e19..0000000 --- a/app/build.gradle +++ /dev/null @@ -1,83 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' - id "org.jetbrains.kotlin.plugin.parcelize" -} - -android { - compileSdk 34 - - defaultConfig { - applicationId "com.fingerprintjs.android.fpjs_pro_demo" - minSdk 21 - targetSdk 33 - versionCode Integer.parseInt(project.VERSION_CODE) - versionName project.VERSION_NAME - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - signingConfigs { - release { - storeFile file("release.jks") - storePassword System.getenv('KEYSTORE_PASSWORD') - keyAlias System.getenv('RELEASE_SIGN_KEY_ALIAS') - keyPassword System.getenv('RELEASE_SIGN_KEY_PASSWORD') - } - releaseLocalSign { - storeFile file("release_local.jks") - storePassword "password" - keyAlias "key0" - keyPassword "password" - } - } - - buildTypes { - release { - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - signingConfig signingConfigs.release - } - releaseLocalSign { - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - signingConfig signingConfigs.releaseLocalSign - matchingFallbacks = ['release'] - } - } - namespace 'com.fingerprintjs.android.fpjs_pro_demo' - - compileOptions { - targetCompatibility = JavaVersion.VERSION_1_8 - sourceCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - - applicationVariants.all { variant -> - variant.outputs.all { - outputFileName = "FPJS-Pro-Playground-${variant.name}-${variant.versionName}.apk" - } - } -} - -dependencies { - implementation "com.fingerprint.android:pro:${project.VERSION_NAME}" - - implementation 'org.osmdroid:osmdroid-android:6.1.11' - implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" - implementation 'androidx.core:core-ktx:1.10.0' - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.8.0' - - // see https://github.com/google/tink/issues/702 - implementation("androidx.security:security-crypto-ktx:1.1.0-alpha06") { - exclude group: "com.google.crypto.tink", module: "tink-android" - } - implementation("com.google.crypto.tink:tink-android:1.9.0") - - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.4' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' -} \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..df09355 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,87 @@ +import com.android.build.gradle.internal.api.BaseVariantOutputImpl + +plugins { + id("com.android.application") + id("kotlin-android") + id("org.jetbrains.kotlin.plugin.parcelize") +} + +android { + compileSdk = 34 + + defaultConfig { + applicationId = "com.fingerprintjs.android.fpjs_pro_demo" + minSdk = 21 + targetSdk = 33 + versionCode = Integer.parseInt(project.property("VERSION_CODE") as String) + versionName = project.property("VERSION_NAME") as String + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + create("release") { + storeFile = file("release.jks") + storePassword = System.getenv("KEYSTORE_PASSWORD") + keyAlias = System.getenv("RELEASE_SIGN_KEY_ALIAS") + keyPassword = System.getenv("RELEASE_SIGN_KEY_PASSWORD") + } + create("releaseLocalSign") { + storeFile = file("release_local.jks") + storePassword = "password" + keyAlias = "key0" + keyPassword = "password" + } + } + + buildTypes { + release { + isMinifyEnabled = true + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + signingConfig = signingConfigs.getByName("release") + } + create("releaseLocalSign") { + isMinifyEnabled = true + proguardFiles (getDefaultProguardFile ("proguard-android-optimize.txt"), "proguard-rules.pro") + signingConfig = signingConfigs.getByName("releaseLocalSign") + matchingFallbacks += listOf("release") + } + } + + namespace = "com.fingerprintjs.android.fpjs_pro_demo" + + buildFeatures { + buildConfig = true + } + + compileOptions { + targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } + + applicationVariants.all { + val variant = this + this.outputs.all { + (this as? BaseVariantOutputImpl)?.outputFileName = "FPJS-Pro-Playground-${variant.name}-${variant.versionName}.apk" + } + } +} + +dependencies { + implementation("com.fingerprint.android:pro:${project.findProperty("VERSION_NAME")}") + + implementation("org.osmdroid:osmdroid-android:6.1.11") + implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") + implementation("androidx.core:core-ktx:1.12.0") + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("com.google.android.material:material:1.9.0") + + // see https://github.com/google/tink/issues/702 + implementation("androidx.security:security-crypto-ktx:1.1.0-alpha06") { + exclude(group = "com.google.crypto.tink", module = "tink-android") + } + implementation("com.google.crypto.tink:tink-android:1.9.0") +} diff --git a/gradle.properties b/gradle.properties index 5c8a6dd..cf02e01 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,5 +3,4 @@ kotlin.code.style=official android.useAndroidX=true org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8 VERSION_NAME=2.3.3 -VERSION_CODE=16 -android.defaults.buildfeatures.buildconfig=true \ No newline at end of file +VERSION_CODE=16 \ No newline at end of file From a06f9f684bbfe5a7878d73cc178a80cc5cfa0ddc Mon Sep 17 00:00:00 2001 From: Sergey Makarov Date: Thu, 12 Oct 2023 13:51:50 +0300 Subject: [PATCH 5/8] Minor: move some constants from gradle properties to app/build.gradle.kts --- app/build.gradle.kts | 11 ++++++++--- gradle.properties | 2 -- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index df09355..d76141d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,5 +1,10 @@ import com.android.build.gradle.internal.api.BaseVariantOutputImpl +@Suppress("PropertyName") +val VERSION_NAME="2.3.3" +@Suppress("PropertyName") +val VERSION_CODE=16 + plugins { id("com.android.application") id("kotlin-android") @@ -13,8 +18,8 @@ android { applicationId = "com.fingerprintjs.android.fpjs_pro_demo" minSdk = 21 targetSdk = 33 - versionCode = Integer.parseInt(project.property("VERSION_CODE") as String) - versionName = project.property("VERSION_NAME") as String + versionCode = VERSION_CODE + versionName = VERSION_NAME testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -71,7 +76,7 @@ android { } dependencies { - implementation("com.fingerprint.android:pro:${project.findProperty("VERSION_NAME")}") + implementation("com.fingerprint.android:pro:$VERSION_NAME") implementation("org.osmdroid:osmdroid-android:6.1.11") implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") diff --git a/gradle.properties b/gradle.properties index cf02e01..e8882de 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,5 +2,3 @@ android.enableJetifier=true kotlin.code.style=official android.useAndroidX=true org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8 -VERSION_NAME=2.3.3 -VERSION_CODE=16 \ No newline at end of file From 9350203365f5e30ad75b7109e4bd4dbec912dce7 Mon Sep 17 00:00:00 2001 From: Sergey Makarov Date: Thu, 12 Oct 2023 14:03:34 +0300 Subject: [PATCH 6/8] settings.gradle to kts; root build.gradle to kts; kotlin gradle plugin to 1.9.10; remove unused android-maven-gradle-plugin --- build.gradle | 16 ---------------- build.gradle.kts | 14 ++++++++++++++ settings.gradle => settings.gradle.kts | 7 ++++--- 3 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts rename settings.gradle => settings.gradle.kts (61%) diff --git a/build.gradle b/build.gradle deleted file mode 100644 index a88ad2f..0000000 --- a/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -buildscript { - ext.kotlin_version = '1.8.0' - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.1.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}" - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..fab783a --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,14 @@ +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.android.tools.build:gradle:8.1.1") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10") + } +} + +task("clean") { + delete(rootProject.buildDir) +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle.kts similarity index 61% rename from settings.gradle rename to settings.gradle.kts index 8373d9f..e51447e 100644 --- a/settings.gradle +++ b/settings.gradle.kts @@ -3,9 +3,10 @@ dependencyResolutionManagement { repositories { google() mavenCentral() - maven { url "https://jitpack.io" } - maven { url "https://maven.fpregistry.io/releases" } + + maven { url = uri("https://jitpack.io") } + maven { url = uri("https://maven.fpregistry.io/releases") } } } rootProject.name = "fingerprintjs-pro-android-demo" -include ':app' +include(":app") From bca8864492993d527e3331fa672bb152e0f7ba8f Mon Sep 17 00:00:00 2001 From: Sergey Makarov Date: Thu, 12 Oct 2023 14:13:27 +0300 Subject: [PATCH 7/8] Remove unused jitpack file --- jitpack.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 jitpack.yml diff --git a/jitpack.yml b/jitpack.yml deleted file mode 100644 index 4dbb678..0000000 --- a/jitpack.yml +++ /dev/null @@ -1,2 +0,0 @@ - jdk: - - openjdk11 \ No newline at end of file From fba49a8332a54f9ca9df91790d94b745cd5b5d4c Mon Sep 17 00:00:00 2001 From: Sergey Makarov Date: Thu, 12 Oct 2023 16:51:01 +0300 Subject: [PATCH 8/8] Add mavenLocal repository for debug builds of the library --- app/build.gradle.kts | 3 ++- settings.gradle.kts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d76141d..2a0002e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -76,7 +76,8 @@ android { } dependencies { - implementation("com.fingerprint.android:pro:$VERSION_NAME") + val useFpProDebugVersion = false // switch to true when needed to debug the library + implementation("com.fingerprint.android:pro:$VERSION_NAME${if (useFpProDebugVersion) "-debug" else ""}") implementation("org.osmdroid:osmdroid-android:6.1.11") implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") diff --git a/settings.gradle.kts b/settings.gradle.kts index e51447e..fc43e06 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,6 +3,11 @@ dependencyResolutionManagement { repositories { google() mavenCentral() + mavenLocal { + mavenContent { + includeVersionByRegex("com.fingerprint.android", "pro", ".*-debug") + } + } maven { url = uri("https://jitpack.io") } maven { url = uri("https://maven.fpregistry.io/releases") }