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

Libraries shouldn't be proguarded on their own #170

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions eyes-two/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ android {
targetSdkVersion 9
versionCode 1
versionName "1.0"
proguardFiles 'proguard-rules.pro'
consumerProguardFiles 'proguard-rules.pro'
}

Expand Down Expand Up @@ -52,7 +51,7 @@ android {

tasks.withType(Delete) {
cleanTask -> cleanTask.dependsOn ndkClean
}
}

lintOptions {
abortOnError false
Expand Down
66 changes: 1 addition & 65 deletions eyes-two/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,69 +1,5 @@
#
# Adapted from example file:
# android-sdk/tools/proguard/examples/library.pro
#
# This ProGuard configuration file illustrates how to process a program
# library, such that it remains usable as a library.
#

# Don't obfuscate field and method names.

-dontobfuscate

# Preserve all annotations.

-keepattributes *Annotation*

# Preserve all public classes, and their public and protected fields and
# methods.

-keep public class * {
public protected *;
}

# Preserve all .class method names.

-keepclassmembernames class * {
java.lang.Class class$(java.lang.String);
java.lang.Class class$(java.lang.String, boolean);
}

# Preserve all native method names and the names of their classes.

-keepclasseswithmembernames class * {
native <methods>;
}

# Preserve the special static methods that are required in all enumeration
# classes.

-keepclassmembers class * extends java.lang.Enum {
public static **[] values();
public static ** valueOf(java.lang.String);
}

# Explicitly preserve all serialization members. The Serializable interface
# is only a marker interface, so it wouldn't save them.
# You can comment this out if your library doesn't use serialization.
# If your code contains serializable classes that have to be backward
# compatible, please refer to the manual.

-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
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();
}

# Your library may contain more items that need to be preserved;
# typically classes that are dynamically created using Class.forName:

# -keep public class mypackage.MyClass
# -keep public interface mypackage.MyInterface
# -keep public class * implements mypackage.MyInterface

-keep class com.googlecode.eyesfree.textdetect.HydrogenTextDetector {
private long mNative;
}
}
3 changes: 1 addition & 2 deletions tess-two/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ android {
targetSdkVersion 22
versionCode 1
versionName "1.0"
proguardFiles 'proguard-rules.pro'
consumerProguardFiles 'proguard-rules.pro'
}

Expand Down Expand Up @@ -57,7 +56,7 @@ android {

tasks.withType(Delete) {
cleanTask -> cleanTask.dependsOn ndkClean
}
}
}

dependencies {
Expand Down
66 changes: 1 addition & 65 deletions tess-two/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,69 +1,5 @@
#
# Adapted from example file:
# android-sdk/tools/proguard/examples/library.pro
#
# This ProGuard configuration file illustrates how to process a program
# library, such that it remains usable as a library.
#

# Don't obfuscate field and method names.

-dontobfuscate

# Preserve all annotations.

-keepattributes *Annotation*

# Preserve all public classes, and their public and protected fields and
# methods.

-keep public class * {
public protected *;
}

# Preserve all .class method names.

-keepclassmembernames class * {
java.lang.Class class$(java.lang.String);
java.lang.Class class$(java.lang.String, boolean);
}

# Preserve all native method names and the names of their classes.

-keepclasseswithmembernames class * {
native <methods>;
}

# Preserve the special static methods that are required in all enumeration
# classes.

-keepclassmembers class * extends java.lang.Enum {
public static **[] values();
public static ** valueOf(java.lang.String);
}

# Explicitly preserve all serialization members. The Serializable interface
# is only a marker interface, so it wouldn't save them.
# You can comment this out if your library doesn't use serialization.
# If your code contains serializable classes that have to be backward
# compatible, please refer to the manual.

-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
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();
}

# Your library may contain more items that need to be preserved;
# typically classes that are dynamically created using Class.forName:

# -keep public class mypackage.MyClass
# -keep public interface mypackage.MyInterface
# -keep public class * implements mypackage.MyInterface

-keep class com.googlecode.leptonica.android.Box {
private long mNativeBox;
}
Expand All @@ -88,4 +24,4 @@
}
-keep class com.googlecode.tesseract.android.ResultIterator {
private long mNativeResultIterator;
}
}