diff --git a/VCL/build.gradle b/VCL/build.gradle index 9413a415..321023d8 100644 --- a/VCL/build.gradle +++ b/VCL/build.gradle @@ -6,15 +6,15 @@ plugins { } android { - compileSdk 33 + compileSdk 34 // buildToolsVersion "30.0.3" namespace 'io.velocitycareerlabs' defaultConfig { minSdk 24 - targetSdk 33 - versionName "2.3.4" - versionCode 134 + targetSdk 34 + versionName "2.4.1-rc.1" + versionCode 135 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" } @@ -63,6 +63,10 @@ android { unitTests.includeAndroidResources = true unitTests.returnDefaultValues = true } + + buildFeatures { + buildConfig true + } } java { @@ -100,6 +104,47 @@ artifacts { archives androidSourcesJar } +def performPublish = { +// Two artifacts, the `aar` (or `jar`) and the sources + if (project.plugins.findPlugin("com.android.library")) { + from components.release + } else { + from components.java + } + + artifact androidSourcesJar + + // Mostly self-explanatory metadata + pom { + name = getArtifactId() + // Library description + description = 'Velocity Career Labs Android library' + // Library Github URL + url = 'https://github.com/velocitycareerlabs/WalletAndroid' + licenses { + license { + name = 'Apache License 2.0' + // Library license + url = 'https://github.com/velocitycareerlabs/WalletAndroid/blob/dev/VCL/LICENSE' + } + } + developers { + developer { + id = 'velocitycareerlabs' + name = 'Michael Avoyan' + email = 'michael.avoyan@velocitycareerlabs.com' + } + } + + scm { + // Library info on Github + connection = 'scm:github.com/velocitycareerlabs/WalletAndroid.git' + developerConnection = 'scm:git:ssh://github.com/velocitycareerlabs/WalletAndroid.git' + url = 'https://github.com/velocitycareerlabs/WalletAndroid' + } + } +} + afterEvaluate { publishing { publications { @@ -108,92 +153,19 @@ afterEvaluate { artifactId getArtifactId() // define rc version name - def vers = getVersionName() - def rcSuffix = rootProject.ext.rcSuffix - version = "${vers}-${rcSuffix}" - - // Two artifacts, the `aar` (or `jar`) and the sources - if (project.plugins.findPlugin("com.android.library")) { - from components.release - } else { - from components.java - } - - artifact androidSourcesJar - - // Mostly self-explanatory metadata - pom { - name = getArtifactId() - // Library description - description = 'Velocity Career Labs Android library' - // Library Github URL - url = 'https://github.com/velocitycareerlabs/WalletAndroid' - licenses { - license { - name = 'Apache License 2.0' - // Library license - url = 'https://github.com/velocitycareerlabs/WalletAndroid/blob/dev/VCL/LICENSE' - } - } - developers { - developer { - id = 'velocitycareerlabs' - name = 'Michael Avoyan' - email = 'michael.avoyan@velocitycareerlabs.com' - } - } - - scm { - // Library info on Github - connection = 'scm:github.com/velocitycareerlabs/WalletAndroid.git' - developerConnection = 'scm:git:ssh://github.com/velocitycareerlabs/WalletAndroid.git' - url = 'https://github.com/velocitycareerlabs/WalletAndroid' - } - } +// def vers = getVersionName() +// def rcSuffix = rootProject.ext.rcSuffix +// version = "${vers}-${rcSuffix}" + version getVersionName() + + performPublish } release(MavenPublication) { groupId getGroupId() artifactId getArtifactId() version getVersionName() - // Two artifacts, the `aar` (or `jar`) and the sources - if (project.plugins.findPlugin("com.android.library")) { - from components.release - } else { - from components.java - } - - artifact androidSourcesJar - - // Mostly self-explanatory metadata - pom { - name = getArtifactId() - // Library description - description = 'Velocity Career Labs Android library' - // Library Github URL - url = 'https://github.com/velocitycareerlabs/WalletAndroid' - licenses { - license { - name = 'Apache License 2.0' - // Library license - url = 'https://github.com/velocitycareerlabs/WalletAndroid/blob/dev/VCL/LICENSE' - } - } - developers { - developer { - id = 'velocitycareerlabs' - name = 'Michael Avoyan' - email = 'michael.avoyan@velocitycareerlabs.com' - } - } - - scm { - // Library info on Github - connection = 'scm:github.com/velocitycareerlabs/WalletAndroid.git' - developerConnection = 'scm:git:ssh://github.com/velocitycareerlabs/WalletAndroid.git' - url = 'https://github.com/velocitycareerlabs/WalletAndroid' - } - } + performPublish } } } @@ -215,7 +187,7 @@ repositories { */ dependencies { - implementation 'androidx.core:core-ktx:1.9.0' + implementation 'androidx.core:core-ktx:1.12.0' implementation "com.nimbusds:nimbus-jose-jwt:9.37" //noinspection GradleDependency @@ -235,7 +207,7 @@ dependencies { testImplementation "org.mockito:mockito-inline:$mockito_version" // Required -- JSON framework testImplementation 'org.json:json:20201115' - // jsonassert + // json assert testImplementation 'org.skyscreamer:jsonassert:1.5.1' androidTestImplementation 'androidx.test.ext:junit:1.1.5' diff --git a/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLCredentialManifest.kt b/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLCredentialManifest.kt index a4cf41c1..4183efe2 100644 --- a/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLCredentialManifest.kt +++ b/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLCredentialManifest.kt @@ -18,9 +18,12 @@ data class VCLCredentialManifest( val iss: String get() = jwt.payload?.toJSONObject()?.get(KeyIss) as? String ?: "" val did: String get() = iss val aud: String get() = retrieveAud() - val issuerId: String get() = jwt.payload?.toJSONObject()?.get(CodingKeys.KeyIssuer) as? String - ?: (jwt.payload?.toJSONObject()?.get(CodingKeys.KeyIssuer) as? Map<*, *>)?.get(CodingKeys.KeyId) as? String - ?: "" + val issuerId: String + get() = jwt.payload?.toJSONObject()?.get(CodingKeys.KeyIssuer) as? String + ?: (jwt.payload?.toJSONObject()?.get(CodingKeys.KeyIssuer) as? Map<*, *>)?.get( + CodingKeys.KeyId + ) as? String + ?: "" val exchangeId: String get() = jwt.payload?.toJSONObject()?.get(KeyExchangeId) as? String ?: "" val presentationDefinitionId: String get() = (jwt.payload?.toJSONObject()?.get(KeyPresentationDefinitionId) as? Map<*, *>)?.get( @@ -49,7 +52,11 @@ data class VCLCredentialManifest( )?.toString() ?: "" private fun retrieveAud() = - ((jwt.payload?.toJSONObject()?.getOrDefault(CodingKeys.KeyMetadata, HashMap()) as? Map )?.getOrDefault(CodingKeys.KeyFinalizeOffersUri, "") as? String ?: "").substringBefore("/issue/") + ((jwt.payload?.toJSONObject() + ?.getOrDefault(CodingKeys.KeyMetadata, HashMap()) as? Map<*, *>) + ?.getOrDefault(CodingKeys.KeyFinalizeOffersUri, "") as? String ?: "") + .substringBefore("/issue/") + companion object CodingKeys { const val KeyIssuingRequest = "issuing_request" diff --git a/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLJwt.kt b/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLJwt.kt index 8ff23c41..9b488e59 100644 --- a/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLJwt.kt +++ b/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLJwt.kt @@ -67,7 +67,7 @@ class VCLJwt { ?: ((header?.toJSONObject()?.getOrDefault( CodingKeys.KeyJwk, null - )) as? Map)?.getOrDefault(CodingKeys.KeyKid, null) + )) as? Map<*, *>)?.getOrDefault(CodingKeys.KeyKid, null) as? String val iss: String? get() = this.payload?.toJSONObject()?.getOrDefault(CodingKeys.KeyIss, null) as? String val aud: String? diff --git a/app/build.gradle b/app/build.gradle index 4a62cb5b..09fb20ea 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,13 +5,13 @@ plugins { } android { - compileSdk 33 + compileSdk 34 // buildToolsVersion "30.0.3" defaultConfig { applicationId "com.vcl.wallet" minSdk 24 - targetSdk 33 + targetSdk 34 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -43,9 +43,9 @@ android { } dependencies { - implementation 'androidx.core:core-ktx:1.9.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' + implementation 'com.google.android.material:material:1.11.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' androidTestImplementation 'androidx.test.ext:junit:1.1.5' diff --git a/app/src/main/java/com/vcl/wallet/Constants.kt b/app/src/main/java/com/vcl/wallet/Constants.kt index 9ceed1d3..ba6763b0 100644 --- a/app/src/main/java/com/vcl/wallet/Constants.kt +++ b/app/src/main/java/com/vcl/wallet/Constants.kt @@ -14,8 +14,7 @@ import org.json.JSONObject object Constants { const val PresentationRequestDeepLinkStrDev = -// "velocity-network-devnet://inspect?request_uri=https%3A%2F%2Fdevagent.velocitycareerlabs.io%2Fapi%2Fholder%2Fv0.6%2Forg%2Fdid%3Avelocity%3A0xd4df29726d500f9b85bc6c7f1b3c021f16305692%2Finspect%2Fget-presentation-request%3Fid%3D61efe084b2658481a3d9248c%26vendorOriginContext%3D%7B%22SubjectKey%22%3A%7B%22BusinessUnit%22%3A%22ZC%22%2C%22KeyCode%22%3A%2254514480%22%7D%2C%22Token%22%3A%22832077a4%22%7D" - "velocity-network-devnet://inspect?request_uri=https%3A%2F%2Fdevagent.velocitycareerlabs.io%2Fapi%2Fholder%2Fv0.6%2Forg%2Fdid%3Avelocity%3A0xd4df29726d500f9b85bc6c7f1b3c021f16305692%2Finspect%2Fget-presentation-request%3Fid%3D61efe084b2658481a3d9248c%26inspectorDid%3Ddid%3Avelocity%3A0xd4df29726d500f9b85bc6c7f1b3c021f16305692%26vendorOriginContext%3D%7B%22SubjectKey%22%3A%7B%22BusinessUnit%22%3A%22ZC%22%2C%22KeyCode%22%3A%2254514480%22%7D%2C%22Token%22%3A%22832077a4%22%7D%26inspectorDid%3Ddid%3Avelocity%3A0xd4df29726d500f9b85bc6c7f1b3c021f16305692" + "velocity-network-devnet://inspect?request_uri=https%3A%2F%2Fdevagent.velocitycareerlabs.io%2Fapi%2Fholder%2Fv0.6%2Forg%2Fdid%3Aion%3AEiAbP9xvCYnUOiLwqgbkV4auH_26Pv7BT2pYYT3masvvhw%2Finspect%2Fget-presentation-request%3Fid%3D62d8f05788de05e27930b037&inspectorDid=did%3Aion%3AEiAbP9xvCYnUOiLwqgbkV4auH_26Pv7BT2pYYT3masvvhw" const val PresentationRequestDeepLinkStrStaging = // "velocity-network-testnet://inspect?request_uri=https%3A%2F%2Fstagingagent.velocitycareerlabs.io%2Fapi%2Fholder%2Fv0.6%2Forg%2Fdid%3Aion%3AEiByBvq95tfmhl41DOxJeaa26HjSxAUoz908PITFwMRDNA%2Finspect%2Fget-presentation-request%3Fid%3D62e0e80c5ebfe73230b0becc&inspectorDid=did%3Aion%3AEiByBvq95tfmhl41DOxJeaa26HjSxAUoz908PITFwMRDNA&vendorOriginContext=%7B%22SubjectKey%22%3A%7B%22BusinessUnit%22%3A%22ZC%22,%22KeyCode%22%3A%2254514480%22%7D,%22Token%22%3A%22832077a4%22%7D" diff --git a/build.gradle b/build.gradle index 07aca28b..d56ddeff 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.7.21" + ext.kotlin_version = "1.9.23" // Set "rc" suffix for VCL SDK release candidate ext.rcSuffix = "rc" repositories { @@ -8,7 +8,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.3.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong @@ -19,7 +19,7 @@ buildscript { plugins { // Automation plugin // https://github.com/gradle-nexus/publish-plugin - id "io.github.gradle-nexus.publish-plugin" version "1.1.0" + id "io.github.gradle-nexus.publish-plugin" version "1.3.0" } // Publishing scripts @@ -31,11 +31,11 @@ allprojects { google() mavenCentral() maven { - url "$buildDir/VCL" + url "${getLayout().getBuildDirectory()}/VCL" } } } -task clean(type: Delete) { - delete rootProject.buildDir +tasks.register('clean', Delete) { + delete rootProject.getLayout().getBuildDirectory() } diff --git a/gradle.properties b/gradle.properties index 0a934162..a2ef864d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,4 +21,8 @@ android.enableJetifier=true kotlin.code.style=official #android.enableR8=true #android.enableD8=true -android.disableAutomaticComponentCreation=true \ No newline at end of file +#android.disableAutomaticComponentCreation=true +#android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false +android.buildFeatures.buildConfig=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 89f2c2d7..331b8762 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip