Skip to content
This repository was archived by the owner on Mar 1, 2022. It is now read-only.

Commit 34743f8

Browse files
author
João Pedro Evangelista
committed
Proguard: Make work with jackson
1 parent 08c11d2 commit 34743f8

File tree

3 files changed

+65
-9
lines changed

3 files changed

+65
-9
lines changed

mobile/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ android {
2929
versionName "1.0.0"
3030
multiDexEnabled true
3131

32+
resConfigs 'en'
3233
vectorDrawables.useSupportLibrary = true
3334
}
3435
buildTypes {
3536
release {
36-
minifyEnabled false
37-
debuggable false
37+
minifyEnabled true
38+
shrinkResources true
3839
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3940
}
4041
}

mobile/proguard-rules.pro

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,60 @@
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
1717
#}
18+
19+
-dontwarn java.beans.** # missing nio file
20+
-dontwarn rx.internal.** # missing sun.Unsfe
21+
## Square Picasso specific rules ##
22+
## https://square.github.io/picasso/ ##
23+
24+
-dontwarn com.squareup.okhttp.**
25+
# Okio
26+
-keep class sun.misc.Unsafe { *; }
27+
-dontwarn java.nio.file.*
28+
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
29+
-dontwarn okio.**
30+
-dontwarn java.lang.invoke.* # retrolambda
31+
32+
# Proguard configuration for Jackson 2.x (fasterxml package instead of codehaus package)
33+
34+
-keepnames class com.fasterxml.jackson.** { *; }
35+
36+
-keep class com.fasterxml.jackson.databind.ObjectMapper {
37+
public <methods>;
38+
public <fields>;
39+
protected <methods>;
40+
}
41+
-keep class com.fasterxml.jackson.databind.ObjectWriter {
42+
public ** writeValueAsString(**);
43+
}
44+
-dontwarn org.w3c.** # Jackson 2.8 DOMSerializer
45+
46+
# Proguard Configuration for Realm (http://realm.io)
47+
# For detailed discussion see: https://groups.google.com/forum/#!topic/realm-java/umqKCc50JGU
48+
# Additionally you need to keep your Realm Model classes as well
49+
# For example:
50+
# -keep class com.yourcompany.realm.** { *; }
51+
52+
-keep class io.realm.annotations.RealmModule
53+
-keep @io.realm.annotations.RealmModule class *
54+
-keep class io.realm.internal.Keep
55+
-keep @io.realm.internal.Keep class *
56+
-dontwarn javax.**
57+
-dontwarn io.realm.**
58+
59+
# Dagger ProGuard rules.
60+
# https://github.com/square/dagger
61+
62+
-dontwarn dagger.internal.codegen.**
63+
-keepclassmembers,allowobfuscation class * {
64+
@javax.inject.* *;
65+
@dagger.* *;
66+
<init>();
67+
}
68+
69+
-keep class dagger.* { *; }
70+
-keep class javax.inject.* { *; }
71+
-keep class * extends dagger.internal.Binding
72+
-keep class * extends dagger.internal.ModuleAdapter
73+
-keep class * extends dagger.internal.StaticInjection
74+

mobile/src/main/AndroidManifest.xml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@
1515
android:supportsRtl="true"
1616
android:theme="@style/AppTheme">
1717
<activity android:name=".user.UserStartActivity">
18-
18+
<intent-filter>
19+
<action android:name="android.intent.action.MAIN"/>
20+
<category android:name="android.intent.category.LAUNCHER"/>
21+
</intent-filter>
1922
<intent-filter>
2023
<action android:name="android.intent.action.VIEW"/>
21-
<action android:name="android.intent.action.MAIN"/>
22-
23-
<category android:name="android.intent.category.DEFAULT"/>
2424
<category android:name="android.intent.category.BROWSABLE"/>
25-
<category android:name="android.intent.category.LAUNCHER"/>
26-
2725
<data
2826
android:host="wakatime.com"
2927
android:pathPrefix="/"
@@ -44,4 +42,4 @@
4442
android:value="c1b0913c1ea618ffe2a1d02eb09dce0f01195da3"/>
4543
</application>
4644

47-
</manifest>
45+
</manifest>

0 commit comments

Comments
 (0)