Skip to content

Commit

Permalink
Fix: Navigation Drawer sticks when swiped
Browse files Browse the repository at this point in the history
Fix: Download Activity can loose its title
Improve: Additional safety checks on onSaveInstanceState for Import Activity's permissions check
Added: Working proguard configuration and required files (proguard is currently off)
Modified: Reduced versionCode now that rigorous testing is complete
  • Loading branch information
avluis committed Apr 5, 2016
1 parent 6ca8e55 commit 5cfc02b
Show file tree
Hide file tree
Showing 26 changed files with 471 additions and 104 deletions.
15 changes: 15 additions & 0 deletions .proguard/proguard-eventbus-2.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## GreenRobot EventBus specific rules ##
# https://github.com/greenrobot/EventBus/blob/master/HOWTO.md#proguard-configuration

-keepclassmembers class ** {
public void onEvent*(***);
}

# Only required if you use AsyncExecutor
-keepclassmembers class * extends de.greenrobot.event.util.ThrowableFailureEvent {
public <init>(java.lang.Throwable);
}

# Don't warn for missing support classes
-dontwarn de.greenrobot.event.util.*$Support
-dontwarn de.greenrobot.event.util.*$SupportManagerFragment
9 changes: 9 additions & 0 deletions .proguard/proguard-glide.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Glide specific rules #
# https://github.com/bumptech/glide

-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
}

3 changes: 3 additions & 0 deletions .proguard/proguard-google-analytics.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Google Analytics 3.0 specific rules ##

-keep class com.google.analytics.** { *; }
19 changes: 19 additions & 0 deletions .proguard/proguard-google-play-services.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Google Play Services 4.3.23 specific rules ##
## https://developer.android.com/google/play-services/setup.html#Proguard ##

-keep class * extends java.util.ListResourceBundle {
protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
14 changes: 14 additions & 0 deletions .proguard/proguard-gson.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## GSON 2.2.4 specific rules ##

# 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*

-keepattributes EnclosingMethod

# Gson specific classes
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.** { *; }
1 change: 1 addition & 0 deletions .proguard/proguard-jsoup.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-keeppackagenames org.jsoup.nodes
14 changes: 14 additions & 0 deletions .proguard/proguard-rx-java.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# RxJava 0.21

-keep class rx.schedulers.Schedulers {
public static <methods>;
}
-keep class rx.schedulers.ImmediateScheduler {
public <methods>;
}
-keep class rx.schedulers.TestScheduler {
public <methods>;
}
-keep class rx.schedulers.Schedulers {
public static ** test();
}
2 changes: 2 additions & 0 deletions .proguard/proguard-sqlite.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-keep class org.sqlite.** { *; }
-keep class org.sqlite.database.** { *; }
6 changes: 6 additions & 0 deletions .proguard/proguard-square-okhttp3.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# OkHttp
-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
5 changes: 5 additions & 0 deletions .proguard/proguard-square-okio.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Okio
-keep class sun.misc.Unsafe { *; }
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**
4 changes: 4 additions & 0 deletions .proguard/proguard-support-design.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$* { *; }
7 changes: 7 additions & 0 deletions .proguard/proguard-support-v7-appcompat.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }

-keep public class * extends android.support.v4.view.ActionProvider {
public <init>(android.content.Context);
}
2 changes: 2 additions & 0 deletions .proguard/proguard-support-v7-cardview.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# http://stackoverflow.com/questions/29679177/cardview-shadow-not-appearing-in-lollipop-after-obfuscate-with-proguard/29698051
-keep class android.support.v7.widget.RoundRectDrawable { *; }
33 changes: 30 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,41 @@ android {
applicationId "me.devsaki.hentoid"
minSdkVersion 15
targetSdkVersion 23
versionCode 37
versionCode 36
versionName '1.2.0r1-beta1'
}
buildTypes {
debug {
debuggable true
minifyEnabled false
shrinkResources true

// Library specific proguard files
FileCollection proGuardFileCollection = files { file('../.proguard/').listFiles() }
proguardFiles(proGuardFileCollection)

// Default proguard files & project app specific rules
proguardFile getDefaultProguardFile('proguard-android.txt')
proguardFile 'proguard-project-app.pro'

// As of Gradle Android plugin 1.1.0, the test APK has a separate config
testProguardFile 'proguard-project-test.pro'
}
release {
minifyEnabled true
debuggable false
minifyEnabled false
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

// Library specific proguard files
FileCollection proGuardFileCollection = files { file('../.proguard/').listFiles() }
proguardFiles(proGuardFileCollection)

// Default proguard files & project app specific rules
proguardFile getDefaultProguardFile('proguard-android.txt')
proguardFile 'proguard-project-app.pro'

// As of Gradle Android plugin 1.1.0, the test APK has a separate config
testProguardFile 'proguard-project-test.pro'
}
}
packagingOptions {
Expand Down
74 changes: 74 additions & 0 deletions app/proguard-android.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html

-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose

# Optimization is turned off by default. Dex does not like code run
# through the ProGuard optimize and preverify steps (and performs some
# of these optimizations on its own).
-dontoptimize
-dontpreverify
# Note that if you want to enable optimization, you cannot just
# include optimization flags in your own project configuration file;
# instead you will need to point to the
# "proguard-android-optimize.txt" file instead of this one from your
# project.properties file.

-keepattributes *Annotation*
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService

# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}

# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}

# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}

# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keepclassmembers class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator CREATOR;
}

