Skip to content

Commit bd9ca57

Browse files
ANDROID:
- added logic for obfuscation
1 parent d620d13 commit bd9ca57

File tree

2 files changed

+32
-33
lines changed

2 files changed

+32
-33
lines changed

simple_sample/android/app/build.gradle

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,20 @@ android {
4040
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
4141
}
4242

43+
signingConfigs {
44+
debug {}
45+
}
46+
4347
buildTypes {
48+
debug {
49+
minifyEnabled = false
50+
debuggable = true
51+
signingConfig signingConfigs.debug
52+
}
53+
4454
release {
45-
// TODO: Add your own signing config for the release build.
46-
// Signing with the debug keys for now, so `flutter run --release` works.
55+
minifyEnabled = true
56+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
4757
signingConfig signingConfigs.debug
4858
}
4959
}
Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Add project specific ProGuard rules here.
22
# By default, the flags in this file are appended to flags specified
3-
# in /home/tereha/Android/sdk/tools/proguard/proguard-android.txt
3+
44
# You can edit the include path and order by changing the proguardFiles
55
# directive in build.gradle.
66
#
77
# For more details, see
8-
# http://developer.android.com/guide/developing/tools/proguard.html
9-
10-
# Add any project specific keep options here:
8+
# http://developer.android.com/guide/developing/tools/proguard.html
119

1210
# If your project uses WebView with JS, uncomment the following
1311
# and specify the fully qualified class name to the JavaScript interface
@@ -20,39 +18,30 @@
2018
#-verbose
2119
#
2220

21+
##---------------Begin: proguard configuration for Gson ----------
22+
# Gson uses generic type information stored in a class file when working with fields. Proguard
23+
# removes such information by default, so configure it to keep all of it.
24+
-keepattributes EnclosingMethod
25+
-keepattributes InnerClasses
2326
-keepattributes Signature
27+
-keepattributes Exceptions
2428

2529
# For using GSON @Expose annotation
2630
-keepattributes *Annotation*
2731

28-
# Gson specific classes
29-
-keep class sun.misc.Unsafe { *; }
30-
#-keep class com.google.gson.stream.** { *; }
31-
32-
# Application classes that will be serialized/deserialized over Gson
33-
-keep class com.quickblox.core.account.model.** { *; }
34-
35-
-keep class com.quickblox.auth.parsers.** { *; }
36-
-keep class com.quickblox.auth.model.** { *; }
37-
-keep class com.quickblox.core.parser.** { *; }
38-
-keep class com.quickblox.core.model.** { *; }
39-
-keep class com.quickblox.core.server.** { *; }
40-
-keep class com.quickblox.core.rest.** { *; }
41-
-keep class com.quickblox.core.error.** { *; }
42-
-keep class com.quickblox.core.Query { *; }
32+
#quickblox sdk
33+
-keep class com.quickblox.** { *; }
4334

44-
-keep class com.quickblox.users.parsers.** { *; }
45-
-keep class com.quickblox.users.model.** { *; }
46-
47-
-keep class com.quickblox.chat.parser.** { *; }
48-
-keep class com.quickblox.chat.model.** { *; }
49-
50-
-keep class com.quickblox.messages.parsers.** { *; }
51-
-keep class com.quickblox.messages.model.** { *; }
35+
#smack xmpp library
36+
-keep class org.jxmpp.** { *; }
37+
-keep class org.jivesoftware.** { *; }
38+
-dontwarn org.jivesoftware.**
5239

53-
-keep class com.quickblox.content.parsers.** { *; }
54-
-keep class com.quickblox.content.model.** { *; }
40+
#webrtc
41+
-keep class org.webrtc.** { *; }
5542

56-
-keep class org.jivesoftware.** { *; }
43+
#google gms
44+
-keep class com.google.android.gms.** { *; }
5745

58-
-dontwarn org.jivesoftware.smackx.**
46+
#json
47+
-keep class org.json.** { *; }

0 commit comments

Comments
 (0)