Using Tyrus Websocket Client in Android with Proguard -
i trying use tyrus (org.glassfish.tyrus.bundles:tyrus-standalone-client:1.10) in android. here proguard related part:
-dontoptimize -keepparameternames -keepclassmembers,allowoptimization enum * { public static **[] values(); public static ** valueof(java.lang.string); } -keep class org.glassfish.tyrus.** { *; } -keep class org.glassfish.grizzly.** { *; } -keep class javax.websocket.** { *; }
i make call clientmanager connecttoserver , method doesnt return , hangs.but works if disable proguard. how can make work in android proguard?
you need add following line fragment or activity use tyrus
-keep,includedescriptorclasses class com.package.yourclass$* { *; }
for tyrus need add following lines
-keepattributes signature,innerclasses,*annotation* -keep,includedescriptorclasses class org.glassfish.tyrus.** { *; } -keep,includedescriptorclasses class org.glassfish.grizzly.** { *; } -keep,includedescriptorclasses class javax.websocket.** { *; }
by adding these lines, managed use tyrus in android. here reference tyrus: https://blogs.oracle.com/pavelbucek/entry/reducing_websocket_client_jar_size
Comments
Post a Comment