Fix the problem where proguard strips interface information.

This commit is contained in:
bʰedoh₂ swé 2024-05-27 14:30:35 +05:00
parent c6f54d9358
commit 8ac5ff7b0e
3 changed files with 8 additions and 3 deletions

View File

@ -6,6 +6,8 @@ SRC_DIR := src
RES_DIR := res RES_DIR := res
PHEADERS = $(HEADERS):$(JAVA_HOME)/jre/lib/rt.jar
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
SRCS := $(call rwildcard,$(SRC_DIR),*.kt) SRCS := $(call rwildcard,$(SRC_DIR),*.kt)
@ -33,7 +35,7 @@ jars/result.jar: jars/classes.jar
jar -umf META-INF/MANIFEST.MF jars/result.jar -C res . jar -umf META-INF/MANIFEST.MF jars/result.jar -C res .
release jars/release.jar: jars/result.jar release jars/release.jar: jars/result.jar
proguard -include proguard.conf -keepclassmembers class $(CLASSNAME) { public \<methods\> ';' } proguard -include proguard.conf -libraryjars $(PHEADERS) -keepclassmembers class $(CLASSNAME) { public \<methods\> ';' } -keep public class $(CLASSNAME)
run: run:
$(EMULATOR) jars/result.jar $(EMULATOR) jars/result.jar

View File

@ -2,4 +2,5 @@ HEADERS =
EMULATOR = java -jar EMULATOR = java -jar
RETROTRANSLATOR = java -jar RETROTRANSLATOR = java -jar
PROGUARD = java -jar PROGUARD = java -jar
JAVA_HOME = /usr/lib/jvm/openjdk8

View File

@ -1,5 +1,7 @@
-injars jars/result.jar(!**.kotlin_builtins,!META-INF/main.kotlin_module,!META-INF/services/**) -injars jars/result.jar(!**.kotlin_builtins,!META-INF/main.kotlin_module,!META-INF/services/**)
-outjars jars/release.jar -outjars jars/release.jar
-dontwarn -dontwarn org.jetbrains.**
-keep public class com.Hello -dontwarn net.sf.retrotranslator.**
-dontwarn edu.emory.mathcs.backport.**
-dontwarn kotlin.**
-microedition -microedition