Skip to content

Commit

Permalink
chore(release): pulling release/1.20.0 into master #333
Browse files Browse the repository at this point in the history
chore(release): pulling release/1.20.0 into master
  • Loading branch information
itsdebs authored Oct 3, 2023
2 parents 782e644 + 83aba4b commit 6434d0d
Show file tree
Hide file tree
Showing 13 changed files with 275 additions and 32 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.20.0](https://github.com/rudderlabs/rudder-sdk-android/compare/v1.19.1...v1.20.0) (2023-10-03)


### Features

* adding metrics for workmanager dbEncryption and dmt ([#329](https://github.com/rudderlabs/rudder-sdk-android/issues/329)) ([d38ad43](https://github.com/rudderlabs/rudder-sdk-android/commit/d38ad433b3dded21cbe57ce4e05699232e502954))


### Bug Fixes

* added filter for rudderstack crashes ([#325](https://github.com/rudderlabs/rudder-sdk-android/issues/325)) ([b804a32](https://github.com/rudderlabs/rudder-sdk-android/commit/b804a32b5928f8a5bab081de624e245a17cc4305))
* expose proguard rules as part of the library to ensure safer builds ([#321](https://github.com/rudderlabs/rudder-sdk-android/issues/321)) ([46a5413](https://github.com/rudderlabs/rudder-sdk-android/commit/46a54137990b171b6430de6ca8e0fc90aa26cde0))

### [1.19.1](https://github.com/rudderlabs/rudder-sdk-android/compare/v1.19.0...v1.19.1) (2023-09-21)


Expand Down
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,60 @@ The variable `it` contains the intialized nativeSDK object.
[**Registering Lotame's onSync callback**](https://github.com/rudderlabs/rudder-integration-lotame-android#register-your-onsync-callback) shows one more example of registering a callback using `onIntegrationReady`.

#### Do I need to add anything to my ProGuard rules?

If you are using Proguard full mode to optimize your app, add the following lines to your Android ProGuard rules:

```java
# Reporter Module
-keep class com.rudderstack.android.ruddermetricsreporterandroid.models.LabelEntity { *; }
-keep class com.rudderstack.android.ruddermetricsreporterandroid.models.MetricEntity { *; }
-keep class com.rudderstack.android.ruddermetricsreporterandroid.models.ErrorEntity { *; }

# Required for the usage off TypeToken class in Utils.converToMap, Utils.convertToList
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken

# Required for the serialization of SourceConfig once it is downloaded.
-keep class com.google.gson.internal.LinkedTreeMap { *; }
-keep class * implements java.io.Serializable { *; }
-keep class com.rudderstack.rudderjsonadapter.RudderTypeAdapter { *; }
-keep class * extends com.rudderstack.rudderjsonadapter.RudderTypeAdapter

# Required to ensure the DefaultPersistenceProviderFactory is not removed by Proguard
# and works as expected even when the customer is not using encryption feature.
-dontwarn net.sqlcipher.Cursor
-dontwarn net.sqlcipher.database.SQLiteDatabase$CursorFactory
-dontwarn net.sqlcipher.database.SQLiteDatabase
-dontwarn net.sqlcipher.database.SQLiteOpenHelper
-keep class com.rudderstack.android.sdk.core.persistence.DefaultPersistenceProviderFactory { *; }

# Required for the usage of annotations across reporter and web modules
-dontwarn com.fasterxml.jackson.annotation.JsonIgnore
-dontwarn com.squareup.moshi.Json
-dontwarn com.fasterxml.jackson.annotation.JsonProperty

# Required for Device Mode Transformations
-keep class com.rudderstack.android.sdk.core.TransformationResponse { *; }
-keep class com.rudderstack.android.sdk.core.TransformationResponseDeserializer { *; }

# to make sure that serialized name annotations are not removed by the Proguard full mode.
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}

# Required for proper serialization of the custom traits and custom context
-keep class * implements com.google.gson.JsonSerializer { *; }

# to make sure that the customContextMap, custom traits are sent in the proper format
-keepclassmembers class com.rudderstack.android.sdk.core.RudderContext { java.util.Map customContextMap; }
-keepclassmembers class com.rudderstack.android.sdk.core.RudderTraits { java.util.Map extras; }

# Required for DBEncryption feature using SQLCipher
-keep class net.sqlcipher.** { *; }
-keep class net.sqlcipher.database.* { *; }
```

## Contribute

We would love to see you contribute to this project. Get more information on how to contribute [**here**](./CONTRIBUTING.md).
Expand Down
4 changes: 2 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 33
// consumerProguardFiles 'proguard-consumer-rules.pro'
consumerProguardFiles 'proguard-consumer-rules.pro'
buildConfigField("String", "VERSION_NAME", "\"${VERSION_NAME}\"")
buildConfigField("String", "VERSION_CODE", "\"${VERSION_CODE}\"")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -44,7 +44,7 @@ dependencies {
implementation 'androidx.annotation:annotation:1.6.0'


implementation ('com.rudderstack.android.sdk:rudderreporter:0.2.0')
implementation ('com.rudderstack.android.sdk:rudderreporter:0.3.0')
// implementation(project(path: ':rudderreporter'))
// implementation(project(path: ':gsonrudderadapter'))
implementation 'com.rudderstack.kotlin.sdk:gsonrudderadapter:0.2.0'
Expand Down
42 changes: 38 additions & 4 deletions core/proguard-consumer-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,41 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#
#-keep class com.rudderstack.android.sdk.core.* { *; }
#-keep class com.rudderstack.android.sdk.core.ecomm.* { *; }
#-keep class com.rudderstack.android.sdk.core.util.* { *; }

# Required for the usage off TypeToken class in Utils.converToMap, Utils.convertToList
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken

# Required for the serialization of SourceConfig once it is downloaded.
-keep class com.google.gson.internal.LinkedTreeMap { *; }
-keep class * implements java.io.Serializable { *; }
-keep class com.rudderstack.rudderjsonadapter.RudderTypeAdapter { *; }
-keep class * extends com.rudderstack.rudderjsonadapter.RudderTypeAdapter

# Required to ensure the DefaultPersistenceProviderFactory is not removed by Proguard
# and works as expected even when the customer is not using encryption feature.
-dontwarn net.sqlcipher.Cursor
-dontwarn net.sqlcipher.database.SQLiteDatabase$CursorFactory
-dontwarn net.sqlcipher.database.SQLiteDatabase
-dontwarn net.sqlcipher.database.SQLiteOpenHelper
-keep class com.rudderstack.android.sdk.core.persistence.DefaultPersistenceProviderFactory { *; }

# Required for Device Mode Transformations
-keep class com.rudderstack.android.sdk.core.TransformationResponse { *; }
-keep class com.rudderstack.android.sdk.core.TransformationResponseDeserializer { *; }

# to make sure that serialized name annotations in model classes are not removed by the Proguard full mode.
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}

# Required for proper serialization of the custom traits and custom context
-keep class * implements com.google.gson.JsonSerializer { *; }

# to make sure that the customContextMap, custom traits are sent in the proper format
-keepclassmembers class com.rudderstack.android.sdk.core.RudderContext { java.util.Map customContextMap; }
-keepclassmembers class com.rudderstack.android.sdk.core.RudderTraits { java.util.Map extras; }

# Required for DBEncryption feature using SQLCipher
-keep class net.sqlcipher.** { *; }
-keep class net.sqlcipher.database.* { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void handleMessage(Message msg) {
RudderLogger.logDebug(String.format("EventRepository: constructor: %s", this.config.toString()));

try {
ReportManager.addErrorMetadata(ReportManager.METADATA_SECTION_GZIP, ReportManager.METADATA_GZIP_KEY_IS_ENABLED,
ReportManager.leaveBreadcrumb(ReportManager.METADATA_SECTION_GZIP, ReportManager.METADATA_GZIP_KEY_IS_ENABLED,
_config.isGzipEnabled());
// initiate RudderPreferenceManager
initiatePreferenceManager(_application);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ public FlushEventsWorker(
persistenceProviderFactoryClassName = params.getInputData().getString(PERSISTENCE_PROVIDER_FACTORY_CLASS_NAME_KEY);
}

private void addWorkerMetrics() {
ReportManager.incrementWorkManagerInitializationCounter(1);
}

@Override
public Result doWork() {
addWorkerMetrics();
RudderFlushConfig flushConfig = RudderFlushWorkManager.getRudderFlushConfig(getApplicationContext());
if (flushConfig == null) {
RudderLogger.logWarn("FlushEventsWorker: doWork: RudderFlushConfig is empty, couldn't flush the events, aborting the work");
return Result.failure();
}
RudderLogger.init(flushConfig.getLogLevel());

DBPersistentManager.DbManagerParams params = new DBPersistentManager
.DbManagerParams(flushConfig.isDbEncrypted(), persistenceProviderFactoryClassName, flushConfig.getEncryptionKey());
DBPersistentManager dbManager = DBPersistentManager.getInstance((Application) getApplicationContext(), params);
Expand Down
Loading

0 comments on commit 6434d0d

Please sign in to comment.