diff --git a/MIDIDriver/build.gradle b/MIDIDriver/build.gradle index 77bab7c..d2434b5 100644 --- a/MIDIDriver/build.gradle +++ b/MIDIDriver/build.gradle @@ -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() diff --git a/MIDIDriver/proguard-rules.pro b/MIDIDriver/proguard-rules.pro new file mode 100644 index 0000000..99a1099 --- /dev/null +++ b/MIDIDriver/proguard-rules.pro @@ -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(); +} diff --git a/build.gradle b/build.gradle index 109ff5e..e0b7d16 100644 --- a/build.gradle +++ b/build.gradle @@ -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' } }