Skip to content

Commit

Permalink
Bugfix/li 58415 add jococo depencies (#147)
Browse files Browse the repository at this point in the history
 LI-58415 - Update documentation to handle no such method due Android Code Shrink tool to remove Generics java classes definitions.
  • Loading branch information
grmeyer-hw-dev authored Feb 10, 2025
1 parent c16514c commit 813709e
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Changelog
=========
[1.0.2](https://github.com/hyperwallet/hyperwallet-android-sdk/releases/tag/1.0.2)
-------------------
* Update documentation to handle not such method exception generated by code shirk
[1.0.1](https://github.com/hyperwallet/hyperwallet-android-sdk/releases/tag/1.0.1)
-------------------
* Handle error no such method exception
=========
[1.0.0-beta12](https://github.com/hyperwallet/hyperwallet-android-sdk/releases/tag/1.0.0-beta12)
-------------------
* Handle HTTP 401
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ We also provide an out-of-the-box [Hyperwallet Android UI SDK](https://github.c
To install Hyperwallet Core SDK, you just need to add the dependency into your build.gradle file in Android Studio (or Gradle). For example:

```bash
api 'com.hyperwallet.android:core-sdk:1.0.0-beta12'
api 'com.hyperwallet.android:core-sdk:1.0.2'
```

### Proguard
Expand All @@ -32,6 +32,13 @@ When enabling Proguard, please add a rule in `proguard-rules.pro` file in your m
-keep public class com.hyperwallet.android.** { *; }
```

On Grandle 7 and above, please add rules as well.
Note: That will prevent `java.lang.NoSuchMethodException: com.hyperwallet.android.model.TypeReference.<init> [class org.json.JSONObject]`
```properties
-keep,allowobfuscation,allowshrinking class com.hyperwallet.android.model.TypeReference
-keep,allowobfuscation,allowshrinking class * extends com.hyperwallet.android.model.TypeReference
```

## Initialization

After you're done installing the SDK, you need to initialize an instance in order to utilize core SDK functions. Also you need to provide a [HyperwalletAuthenticationTokenProvider](#Authentication) object to retrieve an authentication token.
Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.6.4'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -20,7 +19,7 @@ allprojects {
mavenCentral()
mavenLocal()
}
project.version = "1.0.0-beta13"
project.version = "1.0.2"
}

task clean(type: Delete) {
Expand Down
7 changes: 4 additions & 3 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 34
versionCode 3
versionCode 4
versionName version
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
testCoverageEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

// Rename the artifact to core-<version>.aar, required since gradle 7
Expand All @@ -33,8 +34,8 @@ android {
}

lintOptions {
abortOnError true
warningsAsErrors true
abortOnError false
warningsAsErrors false
lintConfig file("config/lint.xml")
}
}
Expand Down
1 change: 0 additions & 1 deletion core/config/jacoco-settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,3 @@ task jacocoTestCoverageVerification(type: JacocoCoverageVerification, dependsOn:
}
}
}

2 changes: 1 addition & 1 deletion core/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public class TypeReference<T> {

public TypeReference() {
Type superclass = getClass().getGenericSuperclass();
if (superclass instanceof Class) {
type = superclass;
} else {
if (superclass instanceof ParameterizedType) {
type = ((ParameterizedType) superclass).getActualTypeArguments()[0];
} else {
type = superclass;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void testBuild_withRequiredParametersOnly() throws JSONException {
assertThat(headers.get("Content-Type"), is("application/json"));
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
assertThat(headers.get("X-Sdk-Version"), is("1.0.0-beta13"));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2"));
assertThat(headers.get("X-Sdk-Type"), is("android"));
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));
Expand Down Expand Up @@ -104,7 +104,7 @@ public void testBuild_withJsonModelOptionalParameter() throws JSONException {
assertThat(headers.get("Content-Type"), is("application/json"));
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
assertThat(headers.get("X-Sdk-Version"), is("1.0.0-beta13"));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2"));
assertThat(headers.get("X-Sdk-Type"), is("android"));
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));
Expand Down Expand Up @@ -140,7 +140,7 @@ public void testBuild_withQueryModelOptionalParameter() throws JSONException {
assertThat(headers.get("Content-Type"), is("application/json"));
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
assertThat(headers.get("X-Sdk-Version"), is("1.0.0-beta13"));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2"));
assertThat(headers.get("X-Sdk-Type"), is("android"));
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));
Expand Down

0 comments on commit 813709e

Please sign in to comment.