Skip to content

Commit

Permalink
Merge pull request #82 from kshoji/feature/add-proguard-20240408
Browse files Browse the repository at this point in the history
Add proguard configuration
  • Loading branch information
kshoji authored Apr 8, 2024
2 parents 511d076 + 1b6e291 commit 99fb5e4
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
15 changes: 15 additions & 0 deletions MIDIDriver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ android {
release.setRoot('build-types/release')
}

defaultConfig {
consumerProguardFiles 'proguard-rules.pro'
}

buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

publishing {
singleVariant('release') {
withSourcesJar()
Expand Down
32 changes: 32 additions & 0 deletions MIDIDriver/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-keep public class jp.kshoji.driver.midi.** {
public protected *;
}
-keep public class jp.kshoji.driver.usb.util.** {
public protected *;
}
-keep public class jp.kshoji.javax.sound.midi.** {
public protected *;
}
-keep public class jp.kshoji.unity.midi.** {
public protected *;
}

-keepparameternames
-renamesourcefileattribute SourceFile
-keepattributes Signature,Exceptions,*Annotation*,
InnerClasses,PermittedSubclasses,EnclosingMethod,
Deprecated,SourceFile,LineNumberTable

-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-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();
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.3.0'
classpath 'com.android.tools.build:gradle:8.3.1'
}
}

Expand Down

0 comments on commit 99fb5e4

Please sign in to comment.