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
PHEADERS = $(HEADERS):$(JAVA_HOME)/jre/lib/rt.jar
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
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 .
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:
$(EMULATOR) jars/result.jar

View File

@ -2,4 +2,5 @@ HEADERS =
EMULATOR = java -jar
RETROTRANSLATOR = 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/**)
-outjars jars/release.jar
-dontwarn
-keep public class com.Hello
-dontwarn org.jetbrains.**
-dontwarn net.sf.retrotranslator.**
-dontwarn edu.emory.mathcs.backport.**
-dontwarn kotlin.**
-microedition