Skip to content

Commit

Permalink
Merge pull request #89 from apivideo/fix/proguard_rules
Browse files Browse the repository at this point in the history
Fix/proguard rules
  • Loading branch information
bot-api-video authored Mar 22, 2024
2 parents 33c7f0e + eac6dfc commit 333a5a4
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All changes to this project will be documented in this file.

## [1.3.5] - 2024-03-21
- Add missing proguard rules for gson and jackson

## [1.3.4] - 2024-01-08
- Upgrade dependencies, gradle and Kotlin

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>video.api</groupId>
<artifactId>android-video-uploader</artifactId>
<version>1.3.4</version>
<version>1.3.5</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -72,7 +72,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
implementation "video.api:android-video-uploader:1.3.4"
implementation "video.api:android-video-uploader:1.3.5"
```

#### Others
Expand All @@ -85,7 +85,7 @@ mvn clean package

Then manually install the following JARs:

* `target/android-video-uploader-1.3.4.jar`
* `target/android-video-uploader-1.3.5.jar`
* `target/lib/*.jar`

### Code sample
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'maven-publish'
apply plugin: 'kotlin-android'

group = 'video.api'
version = '1.3.4'
version = '1.3.5'

buildscript {
repositories {
Expand Down
43 changes: 41 additions & 2 deletions consumer-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,48 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# Workaround for internal missing proguard rules
## Workaround for internal missing proguard rules
-dontwarn aQute.bnd.annotation.spi.ServiceProvider
-dontwarn jakarta.validation.valueextraction.UnwrapByDefault
-dontwarn jakarta.validation.valueextraction.ValueExtractor
-dontwarn javax.validation.valueextraction.UnwrapByDefault
-dontwarn javax.validation.valueextraction.ValueExtractor
-dontwarn javax.validation.valueextraction.ValueExtractor

## Proguard configuration for Gson
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent R8 from leaving Data object members always null
-keep class * {
@com.google.gson.annotations.SerializedName <fields>;
}

# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken

## Proguard configuration for Jackson 2.x (fasterxml package instead of codehaus package)
-keep class com.fasterxml.jackson.databind.ObjectMapper {
public <methods>;
protected <methods>;
}
-keep class com.fasterxml.jackson.databind.ObjectWriter {
public ** writeValueAsString(**);
}
-keepnames class com.fasterxml.jackson.** { *; }
-dontwarn com.fasterxml.jackson.databind.**
2 changes: 1 addition & 1 deletion examples/service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/workmanager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand Down
4 changes: 2 additions & 2 deletions maven-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ apply plugin: 'maven-publish'
apply plugin: 'signing'

def isReleaseBuild() {
return !"1.3.4".contains("SNAPSHOT")
return !"1.3.5".contains("SNAPSHOT")
}

def getReleaseRepositoryUrl() {
Expand Down Expand Up @@ -57,7 +57,7 @@ afterEvaluate {

groupId = "video.api"
artifactId = "android-video-uploader"
version = "1.3.4"
version = "1.3.5"

pom {
name = "video.api:android-video-uploader"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>android-video-uploader</artifactId>
<packaging>jar</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<version>1.3.4</version>
<version>1.3.5</version>
<url>https://github.com/apivideo/api.video-android-uploader</url>
<description>The official Android api.video uploader</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/video/api/uploader/api/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private OkHttpClient initHttpClient(List<Interceptor> interceptors) {
private void init() {
verifyingSsl = true;
json = new JSON();
addDefaultHeader("AV-Origin-Client", "android-uploader:1.3.4");
addDefaultHeader("AV-Origin-Client", "android-uploader:1.3.5");
}

private boolean isValid(String regex, String field) {
Expand Down

0 comments on commit 333a5a4

Please sign in to comment.