-keepclassmembers class **.R$* {
public static <fields>;
}

# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**

# Understand the @Keep support annotation.
-keep class android.support.annotation.Keep

-keep @android.support.annotation.Keep class * {*;}

-keepclasseswithmembers class * {
@android.support.annotation.Keep <methods>;
}

-keepclasseswithmembers class * {
@android.support.annotation.Keep <fields>;
}

-keepclasseswithmembers class * {
@android.support.annotation.Keep <init>(...);
}
105 changes: 105 additions & 0 deletions app/proguard-project-app.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# The simpliest strategy is to not run proguard against your project's own code.
# This doesn't provide the benefits of optimization & obfuscation against your
# project, but will still strip the libraries. The advantage is that your app will
# work without any subsequent effort. If you choose this strategy, the proguard
# configuration for the project is simply the line below.

#-keep class com.yourpackage.app.** { *; }

# The more involved strategy is to specifically provide rules to keep portions of your
# app's codebase unmodified while allowing proguard to optimize the rest.

# The first decision is whether or not you want to obfuscate your code. This provides no
# performance benefit but makes it harder for other people to read your source code.
# Unfortunately obfuscation can cause issues for code that uses reflection or a few other
# techniques. The default is to obfuscate.

-dontobfuscate

# Additionally you will need to keep specific classes. A common use case is keeping all
# of the models that are JSON parsed using something like Jackson.

#-keep class com.yourpackage.app.model.User { *; }

-ignorewarnings
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * implements java.io.Serializable
-keep public class * extends android.support.v4.app.Fragment
-keep public class * extends android.support.v4.app.ListFragment
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers class * extends android.content.Context {
public void *(android.view.View);
public void *(android.view.MenuItem);
}
-keepclassmembers enum me.devsaki.hentoid.** { *; }
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}

-keepattributes JavascriptInterface
-keepattributes InnerClasses
-keepattributes EnclosingMethod

-keep public class me.devsaki.hentoid.activities.HitomiActivity$PageLoadListener
-keep public class * implements me.devsaki.hentoid.activities.HitomiActivity$PageLoadListener
-keepclassmembers class me.devsaki.hentoid.activities.HitomiActivity$PageLoadListener {
<methods>;
}

-keep public class me.devsaki.hentoid.activities.TsuminoActivity$PageLoadListener
-keep public class * implements me.devsaki.hentoid.activities.TsuminoActivity$PageLoadListener
-keepclassmembers class me.devsaki.hentoid.activities.TsuminoActivity$PageLoadListener {
<methods>;
}

-keep class com.github.paolorotolo.** {*;}

#-keep class com.afollestad.materialdialogs.** {*;}

#-keep class me.zhanghai.android.** {*;}

#-keep class com.turhanoz.android.** {*;}
14 changes: 14 additions & 0 deletions app/proguard-project-test.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Proguard rules run against the test module (split since Gradle plugin v 1.1.0)
-dontobfuscate
-ignorewarnings

# Specific classes that common test libs warn about
-dontwarn java.beans.**
-dontwarn javax.lang.model.element.Modifier
-dontwarn org.apache.tools.ant.**
-dontwarn org.assertj.core.internal.cglib.asm.util.TraceClassVisitor
-dontwarn org.easymock.**
-dontwarn org.jmock.core.**
-dontwarn org.w3c.dom.bootstrap.**
-dontwarn sun.misc.Unsafe
-dontwarn sun.reflect.**
23 changes: 3 additions & 20 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,6 @@
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:

-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}

-keepattributes JavascriptInterface

-keep public class me.devsaki.hentoid.activities.HitomiActivity$PageLoadListener
-keep public class * implements me.devsaki.hentoid.HitomiActivity$PageLoadListener
-keepclassmembers class me.devsaki.hentoid.activities.HitomiActivity$PageLoadListener {
<methods>;
}

-keep public class me.devsaki.hentoid.activities.TsuminoActivity$PageLoadListener
-keep public class * implements me.devsaki.hentoid.TsuminoActivity$PageLoadListener
-keepclassmembers class me.devsaki.hentoid.activities.TsuminoActivity$PageLoadListener {
<methods>;
}

-keep class com.github.paolorotolo.** {*;}
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
Loading

0 comments on commit 5cfc02b

Please sign in to comment.