Skip to content

Commit

Permalink
v2.4.1-rc.1 upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelavoyan committed Mar 21, 2024
1 parent f9ead71 commit 7325ce0
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 105 deletions.
144 changes: 58 additions & 86 deletions VCL/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -63,6 +63,10 @@ android {
unitTests.includeAndroidResources = true
unitTests.returnDefaultValues = true
}

buildFeatures {
buildConfig true
}
}

java {
Expand Down Expand Up @@ -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 = '[email protected]'
}
}

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 {
Expand All @@ -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 = '[email protected]'
}
}

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 = '[email protected]'
}
}

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
}
}
}
Expand All @@ -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
Expand All @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -49,7 +52,11 @@ data class VCLCredentialManifest(
)?.toString() ?: ""

private fun retrieveAud() =
((jwt.payload?.toJSONObject()?.getOrDefault(CodingKeys.KeyMetadata, HashMap<String, Any>()) as? Map<String, Any> )?.getOrDefault(CodingKeys.KeyFinalizeOffersUri, "") as? String ?: "").substringBefore("/issue/")
((jwt.payload?.toJSONObject()
?.getOrDefault(CodingKeys.KeyMetadata, HashMap<String, Any>()) as? Map<*, *>)
?.getOrDefault(CodingKeys.KeyFinalizeOffersUri, "") as? String ?: "")
.substringBefore("/issue/")

companion object CodingKeys {
const val KeyIssuingRequest = "issuing_request"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class VCLJwt {
?: ((header?.toJSONObject()?.getOrDefault(
CodingKeys.KeyJwk,
null
)) as? Map<String, String>)?.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?
Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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'
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/vcl/wallet/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// 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 {
google()
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
Expand All @@ -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
Expand All @@ -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()
}
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ android.enableJetifier=true
kotlin.code.style=official
#android.enableR8=true
#android.enableD8=true
android.disableAutomaticComponentCreation=true
#android.disableAutomaticComponentCreation=true
#android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
android.buildFeatures.buildConfig=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7325ce0

Please sign in to comment.